@fluentui/react-charts 9.2.4 → 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 (313) hide show
  1. package/CHANGELOG.md +32 -2
  2. package/dist/index.d.ts +1 -1
  3. package/lib/components/AreaChart/AreaChart.js +6 -4
  4. package/lib/components/AreaChart/AreaChart.js.map +1 -1
  5. package/lib/components/AreaChart/useAreaChartStyles.styles.js +2 -0
  6. package/lib/components/AreaChart/useAreaChartStyles.styles.js.map +1 -1
  7. package/lib/components/AreaChart/useAreaChartStyles.styles.raw.js +1 -0
  8. package/lib/components/AreaChart/useAreaChartStyles.styles.raw.js.map +1 -1
  9. package/lib/components/ChartTable/ChartTable.js +11 -7
  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 +11 -12
  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 +2 -0
  21. package/lib/components/CommonComponents/useCartesianChartStyles.styles.js.map +1 -1
  22. package/lib/components/CommonComponents/useCartesianChartStyles.styles.raw.js +1 -0
  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 +1 -0
  29. package/lib/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
  30. package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js +59 -67
  31. package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
  32. package/lib/components/DeclarativeChart/imageExporter.js +1 -0
  33. package/lib/components/DeclarativeChart/imageExporter.js.map +1 -1
  34. package/lib/components/DonutChart/Arc/Arc.js +8 -8
  35. package/lib/components/DonutChart/Arc/Arc.js.map +1 -1
  36. package/lib/components/DonutChart/Arc/Arc.types.js.map +1 -1
  37. package/lib/components/DonutChart/Arc/useArcStyles.styles.js +4 -2
  38. package/lib/components/DonutChart/Arc/useArcStyles.styles.js.map +1 -1
  39. package/lib/components/DonutChart/Arc/useArcStyles.styles.raw.js +2 -1
  40. package/lib/components/DonutChart/Arc/useArcStyles.styles.raw.js.map +1 -1
  41. package/lib/components/DonutChart/DonutChart.js +55 -24
  42. package/lib/components/DonutChart/DonutChart.js.map +1 -1
  43. package/lib/components/DonutChart/Pie/Pie.js +1 -0
  44. package/lib/components/DonutChart/Pie/Pie.js.map +1 -1
  45. package/lib/components/DonutChart/Pie/Pie.types.js.map +1 -1
  46. package/lib/components/DonutChart/Pie/usePieStyles.styles.js +2 -0
  47. package/lib/components/DonutChart/Pie/usePieStyles.styles.js.map +1 -1
  48. package/lib/components/DonutChart/Pie/usePieStyles.styles.raw.js +1 -0
  49. package/lib/components/DonutChart/Pie/usePieStyles.styles.raw.js.map +1 -1
  50. package/lib/components/DonutChart/useDonutChartStyles.styles.js +2 -0
  51. package/lib/components/DonutChart/useDonutChartStyles.styles.js.map +1 -1
  52. package/lib/components/DonutChart/useDonutChartStyles.styles.raw.js +1 -0
  53. package/lib/components/DonutChart/useDonutChartStyles.styles.raw.js.map +1 -1
  54. package/lib/components/FunnelChart/FunnelChart.js +7 -3
  55. package/lib/components/FunnelChart/FunnelChart.js.map +1 -1
  56. package/lib/components/FunnelChart/useFunnelChartStyles.styles.js +2 -0
  57. package/lib/components/FunnelChart/useFunnelChartStyles.styles.js.map +1 -1
  58. package/lib/components/FunnelChart/useFunnelChartStyles.styles.raw.js +1 -0
  59. package/lib/components/FunnelChart/useFunnelChartStyles.styles.raw.js.map +1 -1
  60. package/lib/components/GanttChart/GanttChart.js +1 -0
  61. package/lib/components/GanttChart/GanttChart.js.map +1 -1
  62. package/lib/components/GaugeChart/GaugeChart.js +1 -0
  63. package/lib/components/GaugeChart/GaugeChart.js.map +1 -1
  64. package/lib/components/GaugeChart/useGaugeChartStyles.styles.js +2 -0
  65. package/lib/components/GaugeChart/useGaugeChartStyles.styles.js.map +1 -1
  66. package/lib/components/GaugeChart/useGaugeChartStyles.styles.raw.js +1 -0
  67. package/lib/components/GaugeChart/useGaugeChartStyles.styles.raw.js.map +1 -1
  68. package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js +13 -7
  69. package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js.map +1 -1
  70. package/lib/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.js +2 -0
  71. package/lib/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.js.map +1 -1
  72. package/lib/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.raw.js +1 -0
  73. package/lib/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.raw.js.map +1 -1
  74. package/lib/components/HeatMapChart/HeatMapChart.js +2 -1
  75. package/lib/components/HeatMapChart/HeatMapChart.js.map +1 -1
  76. package/lib/components/HeatMapChart/useHeatMapChartStyles.styles.js +2 -0
  77. package/lib/components/HeatMapChart/useHeatMapChartStyles.styles.js.map +1 -1
  78. package/lib/components/HeatMapChart/useHeatMapChartStyles.styles.raw.js +1 -0
  79. package/lib/components/HeatMapChart/useHeatMapChartStyles.styles.raw.js.map +1 -1
  80. package/lib/components/HorizontalBarChart/HorizontalBarChart.js +2 -2
  81. package/lib/components/HorizontalBarChart/HorizontalBarChart.js.map +1 -1
  82. package/lib/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.js +3 -1
  83. package/lib/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.js.map +1 -1
  84. package/lib/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.raw.js +2 -1
  85. package/lib/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.raw.js.map +1 -1
  86. package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js +2 -2
  87. package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js.map +1 -1
  88. package/lib/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.js +2 -0
  89. package/lib/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.js.map +1 -1
  90. package/lib/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.raw.js +1 -0
  91. package/lib/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.raw.js.map +1 -1
  92. package/lib/components/Legends/Legends.js +1 -0
  93. package/lib/components/Legends/Legends.js.map +1 -1
  94. package/lib/components/Legends/OverflowMenu.js +1 -0
  95. package/lib/components/Legends/OverflowMenu.js.map +1 -1
  96. package/lib/components/Legends/shape.js +1 -0
  97. package/lib/components/Legends/shape.js.map +1 -1
  98. package/lib/components/Legends/useLegendsStyles.styles.js +2 -0
  99. package/lib/components/Legends/useLegendsStyles.styles.js.map +1 -1
  100. package/lib/components/Legends/useLegendsStyles.styles.raw.js +1 -0
  101. package/lib/components/Legends/useLegendsStyles.styles.raw.js.map +1 -1
  102. package/lib/components/LineChart/LineChart.js +42 -39
  103. package/lib/components/LineChart/LineChart.js.map +1 -1
  104. package/lib/components/LineChart/eventAnnotation/LabelLink.js +1 -0
  105. package/lib/components/LineChart/eventAnnotation/LabelLink.js.map +1 -1
  106. package/lib/components/LineChart/eventAnnotation/Textbox.js +1 -0
  107. package/lib/components/LineChart/eventAnnotation/Textbox.js.map +1 -1
  108. package/lib/components/LineChart/useLineChartStyles.styles.js +2 -0
  109. package/lib/components/LineChart/useLineChartStyles.styles.js.map +1 -1
  110. package/lib/components/LineChart/useLineChartStyles.styles.raw.js +1 -0
  111. package/lib/components/LineChart/useLineChartStyles.styles.raw.js.map +1 -1
  112. package/lib/components/ResponsiveContainer/ResponsiveContainer.js +1 -0
  113. package/lib/components/ResponsiveContainer/ResponsiveContainer.js.map +1 -1
  114. package/lib/components/ResponsiveContainer/useResponsiveChildStyles.styles.js +2 -0
  115. package/lib/components/ResponsiveContainer/useResponsiveChildStyles.styles.js.map +1 -1
  116. package/lib/components/ResponsiveContainer/useResponsiveChildStyles.styles.raw.js +1 -0
  117. package/lib/components/ResponsiveContainer/useResponsiveChildStyles.styles.raw.js.map +1 -1
  118. package/lib/components/ResponsiveContainer/withResponsiveContainer.js +1 -0
  119. package/lib/components/ResponsiveContainer/withResponsiveContainer.js.map +1 -1
  120. package/lib/components/SankeyChart/SankeyChart.js +1 -0
  121. package/lib/components/SankeyChart/SankeyChart.js.map +1 -1
  122. package/lib/components/SankeyChart/useSankeyChartStyles.styles.js +2 -0
  123. package/lib/components/SankeyChart/useSankeyChartStyles.styles.js.map +1 -1
  124. package/lib/components/SankeyChart/useSankeyChartStyles.styles.raw.js +1 -0
  125. package/lib/components/SankeyChart/useSankeyChartStyles.styles.raw.js.map +1 -1
  126. package/lib/components/ScatterChart/ScatterChart.js +7 -6
  127. package/lib/components/ScatterChart/ScatterChart.js.map +1 -1
  128. package/lib/components/ScatterChart/useScatterChartStyles.styles.js +2 -0
  129. package/lib/components/ScatterChart/useScatterChartStyles.styles.js.map +1 -1
  130. package/lib/components/ScatterChart/useScatterChartStyles.styles.raw.js +1 -0
  131. package/lib/components/ScatterChart/useScatterChartStyles.styles.raw.js.map +1 -1
  132. package/lib/components/Sparkline/Sparkline.js +1 -0
  133. package/lib/components/Sparkline/Sparkline.js.map +1 -1
  134. package/lib/components/Sparkline/useSparklineStyles.styles.js +2 -0
  135. package/lib/components/Sparkline/useSparklineStyles.styles.js.map +1 -1
  136. package/lib/components/Sparkline/useSparklineStyles.styles.raw.js +1 -0
  137. package/lib/components/Sparkline/useSparklineStyles.styles.raw.js.map +1 -1
  138. package/lib/components/VerticalBarChart/VerticalBarChart.js +15 -10
  139. package/lib/components/VerticalBarChart/VerticalBarChart.js.map +1 -1
  140. package/lib/components/VerticalBarChart/useVerticalBarChartStyles.styles.js +2 -0
  141. package/lib/components/VerticalBarChart/useVerticalBarChartStyles.styles.js.map +1 -1
  142. package/lib/components/VerticalBarChart/useVerticalBarChartStyles.styles.raw.js +1 -0
  143. package/lib/components/VerticalBarChart/useVerticalBarChartStyles.styles.raw.js.map +1 -1
  144. package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.js +29 -24
  145. package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.js.map +1 -1
  146. package/lib/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.js +2 -0
  147. package/lib/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.js.map +1 -1
  148. package/lib/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.raw.js +1 -0
  149. package/lib/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.raw.js.map +1 -1
  150. package/lib/utilities/FocusableTooltipText.js +1 -0
  151. package/lib/utilities/FocusableTooltipText.js.map +1 -1
  152. package/lib/utilities/SVGTooltipText.js +1 -0
  153. package/lib/utilities/SVGTooltipText.js.map +1 -1
  154. package/lib/utilities/image-export-utils.js +1 -0
  155. package/lib/utilities/image-export-utils.js.map +1 -1
  156. package/lib/utilities/utilities.js +12 -11
  157. package/lib/utilities/utilities.js.map +1 -1
  158. package/lib-commonjs/components/AreaChart/AreaChart.js +5 -3
  159. package/lib-commonjs/components/AreaChart/AreaChart.js.map +1 -1
  160. package/lib-commonjs/components/AreaChart/useAreaChartStyles.styles.js +1 -0
  161. package/lib-commonjs/components/AreaChart/useAreaChartStyles.styles.js.map +1 -1
  162. package/lib-commonjs/components/AreaChart/useAreaChartStyles.styles.raw.js +1 -0
  163. package/lib-commonjs/components/AreaChart/useAreaChartStyles.styles.raw.js.map +1 -1
  164. package/lib-commonjs/components/ChartTable/ChartTable.js +11 -7
  165. package/lib-commonjs/components/ChartTable/ChartTable.js.map +1 -1
  166. package/lib-commonjs/components/ChartTable/useChartTableStyles.styles.js +4 -3
  167. package/lib-commonjs/components/ChartTable/useChartTableStyles.styles.js.map +1 -1
  168. package/lib-commonjs/components/ChartTable/useChartTableStyles.styles.raw.js +3 -2
  169. package/lib-commonjs/components/ChartTable/useChartTableStyles.styles.raw.js.map +1 -1
  170. package/lib-commonjs/components/CommonComponents/CartesianChart.js +11 -12
  171. package/lib-commonjs/components/CommonComponents/CartesianChart.js.map +1 -1
  172. package/lib-commonjs/components/CommonComponents/CartesianChart.types.js.map +1 -1
  173. package/lib-commonjs/components/CommonComponents/ChartPopover.js +14 -5
  174. package/lib-commonjs/components/CommonComponents/ChartPopover.js.map +1 -1
  175. package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.js +1 -0
  176. package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.js.map +1 -1
  177. package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.raw.js +1 -0
  178. package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.raw.js.map +1 -1
  179. package/lib-commonjs/components/CommonComponents/useChartPopoverStyles.styles.js +4 -3
  180. package/lib-commonjs/components/CommonComponents/useChartPopoverStyles.styles.js.map +1 -1
  181. package/lib-commonjs/components/CommonComponents/useChartPopoverStyles.styles.raw.js +3 -2
  182. package/lib-commonjs/components/CommonComponents/useChartPopoverStyles.styles.raw.js.map +1 -1
  183. package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js +2 -1
  184. package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
  185. package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js +60 -68
  186. package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
  187. package/lib-commonjs/components/DeclarativeChart/imageExporter.js +1 -0
  188. package/lib-commonjs/components/DeclarativeChart/imageExporter.js.map +1 -1
  189. package/lib-commonjs/components/DonutChart/Arc/Arc.js +8 -8
  190. package/lib-commonjs/components/DonutChart/Arc/Arc.js.map +1 -1
  191. package/lib-commonjs/components/DonutChart/Arc/Arc.types.js.map +1 -1
  192. package/lib-commonjs/components/DonutChart/Arc/useArcStyles.styles.js +3 -2
  193. package/lib-commonjs/components/DonutChart/Arc/useArcStyles.styles.js.map +1 -1
  194. package/lib-commonjs/components/DonutChart/Arc/useArcStyles.styles.raw.js +2 -1
  195. package/lib-commonjs/components/DonutChart/Arc/useArcStyles.styles.raw.js.map +1 -1
  196. package/lib-commonjs/components/DonutChart/DonutChart.js +55 -24
  197. package/lib-commonjs/components/DonutChart/DonutChart.js.map +1 -1
  198. package/lib-commonjs/components/DonutChart/Pie/Pie.js +2 -1
  199. package/lib-commonjs/components/DonutChart/Pie/Pie.js.map +1 -1
  200. package/lib-commonjs/components/DonutChart/Pie/Pie.types.js.map +1 -1
  201. package/lib-commonjs/components/DonutChart/Pie/usePieStyles.styles.js +1 -0
  202. package/lib-commonjs/components/DonutChart/Pie/usePieStyles.styles.js.map +1 -1
  203. package/lib-commonjs/components/DonutChart/Pie/usePieStyles.styles.raw.js +1 -0
  204. package/lib-commonjs/components/DonutChart/Pie/usePieStyles.styles.raw.js.map +1 -1
  205. package/lib-commonjs/components/DonutChart/useDonutChartStyles.styles.js +1 -0
  206. package/lib-commonjs/components/DonutChart/useDonutChartStyles.styles.js.map +1 -1
  207. package/lib-commonjs/components/DonutChart/useDonutChartStyles.styles.raw.js +1 -0
  208. package/lib-commonjs/components/DonutChart/useDonutChartStyles.styles.raw.js.map +1 -1
  209. package/lib-commonjs/components/FunnelChart/FunnelChart.js +7 -3
  210. package/lib-commonjs/components/FunnelChart/FunnelChart.js.map +1 -1
  211. package/lib-commonjs/components/FunnelChart/useFunnelChartStyles.styles.js +1 -0
  212. package/lib-commonjs/components/FunnelChart/useFunnelChartStyles.styles.js.map +1 -1
  213. package/lib-commonjs/components/FunnelChart/useFunnelChartStyles.styles.raw.js +1 -0
  214. package/lib-commonjs/components/FunnelChart/useFunnelChartStyles.styles.raw.js.map +1 -1
  215. package/lib-commonjs/components/GanttChart/GanttChart.js +1 -0
  216. package/lib-commonjs/components/GanttChart/GanttChart.js.map +1 -1
  217. package/lib-commonjs/components/GaugeChart/GaugeChart.js +1 -0
  218. package/lib-commonjs/components/GaugeChart/GaugeChart.js.map +1 -1
  219. package/lib-commonjs/components/GaugeChart/useGaugeChartStyles.styles.js +1 -0
  220. package/lib-commonjs/components/GaugeChart/useGaugeChartStyles.styles.js.map +1 -1
  221. package/lib-commonjs/components/GaugeChart/useGaugeChartStyles.styles.raw.js +1 -0
  222. package/lib-commonjs/components/GaugeChart/useGaugeChartStyles.styles.raw.js.map +1 -1
  223. package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js +13 -7
  224. package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js.map +1 -1
  225. package/lib-commonjs/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.js +1 -0
  226. package/lib-commonjs/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.js.map +1 -1
  227. package/lib-commonjs/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.raw.js +1 -0
  228. package/lib-commonjs/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.raw.js.map +1 -1
  229. package/lib-commonjs/components/HeatMapChart/HeatMapChart.js +2 -1
  230. package/lib-commonjs/components/HeatMapChart/HeatMapChart.js.map +1 -1
  231. package/lib-commonjs/components/HeatMapChart/useHeatMapChartStyles.styles.js +1 -0
  232. package/lib-commonjs/components/HeatMapChart/useHeatMapChartStyles.styles.js.map +1 -1
  233. package/lib-commonjs/components/HeatMapChart/useHeatMapChartStyles.styles.raw.js +1 -0
  234. package/lib-commonjs/components/HeatMapChart/useHeatMapChartStyles.styles.raw.js.map +1 -1
  235. package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.js +2 -2
  236. package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.js.map +1 -1
  237. package/lib-commonjs/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.js +2 -1
  238. package/lib-commonjs/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.js.map +1 -1
  239. package/lib-commonjs/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.raw.js +2 -1
  240. package/lib-commonjs/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.raw.js.map +1 -1
  241. package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js +2 -2
  242. package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js.map +1 -1
  243. package/lib-commonjs/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.js +1 -0
  244. package/lib-commonjs/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.js.map +1 -1
  245. package/lib-commonjs/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.raw.js +1 -0
  246. package/lib-commonjs/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.raw.js.map +1 -1
  247. package/lib-commonjs/components/Legends/Legends.js +1 -0
  248. package/lib-commonjs/components/Legends/Legends.js.map +1 -1
  249. package/lib-commonjs/components/Legends/OverflowMenu.js +1 -0
  250. package/lib-commonjs/components/Legends/OverflowMenu.js.map +1 -1
  251. package/lib-commonjs/components/Legends/shape.js +1 -0
  252. package/lib-commonjs/components/Legends/shape.js.map +1 -1
  253. package/lib-commonjs/components/Legends/useLegendsStyles.styles.js +1 -0
  254. package/lib-commonjs/components/Legends/useLegendsStyles.styles.js.map +1 -1
  255. package/lib-commonjs/components/Legends/useLegendsStyles.styles.raw.js +1 -0
  256. package/lib-commonjs/components/Legends/useLegendsStyles.styles.raw.js.map +1 -1
  257. package/lib-commonjs/components/LineChart/LineChart.js +41 -38
  258. package/lib-commonjs/components/LineChart/LineChart.js.map +1 -1
  259. package/lib-commonjs/components/LineChart/eventAnnotation/LabelLink.js +1 -0
  260. package/lib-commonjs/components/LineChart/eventAnnotation/LabelLink.js.map +1 -1
  261. package/lib-commonjs/components/LineChart/eventAnnotation/Textbox.js +1 -0
  262. package/lib-commonjs/components/LineChart/eventAnnotation/Textbox.js.map +1 -1
  263. package/lib-commonjs/components/LineChart/useLineChartStyles.styles.js +1 -0
  264. package/lib-commonjs/components/LineChart/useLineChartStyles.styles.js.map +1 -1
  265. package/lib-commonjs/components/LineChart/useLineChartStyles.styles.raw.js +1 -0
  266. package/lib-commonjs/components/LineChart/useLineChartStyles.styles.raw.js.map +1 -1
  267. package/lib-commonjs/components/ResponsiveContainer/ResponsiveContainer.js +1 -0
  268. package/lib-commonjs/components/ResponsiveContainer/ResponsiveContainer.js.map +1 -1
  269. package/lib-commonjs/components/ResponsiveContainer/useResponsiveChildStyles.styles.js +1 -0
  270. package/lib-commonjs/components/ResponsiveContainer/useResponsiveChildStyles.styles.js.map +1 -1
  271. package/lib-commonjs/components/ResponsiveContainer/useResponsiveChildStyles.styles.raw.js +1 -0
  272. package/lib-commonjs/components/ResponsiveContainer/useResponsiveChildStyles.styles.raw.js.map +1 -1
  273. package/lib-commonjs/components/ResponsiveContainer/withResponsiveContainer.js +2 -1
  274. package/lib-commonjs/components/ResponsiveContainer/withResponsiveContainer.js.map +1 -1
  275. package/lib-commonjs/components/SankeyChart/SankeyChart.js +1 -0
  276. package/lib-commonjs/components/SankeyChart/SankeyChart.js.map +1 -1
  277. package/lib-commonjs/components/SankeyChart/useSankeyChartStyles.styles.js +1 -0
  278. package/lib-commonjs/components/SankeyChart/useSankeyChartStyles.styles.js.map +1 -1
  279. package/lib-commonjs/components/SankeyChart/useSankeyChartStyles.styles.raw.js +1 -0
  280. package/lib-commonjs/components/SankeyChart/useSankeyChartStyles.styles.raw.js.map +1 -1
  281. package/lib-commonjs/components/ScatterChart/ScatterChart.js +6 -5
  282. package/lib-commonjs/components/ScatterChart/ScatterChart.js.map +1 -1
  283. package/lib-commonjs/components/ScatterChart/useScatterChartStyles.styles.js +1 -0
  284. package/lib-commonjs/components/ScatterChart/useScatterChartStyles.styles.js.map +1 -1
  285. package/lib-commonjs/components/ScatterChart/useScatterChartStyles.styles.raw.js +1 -0
  286. package/lib-commonjs/components/ScatterChart/useScatterChartStyles.styles.raw.js.map +1 -1
  287. package/lib-commonjs/components/Sparkline/Sparkline.js +1 -0
  288. package/lib-commonjs/components/Sparkline/Sparkline.js.map +1 -1
  289. package/lib-commonjs/components/Sparkline/useSparklineStyles.styles.js +1 -0
  290. package/lib-commonjs/components/Sparkline/useSparklineStyles.styles.js.map +1 -1
  291. package/lib-commonjs/components/Sparkline/useSparklineStyles.styles.raw.js +1 -0
  292. package/lib-commonjs/components/Sparkline/useSparklineStyles.styles.raw.js.map +1 -1
  293. package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.js +15 -10
  294. package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.js.map +1 -1
  295. package/lib-commonjs/components/VerticalBarChart/useVerticalBarChartStyles.styles.js +1 -0
  296. package/lib-commonjs/components/VerticalBarChart/useVerticalBarChartStyles.styles.js.map +1 -1
  297. package/lib-commonjs/components/VerticalBarChart/useVerticalBarChartStyles.styles.raw.js +1 -0
  298. package/lib-commonjs/components/VerticalBarChart/useVerticalBarChartStyles.styles.raw.js.map +1 -1
  299. package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.js +28 -23
  300. package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.js.map +1 -1
  301. package/lib-commonjs/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.js +1 -0
  302. package/lib-commonjs/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.js.map +1 -1
  303. package/lib-commonjs/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.raw.js +1 -0
  304. package/lib-commonjs/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.raw.js.map +1 -1
  305. package/lib-commonjs/utilities/FocusableTooltipText.js +2 -1
  306. package/lib-commonjs/utilities/FocusableTooltipText.js.map +1 -1
  307. package/lib-commonjs/utilities/SVGTooltipText.js +1 -0
  308. package/lib-commonjs/utilities/SVGTooltipText.js.map +1 -1
  309. package/lib-commonjs/utilities/image-export-utils.js +1 -0
  310. package/lib-commonjs/utilities/image-export-utils.js.map +1 -1
  311. package/lib-commonjs/utilities/utilities.js +12 -11
  312. package/lib-commonjs/utilities/utilities.js.map +1 -1
  313. package/package.json +10 -10
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/DeclarativeChart/DeclarativeChart.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/naming-convention */\nimport * as React from 'react';\nimport type { Data, PlotData, PlotlySchema, OutputChartType, TraceInfo } from '@fluentui/chart-utilities';\nimport {\n decodeBase64Fields,\n isArrayOrTypedArray,\n isMonthArray,\n mapFluentChart,\n sanitizeJson,\n} from '@fluentui/chart-utilities';\nimport type { GridProperties } from './PlotlySchemaAdapter';\nimport { tokens } from '@fluentui/react-theme';\nimport { ThemeContext_unstable as V9ThemeContext } from '@fluentui/react-shared-contexts';\nimport { Theme, webLightTheme } from '@fluentui/tokens';\nimport * as d3Color from 'd3-color';\n\nimport {\n correctYearMonth,\n getGridProperties,\n isNonPlotType,\n transformPlotlyJsonToDonutProps,\n transformPlotlyJsonToVSBCProps,\n transformPlotlyJsonToAreaChartProps,\n transformPlotlyJsonToLineChartProps,\n transformPlotlyJsonToHorizontalBarWithAxisProps,\n transformPlotlyJsonToHeatmapProps,\n transformPlotlyJsonToSankeyProps,\n transformPlotlyJsonToGaugeProps,\n transformPlotlyJsonToGVBCProps,\n transformPlotlyJsonToVBCProps,\n transformPlotlyJsonToChartTableProps,\n transformPlotlyJsonToScatterChartProps,\n projectPolarToCartesian,\n getAllupLegendsProps,\n NON_PLOT_KEY_PREFIX,\n SINGLE_REPEAT,\n transformPlotlyJsonToFunnelChartProps,\n transformPlotlyJsonToGanttChartProps,\n} from './PlotlySchemaAdapter';\nimport type { ColorwayType } from './PlotlyColorAdapter';\nimport { DonutChart } from '../DonutChart/index';\nimport { VerticalStackedBarChart } from '../VerticalStackedBarChart/index';\nimport { LineChart } from '../LineChart/index';\nimport { HorizontalBarChartWithAxis } from '../HorizontalBarChartWithAxis/index';\nimport { AreaChart } from '../AreaChart/index';\nimport { HeatMapChart } from '../HeatMapChart/index';\nimport { SankeyChart } from '../SankeyChart/SankeyChart';\nimport { GaugeChart } from '../GaugeChart/index';\nimport { GroupedVerticalBarChart } from '../GroupedVerticalBarChart/index';\nimport { VerticalBarChart } from '../VerticalBarChart/index';\nimport { Chart, ImageExportOptions } from '../../types/index';\nimport { ScatterChart } from '../ScatterChart/index';\nimport { FunnelChart } from '../FunnelChart/FunnelChart';\nimport { GanttChart } from '../GanttChart/index';\n\nimport { withResponsiveContainer } from '../ResponsiveContainer/withResponsiveContainer';\nimport { ChartTable } from '../ChartTable/index';\nimport { LegendsProps, Legends } from '../Legends/index';\nimport { JSXElement } from '@fluentui/react-utilities/src/index';\n\nconst ResponsiveDonutChart = withResponsiveContainer(DonutChart);\nconst ResponsiveVerticalStackedBarChart = withResponsiveContainer(VerticalStackedBarChart);\nconst ResponsiveLineChart = withResponsiveContainer(LineChart);\nconst ResponsiveHorizontalBarChartWithAxis = withResponsiveContainer(HorizontalBarChartWithAxis);\nconst ResponsiveAreaChart = withResponsiveContainer(AreaChart);\nconst ResponsiveHeatMapChart = withResponsiveContainer(HeatMapChart);\nconst ResponsiveSankeyChart = withResponsiveContainer(SankeyChart);\nconst ResponsiveGaugeChart = withResponsiveContainer(GaugeChart);\nconst ResponsiveGroupedVerticalBarChart = withResponsiveContainer(GroupedVerticalBarChart);\nconst ResponsiveVerticalBarChart = withResponsiveContainer(VerticalBarChart);\nconst ResponsiveScatterChart = withResponsiveContainer(ScatterChart);\nconst ResponsiveChartTable = withResponsiveContainer(ChartTable);\nconst ResponsiveGanttChart = withResponsiveContainer(GanttChart);\n// Removing responsive wrapper for FunnelChart as responsive container is not working with FunnelChart\n//const ResponsiveFunnelChart = withResponsiveContainer(FunnelChart);\n\n// Default x-axis key for grouping traces. Also applicable for PieData and SankeyData where x-axis is not defined.\nconst DEFAULT_XAXIS = 'x';\nconst FALLBACK_TYPE = 'fallback';\n\n/**\n * DeclarativeChart schema.\n * {@docCategory DeclarativeChart}\n */\nexport interface Schema {\n /**\n * Plotly schema represented as JSON object\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n plotlySchema: any;\n}\n\n/**\n * DeclarativeChart props.\n * {@docCategory DeclarativeChart}\n */\nexport interface DeclarativeChartProps extends React.RefAttributes<HTMLDivElement> {\n /**\n * The schema representing the chart data, layout and configuration\n */\n chartSchema: Schema;\n\n /**\n * Callback when an event occurs\n */\n onSchemaChange?: (eventData: Schema) => void;\n\n /**\n * Optional callback to access the IDeclarativeChart interface. Use this instead of ref for accessing\n * the public methods and properties of the component.\n */\n componentRef?: React.RefObject<IDeclarativeChart | null>;\n\n /**\n * Optional prop to specify the colorway type of the chart.\n * - 'default': Use Fluent UI color palette aligning with plotly colorway.\n * - 'builtin': Use Fluent UI colorway.\n * - 'others': Reserved for future colorways.\n * @default 'default'\n */\n colorwayType?: ColorwayType;\n}\n\n/**\n * {@docCategory DeclarativeChart}\n */\nexport interface IDeclarativeChart {\n exportAsImage: (opts?: ImageExportOptions) => Promise<string>;\n}\n\nconst useColorMapping = () => {\n const colorMap = React.useRef(new Map<string, string>());\n return colorMap;\n};\n\nfunction renderChart<TProps>(\n Renderer: React.ComponentType<TProps>,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n transformer: (...args: any[]) => TProps,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n transformerArgs: any[],\n commonProps: Partial<TProps>,\n cellRow: number,\n cellColumn: number,\n): JSXElement {\n const chartProps = transformer(...transformerArgs);\n return (\n <div\n key={`${cellRow}_${cellColumn}`}\n style={{\n gridRowStart: cellRow,\n gridRowEnd: cellRow + 1,\n gridColumnStart: cellColumn,\n gridColumnEnd: cellColumn + 1,\n }}\n >\n <Renderer {...chartProps} {...commonProps} />\n </div>\n );\n}\n\ntype PreTransformHooks = {\n preTransformCondition?: (plotlySchema: PlotlySchema) => boolean;\n preTransformOperation?: (plotlySchema: PlotlySchema) => PlotlySchema;\n};\n\nconst LineAreaPreTransformOp = (plotlyInput: PlotlySchema) => {\n const xValues = (plotlyInput.data[0] as PlotData).x;\n const isXMonth = isMonthArray(xValues);\n let renderData = plotlyInput.data;\n if (isXMonth) {\n renderData = plotlyInput.data.map((dataPoint: PlotData) => ({\n ...dataPoint,\n x: correctYearMonth(dataPoint.x),\n }));\n }\n return { data: renderData, layout: plotlyInput.layout };\n};\n\ntype ChartTypeMap = {\n donut: {\n transformer: typeof transformPlotlyJsonToDonutProps;\n renderer: typeof ResponsiveDonutChart;\n } & PreTransformHooks;\n sankey: {\n transformer: typeof transformPlotlyJsonToSankeyProps;\n renderer: typeof ResponsiveSankeyChart;\n } & PreTransformHooks;\n table: {\n transformer: typeof transformPlotlyJsonToChartTableProps;\n renderer: typeof ResponsiveChartTable;\n } & PreTransformHooks;\n horizontalbar: {\n transformer: typeof transformPlotlyJsonToHorizontalBarWithAxisProps;\n renderer: typeof ResponsiveHorizontalBarChartWithAxis;\n } & PreTransformHooks;\n groupedverticalbar: {\n transformer: typeof transformPlotlyJsonToGVBCProps;\n renderer: typeof ResponsiveGroupedVerticalBarChart;\n } & PreTransformHooks;\n verticalstackedbar: {\n transformer: typeof transformPlotlyJsonToVSBCProps;\n renderer: typeof ResponsiveVerticalStackedBarChart;\n } & PreTransformHooks;\n heatmap: {\n transformer: typeof transformPlotlyJsonToHeatmapProps;\n renderer: typeof ResponsiveHeatMapChart;\n } & PreTransformHooks;\n gauge: {\n transformer: typeof transformPlotlyJsonToGaugeProps;\n renderer: typeof ResponsiveGaugeChart;\n } & PreTransformHooks;\n verticalbar: {\n transformer: typeof transformPlotlyJsonToVBCProps;\n renderer: typeof ResponsiveVerticalBarChart;\n } & PreTransformHooks;\n area: {\n transformer: typeof transformPlotlyJsonToAreaChartProps;\n renderer: typeof ResponsiveAreaChart;\n } & PreTransformHooks;\n line: {\n transformer: typeof transformPlotlyJsonToLineChartProps;\n renderer: typeof ResponsiveLineChart;\n } & PreTransformHooks;\n scatter: {\n transformer: typeof transformPlotlyJsonToScatterChartProps;\n renderer: typeof ResponsiveScatterChart;\n } & PreTransformHooks;\n gantt: {\n transformer: typeof transformPlotlyJsonToGanttChartProps;\n renderer: typeof ResponsiveGanttChart;\n } & PreTransformHooks;\n funnel: {\n transformer: typeof transformPlotlyJsonToFunnelChartProps;\n renderer: typeof FunnelChart;\n } & PreTransformHooks;\n fallback: {\n transformer: typeof transformPlotlyJsonToVSBCProps;\n renderer: typeof ResponsiveVerticalStackedBarChart;\n } & PreTransformHooks;\n};\n\nconst chartMap: ChartTypeMap = {\n // PieData category charts\n donut: {\n transformer: transformPlotlyJsonToDonutProps,\n renderer: ResponsiveDonutChart,\n },\n // SankeyData category charts\n sankey: {\n transformer: transformPlotlyJsonToSankeyProps,\n renderer: ResponsiveSankeyChart,\n },\n // TableData category charts\n table: {\n transformer: transformPlotlyJsonToChartTableProps,\n renderer: ResponsiveChartTable,\n },\n // PlotData category charts\n horizontalbar: {\n transformer: transformPlotlyJsonToHorizontalBarWithAxisProps,\n renderer: ResponsiveHorizontalBarChartWithAxis,\n },\n groupedverticalbar: {\n transformer: transformPlotlyJsonToGVBCProps,\n renderer: ResponsiveGroupedVerticalBarChart,\n },\n verticalstackedbar: {\n transformer: transformPlotlyJsonToVSBCProps,\n renderer: ResponsiveVerticalStackedBarChart,\n },\n heatmap: {\n transformer: transformPlotlyJsonToHeatmapProps,\n renderer: ResponsiveHeatMapChart,\n },\n gauge: {\n transformer: transformPlotlyJsonToGaugeProps,\n renderer: ResponsiveGaugeChart,\n },\n verticalbar: {\n transformer: transformPlotlyJsonToVBCProps,\n renderer: ResponsiveVerticalBarChart,\n },\n area: {\n transformer: transformPlotlyJsonToAreaChartProps,\n renderer: ResponsiveAreaChart,\n preTransformOperation: LineAreaPreTransformOp,\n },\n line: {\n transformer: transformPlotlyJsonToLineChartProps,\n renderer: ResponsiveLineChart,\n preTransformOperation: LineAreaPreTransformOp,\n },\n scatter: {\n transformer: transformPlotlyJsonToScatterChartProps,\n renderer: ResponsiveScatterChart,\n preTransformOperation: LineAreaPreTransformOp,\n },\n gantt: {\n transformer: transformPlotlyJsonToGanttChartProps,\n renderer: ResponsiveGanttChart,\n },\n funnel: {\n transformer: transformPlotlyJsonToFunnelChartProps,\n renderer: FunnelChart,\n },\n fallback: {\n transformer: transformPlotlyJsonToVSBCProps,\n renderer: ResponsiveVerticalStackedBarChart,\n },\n};\n\nconst useIsDarkTheme = (): boolean => {\n const parentV9Theme = React.useContext(V9ThemeContext) as Theme;\n const v9Theme: Theme = parentV9Theme ? parentV9Theme : webLightTheme;\n\n // Get background and foreground colors\n const backgroundColor = d3Color.hsl(v9Theme.colorNeutralBackground1);\n const foregroundColor = d3Color.hsl(v9Theme.colorNeutralForeground1);\n\n const isDarkTheme = backgroundColor.l < foregroundColor.l;\n\n return isDarkTheme;\n};\n\n/**\n * DeclarativeChart component.\n * {@docCategory DeclarativeChart}\n */\nexport const DeclarativeChart: React.FunctionComponent<DeclarativeChartProps> = React.forwardRef<\n HTMLDivElement,\n DeclarativeChartProps\n>((props, forwardedRef) => {\n const { plotlySchema } = sanitizeJson(props.chartSchema);\n const chart: OutputChartType = mapFluentChart(plotlySchema);\n if (!chart.isValid) {\n throw new Error(`Invalid chart schema: ${chart.errorMessage}`);\n }\n let plotlyInput = plotlySchema as PlotlySchema;\n try {\n plotlyInput = decodeBase64Fields(plotlyInput);\n } catch (error) {\n throw new Error(`Failed to decode plotly schema: ${error}`);\n }\n const plotlyInputWithValidData: PlotlySchema = {\n ...plotlyInput,\n data: chart.validTracesInfo!.map(trace => plotlyInput.data[trace.index]),\n };\n\n const validTracesFilteredIndex: TraceInfo[] = chart.validTracesInfo!.map((trace, index) => ({\n index,\n type: trace.type,\n }));\n\n let { selectedLegends } = plotlySchema;\n const colorMap = useColorMapping();\n const isDarkTheme = useIsDarkTheme();\n const chartRef = React.useRef<Chart>(null);\n const isMultiPlot = React.useRef(false);\n\n if (!isArrayOrTypedArray(selectedLegends)) {\n selectedLegends = [];\n }\n\n const [activeLegends, setActiveLegends] = React.useState<string[]>(selectedLegends);\n const onActiveLegendsChange = (keys: string[]) => {\n setActiveLegends(keys);\n if (props.onSchemaChange) {\n props.onSchemaChange({ plotlySchema: { plotlyInput, selectedLegends: keys } });\n }\n };\n\n React.useEffect(() => {\n // eslint-disable-next-line @typescript-eslint/no-shadow\n const { plotlySchema } = sanitizeJson(props.chartSchema);\n // eslint-disable-next-line @typescript-eslint/no-shadow\n const { selectedLegends } = plotlySchema;\n setActiveLegends(selectedLegends ?? []);\n }, [props.chartSchema]);\n\n const multiSelectLegendProps = {\n canSelectMultipleLegends: true,\n onChange: onActiveLegendsChange,\n selectedLegends: activeLegends,\n };\n\n const commonProps = {\n legendProps: multiSelectLegendProps,\n componentRef: chartRef,\n };\n\n function createLegends(legendProps: LegendsProps): JSXElement {\n // eslint-disable-next-line react/jsx-no-bind\n return <Legends {...legendProps} selectedLegends={activeLegends} onChange={onActiveLegendsChange} />;\n }\n\n // TODO\n const exportAsImage = React.useCallback((opts?: ImageExportOptions): Promise<string> => {\n return new Promise((resolve, reject) => {\n if (isMultiPlot.current) {\n return reject(Error('Exporting multi plot charts as image is not supported'));\n }\n if (!chartRef.current || typeof chartRef.current.toImage !== 'function') {\n return reject(Error('Chart cannot be exported as image'));\n }\n\n chartRef.current\n .toImage({\n background: tokens.colorNeutralBackground1,\n scale: 5,\n ...opts,\n })\n .then(resolve)\n .catch(reject);\n });\n }, []);\n\n React.useImperativeHandle(\n props.componentRef,\n () => ({\n exportAsImage,\n }),\n [exportAsImage],\n );\n\n if (chart.type === 'scatterpolar') {\n const cartesianProjection = projectPolarToCartesian(plotlyInputWithValidData);\n plotlyInputWithValidData.data = cartesianProjection.data;\n plotlyInputWithValidData.layout = cartesianProjection.layout;\n validTracesFilteredIndex.forEach((trace, index) => {\n if (trace.type === 'scatterpolar') {\n const mode = (plotlyInputWithValidData.data[index] as PlotData)?.mode ?? '';\n if (mode.includes('line')) {\n validTracesFilteredIndex[index].type = 'line';\n } else if (mode.includes('markers') || mode === 'text') {\n validTracesFilteredIndex[index].type = 'scatter';\n } else {\n validTracesFilteredIndex[index].type = 'line';\n }\n }\n });\n }\n const groupedTraces: Record<string, number[]> = {};\n let nonCartesianTraceCount = 0;\n plotlyInputWithValidData.data.forEach((trace: Data, index: number) => {\n let traceKey = '';\n if (isNonPlotType(chart.validTracesInfo![index].type)) {\n traceKey = `${NON_PLOT_KEY_PREFIX}${nonCartesianTraceCount + 1}`;\n nonCartesianTraceCount++;\n } else {\n traceKey = (trace as PlotData).xaxis ?? DEFAULT_XAXIS;\n }\n if (!groupedTraces[traceKey]) {\n groupedTraces[traceKey] = [];\n }\n groupedTraces[traceKey].push(index);\n });\n\n isMultiPlot.current = Object.keys(groupedTraces).length > 1;\n const gridProperties: GridProperties = getGridProperties(\n plotlyInputWithValidData,\n isMultiPlot.current,\n chart.validTracesInfo!,\n );\n\n // Render only one plot if the grid properties cannot determine positioning of multiple plots.\n if (\n isMultiPlot.current &&\n gridProperties.templateRows === SINGLE_REPEAT &&\n gridProperties.templateColumns === SINGLE_REPEAT\n ) {\n Object.keys(groupedTraces).forEach((key, index) => {\n if (index > 0) {\n delete groupedTraces[key];\n }\n });\n isMultiPlot.current = false;\n }\n\n const allupLegendsProps = getAllupLegendsProps(\n plotlyInputWithValidData,\n colorMap,\n props.colorwayType,\n chart.validTracesInfo!,\n isDarkTheme,\n );\n\n type ChartType = keyof ChartTypeMap;\n // map through the grouped traces and render the appropriate chart\n return (\n <>\n <div\n style={{\n display: 'grid',\n gridTemplateRows: gridProperties.templateRows,\n gridTemplateColumns: gridProperties.templateColumns,\n }}\n >\n {Object.entries(groupedTraces).map(([xAxisKey, index]) => {\n const plotlyInputForGroup: PlotlySchema = {\n ...plotlyInputWithValidData,\n data: index.map(idx => plotlyInputWithValidData.data[idx]),\n };\n\n const filteredTracesInfo = validTracesFilteredIndex.filter(trace => index.includes(trace.index));\n let chartType =\n validTracesFilteredIndex.some(trace => trace.type === FALLBACK_TYPE) || chart.type === FALLBACK_TYPE\n ? FALLBACK_TYPE\n : filteredTracesInfo[0].type;\n\n if (\n validTracesFilteredIndex.some(trace => trace.type === 'line') &&\n validTracesFilteredIndex.some(trace => trace.type === 'scatter')\n ) {\n chartType = 'line';\n }\n\n const chartEntry = chartMap[chartType as ChartType];\n if (chartEntry) {\n const { transformer, renderer, preTransformCondition, preTransformOperation } = chartEntry;\n if (preTransformCondition === undefined || preTransformCondition(plotlyInputForGroup)) {\n const transformedInput = preTransformOperation\n ? preTransformOperation(plotlyInputForGroup)\n : plotlyInputForGroup;\n const cellProperties = gridProperties.layout[xAxisKey];\n\n return renderChart<ReturnType<typeof transformer>>(\n renderer,\n transformer,\n [transformedInput, isMultiPlot.current, colorMap, props.colorwayType, isDarkTheme],\n {\n ...commonProps,\n xAxisAnnotation: cellProperties?.xAnnotation,\n yAxisAnnotation: cellProperties?.yAnnotation,\n },\n cellProperties?.row ?? 1,\n cellProperties?.column ?? 1,\n );\n }\n return <></>;\n } else {\n throw new Error(`Unsupported chart type :${plotlyInputForGroup.data[0]?.type}`);\n }\n })}\n </div>\n {isMultiPlot.current && createLegends(allupLegendsProps)}\n </>\n );\n});\nDeclarativeChart.displayName = 'DeclarativeChart';\nDeclarativeChart.defaultProps = {\n colorwayType: 'default',\n};\n"],"names":["React","decodeBase64Fields","isArrayOrTypedArray","isMonthArray","mapFluentChart","sanitizeJson","tokens","ThemeContext_unstable","V9ThemeContext","webLightTheme","d3Color","correctYearMonth","getGridProperties","isNonPlotType","transformPlotlyJsonToDonutProps","transformPlotlyJsonToVSBCProps","transformPlotlyJsonToAreaChartProps","transformPlotlyJsonToLineChartProps","transformPlotlyJsonToHorizontalBarWithAxisProps","transformPlotlyJsonToHeatmapProps","transformPlotlyJsonToSankeyProps","transformPlotlyJsonToGaugeProps","transformPlotlyJsonToGVBCProps","transformPlotlyJsonToVBCProps","transformPlotlyJsonToChartTableProps","transformPlotlyJsonToScatterChartProps","projectPolarToCartesian","getAllupLegendsProps","NON_PLOT_KEY_PREFIX","SINGLE_REPEAT","transformPlotlyJsonToFunnelChartProps","transformPlotlyJsonToGanttChartProps","DonutChart","VerticalStackedBarChart","LineChart","HorizontalBarChartWithAxis","AreaChart","HeatMapChart","SankeyChart","GaugeChart","GroupedVerticalBarChart","VerticalBarChart","ScatterChart","FunnelChart","GanttChart","withResponsiveContainer","ChartTable","Legends","ResponsiveDonutChart","ResponsiveVerticalStackedBarChart","ResponsiveLineChart","ResponsiveHorizontalBarChartWithAxis","ResponsiveAreaChart","ResponsiveHeatMapChart","ResponsiveSankeyChart","ResponsiveGaugeChart","ResponsiveGroupedVerticalBarChart","ResponsiveVerticalBarChart","ResponsiveScatterChart","ResponsiveChartTable","ResponsiveGanttChart","DEFAULT_XAXIS","FALLBACK_TYPE","useColorMapping","colorMap","useRef","Map","renderChart","Renderer","transformer","transformerArgs","commonProps","cellRow","cellColumn","chartProps","div","key","style","gridRowStart","gridRowEnd","gridColumnStart","gridColumnEnd","LineAreaPreTransformOp","plotlyInput","xValues","data","x","isXMonth","renderData","map","dataPoint","layout","chartMap","donut","renderer","sankey","table","horizontalbar","groupedverticalbar","verticalstackedbar","heatmap","gauge","verticalbar","area","preTransformOperation","line","scatter","gantt","funnel","fallback","useIsDarkTheme","parentV9Theme","useContext","v9Theme","backgroundColor","hsl","colorNeutralBackground1","foregroundColor","colorNeutralForeground1","isDarkTheme","l","DeclarativeChart","forwardRef","props","forwardedRef","plotlySchema","chartSchema","chart","isValid","Error","errorMessage","error","plotlyInputWithValidData","validTracesInfo","trace","index","validTracesFilteredIndex","type","selectedLegends","chartRef","isMultiPlot","activeLegends","setActiveLegends","useState","onActiveLegendsChange","keys","onSchemaChange","useEffect","multiSelectLegendProps","canSelectMultipleLegends","onChange","legendProps","componentRef","createLegends","exportAsImage","useCallback","opts","Promise","resolve","reject","current","toImage","background","scale","then","catch","useImperativeHandle","cartesianProjection","forEach","mode","includes","groupedTraces","nonCartesianTraceCount","traceKey","xaxis","push","Object","length","gridProperties","templateRows","templateColumns","allupLegendsProps","colorwayType","display","gridTemplateRows","gridTemplateColumns","entries","xAxisKey","plotlyInputForGroup","idx","filteredTracesInfo","filter","chartType","some","chartEntry","preTransformCondition","undefined","transformedInput","cellProperties","xAxisAnnotation","xAnnotation","yAxisAnnotation","yAnnotation","row","column","displayName","defaultProps"],"mappings":"AAAA,uDAAuD,GACvD,YAAYA,WAAW,QAAQ;AAE/B,SACEC,kBAAkB,EAClBC,mBAAmB,EACnBC,YAAY,EACZC,cAAc,EACdC,YAAY,QACP,4BAA4B;AAEnC,SAASC,MAAM,QAAQ,wBAAwB;AAC/C,SAASC,yBAAyBC,cAAc,QAAQ,kCAAkC;AAC1F,SAAgBC,aAAa,QAAQ,mBAAmB;AACxD,YAAYC,aAAa,WAAW;AAEpC,SACEC,gBAAgB,EAChBC,iBAAiB,EACjBC,aAAa,EACbC,+BAA+B,EAC/BC,8BAA8B,EAC9BC,mCAAmC,EACnCC,mCAAmC,EACnCC,+CAA+C,EAC/CC,iCAAiC,EACjCC,gCAAgC,EAChCC,+BAA+B,EAC/BC,8BAA8B,EAC9BC,6BAA6B,EAC7BC,oCAAoC,EACpCC,sCAAsC,EACtCC,uBAAuB,EACvBC,oBAAoB,EACpBC,mBAAmB,EACnBC,aAAa,EACbC,qCAAqC,EACrCC,oCAAoC,QAC/B,wBAAwB;AAE/B,SAASC,UAAU,QAA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YAE9B;YACA,qBAAO;QACT,OAAO;gBACsCV;YAA3C,MAAM,IAAI3D,MAAM,CAAC,wBAAwB,GAAE2D,6BAAAA,oBAAoBvG,IAAI,CAAC,EAAE,cAA3BuG,iDAAAA,2BAA6BnD,IAAI,EAAE;QAChF;IACF,KAEDG,YAAYoB,OAAO,IAAIP,cAAc4B;AAG5C,GAAG;AACH5D,iBAAiBoF,WAAW,GAAG;AAC/BpF,iBAAiBqF,YAAY,GAAG;IAC9BxB,cAAc;AAChB"}
1
+ {"version":3,"sources":["../src/components/DeclarativeChart/DeclarativeChart.tsx"],"sourcesContent":["'use client';\n\n/* eslint-disable @typescript-eslint/naming-convention */\nimport * as React from 'react';\nimport type { Data, PlotData, PlotlySchema, OutputChartType, TraceInfo } from '@fluentui/chart-utilities';\nimport {\n decodeBase64Fields,\n isArrayOrTypedArray,\n isMonthArray,\n mapFluentChart,\n sanitizeJson,\n} from '@fluentui/chart-utilities';\nimport type { GridProperties } from './PlotlySchemaAdapter';\nimport { tokens } from '@fluentui/react-theme';\nimport { ThemeContext_unstable as V9ThemeContext } from '@fluentui/react-shared-contexts';\nimport { Theme, webLightTheme } from '@fluentui/tokens';\nimport * as d3Color from 'd3-color';\n\nimport {\n correctYearMonth,\n getGridProperties,\n isNonPlotType,\n transformPlotlyJsonToDonutProps,\n transformPlotlyJsonToVSBCProps,\n transformPlotlyJsonToAreaChartProps,\n transformPlotlyJsonToLineChartProps,\n transformPlotlyJsonToHorizontalBarWithAxisProps,\n transformPlotlyJsonToHeatmapProps,\n transformPlotlyJsonToSankeyProps,\n transformPlotlyJsonToGaugeProps,\n transformPlotlyJsonToGVBCProps,\n transformPlotlyJsonToVBCProps,\n transformPlotlyJsonToChartTableProps,\n transformPlotlyJsonToScatterChartProps,\n projectPolarToCartesian,\n getAllupLegendsProps,\n NON_PLOT_KEY_PREFIX,\n SINGLE_REPEAT,\n transformPlotlyJsonToFunnelChartProps,\n transformPlotlyJsonToGanttChartProps,\n} from './PlotlySchemaAdapter';\nimport type { ColorwayType } from './PlotlyColorAdapter';\nimport { DonutChart } from '../DonutChart/index';\nimport { VerticalStackedBarChart } from '../VerticalStackedBarChart/index';\nimport { LineChart } from '../LineChart/index';\nimport { HorizontalBarChartWithAxis } from '../HorizontalBarChartWithAxis/index';\nimport { AreaChart } from '../AreaChart/index';\nimport { HeatMapChart } from '../HeatMapChart/index';\nimport { SankeyChart } from '../SankeyChart/SankeyChart';\nimport { GaugeChart } from '../GaugeChart/index';\nimport { GroupedVerticalBarChart } from '../GroupedVerticalBarChart/index';\nimport { VerticalBarChart } from '../VerticalBarChart/index';\nimport { Chart, ImageExportOptions } from '../../types/index';\nimport { ScatterChart } from '../ScatterChart/index';\nimport { FunnelChart } from '../FunnelChart/FunnelChart';\nimport { GanttChart } from '../GanttChart/index';\n\nimport { withResponsiveContainer } from '../ResponsiveContainer/withResponsiveContainer';\nimport { ChartTable } from '../ChartTable/index';\nimport { LegendsProps, Legends } from '../Legends/index';\nimport { JSXElement } from '@fluentui/react-utilities/src/index';\n\nconst ResponsiveDonutChart = withResponsiveContainer(DonutChart);\nconst ResponsiveVerticalStackedBarChart = withResponsiveContainer(VerticalStackedBarChart);\nconst ResponsiveLineChart = withResponsiveContainer(LineChart);\nconst ResponsiveHorizontalBarChartWithAxis = withResponsiveContainer(HorizontalBarChartWithAxis);\nconst ResponsiveAreaChart = withResponsiveContainer(AreaChart);\nconst ResponsiveHeatMapChart = withResponsiveContainer(HeatMapChart);\nconst ResponsiveSankeyChart = withResponsiveContainer(SankeyChart);\nconst ResponsiveGaugeChart = withResponsiveContainer(GaugeChart);\nconst ResponsiveGroupedVerticalBarChart = withResponsiveContainer(GroupedVerticalBarChart);\nconst ResponsiveVerticalBarChart = withResponsiveContainer(VerticalBarChart);\nconst ResponsiveScatterChart = withResponsiveContainer(ScatterChart);\nconst ResponsiveChartTable = withResponsiveContainer(ChartTable);\nconst ResponsiveGanttChart = withResponsiveContainer(GanttChart);\n// Removing responsive wrapper for FunnelChart as responsive container is not working with FunnelChart\n//const ResponsiveFunnelChart = withResponsiveContainer(FunnelChart);\n\n// Default x-axis key for grouping traces. Also applicable for PieData and SankeyData where x-axis is not defined.\nconst DEFAULT_XAXIS = 'x';\nconst FALLBACK_TYPE = 'fallback';\n\n/**\n * DeclarativeChart schema.\n * {@docCategory DeclarativeChart}\n */\nexport interface Schema {\n /**\n * Plotly schema represented as JSON object\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n plotlySchema: any;\n}\n\n/**\n * DeclarativeChart props.\n * {@docCategory DeclarativeChart}\n */\nexport interface DeclarativeChartProps extends React.RefAttributes<HTMLDivElement> {\n /**\n * The schema representing the chart data, layout and configuration\n */\n chartSchema: Schema;\n\n /**\n * Callback when an event occurs\n */\n onSchemaChange?: (eventData: Schema) => void;\n\n /**\n * Optional callback to access the IDeclarativeChart interface. Use this instead of ref for accessing\n * the public methods and properties of the component.\n */\n componentRef?: React.RefObject<IDeclarativeChart | null>;\n\n /**\n * Optional prop to specify the colorway type of the chart.\n * - 'default': Use Fluent UI color palette aligning with plotly colorway.\n * - 'builtin': Use Fluent UI colorway.\n * - 'others': Reserved for future colorways.\n * @default 'default'\n */\n colorwayType?: ColorwayType;\n}\n\n/**\n * {@docCategory DeclarativeChart}\n */\nexport interface IDeclarativeChart {\n exportAsImage: (opts?: ImageExportOptions) => Promise<string>;\n}\n\nconst useColorMapping = () => {\n const colorMap = React.useRef(new Map<string, string>());\n return colorMap;\n};\n\nfunction renderChart<TProps>(\n Renderer: React.ComponentType<TProps>,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n transformer: (...args: any[]) => TProps,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n transformerArgs: any[],\n commonProps: Partial<TProps>,\n cellRow: number,\n cellColumn: number,\n): JSXElement {\n const chartProps = transformer(...transformerArgs);\n return (\n <div\n key={`${cellRow}_${cellColumn}`}\n style={{\n gridRowStart: cellRow,\n gridRowEnd: cellRow + 1,\n gridColumnStart: cellColumn,\n gridColumnEnd: cellColumn + 1,\n }}\n >\n <Renderer {...chartProps} {...commonProps} />\n </div>\n );\n}\n\ntype PreTransformHooks = {\n preTransformCondition?: (plotlySchema: PlotlySchema) => boolean;\n preTransformOperation?: (plotlySchema: PlotlySchema) => PlotlySchema;\n};\n\nconst LineAreaPreTransformOp = (plotlyInput: PlotlySchema) => {\n const xValues = (plotlyInput.data[0] as PlotData).x;\n const isXMonth = isMonthArray(xValues);\n let renderData = plotlyInput.data;\n if (isXMonth) {\n renderData = plotlyInput.data.map((dataPoint: PlotData) => ({\n ...dataPoint,\n x: correctYearMonth(dataPoint.x),\n }));\n }\n return { data: renderData, layout: plotlyInput.layout };\n};\n\ntype ChartTypeMap = {\n donut: {\n transformer: typeof transformPlotlyJsonToDonutProps;\n renderer: typeof ResponsiveDonutChart;\n } & PreTransformHooks;\n sankey: {\n transformer: typeof transformPlotlyJsonToSankeyProps;\n renderer: typeof ResponsiveSankeyChart;\n } & PreTransformHooks;\n table: {\n transformer: typeof transformPlotlyJsonToChartTableProps;\n renderer: typeof ResponsiveChartTable;\n } & PreTransformHooks;\n horizontalbar: {\n transformer: typeof transformPlotlyJsonToHorizontalBarWithAxisProps;\n renderer: typeof ResponsiveHorizontalBarChartWithAxis;\n } & PreTransformHooks;\n groupedverticalbar: {\n transformer: typeof transformPlotlyJsonToGVBCProps;\n renderer: typeof ResponsiveGroupedVerticalBarChart;\n } & PreTransformHooks;\n verticalstackedbar: {\n transformer: typeof transformPlotlyJsonToVSBCProps;\n renderer: typeof ResponsiveVerticalStackedBarChart;\n } & PreTransformHooks;\n heatmap: {\n transformer: typeof transformPlotlyJsonToHeatmapProps;\n renderer: typeof ResponsiveHeatMapChart;\n } & PreTransformHooks;\n gauge: {\n transformer: typeof transformPlotlyJsonToGaugeProps;\n renderer: typeof ResponsiveGaugeChart;\n } & PreTransformHooks;\n verticalbar: {\n transformer: typeof transformPlotlyJsonToVBCProps;\n renderer: typeof ResponsiveVerticalBarChart;\n } & PreTransformHooks;\n area: {\n transformer: typeof transformPlotlyJsonToAreaChartProps;\n renderer: typeof ResponsiveAreaChart;\n } & PreTransformHooks;\n line: {\n transformer: typeof transformPlotlyJsonToLineChartProps;\n renderer: typeof ResponsiveLineChart;\n } & PreTransformHooks;\n scatter: {\n transformer: typeof transformPlotlyJsonToScatterChartProps;\n renderer: typeof ResponsiveScatterChart;\n } & PreTransformHooks;\n gantt: {\n transformer: typeof transformPlotlyJsonToGanttChartProps;\n renderer: typeof ResponsiveGanttChart;\n } & PreTransformHooks;\n funnel: {\n transformer: typeof transformPlotlyJsonToFunnelChartProps;\n renderer: typeof FunnelChart;\n } & PreTransformHooks;\n fallback: {\n transformer: typeof transformPlotlyJsonToVSBCProps;\n renderer: typeof ResponsiveVerticalStackedBarChart;\n } & PreTransformHooks;\n};\n\nconst chartMap: ChartTypeMap = {\n // PieData category charts\n donut: {\n transformer: transformPlotlyJsonToDonutProps,\n renderer: ResponsiveDonutChart,\n },\n // SankeyData category charts\n sankey: {\n transformer: transformPlotlyJsonToSankeyProps,\n renderer: ResponsiveSankeyChart,\n },\n // TableData category charts\n table: {\n transformer: transformPlotlyJsonToChartTableProps,\n renderer: ResponsiveChartTable,\n },\n // PlotData category charts\n horizontalbar: {\n transformer: transformPlotlyJsonToHorizontalBarWithAxisProps,\n renderer: ResponsiveHorizontalBarChartWithAxis,\n },\n groupedverticalbar: {\n transformer: transformPlotlyJsonToGVBCProps,\n renderer: ResponsiveGroupedVerticalBarChart,\n },\n verticalstackedbar: {\n transformer: transformPlotlyJsonToVSBCProps,\n renderer: ResponsiveVerticalStackedBarChart,\n },\n heatmap: {\n transformer: transformPlotlyJsonToHeatmapProps,\n renderer: ResponsiveHeatMapChart,\n },\n gauge: {\n transformer: transformPlotlyJsonToGaugeProps,\n renderer: ResponsiveGaugeChart,\n },\n verticalbar: {\n transformer: transformPlotlyJsonToVBCProps,\n renderer: ResponsiveVerticalBarChart,\n },\n area: {\n transformer: transformPlotlyJsonToAreaChartProps,\n renderer: ResponsiveAreaChart,\n preTransformOperation: LineAreaPreTransformOp,\n },\n line: {\n transformer: transformPlotlyJsonToLineChartProps,\n renderer: ResponsiveLineChart,\n preTransformOperation: LineAreaPreTransformOp,\n },\n scatter: {\n transformer: transformPlotlyJsonToScatterChartProps,\n renderer: ResponsiveScatterChart,\n preTransformOperation: LineAreaPreTransformOp,\n },\n gantt: {\n transformer: transformPlotlyJsonToGanttChartProps,\n renderer: ResponsiveGanttChart,\n },\n funnel: {\n transformer: transformPlotlyJsonToFunnelChartProps,\n renderer: FunnelChart,\n },\n fallback: {\n transformer: transformPlotlyJsonToVSBCProps,\n renderer: ResponsiveVerticalStackedBarChart,\n },\n};\n\nconst useIsDarkTheme = (): boolean => {\n const parentV9Theme = React.useContext(V9ThemeContext) as Theme;\n const v9Theme: Theme = parentV9Theme ? parentV9Theme : webLightTheme;\n\n // Get background and foreground colors\n const backgroundColor = d3Color.hsl(v9Theme.colorNeutralBackground1);\n const foregroundColor = d3Color.hsl(v9Theme.colorNeutralForeground1);\n\n const isDarkTheme = backgroundColor.l < foregroundColor.l;\n\n return isDarkTheme;\n};\n\n/**\n * DeclarativeChart component.\n * {@docCategory DeclarativeChart}\n */\nexport const DeclarativeChart: React.FunctionComponent<DeclarativeChartProps> = React.forwardRef<\n HTMLDivElement,\n DeclarativeChartProps\n>((props, forwardedRef) => {\n const { plotlySchema } = sanitizeJson(props.chartSchema);\n const chart: OutputChartType = mapFluentChart(plotlySchema);\n if (!chart.isValid) {\n throw new Error(`Invalid chart schema: ${chart.errorMessage}`);\n }\n let plotlyInput = plotlySchema as PlotlySchema;\n try {\n plotlyInput = decodeBase64Fields(plotlyInput);\n } catch (error) {\n throw new Error(`Failed to decode plotly schema: ${error}`);\n }\n const plotlyInputWithValidData: PlotlySchema = {\n ...plotlyInput,\n data: chart.validTracesInfo!.map(trace => plotlyInput.data[trace.index]),\n };\n\n const validTracesFilteredIndex: TraceInfo[] = chart.validTracesInfo!.map((trace, index) => ({\n index,\n type: trace.type,\n }));\n\n let { selectedLegends } = plotlySchema;\n const colorMap = useColorMapping();\n const isDarkTheme = useIsDarkTheme();\n const chartRef = React.useRef<Chart>(null);\n const isMultiPlot = React.useRef(false);\n\n if (!isArrayOrTypedArray(selectedLegends)) {\n selectedLegends = [];\n }\n\n const [activeLegends, setActiveLegends] = React.useState<string[]>(selectedLegends);\n const onActiveLegendsChange = (keys: string[]) => {\n setActiveLegends(keys);\n if (props.onSchemaChange) {\n props.onSchemaChange({ plotlySchema: { plotlyInput, selectedLegends: keys } });\n }\n };\n\n React.useEffect(() => {\n // eslint-disable-next-line @typescript-eslint/no-shadow\n const { plotlySchema } = sanitizeJson(props.chartSchema);\n // eslint-disable-next-line @typescript-eslint/no-shadow\n const { selectedLegends } = plotlySchema;\n setActiveLegends(selectedLegends ?? []);\n }, [props.chartSchema]);\n\n const multiSelectLegendProps = {\n canSelectMultipleLegends: true,\n onChange: onActiveLegendsChange,\n selectedLegends: activeLegends,\n };\n\n const commonProps = {\n legendProps: multiSelectLegendProps,\n componentRef: chartRef,\n };\n\n function createLegends(legendProps: LegendsProps): JSXElement {\n // eslint-disable-next-line react/jsx-no-bind\n return <Legends {...legendProps} selectedLegends={activeLegends} onChange={onActiveLegendsChange} />;\n }\n\n // TODO\n const exportAsImage = React.useCallback((opts?: ImageExportOptions): Promise<string> => {\n return new Promise((resolve, reject) => {\n if (isMultiPlot.current) {\n return reject(Error('Exporting multi plot charts as image is not supported'));\n }\n if (!chartRef.current || typeof chartRef.current.toImage !== 'function') {\n return reject(Error('Chart cannot be exported as image'));\n }\n\n chartRef.current\n .toImage({\n background: tokens.colorNeutralBackground1,\n scale: 5,\n ...opts,\n })\n .then(resolve)\n .catch(reject);\n });\n }, []);\n\n React.useImperativeHandle(\n props.componentRef,\n () => ({\n exportAsImage,\n }),\n [exportAsImage],\n );\n\n if (chart.type === 'scatterpolar') {\n const cartesianProjection = projectPolarToCartesian(plotlyInputWithValidData);\n plotlyInputWithValidData.data = cartesianProjection.data;\n plotlyInputWithValidData.layout = cartesianProjection.layout;\n validTracesFilteredIndex.forEach((trace, index) => {\n if (trace.type === 'scatterpolar') {\n const mode = (plotlyInputWithValidData.data[index] as PlotData)?.mode ?? '';\n if (mode.includes('line')) {\n validTracesFilteredIndex[index].type = 'line';\n } else if (mode.includes('markers') || mode === 'text') {\n validTracesFilteredIndex[index].type = 'scatter';\n } else {\n validTracesFilteredIndex[index].type = 'line';\n }\n }\n });\n }\n const groupedTraces: Record<string, number[]> = {};\n let nonCartesianTraceCount = 0;\n plotlyInputWithValidData.data.forEach((trace: Data, index: number) => {\n let traceKey = '';\n if (isNonPlotType(chart.validTracesInfo![index].type)) {\n traceKey = `${NON_PLOT_KEY_PREFIX}${nonCartesianTraceCount + 1}`;\n nonCartesianTraceCount++;\n } else {\n traceKey = (trace as PlotData).xaxis ?? DEFAULT_XAXIS;\n }\n if (!groupedTraces[traceKey]) {\n groupedTraces[traceKey] = [];\n }\n groupedTraces[traceKey].push(index);\n });\n\n isMultiPlot.current = Object.keys(groupedTraces).length > 1;\n const gridProperties: GridProperties = getGridProperties(\n plotlyInputWithValidData,\n isMultiPlot.current,\n chart.validTracesInfo!,\n );\n\n // Render only one plot if the grid properties cannot determine positioning of multiple plots.\n if (\n isMultiPlot.current &&\n gridProperties.templateRows === SINGLE_REPEAT &&\n gridProperties.templateColumns === SINGLE_REPEAT\n ) {\n Object.keys(groupedTraces).forEach((key, index) => {\n if (index > 0) {\n delete groupedTraces[key];\n }\n });\n isMultiPlot.current = false;\n }\n\n const allupLegendsProps = getAllupLegendsProps(\n plotlyInputWithValidData,\n colorMap,\n props.colorwayType,\n chart.validTracesInfo!,\n isDarkTheme,\n );\n\n type ChartType = keyof ChartTypeMap;\n // map through the grouped traces and render the appropriate chart\n return (\n <>\n <div\n style={{\n display: 'grid',\n gridTemplateRows: gridProperties.templateRows,\n gridTemplateColumns: gridProperties.templateColumns,\n }}\n >\n {Object.entries(groupedTraces).map(([xAxisKey, index]) => {\n const plotlyInputForGroup: PlotlySchema = {\n ...plotlyInputWithValidData,\n data: index.map(idx => plotlyInputWithValidData.data[idx]),\n };\n\n const filteredTracesInfo = validTracesFilteredIndex.filter(trace => index.includes(trace.index));\n let chartType =\n validTracesFilteredIndex.some(trace => trace.type === FALLBACK_TYPE) || chart.type === FALLBACK_TYPE\n ? FALLBACK_TYPE\n : filteredTracesInfo[0].type;\n\n if (\n validTracesFilteredIndex.some(trace => trace.type === 'line') &&\n validTracesFilteredIndex.some(trace => trace.type === 'scatter')\n ) {\n chartType = 'line';\n }\n\n const chartEntry = chartMap[chartType as ChartType];\n if (chartEntry) {\n const { transformer, renderer, preTransformCondition, preTransformOperation } = chartEntry;\n if (preTransformCondition === undefined || preTransformCondition(plotlyInputForGroup)) {\n const transformedInput = preTransformOperation\n ? preTransformOperation(plotlyInputForGroup)\n : plotlyInputForGroup;\n const cellProperties = gridProperties.layout[xAxisKey];\n\n return renderChart<ReturnType<typeof transformer>>(\n renderer,\n transformer,\n [transformedInput, isMultiPlot.current, colorMap, props.colorwayType, isDarkTheme],\n {\n ...commonProps,\n xAxisAnnotation: cellProperties?.xAnnotation,\n yAxisAnnotation: cellProperties?.yAnnotation,\n },\n cellProperties?.row ?? 1,\n cellProperties?.column ?? 1,\n );\n }\n return <></>;\n } else {\n throw new Error(`Unsupported chart type :${plotlyInputForGroup.data[0]?.type}`);\n }\n })}\n </div>\n {isMultiPlot.current && createLegends(allupLegendsProps)}\n </>\n );\n});\nDeclarativeChart.displayName = 'DeclarativeChart';\nDeclarativeChart.defaultProps = {\n colorwayType: 'default',\n};\n"],"names":["React","decodeBase64Fields","isArrayOrTypedArray","isMonthArray","mapFluentChart","sanitizeJson","tokens","ThemeContext_unstable","V9ThemeContext","webLightTheme","d3Color","correctYearMonth","getGridProperties","isNonPlotType","transformPlotlyJsonToDonutProps","transformPlotlyJsonToVSBCProps","transformPlotlyJsonToAreaChartProps","transformPlotlyJsonToLineChartProps","transformPlotlyJsonToHorizontalBarWithAxisProps","transformPlotlyJsonToHeatmapProps","transformPlotlyJsonToSankeyProps","transformPlotlyJsonToGaugeProps","transformPlotlyJsonToGVBCProps","transformPlotlyJsonToVBCProps","transformPlotlyJsonToChartTableProps","transformPlotlyJsonToScatterChartProps","projectPolarToCartesian","getAllupLegendsProps","NON_PLOT_KEY_PREFIX","SINGLE_REPEAT","transformPlotlyJsonToFunnelChartProps","transformPlotlyJsonToGanttChartProps","DonutChart","VerticalStackedBarChart","LineChart","HorizontalBarChartWithAxis","AreaChart","HeatMapChart","SankeyChart","GaugeChart","GroupedVerticalBarChart","VerticalBarChart","ScatterChart","FunnelChart","GanttChart","withResponsiveContainer","ChartTable","Legends","ResponsiveDonutChart","ResponsiveVerticalStackedBarChart","ResponsiveLineChart","ResponsiveHorizontalBarChartWithAxis","ResponsiveAreaChart","ResponsiveHeatMapChart","ResponsiveSankeyChart","ResponsiveGaugeChart","ResponsiveGroupedVerticalBarChart","ResponsiveVerticalBarChart","ResponsiveScatterChart","ResponsiveChartTable","ResponsiveGanttChart","DEFAULT_XAXIS","FALLBACK_TYPE","useColorMapping","colorMap","useRef","Map","renderChart","Renderer","transformer","transformerArgs","commonProps","cellRow","cellColumn","chartProps","div","key","style","gridRowStart","gridRowEnd","gridColumnStart","gridColumnEnd","LineAreaPreTransformOp","plotlyInput","xValues","data","x","isXMonth","renderData","map","dataPoint","layout","chartMap","donut","renderer","sankey","table","horizontalbar","groupedverticalbar","verticalstackedbar","heatmap","gauge","verticalbar","area","preTransformOperation","line","scatter","gantt","funnel","fallback","useIsDarkTheme","parentV9Theme","useContext","v9Theme","backgroundColor","hsl","colorNeutralBackground1","foregroundColor","colorNeutralForeground1","isDarkTheme","l","DeclarativeChart","forwardRef","props","forwardedRef","plotlySchema","chartSchema","chart","isValid","Error","errorMessage","error","plotlyInputWithValidData","validTracesInfo","trace","index","validTracesFilteredIndex","type","selectedLegends","chartRef","isMultiPlot","activeLegends","setActiveLegends","useState","onActiveLegendsChange","keys","onSchemaChange","useEffect","multiSelectLegendProps","canSelectMultipleLegends","onChange","legendProps","componentRef","createLegends","exportAsImage","useCallback","opts","Promise","resolve","reject","current","toImage","background","scale","then","catch","useImperativeHandle","cartesianProjection","forEach","mode","includes","groupedTraces","nonCartesianTraceCount","traceKey","xaxis","push","Object","length","gridProperties","templateRows","templateColumns","allupLegendsProps","colorwayType","display","gridTemplateRows","gridTemplateColumns","entries","xAxisKey","plotlyInputForGroup","idx","filteredTracesInfo","filter","chartType","some","chartEntry","preTransformCondition","undefined","transformedInput","cellProperties","xAxisAnnotation","xAnnotation","yAxisAnnotation","yAnnotation","row","column","displayName","defaultProps"],"mappings":"AAAA;AAEA,uDAAuD,GACvD,YAAYA,WAAW,QAAQ;AAE/B,SACEC,kBAAkB,EAClBC,mBAAmB,EACnBC,YAAY,EACZC,cAAc,EACdC,YAAY,QACP,4BAA4B;AAEnC,SAASC,MAAM,QAAQ,wBAAwB;AAC/C,SAASC,yBAAyBC,cAAc,QAAQ,kCAAkC;AAC1F,SAAgBC,aAAa,QAAQ,mBAAmB;AACxD,YAAYC,aAAa,WAAW;AAEpC,SACEC,gBAAgB,EAChBC,iBAAiB,EACjBC,aAAa,EACbC,+BAA+B,EAC/BC,8BAA8B,EAC9BC,mCAAmC,EACnCC,mCAAmC,EACnCC,+CAA+C,EAC/CC,iCAAiC,EACjCC,gCAAgC,EAChCC,+BAA+B,EAC/BC,8BAA8B,EAC9BC,6BAA6B,EAC7BC,oCAAoC,EACpCC,sCAAsC,EACtCC,uBAAuB,EACvBC,oBAAoB,EACpBC,mBAAmB,EACnBC,aAAa,EACbC,qCAAqC,EACrCC,oCAAoC,QAC/B,wBAAwB;AAE/B,SAASC,UAAU,QAAQ,sBAAsB;AACjD,SAASC,uBAAuB,QAAQ,mCAAmC;AAC3E,SAASC,SAAS,QAAQ,qBAAqB;AAC/C,SAASC,0BAA0B,QAAQ,sCAAsC;AACjF,SAASC,SAAS,QAAQ,qBAAqB;AAC/C,SAASC,YAAY,QAAQ,wB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G,YAAYoB,OAAO,IAAIP,cAAc4B;AAG5C,GAAG;AACH5D,iBAAiBoF,WAAW,GAAG;AAC/BpF,iBAAiBqF,YAAY,GAAG;IAC9BxB,cAAc;AAChB"}
@@ -1,3 +1,4 @@
1
+ 'use client';
1
2
  /* eslint-disable one-var */ /* eslint-disable vars-on-top */ /* eslint-disable no-var */ import * as React from 'react';
2
3
  import { bin as d3Bin, extent as d3Extent, sum as d3Sum, min as d3Min, max as d3Max, range as d3Range } from 'd3-array';
3
4
  import { scaleLinear as d3ScaleLinear } from 'd3-scale';
@@ -1213,43 +1214,49 @@ const formatValue = (value, colIndex, cells)=>{
1213
1214
  }
1214
1215
  return `${prefix !== null && prefix !== void 0 ? prefix : ''}${formatted}${suffix !== null && suffix !== void 0 ? suffix : ''}`;
1215
1216
  };
1217
+ function resolveCellStyle(raw, rowIndex, colIndex) {
1218
+ if (Array.isArray(raw)) {
1219
+ var _raw_colIndex;
1220
+ const rowEntry = (_raw_colIndex = raw[colIndex]) !== null && _raw_colIndex !== void 0 ? _raw_colIndex : raw[0];
1221
+ if (Array.isArray(rowEntry)) {
1222
+ var _rowEntry_rowIndex;
1223
+ return (_rowEntry_rowIndex = rowEntry[rowIndex]) !== null && _rowEntry_rowIndex !== void 0 ? _rowEntry_rowIndex : rowEntry[0];
1224
+ }
1225
+ return rowEntry;
1226
+ }
1227
+ return raw;
1228
+ }
1229
+ function mergeCells(tableCells, templateCells) {
1230
+ var _tableCells_values, _ref, _tableCells_align, _templateCells_fill, _tableCells_fill, _templateCells_font, _tableCells_font, _tableCells_format, _tableCells_prefix, _tableCells_suffix;
1231
+ return {
1232
+ values: (_ref = (_tableCells_values = tableCells === null || tableCells === void 0 ? void 0 : tableCells.values) !== null && _tableCells_values !== void 0 ? _tableCells_values : templateCells === null || templateCells === void 0 ? void 0 : templateCells.values) !== null && _ref !== void 0 ? _ref : [],
1233
+ align: (_tableCells_align = tableCells === null || tableCells === void 0 ? void 0 : tableCells.align) !== null && _tableCells_align !== void 0 ? _tableCells_align : templateCells === null || templateCells === void 0 ? void 0 : templateCells.align,
1234
+ fill: {
1235
+ ...(_templateCells_fill = templateCells === null || templateCells === void 0 ? void 0 : templateCells.fill) !== null && _templateCells_fill !== void 0 ? _templateCells_fill : {},
1236
+ ...(_tableCells_fill = tableCells === null || tableCells === void 0 ? void 0 : tableCells.fill) !== null && _tableCells_fill !== void 0 ? _tableCells_fill : {}
1237
+ },
1238
+ font: {
1239
+ ...(_templateCells_font = templateCells === null || templateCells === void 0 ? void 0 : templateCells.font) !== null && _templateCells_font !== void 0 ? _templateCells_font : {},
1240
+ ...(_tableCells_font = tableCells === null || tableCells === void 0 ? void 0 : tableCells.font) !== null && _tableCells_font !== void 0 ? _tableCells_font : {}
1241
+ },
1242
+ format: (_tableCells_format = tableCells === null || tableCells === void 0 ? void 0 : tableCells.format) !== null && _tableCells_format !== void 0 ? _tableCells_format : templateCells === null || templateCells === void 0 ? void 0 : templateCells.format,
1243
+ prefix: (_tableCells_prefix = tableCells === null || tableCells === void 0 ? void 0 : tableCells.prefix) !== null && _tableCells_prefix !== void 0 ? _tableCells_prefix : templateCells === null || templateCells === void 0 ? void 0 : templateCells.prefix,
1244
+ suffix: (_tableCells_suffix = tableCells === null || tableCells === void 0 ? void 0 : tableCells.suffix) !== null && _tableCells_suffix !== void 0 ? _tableCells_suffix : templateCells === null || templateCells === void 0 ? void 0 : templateCells.suffix
1245
+ };
1246
+ }
1216
1247
  export const transformPlotlyJsonToChartTableProps = (input, isMultiPlot, colorMap, colorwayType, isDarkTheme)=>{
1217
- var _tableData_cells, _input_layout_template_data_table_, _input_layout_template_data_table, _input_layout_template_data, _input_layout_template, _input_layout, _input_layout_font, _input_layout1, _tableData_header, _input_layout_template_data1, _input_layout_template1, _input_layout2, _input_layout3, _input_layout4;
1248
+ var _tableData_cells, _input_layout_template_data_table_, _input_layout_template_data_table, _input_layout_template_data, _input_layout_template, _input_layout, _input_layout_font, _input_layout1, _input_layout_template_data_table_1, _input_layout_template_data_table1, _input_layout_template_data1, _input_layout_template1, _input_layout2, _tableData_header, _input_layout3, _input_layout4;
1218
1249
  const tableData = input.data[0];
1219
1250
  const normalizeHeaders = (values, header)=>{
1220
1251
  const cleanedValues = Array.isArray(values[0]) ? values.map((row)=>row.map((cell)=>cleanText(cell)).filter(Boolean).join(' ')) : values.map((cell)=>cleanText(cell));
1221
1252
  return cleanedValues.map((value, colIndex)=>{
1222
1253
  var _header_font, _header_font1, _header_fill;
1223
- const fontColorRaw = header === null || header === void 0 ? void 0 : (_header_font = header.font) === null || _header_font === void 0 ? void 0 : _header_font.color;
1224
- let fontColor;
1225
- if (Array.isArray(fontColorRaw)) {
1226
- var _fontColorRaw_colIndex;
1227
- const colorEntry = (_fontColorRaw_colIndex = fontColorRaw[colIndex]) !== null && _fontColorRaw_colIndex !== void 0 ? _fontColorRaw_colIndex : fontColorRaw[0];
1228
- if (Array.isArray(colorEntry)) {
1229
- fontColor = typeof colorEntry[0] === 'string' ? colorEntry[0] : undefined;
1230
- } else if (typeof colorEntry === 'string') {
1231
- fontColor = colorEntry;
1232
- }
1233
- } else if (typeof fontColorRaw === 'string') {
1234
- fontColor = fontColorRaw;
1235
- }
1236
- const fontSizeRaw = header === null || header === void 0 ? void 0 : (_header_font1 = header.font) === null || _header_font1 === void 0 ? void 0 : _header_font1.size;
1237
- let fontSize;
1238
- if (Array.isArray(fontSizeRaw)) {
1239
- var _fontSizeRaw_colIndex;
1240
- const fontSizeEntry = (_fontSizeRaw_colIndex = fontSizeRaw[colIndex]) !== null && _fontSizeRaw_colIndex !== void 0 ? _fontSizeRaw_colIndex : fontSizeRaw[0];
1241
- var _fontSizeRaw__colIndex;
1242
- fontSize = Array.isArray(fontSizeRaw[0]) ? (_fontSizeRaw__colIndex = fontSizeRaw[0][colIndex]) !== null && _fontSizeRaw__colIndex !== void 0 ? _fontSizeRaw__colIndex : fontSizeRaw[0][0] : typeof fontSizeEntry === 'number' ? fontSizeEntry : undefined;
1243
- } else if (typeof fontSizeRaw === 'number') {
1244
- fontSize = fontSizeRaw;
1245
- }
1246
- const updatedColIndex = colIndex >= 1 ? 1 : 0;
1247
- const fillColorRaw = header === null || header === void 0 ? void 0 : (_header_fill = header.fill) === null || _header_fill === void 0 ? void 0 : _header_fill.color;
1248
- var _fillColorRaw_updatedColIndex;
1249
- const backgroundColor = Array.isArray(fillColorRaw) ? (_fillColorRaw_updatedColIndex = fillColorRaw[updatedColIndex]) !== null && _fillColorRaw_updatedColIndex !== void 0 ? _fillColorRaw_updatedColIndex : fillColorRaw[0] : fillColorRaw;
1250
- const textAlignRaw = header === null || header === void 0 ? void 0 : header.align;
1251
- var _textAlignRaw_colIndex;
1252
- const textAlign = Array.isArray(textAlignRaw) ? (_textAlignRaw_colIndex = textAlignRaw[colIndex]) !== null && _textAlignRaw_colIndex !== void 0 ? _textAlignRaw_colIndex : textAlignRaw[0] : textAlignRaw;
1254
+ //headers are at first row only
1255
+ const rowIndex = 0;
1256
+ const fontColor = resolveCellStyle(header === null || header === void 0 ? void 0 : (_header_font = header.font) === null || _header_font === void 0 ? void 0 : _header_font.color, rowIndex, colIndex);
1257
+ const fontSize = resolveCellStyle(header === null || header === void 0 ? void 0 : (_header_font1 = header.font) === null || _header_font1 === void 0 ? void 0 : _header_font1.size, rowIndex, colIndex);
1258
+ const backgroundColor = resolveCellStyle(header === null || header === void 0 ? void 0 : (_header_fill = header.fill) === null || _header_fill === void 0 ? void 0 : _header_fill.color, rowIndex, colIndex);
1259
+ const textAlign = resolveCellStyle(header === null || header === void 0 ? void 0 : header.align, rowIndex, colIndex);
1253
1260
  const style = {
1254
1261
  ...typeof fontColor === 'string' ? {
1255
1262
  color: fontColor
@@ -1272,46 +1279,16 @@ export const transformPlotlyJsonToChartTableProps = (input, isMultiPlot, colorMa
1272
1279
  };
1273
1280
  var _tableData_cells_values;
1274
1281
  const columns = (_tableData_cells_values = (_tableData_cells = tableData.cells) === null || _tableData_cells === void 0 ? void 0 : _tableData_cells.values) !== null && _tableData_cells_values !== void 0 ? _tableData_cells_values : [];
1275
- const cells = tableData.cells && Object.keys(tableData.cells).length > 0 ? tableData.cells : (_input_layout = input.layout) === null || _input_layout === void 0 ? void 0 : (_input_layout_template = _input_layout.template) === null || _input_layout_template === void 0 ? void 0 : (_input_layout_template_data = _input_layout_template.data) === null || _input_layout_template_data === void 0 ? void 0 : (_input_layout_template_data_table = _input_layout_template_data.table) === null || _input_layout_template_data_table === void 0 ? void 0 : (_input_layout_template_data_table_ = _input_layout_template_data_table[0]) === null || _input_layout_template_data_table_ === void 0 ? void 0 : _input_layout_template_data_table_.cells;
1282
+ const cells = mergeCells(tableData.cells, (_input_layout = input.layout) === null || _input_layout === void 0 ? void 0 : (_input_layout_template = _input_layout.template) === null || _input_layout_template === void 0 ? void 0 : (_input_layout_template_data = _input_layout_template.data) === null || _input_layout_template_data === void 0 ? void 0 : (_input_layout_template_data_table = _input_layout_template_data.table) === null || _input_layout_template_data_table === void 0 ? void 0 : (_input_layout_template_data_table_ = _input_layout_template_data_table[0]) === null || _input_layout_template_data_table_ === void 0 ? void 0 : _input_layout_template_data_table_.cells);
1276
1283
  const rows = columns[0].map((_, rowIndex)=>columns.map((col, colIndex)=>{
1277
1284
  var _cells_font, _cells_font1, _cells_fill;
1278
1285
  const cellValue = col[rowIndex];
1279
1286
  const cleanValue = typeof cellValue === 'string' ? cleanText(cellValue) : cellValue;
1280
1287
  const formattedValue = typeof cleanValue === 'string' || typeof cleanValue === 'number' ? formatValue(cleanValue, colIndex, cells) : cleanValue;
1281
- const rawFontColor = cells === null || cells === void 0 ? void 0 : (_cells_font = cells.font) === null || _cells_font === void 0 ? void 0 : _cells_font.color;
1282
- let fontColor;
1283
- if (Array.isArray(rawFontColor)) {
1284
- var _rawFontColor_colIndex;
1285
- const entry = (_rawFontColor_colIndex = rawFontColor[colIndex]) !== null && _rawFontColor_colIndex !== void 0 ? _rawFontColor_colIndex : rawFontColor[0];
1286
- const colorValue = Array.isArray(entry) ? entry[rowIndex] : entry;
1287
- fontColor = typeof colorValue === 'string' ? colorValue : undefined;
1288
- } else if (typeof rawFontColor === 'string') {
1289
- fontColor = rawFontColor;
1290
- }
1291
- const rawFontSize = cells === null || cells === void 0 ? void 0 : (_cells_font1 = cells.font) === null || _cells_font1 === void 0 ? void 0 : _cells_font1.size;
1292
- let fontSize;
1293
- if (Array.isArray(rawFontSize)) {
1294
- var _rawFontSize_colIndex;
1295
- const entry = (_rawFontSize_colIndex = rawFontSize[colIndex]) !== null && _rawFontSize_colIndex !== void 0 ? _rawFontSize_colIndex : rawFontSize[0];
1296
- const fontSizeValue = Array.isArray(entry) ? entry[rowIndex] : entry;
1297
- fontSize = typeof fontSizeValue === 'number' ? fontSizeValue : undefined;
1298
- } else if (typeof rawFontSize === 'number') {
1299
- fontSize = rawFontSize;
1300
- }
1301
- const updatedColIndex = colIndex >= 1 ? 1 : 0;
1302
- const rawBackgroundColor = cells === null || cells === void 0 ? void 0 : (_cells_fill = cells.fill) === null || _cells_fill === void 0 ? void 0 : _cells_fill.color;
1303
- let backgroundColor;
1304
- if (Array.isArray(rawBackgroundColor)) {
1305
- var _rawBackgroundColor_updatedColIndex;
1306
- const entry = (_rawBackgroundColor_updatedColIndex = rawBackgroundColor[updatedColIndex]) !== null && _rawBackgroundColor_updatedColIndex !== void 0 ? _rawBackgroundColor_updatedColIndex : rawBackgroundColor[0];
1307
- const colorValue = Array.isArray(entry) ? entry[rowIndex] : entry;
1308
- backgroundColor = typeof colorValue === 'string' ? colorValue : undefined;
1309
- } else if (typeof rawBackgroundColor === 'string') {
1310
- backgroundColor = rawBackgroundColor;
1311
- }
1312
- var _cells_align_colIndex;
1313
- const rawTextAlign = Array.isArray(cells === null || cells === void 0 ? void 0 : cells.align) ? (_cells_align_colIndex = cells.align[colIndex]) !== null && _cells_align_colIndex !== void 0 ? _cells_align_colIndex : cells.align[0] : cells === null || cells === void 0 ? void 0 : cells.align;
1314
- const textAlign = rawTextAlign;
1288
+ const fontColor = resolveCellStyle(cells === null || cells === void 0 ? void 0 : (_cells_font = cells.font) === null || _cells_font === void 0 ? void 0 : _cells_font.color, rowIndex, colIndex);
1289
+ const fontSize = resolveCellStyle(cells === null || cells === void 0 ? void 0 : (_cells_font1 = cells.font) === null || _cells_font1 === void 0 ? void 0 : _cells_font1.size, rowIndex, colIndex);
1290
+ const backgroundColor = resolveCellStyle(cells === null || cells === void 0 ? void 0 : (_cells_fill = cells.fill) === null || _cells_fill === void 0 ? void 0 : _cells_fill.color, rowIndex, colIndex);
1291
+ const textAlign = resolveCellStyle(cells === null || cells === void 0 ? void 0 : cells.align, rowIndex, colIndex);
1315
1292
  const style = {
1316
1293
  ...fontColor ? {
1317
1294
  color: fontColor
@@ -1338,9 +1315,24 @@ export const transformPlotlyJsonToChartTableProps = (input, isMultiPlot, colorMa
1338
1315
  } : {}
1339
1316
  }
1340
1317
  };
1318
+ const templateHeader = (_input_layout2 = input.layout) === null || _input_layout2 === void 0 ? void 0 : (_input_layout_template1 = _input_layout2.template) === null || _input_layout_template1 === void 0 ? void 0 : (_input_layout_template_data1 = _input_layout_template1.data) === null || _input_layout_template_data1 === void 0 ? void 0 : (_input_layout_template_data_table1 = _input_layout_template_data1.table) === null || _input_layout_template_data_table1 === void 0 ? void 0 : (_input_layout_template_data_table_1 = _input_layout_template_data_table1[0]) === null || _input_layout_template_data_table_1 === void 0 ? void 0 : _input_layout_template_data_table_1.header;
1319
+ const tableHeader = tableData.header;
1320
+ var _tableHeader_align, _templateHeader_fill, _tableHeader_fill, _templateHeader_font, _tableHeader_font, _tableHeader_values, _ref;
1321
+ const header = {
1322
+ align: (_tableHeader_align = tableHeader === null || tableHeader === void 0 ? void 0 : tableHeader.align) !== null && _tableHeader_align !== void 0 ? _tableHeader_align : templateHeader === null || templateHeader === void 0 ? void 0 : templateHeader.align,
1323
+ fill: {
1324
+ ...(_templateHeader_fill = templateHeader === null || templateHeader === void 0 ? void 0 : templateHeader.fill) !== null && _templateHeader_fill !== void 0 ? _templateHeader_fill : {},
1325
+ ...(_tableHeader_fill = tableHeader === null || tableHeader === void 0 ? void 0 : tableHeader.fill) !== null && _tableHeader_fill !== void 0 ? _tableHeader_fill : {}
1326
+ },
1327
+ font: {
1328
+ ...(_templateHeader_font = templateHeader === null || templateHeader === void 0 ? void 0 : templateHeader.font) !== null && _templateHeader_font !== void 0 ? _templateHeader_font : {},
1329
+ ...(_tableHeader_font = tableHeader === null || tableHeader === void 0 ? void 0 : tableHeader.font) !== null && _tableHeader_font !== void 0 ? _tableHeader_font : {}
1330
+ },
1331
+ values: (_ref = (_tableHeader_values = tableHeader === null || tableHeader === void 0 ? void 0 : tableHeader.values) !== null && _tableHeader_values !== void 0 ? _tableHeader_values : templateHeader === null || templateHeader === void 0 ? void 0 : templateHeader.values) !== null && _ref !== void 0 ? _ref : []
1332
+ };
1341
1333
  var _tableData_header_values;
1342
1334
  return {
1343
- headers: normalizeHeaders((_tableData_header_values = (_tableData_header = tableData.header) === null || _tableData_header === void 0 ? void 0 : _tableData_header.values) !== null && _tableData_header_values !== void 0 ? _tableData_header_values : [], tableData.header && Object.keys(tableData.header).length > 0 ? tableData.header : (_input_layout2 = input.layout) === null || _input_layout2 === void 0 ? void 0 : (_input_layout_template1 = _input_layout2.template) === null || _input_layout_template1 === void 0 ? void 0 : (_input_layout_template_data1 = _input_layout_template1.data) === null || _input_layout_template_data1 === void 0 ? void 0 : _input_layout_template_data1.table[0].header),
1335
+ headers: normalizeHeaders((_tableData_header_values = (_tableData_header = tableData.header) === null || _tableData_header === void 0 ? void 0 : _tableData_header.values) !== null && _tableData_header_values !== void 0 ? _tableData_header_values : [], header),
1344
1336
  rows,
1345
1337
  width: (_input_layout3 = input.layout) === null || _input_layout3 === void 0 ? void 0 : _input_layout3.width,
1346
1338
  height: (_input_layout4 = input.layout) === null || _input_layout4 === void 0 ? void 0 : _input_layout4.height,