@fluentui/react-charting 5.25.4 → 5.25.6

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 (379) hide show
  1. package/CHANGELOG.json +107 -1
  2. package/CHANGELOG.md +30 -2
  3. package/bundle-size/PolarChart.fixture.js +7 -0
  4. package/dist/react-charting.d.ts +424 -1
  5. package/dist/react-charting.js +1 -1
  6. package/dist/react-charting.min.js +1 -1
  7. package/etc/react-charting.api.md +93 -1
  8. package/lib/PolarChart.d.ts +1 -0
  9. package/lib/PolarChart.js +2 -0
  10. package/lib/PolarChart.js.map +1 -0
  11. package/lib/components/AnnotationOnlyChart/AnnotationOnlyChart.js +1 -1
  12. package/lib/components/AnnotationOnlyChart/AnnotationOnlyChart.js.map +1 -1
  13. package/lib/components/AreaChart/AreaChart.base.d.ts +0 -1
  14. package/lib/components/AreaChart/AreaChart.base.js +2 -31
  15. package/lib/components/AreaChart/AreaChart.base.js.map +1 -1
  16. package/lib/components/ChartTable/ChartTable.base.js +12 -4
  17. package/lib/components/ChartTable/ChartTable.base.js.map +1 -1
  18. package/lib/components/ChartTable/ChartTable.styles.js +3 -0
  19. package/lib/components/ChartTable/ChartTable.styles.js.map +1 -1
  20. package/lib/components/ChartTable/ChartTable.types.d.ts +11 -0
  21. package/lib/components/ChartTable/ChartTable.types.js.map +1 -1
  22. package/lib/components/CommonComponents/Annotations/ChartAnnotationLayer.js +11 -6
  23. package/lib/components/CommonComponents/Annotations/ChartAnnotationLayer.js.map +1 -1
  24. package/lib/components/CommonComponents/Annotations/ChartAnnotationLayer.styles.d.ts +1 -0
  25. package/lib/components/CommonComponents/Annotations/ChartAnnotationLayer.styles.js +17 -1
  26. package/lib/components/CommonComponents/Annotations/ChartAnnotationLayer.styles.js.map +1 -1
  27. package/lib/components/CommonComponents/Annotations/ChartAnnotationLayer.types.d.ts +5 -0
  28. package/lib/components/CommonComponents/Annotations/ChartAnnotationLayer.types.js.map +1 -1
  29. package/lib/components/CommonComponents/CartesianChart.base.d.ts +1 -1
  30. package/lib/components/CommonComponents/CartesianChart.base.js +82 -42
  31. package/lib/components/CommonComponents/CartesianChart.base.js.map +1 -1
  32. package/lib/components/CommonComponents/CartesianChart.styles.js +31 -27
  33. package/lib/components/CommonComponents/CartesianChart.styles.js.map +1 -1
  34. package/lib/components/CommonComponents/CartesianChart.types.d.ts +20 -1
  35. package/lib/components/CommonComponents/CartesianChart.types.js.map +1 -1
  36. package/lib/components/DeclarativeChart/DeclarativeChart.js +24 -28
  37. package/lib/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
  38. package/lib/components/DeclarativeChart/PlotlySchemaAdapter.d.ts +3 -1
  39. package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js +390 -267
  40. package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
  41. package/lib/components/DonutChart/DonutChart.base.d.ts +1 -0
  42. package/lib/components/DonutChart/DonutChart.base.js +16 -4
  43. package/lib/components/DonutChart/DonutChart.base.js.map +1 -1
  44. package/lib/components/DonutChart/DonutChart.styles.js +3 -1
  45. package/lib/components/DonutChart/DonutChart.styles.js.map +1 -1
  46. package/lib/components/DonutChart/DonutChart.types.d.ts +13 -0
  47. package/lib/components/DonutChart/DonutChart.types.js.map +1 -1
  48. package/lib/components/DonutChart/Pie/Pie.js +4 -2
  49. package/lib/components/DonutChart/Pie/Pie.js.map +1 -1
  50. package/lib/components/FunnelChart/FunnelChart.base.js +14 -8
  51. package/lib/components/FunnelChart/FunnelChart.base.js.map +1 -1
  52. package/lib/components/FunnelChart/FunnelChart.styles.js +3 -0
  53. package/lib/components/FunnelChart/FunnelChart.styles.js.map +1 -1
  54. package/lib/components/FunnelChart/FunnelChart.types.d.ts +13 -0
  55. package/lib/components/FunnelChart/FunnelChart.types.js.map +1 -1
  56. package/lib/components/GaugeChart/GaugeChart.base.js +2 -2
  57. package/lib/components/GaugeChart/GaugeChart.base.js.map +1 -1
  58. package/lib/components/GaugeChart/GaugeChart.styles.js +16 -22
  59. package/lib/components/GaugeChart/GaugeChart.styles.js.map +1 -1
  60. package/lib/components/GaugeChart/GaugeChart.types.d.ts +9 -0
  61. package/lib/components/GaugeChart/GaugeChart.types.js.map +1 -1
  62. package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.d.ts +0 -1
  63. package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js +6 -18
  64. package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js.map +1 -1
  65. package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.d.ts +2 -0
  66. package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js +55 -5
  67. package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js.map +1 -1
  68. package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.styles.js +12 -1
  69. package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.styles.js.map +1 -1
  70. package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.types.d.ts +9 -0
  71. package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.types.js.map +1 -1
  72. package/lib/components/LineChart/LineChart.base.d.ts +0 -1
  73. package/lib/components/LineChart/LineChart.base.js +2 -26
  74. package/lib/components/LineChart/LineChart.base.js.map +1 -1
  75. package/lib/components/PolarChart/PolarChart.base.d.ts +3 -0
  76. package/lib/components/PolarChart/PolarChart.base.js +426 -0
  77. package/lib/components/PolarChart/PolarChart.base.js.map +1 -0
  78. package/lib/components/PolarChart/PolarChart.d.ts +7 -0
  79. package/lib/components/PolarChart/PolarChart.js +9 -0
  80. package/lib/components/PolarChart/PolarChart.js.map +1 -0
  81. package/lib/components/PolarChart/PolarChart.styles.d.ts +2 -0
  82. package/lib/components/PolarChart/PolarChart.styles.js +39 -0
  83. package/lib/components/PolarChart/PolarChart.styles.js.map +1 -0
  84. package/lib/components/PolarChart/PolarChart.types.d.ts +185 -0
  85. package/lib/components/PolarChart/PolarChart.types.js +2 -0
  86. package/lib/components/PolarChart/PolarChart.types.js.map +1 -0
  87. package/lib/components/PolarChart/PolarChart.utils.d.ts +43 -0
  88. package/lib/components/PolarChart/PolarChart.utils.js +180 -0
  89. package/lib/components/PolarChart/PolarChart.utils.js.map +1 -0
  90. package/lib/components/PolarChart/index.d.ts +2 -0
  91. package/lib/components/PolarChart/index.js +3 -0
  92. package/lib/components/PolarChart/index.js.map +1 -0
  93. package/lib/components/SankeyChart/SankeyChart.base.js +10 -3
  94. package/lib/components/SankeyChart/SankeyChart.base.js.map +1 -1
  95. package/lib/components/SankeyChart/SankeyChart.styles.js +3 -0
  96. package/lib/components/SankeyChart/SankeyChart.styles.js.map +1 -1
  97. package/lib/components/SankeyChart/SankeyChart.types.d.ts +18 -0
  98. package/lib/components/SankeyChart/SankeyChart.types.js.map +1 -1
  99. package/lib/components/ScatterChart/ScatterChart.base.js +14 -32
  100. package/lib/components/ScatterChart/ScatterChart.base.js.map +1 -1
  101. package/lib/components/ScatterChart/ScatterChart.types.d.ts +4 -0
  102. package/lib/components/ScatterChart/ScatterChart.types.js.map +1 -1
  103. package/lib/components/VerticalBarChart/VerticalBarChart.base.d.ts +0 -1
  104. package/lib/components/VerticalBarChart/VerticalBarChart.base.js +12 -80
  105. package/lib/components/VerticalBarChart/VerticalBarChart.base.js.map +1 -1
  106. package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.base.d.ts +0 -1
  107. package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js +19 -31
  108. package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js.map +1 -1
  109. package/lib/index.d.ts +2 -0
  110. package/lib/index.js +1 -0
  111. package/lib/index.js.map +1 -1
  112. package/lib/types/IDataPoint.d.ts +107 -0
  113. package/lib/types/IDataPoint.js.map +1 -1
  114. package/lib/utilities/ChartTitle.d.ts +55 -0
  115. package/lib/utilities/ChartTitle.js +45 -0
  116. package/lib/utilities/ChartTitle.js.map +1 -0
  117. package/lib/utilities/Common.styles.d.ts +51 -0
  118. package/lib/utilities/Common.styles.js +70 -1
  119. package/lib/utilities/Common.styles.js.map +1 -1
  120. package/lib/utilities/image-export-utils.js +4 -4
  121. package/lib/utilities/image-export-utils.js.map +1 -1
  122. package/lib/utilities/index.d.ts +1 -0
  123. package/lib/utilities/index.js +1 -0
  124. package/lib/utilities/index.js.map +1 -1
  125. package/lib/utilities/utilities.d.ts +32 -8
  126. package/lib/utilities/utilities.js +232 -111
  127. package/lib/utilities/utilities.js.map +1 -1
  128. package/lib-amd/PolarChart.d.ts +1 -0
  129. package/lib-amd/PolarChart.js +6 -0
  130. package/lib-amd/PolarChart.js.map +1 -0
  131. package/lib-amd/components/AnnotationOnlyChart/AnnotationOnlyChart.js +1 -1
  132. package/lib-amd/components/AnnotationOnlyChart/AnnotationOnlyChart.js.map +1 -1
  133. package/lib-amd/components/AreaChart/AreaChart.base.d.ts +0 -1
  134. package/lib-amd/components/AreaChart/AreaChart.base.js +1 -29
  135. package/lib-amd/components/AreaChart/AreaChart.base.js.map +1 -1
  136. package/lib-amd/components/ChartTable/ChartTable.base.js +12 -5
  137. package/lib-amd/components/ChartTable/ChartTable.base.js.map +1 -1
  138. package/lib-amd/components/ChartTable/ChartTable.styles.js +3 -1
  139. package/lib-amd/components/ChartTable/ChartTable.styles.js.map +1 -1
  140. package/lib-amd/components/ChartTable/ChartTable.types.d.ts +11 -0
  141. package/lib-amd/components/ChartTable/ChartTable.types.js.map +1 -1
  142. package/lib-amd/components/CommonComponents/Annotations/ChartAnnotationLayer.js +11 -6
  143. package/lib-amd/components/CommonComponents/Annotations/ChartAnnotationLayer.js.map +1 -1
  144. package/lib-amd/components/CommonComponents/Annotations/ChartAnnotationLayer.styles.d.ts +1 -0
  145. package/lib-amd/components/CommonComponents/Annotations/ChartAnnotationLayer.styles.js +17 -1
  146. package/lib-amd/components/CommonComponents/Annotations/ChartAnnotationLayer.styles.js.map +1 -1
  147. package/lib-amd/components/CommonComponents/Annotations/ChartAnnotationLayer.types.d.ts +5 -0
  148. package/lib-amd/components/CommonComponents/Annotations/ChartAnnotationLayer.types.js.map +1 -1
  149. package/lib-amd/components/CommonComponents/CartesianChart.base.d.ts +1 -1
  150. package/lib-amd/components/CommonComponents/CartesianChart.base.js +81 -41
  151. package/lib-amd/components/CommonComponents/CartesianChart.base.js.map +1 -1
  152. package/lib-amd/components/CommonComponents/CartesianChart.styles.js +30 -26
  153. package/lib-amd/components/CommonComponents/CartesianChart.styles.js.map +1 -1
  154. package/lib-amd/components/CommonComponents/CartesianChart.types.d.ts +20 -1
  155. package/lib-amd/components/CommonComponents/CartesianChart.types.js.map +1 -1
  156. package/lib-amd/components/DeclarativeChart/DeclarativeChart.js +22 -28
  157. package/lib-amd/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
  158. package/lib-amd/components/DeclarativeChart/PlotlySchemaAdapter.d.ts +3 -1
  159. package/lib-amd/components/DeclarativeChart/PlotlySchemaAdapter.js +392 -269
  160. package/lib-amd/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
  161. package/lib-amd/components/DonutChart/DonutChart.base.d.ts +1 -0
  162. package/lib-amd/components/DonutChart/DonutChart.base.js +15 -3
  163. package/lib-amd/components/DonutChart/DonutChart.base.js.map +1 -1
  164. package/lib-amd/components/DonutChart/DonutChart.styles.js +2 -0
  165. package/lib-amd/components/DonutChart/DonutChart.styles.js.map +1 -1
  166. package/lib-amd/components/DonutChart/DonutChart.types.d.ts +13 -0
  167. package/lib-amd/components/DonutChart/DonutChart.types.js.map +1 -1
  168. package/lib-amd/components/DonutChart/Pie/Pie.js +4 -2
  169. package/lib-amd/components/DonutChart/Pie/Pie.js.map +1 -1
  170. package/lib-amd/components/FunnelChart/FunnelChart.base.js +14 -9
  171. package/lib-amd/components/FunnelChart/FunnelChart.base.js.map +1 -1
  172. package/lib-amd/components/FunnelChart/FunnelChart.styles.js +3 -1
  173. package/lib-amd/components/FunnelChart/FunnelChart.styles.js.map +1 -1
  174. package/lib-amd/components/FunnelChart/FunnelChart.types.d.ts +13 -0
  175. package/lib-amd/components/FunnelChart/FunnelChart.types.js.map +1 -1
  176. package/lib-amd/components/GaugeChart/GaugeChart.base.js +1 -1
  177. package/lib-amd/components/GaugeChart/GaugeChart.base.js.map +1 -1
  178. package/lib-amd/components/GaugeChart/GaugeChart.styles.js +16 -23
  179. package/lib-amd/components/GaugeChart/GaugeChart.styles.js.map +1 -1
  180. package/lib-amd/components/GaugeChart/GaugeChart.types.d.ts +9 -0
  181. package/lib-amd/components/GaugeChart/GaugeChart.types.js.map +1 -1
  182. package/lib-amd/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.d.ts +0 -1
  183. package/lib-amd/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js +4 -16
  184. package/lib-amd/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js.map +1 -1
  185. package/lib-amd/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.d.ts +2 -0
  186. package/lib-amd/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js +54 -4
  187. package/lib-amd/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js.map +1 -1
  188. package/lib-amd/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.styles.js +12 -2
  189. package/lib-amd/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.styles.js.map +1 -1
  190. package/lib-amd/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.types.d.ts +9 -0
  191. package/lib-amd/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.types.js.map +1 -1
  192. package/lib-amd/components/LineChart/LineChart.base.d.ts +0 -1
  193. package/lib-amd/components/LineChart/LineChart.base.js +1 -25
  194. package/lib-amd/components/LineChart/LineChart.base.js.map +1 -1
  195. package/lib-amd/components/PolarChart/PolarChart.base.d.ts +3 -0
  196. package/lib-amd/components/PolarChart/PolarChart.base.js +421 -0
  197. package/lib-amd/components/PolarChart/PolarChart.base.js.map +1 -0
  198. package/lib-amd/components/PolarChart/PolarChart.d.ts +7 -0
  199. package/lib-amd/components/PolarChart/PolarChart.js +11 -0
  200. package/lib-amd/components/PolarChart/PolarChart.js.map +1 -0
  201. package/lib-amd/components/PolarChart/PolarChart.styles.d.ts +2 -0
  202. package/lib-amd/components/PolarChart/PolarChart.styles.js +43 -0
  203. package/lib-amd/components/PolarChart/PolarChart.styles.js.map +1 -0
  204. package/lib-amd/components/PolarChart/PolarChart.types.d.ts +185 -0
  205. package/lib-amd/components/PolarChart/PolarChart.types.js +5 -0
  206. package/lib-amd/components/PolarChart/PolarChart.types.js.map +1 -0
  207. package/lib-amd/components/PolarChart/PolarChart.utils.d.ts +43 -0
  208. package/lib-amd/components/PolarChart/PolarChart.utils.js +183 -0
  209. package/lib-amd/components/PolarChart/PolarChart.utils.js.map +1 -0
  210. package/lib-amd/components/PolarChart/index.d.ts +2 -0
  211. package/lib-amd/components/PolarChart/index.js +7 -0
  212. package/lib-amd/components/PolarChart/index.js.map +1 -0
  213. package/lib-amd/components/SankeyChart/SankeyChart.base.js +10 -4
  214. package/lib-amd/components/SankeyChart/SankeyChart.base.js.map +1 -1
  215. package/lib-amd/components/SankeyChart/SankeyChart.styles.js +3 -1
  216. package/lib-amd/components/SankeyChart/SankeyChart.styles.js.map +1 -1
  217. package/lib-amd/components/SankeyChart/SankeyChart.types.d.ts +18 -0
  218. package/lib-amd/components/SankeyChart/SankeyChart.types.js.map +1 -1
  219. package/lib-amd/components/ScatterChart/ScatterChart.base.js +13 -31
  220. package/lib-amd/components/ScatterChart/ScatterChart.base.js.map +1 -1
  221. package/lib-amd/components/ScatterChart/ScatterChart.types.d.ts +4 -0
  222. package/lib-amd/components/ScatterChart/ScatterChart.types.js.map +1 -1
  223. package/lib-amd/components/VerticalBarChart/VerticalBarChart.base.d.ts +0 -1
  224. package/lib-amd/components/VerticalBarChart/VerticalBarChart.base.js +12 -79
  225. package/lib-amd/components/VerticalBarChart/VerticalBarChart.base.js.map +1 -1
  226. package/lib-amd/components/VerticalStackedBarChart/VerticalStackedBarChart.base.d.ts +0 -1
  227. package/lib-amd/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js +19 -30
  228. package/lib-amd/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js.map +1 -1
  229. package/lib-amd/index.d.ts +2 -0
  230. package/lib-amd/index.js +3 -2
  231. package/lib-amd/index.js.map +1 -1
  232. package/lib-amd/types/IDataPoint.d.ts +107 -0
  233. package/lib-amd/types/IDataPoint.js.map +1 -1
  234. package/lib-amd/utilities/ChartTitle.d.ts +55 -0
  235. package/lib-amd/utilities/ChartTitle.js +46 -0
  236. package/lib-amd/utilities/ChartTitle.js.map +1 -0
  237. package/lib-amd/utilities/Common.styles.d.ts +51 -0
  238. package/lib-amd/utilities/Common.styles.js +74 -2
  239. package/lib-amd/utilities/Common.styles.js.map +1 -1
  240. package/lib-amd/utilities/image-export-utils.js +3 -3
  241. package/lib-amd/utilities/image-export-utils.js.map +1 -1
  242. package/lib-amd/utilities/index.d.ts +1 -0
  243. package/lib-amd/utilities/index.js +2 -1
  244. package/lib-amd/utilities/index.js.map +1 -1
  245. package/lib-amd/utilities/utilities.d.ts +32 -8
  246. package/lib-amd/utilities/utilities.js +239 -114
  247. package/lib-amd/utilities/utilities.js.map +1 -1
  248. package/lib-commonjs/PolarChart.d.ts +1 -0
  249. package/lib-commonjs/PolarChart.js +5 -0
  250. package/lib-commonjs/PolarChart.js.map +1 -0
  251. package/lib-commonjs/components/AnnotationOnlyChart/AnnotationOnlyChart.js +1 -1
  252. package/lib-commonjs/components/AnnotationOnlyChart/AnnotationOnlyChart.js.map +1 -1
  253. package/lib-commonjs/components/AreaChart/AreaChart.base.d.ts +0 -1
  254. package/lib-commonjs/components/AreaChart/AreaChart.base.js +0 -29
  255. package/lib-commonjs/components/AreaChart/AreaChart.base.js.map +1 -1
  256. package/lib-commonjs/components/ChartTable/ChartTable.base.js +12 -4
  257. package/lib-commonjs/components/ChartTable/ChartTable.base.js.map +1 -1
  258. package/lib-commonjs/components/ChartTable/ChartTable.styles.js +3 -0
  259. package/lib-commonjs/components/ChartTable/ChartTable.styles.js.map +1 -1
  260. package/lib-commonjs/components/ChartTable/ChartTable.types.d.ts +11 -0
  261. package/lib-commonjs/components/ChartTable/ChartTable.types.js.map +1 -1
  262. package/lib-commonjs/components/CommonComponents/Annotations/ChartAnnotationLayer.js +11 -6
  263. package/lib-commonjs/components/CommonComponents/Annotations/ChartAnnotationLayer.js.map +1 -1
  264. package/lib-commonjs/components/CommonComponents/Annotations/ChartAnnotationLayer.styles.d.ts +1 -0
  265. package/lib-commonjs/components/CommonComponents/Annotations/ChartAnnotationLayer.styles.js +17 -1
  266. package/lib-commonjs/components/CommonComponents/Annotations/ChartAnnotationLayer.styles.js.map +1 -1
  267. package/lib-commonjs/components/CommonComponents/Annotations/ChartAnnotationLayer.types.d.ts +5 -0
  268. package/lib-commonjs/components/CommonComponents/Annotations/ChartAnnotationLayer.types.js.map +1 -1
  269. package/lib-commonjs/components/CommonComponents/CartesianChart.base.d.ts +1 -1
  270. package/lib-commonjs/components/CommonComponents/CartesianChart.base.js +81 -41
  271. package/lib-commonjs/components/CommonComponents/CartesianChart.base.js.map +1 -1
  272. package/lib-commonjs/components/CommonComponents/CartesianChart.styles.js +30 -26
  273. package/lib-commonjs/components/CommonComponents/CartesianChart.styles.js.map +1 -1
  274. package/lib-commonjs/components/CommonComponents/CartesianChart.types.d.ts +20 -1
  275. package/lib-commonjs/components/CommonComponents/CartesianChart.types.js.map +1 -1
  276. package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js +23 -27
  277. package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
  278. package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.d.ts +3 -1
  279. package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js +392 -269
  280. package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
  281. package/lib-commonjs/components/DonutChart/DonutChart.base.d.ts +1 -0
  282. package/lib-commonjs/components/DonutChart/DonutChart.base.js +15 -3
  283. package/lib-commonjs/components/DonutChart/DonutChart.base.js.map +1 -1
  284. package/lib-commonjs/components/DonutChart/DonutChart.styles.js +2 -0
  285. package/lib-commonjs/components/DonutChart/DonutChart.styles.js.map +1 -1
  286. package/lib-commonjs/components/DonutChart/DonutChart.types.d.ts +13 -0
  287. package/lib-commonjs/components/DonutChart/DonutChart.types.js.map +1 -1
  288. package/lib-commonjs/components/DonutChart/Pie/Pie.js +4 -2
  289. package/lib-commonjs/components/DonutChart/Pie/Pie.js.map +1 -1
  290. package/lib-commonjs/components/FunnelChart/FunnelChart.base.js +14 -8
  291. package/lib-commonjs/components/FunnelChart/FunnelChart.base.js.map +1 -1
  292. package/lib-commonjs/components/FunnelChart/FunnelChart.styles.js +3 -0
  293. package/lib-commonjs/components/FunnelChart/FunnelChart.styles.js.map +1 -1
  294. package/lib-commonjs/components/FunnelChart/FunnelChart.types.d.ts +13 -0
  295. package/lib-commonjs/components/FunnelChart/FunnelChart.types.js.map +1 -1
  296. package/lib-commonjs/components/GaugeChart/GaugeChart.base.js +1 -1
  297. package/lib-commonjs/components/GaugeChart/GaugeChart.base.js.map +1 -1
  298. package/lib-commonjs/components/GaugeChart/GaugeChart.styles.js +16 -22
  299. package/lib-commonjs/components/GaugeChart/GaugeChart.styles.js.map +1 -1
  300. package/lib-commonjs/components/GaugeChart/GaugeChart.types.d.ts +9 -0
  301. package/lib-commonjs/components/GaugeChart/GaugeChart.types.js.map +1 -1
  302. package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.d.ts +0 -1
  303. package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js +4 -16
  304. package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js.map +1 -1
  305. package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.d.ts +2 -0
  306. package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js +54 -4
  307. package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js.map +1 -1
  308. package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.styles.js +12 -1
  309. package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.styles.js.map +1 -1
  310. package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.types.d.ts +9 -0
  311. package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.types.js.map +1 -1
  312. package/lib-commonjs/components/LineChart/LineChart.base.d.ts +0 -1
  313. package/lib-commonjs/components/LineChart/LineChart.base.js +1 -25
  314. package/lib-commonjs/components/LineChart/LineChart.base.js.map +1 -1
  315. package/lib-commonjs/components/PolarChart/PolarChart.base.d.ts +3 -0
  316. package/lib-commonjs/components/PolarChart/PolarChart.base.js +429 -0
  317. package/lib-commonjs/components/PolarChart/PolarChart.base.js.map +1 -0
  318. package/lib-commonjs/components/PolarChart/PolarChart.d.ts +7 -0
  319. package/lib-commonjs/components/PolarChart/PolarChart.js +12 -0
  320. package/lib-commonjs/components/PolarChart/PolarChart.js.map +1 -0
  321. package/lib-commonjs/components/PolarChart/PolarChart.styles.d.ts +2 -0
  322. package/lib-commonjs/components/PolarChart/PolarChart.styles.js +43 -0
  323. package/lib-commonjs/components/PolarChart/PolarChart.styles.js.map +1 -0
  324. package/lib-commonjs/components/PolarChart/PolarChart.types.d.ts +185 -0
  325. package/lib-commonjs/components/PolarChart/PolarChart.types.js +3 -0
  326. package/lib-commonjs/components/PolarChart/PolarChart.types.js.map +1 -0
  327. package/lib-commonjs/components/PolarChart/PolarChart.utils.d.ts +43 -0
  328. package/lib-commonjs/components/PolarChart/PolarChart.utils.js +188 -0
  329. package/lib-commonjs/components/PolarChart/PolarChart.utils.js.map +1 -0
  330. package/lib-commonjs/components/PolarChart/index.d.ts +2 -0
  331. package/lib-commonjs/components/PolarChart/index.js +6 -0
  332. package/lib-commonjs/components/PolarChart/index.js.map +1 -0
  333. package/lib-commonjs/components/SankeyChart/SankeyChart.base.js +10 -3
  334. package/lib-commonjs/components/SankeyChart/SankeyChart.base.js.map +1 -1
  335. package/lib-commonjs/components/SankeyChart/SankeyChart.styles.js +3 -0
  336. package/lib-commonjs/components/SankeyChart/SankeyChart.styles.js.map +1 -1
  337. package/lib-commonjs/components/SankeyChart/SankeyChart.types.d.ts +18 -0
  338. package/lib-commonjs/components/SankeyChart/SankeyChart.types.js.map +1 -1
  339. package/lib-commonjs/components/ScatterChart/ScatterChart.base.js +13 -31
  340. package/lib-commonjs/components/ScatterChart/ScatterChart.base.js.map +1 -1
  341. package/lib-commonjs/components/ScatterChart/ScatterChart.types.d.ts +4 -0
  342. package/lib-commonjs/components/ScatterChart/ScatterChart.types.js.map +1 -1
  343. package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.base.d.ts +0 -1
  344. package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.base.js +11 -79
  345. package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.base.js.map +1 -1
  346. package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.base.d.ts +0 -1
  347. package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js +18 -30
  348. package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js.map +1 -1
  349. package/lib-commonjs/index.d.ts +2 -0
  350. package/lib-commonjs/index.js +3 -1
  351. package/lib-commonjs/index.js.map +1 -1
  352. package/lib-commonjs/types/IDataPoint.d.ts +107 -0
  353. package/lib-commonjs/types/IDataPoint.js.map +1 -1
  354. package/lib-commonjs/utilities/ChartTitle.d.ts +55 -0
  355. package/lib-commonjs/utilities/ChartTitle.js +49 -0
  356. package/lib-commonjs/utilities/ChartTitle.js.map +1 -0
  357. package/lib-commonjs/utilities/Common.styles.d.ts +51 -0
  358. package/lib-commonjs/utilities/Common.styles.js +74 -2
  359. package/lib-commonjs/utilities/Common.styles.js.map +1 -1
  360. package/lib-commonjs/utilities/image-export-utils.js +3 -3
  361. package/lib-commonjs/utilities/image-export-utils.js.map +1 -1
  362. package/lib-commonjs/utilities/index.d.ts +1 -0
  363. package/lib-commonjs/utilities/index.js +1 -0
  364. package/lib-commonjs/utilities/index.js.map +1 -1
  365. package/lib-commonjs/utilities/utilities.d.ts +32 -8
  366. package/lib-commonjs/utilities/utilities.js +239 -114
  367. package/lib-commonjs/utilities/utilities.js.map +1 -1
  368. package/package.json +4 -12
  369. package/project.json +0 -1
  370. package/src/components/ChartTable/ChartTable.types.ts +13 -0
  371. package/src/components/CommonComponents/Annotations/ChartAnnotationLayer.types.ts +5 -0
  372. package/src/components/CommonComponents/CartesianChart.types.ts +22 -1
  373. package/src/components/DonutChart/DonutChart.types.ts +16 -0
  374. package/src/components/FunnelChart/FunnelChart.types.ts +16 -0
  375. package/src/components/GaugeChart/GaugeChart.types.ts +11 -0
  376. package/src/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.types.ts +11 -0
  377. package/src/components/PolarChart/PolarChart.types.ts +232 -0
  378. package/src/components/SankeyChart/SankeyChart.types.ts +22 -0
  379. package/src/components/ScatterChart/ScatterChart.types.ts +5 -0
@@ -1,7 +1,7 @@
1
1
  define(["require", "exports", "tslib", "d3-array", "d3-scale", "d3-format", "../../utilities/colors", "../GaugeChart/index", "../../utilities/utilities", "@fluentui/chart-utilities", "d3-shape", "./PlotlyColorAdapter", "d3-color", "@fluentui/react"], function (require, exports, tslib_1, d3_array_1, d3_scale_1, d3_format_1, colors_1, index_1, utilities_1, chart_utilities_1, d3_shape_1, PlotlyColorAdapter_1, d3_color_1, react_1) {
2
2
  "use strict";
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.getGridProperties = exports.isNonPlotType = exports.getValidXYRanges = exports.getNumberAtIndexOrDefault = exports.getAllupLegendsProps = exports.projectPolarToCartesian = exports.transformPlotlyJsonToFunnelChartProps = exports.transformPlotlyJsonToChartTableProps = exports.transformPlotlyJsonToGaugeProps = exports.transformPlotlyJsonToSankeyProps = exports.transformPlotlyJsonToHeatmapProps = exports.transformPlotlyJsonToGanttChartProps = exports.transformPlotlyJsonToHorizontalBarWithAxisProps = exports.transformPlotlyJsonToScatterChartProps = exports.transformPlotlyJsonToLineChartProps = exports.transformPlotlyJsonToAreaChartProps = exports.transformPlotlyJsonToVBCProps = exports.transformPlotlyJsonToGVBCProps = exports.transformPlotlyJsonToVSBCProps = exports.transformPlotlyJsonToDonutProps = exports.transformPlotlyJsonToAnnotationChartProps = exports.normalizeObjectArrayForGVBC = exports.resolveXAxisPoint = exports._getGaugeAxisColor = exports.correctYearMonth = exports.SINGLE_REPEAT = exports.NON_PLOT_KEY_PREFIX = void 0;
4
+ exports.DEFAULT_POLAR_SUBPLOT = exports.getGridProperties = exports.isNonPlotType = exports.getValidXYRanges = exports.getNumberAtIndexOrDefault = exports.getAllupLegendsProps = exports.transformPlotlyJsonToPolarChartProps = exports.transformPlotlyJsonToFunnelChartProps = exports.transformPlotlyJsonToChartTableProps = exports.transformPlotlyJsonToGaugeProps = exports.transformPlotlyJsonToSankeyProps = exports.transformPlotlyJsonToHeatmapProps = exports.transformPlotlyJsonToGanttChartProps = exports.transformPlotlyJsonToHorizontalBarWithAxisProps = exports.transformPlotlyJsonToScatterChartProps = exports.transformPlotlyJsonToLineChartProps = exports.transformPlotlyJsonToAreaChartProps = exports.transformPlotlyJsonToVBCProps = exports.transformPlotlyJsonToGVBCProps = exports.transformPlotlyJsonToVSBCProps = exports.transformPlotlyJsonToDonutProps = exports.transformPlotlyJsonToAnnotationChartProps = exports.normalizeObjectArrayForGVBC = exports.resolveXAxisPoint = exports._getGaugeAxisColor = exports.correctYearMonth = exports.SINGLE_REPEAT = exports.NON_PLOT_KEY_PREFIX = void 0;
5
5
  exports.findArrayAttributes = findArrayAttributes;
6
6
  exports.NON_PLOT_KEY_PREFIX = 'nonplot_';
7
7
  exports.SINGLE_REPEAT = 'repeat(1, 1fr)';
@@ -44,12 +44,15 @@ define(["require", "exports", "tslib", "d3-array", "d3-scale", "d3-format", "../
44
44
  },
45
45
  };
46
46
  function getTitles(layout) {
47
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
48
- var titles = {
49
- chartTitle: typeof (layout === null || layout === void 0 ? void 0 : layout.title) === 'string' ? layout.title : (_b = (_a = layout === null || layout === void 0 ? void 0 : layout.title) === null || _a === void 0 ? void 0 : _a.text) !== null && _b !== void 0 ? _b : '',
50
- xAxisTitle: typeof ((_c = layout === null || layout === void 0 ? void 0 : layout.xaxis) === null || _c === void 0 ? void 0 : _c.title) === 'string' ? (_d = layout === null || layout === void 0 ? void 0 : layout.xaxis) === null || _d === void 0 ? void 0 : _d.title : (_g = (_f = (_e = layout === null || layout === void 0 ? void 0 : layout.xaxis) === null || _e === void 0 ? void 0 : _e.title) === null || _f === void 0 ? void 0 : _f.text) !== null && _g !== void 0 ? _g : '',
51
- yAxisTitle: typeof ((_h = layout === null || layout === void 0 ? void 0 : layout.yaxis) === null || _h === void 0 ? void 0 : _h.title) === 'string' ? (_j = layout === null || layout === void 0 ? void 0 : layout.yaxis) === null || _j === void 0 ? void 0 : _j.title : (_m = (_l = (_k = layout === null || layout === void 0 ? void 0 : layout.yaxis) === null || _k === void 0 ? void 0 : _k.title) === null || _l === void 0 ? void 0 : _l.text) !== null && _m !== void 0 ? _m : '',
52
- };
47
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
48
+ var titleObj = layout === null || layout === void 0 ? void 0 : layout.title;
49
+ var chartTitle = typeof titleObj === 'string' ? titleObj : (_a = titleObj === null || titleObj === void 0 ? void 0 : titleObj.text) !== null && _a !== void 0 ? _a : '';
50
+ var titleFont = typeof titleObj === 'object' ? titleObj === null || titleObj === void 0 ? void 0 : titleObj.font : undefined;
51
+ var titleXAnchor = typeof titleObj === 'object' ? titleObj === null || titleObj === void 0 ? void 0 : titleObj.xanchor : undefined;
52
+ var titleYAnchor = typeof titleObj === 'object' ? titleObj === null || titleObj === void 0 ? void 0 : titleObj.yanchor : undefined;
53
+ var titlePad = typeof titleObj === 'object' ? titleObj === null || titleObj === void 0 ? void 0 : titleObj.pad : undefined;
54
+ var titleStyles = tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({}, (titleFont ? { titleFont: titleFont } : {})), (titleXAnchor ? { titleXAnchor: titleXAnchor } : {})), (titleYAnchor ? { titleYAnchor: titleYAnchor } : {})), (titlePad ? { titlePad: titlePad } : {}));
55
+ var titles = tslib_1.__assign(tslib_1.__assign({ chartTitle: chartTitle }, (Object.keys(titleStyles).length > 0 ? { titleStyles: titleStyles } : {})), { xAxisTitle: typeof ((_b = layout === null || layout === void 0 ? void 0 : layout.xaxis) === null || _b === void 0 ? void 0 : _b.title) === 'string' ? (_c = layout === null || layout === void 0 ? void 0 : layout.xaxis) === null || _c === void 0 ? void 0 : _c.title : (_f = (_e = (_d = layout === null || layout === void 0 ? void 0 : layout.xaxis) === null || _d === void 0 ? void 0 : _d.title) === null || _e === void 0 ? void 0 : _e.text) !== null && _f !== void 0 ? _f : '', yAxisTitle: typeof ((_g = layout === null || layout === void 0 ? void 0 : layout.yaxis) === null || _g === void 0 ? void 0 : _g.title) === 'string' ? (_h = layout === null || layout === void 0 ? void 0 : layout.yaxis) === null || _h === void 0 ? void 0 : _h.title : (_l = (_k = (_j = layout === null || layout === void 0 ? void 0 : layout.yaxis) === null || _j === void 0 ? void 0 : _j.title) === null || _k === void 0 ? void 0 : _k.text) !== null && _l !== void 0 ? _l : '', xAxisAnnotation: chartTitle });
53
56
  return titles;
54
57
  }
55
58
  var getXAxisTickFormat = function (series, layout) {
@@ -81,6 +84,18 @@ define(["require", "exports", "tslib", "d3-array", "d3-scale", "d3-format", "../
81
84
  }
82
85
  return {};
83
86
  };
87
+ var getXMinMaxValues = function (series, layout) {
88
+ var _a;
89
+ var range = (_a = getXAxisProperties(series, layout)) === null || _a === void 0 ? void 0 : _a.range;
90
+ if (range && range.length === 2) {
91
+ return {
92
+ xMinValue: range[0],
93
+ xMaxValue: range[1],
94
+ showRoundOffXTickValues: false,
95
+ };
96
+ }
97
+ return {};
98
+ };
84
99
  var getYAxisProperties = function (series, layout) {
85
100
  return layout === null || layout === void 0 ? void 0 : layout.yaxis;
86
101
  };
@@ -208,6 +223,64 @@ define(["require", "exports", "tslib", "d3-array", "d3-scale", "d3-format", "../
208
223
  return x;
209
224
  };
210
225
  exports.resolveXAxisPoint = resolveXAxisPoint;
226
+ /**
227
+ * Formats text values according to the texttemplate specification
228
+ * Supports D3 format specifiers within %{text:format} patterns
229
+ * @param textValue The raw text value to format
230
+ * @param textTemplate The template string (e.g., "%{text:.1f}%", "%{text:.2%}", "%{text:,.0f}")
231
+ * @param index Optional index for array-based templates
232
+ * @returns Formatted text string
233
+ *
234
+ * Examples:
235
+ * - "%{text:.1f}%" → Formats number with 1 decimal place and adds % suffix
236
+ * - "%{text:.2%}" → Formats as percentage with 2 decimal places
237
+ * - "%{text:,.0f}" → Formats with thousands separator and no decimals
238
+ * - "%{text:$,.2f}" → Formats as currency with thousands separator and 2 decimals
239
+ */
240
+ var formatTextWithTemplate = function (textValue, textTemplate, index) {
241
+ if (!textTemplate) {
242
+ return String(textValue);
243
+ }
244
+ var numVal = typeof textValue === 'number' ? textValue : parseFloat(String(textValue));
245
+ if (isNaN(numVal)) {
246
+ return String(textValue);
247
+ }
248
+ var template = typeof textTemplate === 'string' ? textTemplate : textTemplate[index || 0] || '';
249
+ // Match Plotly's texttemplate pattern: %{text:format} or %{text}
250
+ // Can be followed by any literal text like %, $, etc.
251
+ var plotlyPattern = /%\{text(?::([^}]+))?\}(.*)$/;
252
+ var match = template.match(plotlyPattern);
253
+ if (match) {
254
+ var formatSpec = match[1]; // The format specifier (e.g., ".1f", ".2%", ",.0f") or undefined
255
+ var suffix = match[2]; // Any text after the closing brace (e.g., "%", " units")
256
+ // If no format specifier is provided (e.g., %{text}%), try to infer from suffix
257
+ if (!formatSpec) {
258
+ // Check if suffix starts with % - assume simple percentage with 1 decimal
259
+ if (suffix.startsWith('%')) {
260
+ return "".concat(numVal.toFixed(1)).concat(suffix);
261
+ }
262
+ // No format specifier, just return the number with the suffix
263
+ return "".concat(numVal).concat(suffix);
264
+ }
265
+ try {
266
+ // Use D3 format function to apply the format specifier
267
+ var formatter = (0, d3_format_1.format)(formatSpec);
268
+ var formattedValue = formatter(numVal);
269
+ return "".concat(formattedValue).concat(suffix);
270
+ }
271
+ catch (error) {
272
+ // Try to extract precision for basic fallback
273
+ var precisionMatch = formatSpec.match(/\.(\d+)[f%]/);
274
+ var precision = precisionMatch ? parseInt(precisionMatch[1], 10) : 2;
275
+ // Check if it's a percentage format
276
+ if (formatSpec.includes('%')) {
277
+ return "".concat((numVal * 100).toFixed(precision), "%").concat(suffix);
278
+ }
279
+ return "".concat(numVal.toFixed(precision)).concat(suffix);
280
+ }
281
+ }
282
+ return String(textValue);
283
+ };
211
284
  /**
212
285
  * Extracts unique X-axis categories from Plotly data traces
213
286
  * @param data Array of Plotly data traces
@@ -952,7 +1025,7 @@ define(["require", "exports", "tslib", "d3-array", "d3-scale", "d3-format", "../
952
1025
  var innerRadius = firstData.hole
953
1026
  ? firstData.hole * (Math.min(width - donutMarginHorizontal, height - donutMarginVertical) / 2)
954
1027
  : utilities_1.MIN_DONUT_RADIUS;
955
- var chartTitle = getTitles(input.layout).chartTitle;
1028
+ var _r = getTitles(input.layout), chartTitle = _r.chartTitle, titleStyles = _r.titleStyles;
956
1029
  // Build anticlockwise order by keeping the first item, reversing the rest
957
1030
  var legends = Object.keys(mapLegendToDataPoint);
958
1031
  var reorderedEntries = legends.length > 1
@@ -963,34 +1036,26 @@ define(["require", "exports", "tslib", "d3-array", "d3-scale", "d3-format", "../
963
1036
  .reverse()
964
1037
  .map(function (key) { return [key, mapLegendToDataPoint[key]]; }), true)
965
1038
  : legends.map(function (key) { return [key, mapLegendToDataPoint[key]]; });
966
- return {
967
- data: {
1039
+ return tslib_1.__assign({ data: {
968
1040
  chartTitle: chartTitle,
969
1041
  chartData: reorderedEntries.map(function (_a) {
970
1042
  var v = _a[1];
971
1043
  return v;
972
1044
  }),
973
- },
974
- hideLegend: isMultiPlot || ((_p = input.layout) === null || _p === void 0 ? void 0 : _p.showlegend) === false,
975
- width: (_q = input.layout) === null || _q === void 0 ? void 0 : _q.width,
976
- height: height,
977
- innerRadius: innerRadius,
978
- hideLabels: hideLabels,
979
- showLabelsInPercent: firstData.textinfo ? ['percent', 'label+percent'].includes(firstData.textinfo) : true,
980
- roundCorners: true,
981
- order: 'sorted',
982
- };
1045
+ }, hideLegend: isMultiPlot || ((_p = input.layout) === null || _p === void 0 ? void 0 : _p.showlegend) === false, width: (_q = input.layout) === null || _q === void 0 ? void 0 : _q.width, height: height, innerRadius: innerRadius, hideLabels: hideLabels, showLabelsInPercent: firstData.textinfo
1046
+ ? ['percent', 'label+percent', 'percent+label'].includes(firstData.textinfo)
1047
+ : true, roundCorners: true, order: 'sorted' }, (titleStyles ? { titleStyles: titleStyles } : {}));
983
1048
  };
984
1049
  exports.transformPlotlyJsonToDonutProps = transformPlotlyJsonToDonutProps;
985
1050
  var transformPlotlyJsonToVSBCProps = function (input, isMultiPlot,
986
1051
  // eslint-disable-next-line @typescript-eslint/no-deprecated
987
1052
  colorMap, colorwayType, isDarkTheme, fallbackVSBC) {
988
- var _a, _b, _c, _d, _e, _f;
1053
+ var _a, _b, _c, _d, _e;
989
1054
  var mapXToDataPoints = {};
990
1055
  var yMaxValue = 0;
991
1056
  var yMinValue = 0;
992
1057
  var secondaryYAxisValues = getSecondaryYAxisValues(input.data, input.layout);
993
- var _g = getLegendProps(input.data, input.layout, isMultiPlot), legends = _g.legends, hideLegend = _g.hideLegend;
1058
+ var _f = getLegendProps(input.data, input.layout, isMultiPlot), legends = _f.legends, hideLegend = _f.hideLegend;
994
1059
  var colorScale = undefined;
995
1060
  var yAxisTickFormat = getYAxisTickFormat(input.data[0], input.layout);
996
1061
  var resolveXValue = getAxisValueResolver(getAxisType(input.data, getAxisObjects(input.data, input.layout).x));
@@ -1006,6 +1071,11 @@ define(["require", "exports", "tslib", "d3-array", "d3-scale", "d3-format", "../
1006
1071
  var rangeStart = _a[0], rangeEnd = _a[1];
1007
1072
  var rangeXValues = series.x.slice(rangeStart, rangeEnd);
1008
1073
  var rangeYValues = series.y.slice(rangeStart, rangeEnd);
1074
+ var textValues = Array.isArray(series.text)
1075
+ ? series.text.slice(rangeStart, rangeEnd)
1076
+ : typeof series.text === 'string'
1077
+ ? series.text
1078
+ : undefined;
1009
1079
  rangeXValues.forEach(function (x, index2) {
1010
1080
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
1011
1081
  if (!mapXToDataPoints[x]) {
@@ -1025,13 +1095,13 @@ define(["require", "exports", "tslib", "d3-array", "d3-scale", "d3-format", "../
1025
1095
  var opacity = (0, PlotlyColorAdapter_1.getOpacity)(series, index2);
1026
1096
  var yVal = rangeYValues[index2];
1027
1097
  var yAxisCalloutData = getFormattedCalloutYData(yVal, yAxisTickFormat);
1098
+ var barLabel = Array.isArray(textValues) ? textValues[index2] : textValues;
1099
+ // Apply texttemplate formatting if specified
1100
+ if (barLabel && series.texttemplate) {
1101
+ barLabel = formatTextWithTemplate(barLabel, series.texttemplate, index2);
1102
+ }
1028
1103
  if (series.type === 'bar') {
1029
- mapXToDataPoints[x].chartData.push({
1030
- legend: legend,
1031
- data: yVal,
1032
- color: (_h = (0, d3_color_1.rgb)(color).copy({ opacity: opacity }).formatHex8()) !== null && _h !== void 0 ? _h : color,
1033
- yAxisCalloutData: yAxisCalloutData,
1034
- });
1104
+ mapXToDataPoints[x].chartData.push(tslib_1.__assign({ legend: legend, data: yVal, color: (_h = (0, d3_color_1.rgb)(color).copy({ opacity: opacity }).formatHex8()) !== null && _h !== void 0 ? _h : color, yAxisCalloutData: yAxisCalloutData }, (barLabel ? { barLabel: String(barLabel) } : {})));
1035
1105
  if (typeof yVal === 'number') {
1036
1106
  yMaxValue = Math.max(yMaxValue, yVal);
1037
1107
  }
@@ -1064,6 +1134,14 @@ define(["require", "exports", "tslib", "d3-array", "d3-scale", "d3-format", "../
1064
1134
  var _a, _b, _c;
1065
1135
  var lineColor = (_a = shape.line) === null || _a === void 0 ? void 0 : _a.color;
1066
1136
  var resolveX = function (val) {
1137
+ if (shape.xref === 'x domain') {
1138
+ if (val === 0) {
1139
+ return xCategories[0];
1140
+ }
1141
+ if (val === 1) {
1142
+ return xCategories[xCategories.length - 1];
1143
+ }
1144
+ }
1067
1145
  if (typeof val === 'number' && Array.isArray(xCategories)) {
1068
1146
  if (xCategories[val] !== undefined) {
1069
1147
  return xCategories[val];
@@ -1114,7 +1192,7 @@ define(["require", "exports", "tslib", "d3-array", "d3-scale", "d3-format", "../
1114
1192
  });
1115
1193
  var vsbcData = Object.values(mapXToDataPoints);
1116
1194
  var annotations = getChartAnnotationsFromLayout(input.layout, input.data, isMultiPlot);
1117
- return tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({ data: vsbcData, width: (_c = input.layout) === null || _c === void 0 ? void 0 : _c.width, height: (_e = (_d = input.layout) === null || _d === void 0 ? void 0 : _d.height) !== null && _e !== void 0 ? _e : 350, barWidth: 'auto', yMaxValue: yMaxValue, yMinValue: yMinValue, mode: 'plotly' }, secondaryYAxisValues), { hideTickOverlap: true, hideLegend: hideLegend, roundCorners: true, supportNegativeData: true, barGapMax: 2, showYAxisLables: true, noOfCharsToTruncate: 20, showYAxisLablesTooltip: true, wrapXAxisLables: typeof ((_f = vsbcData[0]) === null || _f === void 0 ? void 0 : _f.xAxisPoint) === 'string' }), getTitles(input.layout)), getAxisCategoryOrderProps(input.data, input.layout)), getYMinMaxValues(input.data[0], input.layout)), getXAxisTickFormat(input.data[0], input.layout)), yAxisTickFormat), getBarProps(input.data, input.layout)), getAxisTickProps(input.data, input.layout)), (annotations ? { annotations: annotations } : {}));
1195
+ return tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({ data: vsbcData, width: (_c = input.layout) === null || _c === void 0 ? void 0 : _c.width, height: (_e = (_d = input.layout) === null || _d === void 0 ? void 0 : _d.height) !== null && _e !== void 0 ? _e : 350, barWidth: 'auto', yMaxValue: yMaxValue, yMinValue: yMinValue, mode: 'plotly' }, secondaryYAxisValues), { hideTickOverlap: true, hideLegend: hideLegend, roundCorners: true, supportNegativeData: true, barGapMax: 2, showYAxisLables: true, noOfCharsToTruncate: 20, showYAxisLablesTooltip: true, roundedTicks: true }), getXMinMaxValues(input.data[0], input.layout)), getTitles(input.layout)), getAxisCategoryOrderProps(input.data, input.layout)), getYMinMaxValues(input.data[0], input.layout)), getXAxisTickFormat(input.data[0], input.layout)), yAxisTickFormat), getBarProps(input.data, input.layout)), getAxisTickProps(input.data, input.layout)), (annotations ? { annotations: annotations } : {}));
1118
1196
  };
1119
1197
  exports.transformPlotlyJsonToVSBCProps = transformPlotlyJsonToVSBCProps;
1120
1198
  var transformPlotlyJsonToGVBCProps = function (input, isMultiPlot,
@@ -1173,12 +1251,13 @@ define(["require", "exports", "tslib", "d3-array", "d3-scale", "d3-format", "../
1173
1251
  : (0, PlotlyColorAdapter_1.resolveColor)(extractedBarColors_1, xIndex, legend, colorMap, (_h = (_g = (_f = processedInput.layout) === null || _f === void 0 ? void 0 : _f.template) === null || _g === void 0 ? void 0 : _g.layout) === null || _h === void 0 ? void 0 : _h.colorway, isDarkTheme);
1174
1252
  var opacity = (0, PlotlyColorAdapter_1.getOpacity)(series, xIndex);
1175
1253
  var yVal = series.y[xIndex];
1176
- return {
1177
- x: x.toString(),
1178
- y: yVal,
1179
- yAxisCalloutData: getFormattedCalloutYData(yVal, yAxisTickFormat),
1180
- color: (_j = (0, d3_color_1.rgb)(color).copy({ opacity: opacity }).formatHex8()) !== null && _j !== void 0 ? _j : color,
1181
- };
1254
+ // Extract text value for barLabel
1255
+ var barLabel = Array.isArray(series.text) ? series.text[xIndex] : series.text;
1256
+ // Apply texttemplate formatting if specified
1257
+ if (barLabel && series.texttemplate) {
1258
+ barLabel = formatTextWithTemplate(barLabel, series.texttemplate, xIndex);
1259
+ }
1260
+ return tslib_1.__assign({ x: x.toString(), y: yVal, yAxisCalloutData: getFormattedCalloutYData(yVal, yAxisTickFormat), color: (_j = (0, d3_color_1.rgb)(color).copy({ opacity: opacity }).formatHex8()) !== null && _j !== void 0 ? _j : color }, (barLabel ? { barLabel: String(barLabel) } : {}));
1182
1261
  })
1183
1262
  .filter(function (item) { return typeof item !== 'undefined'; }),
1184
1263
  useSecondaryYScale: usesSecondaryYScale(series, processedInput.layout),
@@ -1216,15 +1295,15 @@ define(["require", "exports", "tslib", "d3-array", "d3-scale", "d3-format", "../
1216
1295
  }
1217
1296
  });
1218
1297
  var annotations = getChartAnnotationsFromLayout(processedInput.layout, processedInput.data, isMultiPlot);
1219
- return tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({ dataV2: gvbcDataV2, width: (_a = processedInput.layout) === null || _a === void 0 ? void 0 : _a.width, height: (_c = (_b = processedInput.layout) === null || _b === void 0 ? void 0 : _b.height) !== null && _c !== void 0 ? _c : 350, barwidth: 'auto', mode: 'plotly' }, secondaryYAxisValues), { hideTickOverlap: true, hideLegend: hideLegend, roundCorners: true, wrapXAxisLables: true, showYAxisLables: true }), getTitles(processedInput.layout)), getAxisCategoryOrderProps(processedInput.data, processedInput.layout)), getYMinMaxValues(processedInput.data[0], processedInput.layout)), getXAxisTickFormat(processedInput.data[0], processedInput.layout)), yAxisTickFormat), getBarProps(processedInput.data, processedInput.layout)), getAxisTickProps(processedInput.data, processedInput.layout)), (annotations ? { annotations: annotations } : {}));
1298
+ return tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({ dataV2: gvbcDataV2, width: (_a = processedInput.layout) === null || _a === void 0 ? void 0 : _a.width, height: (_c = (_b = processedInput.layout) === null || _b === void 0 ? void 0 : _b.height) !== null && _c !== void 0 ? _c : 350, barwidth: 'auto', mode: 'plotly' }, secondaryYAxisValues), { hideTickOverlap: true, hideLegend: hideLegend, roundCorners: true, roundedTicks: true, showYAxisLables: true }), getXMinMaxValues(processedInput.data[0], processedInput.layout)), getTitles(processedInput.layout)), getAxisCategoryOrderProps(processedInput.data, processedInput.layout)), getYMinMaxValues(processedInput.data[0], processedInput.layout)), getXAxisTickFormat(processedInput.data[0], processedInput.layout)), yAxisTickFormat), getBarProps(processedInput.data, processedInput.layout)), getAxisTickProps(processedInput.data, processedInput.layout)), (annotations ? { annotations: annotations } : {}));
1220
1299
  };
1221
1300
  exports.transformPlotlyJsonToGVBCProps = transformPlotlyJsonToGVBCProps;
1222
1301
  var transformPlotlyJsonToVBCProps = function (input, isMultiPlot,
1223
1302
  // eslint-disable-next-line @typescript-eslint/no-deprecated
1224
1303
  colorMap, colorwayType, isDarkTheme) {
1225
- var _a, _b, _c, _d;
1304
+ var _a, _b, _c;
1226
1305
  var vbcData = [];
1227
- var _e = getLegendProps(input.data, input.layout, isMultiPlot), legends = _e.legends, hideLegend = _e.hideLegend;
1306
+ var _d = getLegendProps(input.data, input.layout, isMultiPlot), legends = _d.legends, hideLegend = _d.hideLegend;
1228
1307
  var colorScale = undefined;
1229
1308
  input.data.forEach(function (series, seriesIdx) {
1230
1309
  var _a, _b, _c, _d, _e, _f, _g;
@@ -1273,13 +1352,18 @@ define(["require", "exports", "tslib", "d3-array", "d3-scale", "d3-format", "../
1273
1352
  : (0, PlotlyColorAdapter_1.resolveColor)(extractedColors, index, legend, colorMap, (_g = (_f = (_e = input.layout) === null || _e === void 0 ? void 0 : _e.template) === null || _f === void 0 ? void 0 : _f.layout) === null || _g === void 0 ? void 0 : _g.colorway, isDarkTheme);
1274
1353
  var opacity = (0, PlotlyColorAdapter_1.getOpacity)(series, index);
1275
1354
  var yVal = calculateHistNorm(series.histnorm, y[index], total, isXString ? bin.length : getBinSize(bin));
1276
- vbcData.push(tslib_1.__assign({ x: isXString ? bin.join(', ') : getBinCenter(bin), y: yVal, legend: legend, color: (_h = (0, d3_color_1.rgb)(color).copy({ opacity: opacity }).formatHex8()) !== null && _h !== void 0 ? _h : color }, (isXString
1355
+ // Handle text values and texttemplate formatting for histogram bins
1356
+ var barLabel = Array.isArray(series.text) ? series.text[index] : series.text;
1357
+ if (barLabel && series.texttemplate) {
1358
+ barLabel = formatTextWithTemplate(barLabel, series.texttemplate, index);
1359
+ }
1360
+ vbcData.push(tslib_1.__assign(tslib_1.__assign({ x: isXString ? bin.join(', ') : getBinCenter(bin), y: yVal, legend: legend, color: (_h = (0, d3_color_1.rgb)(color).copy({ opacity: opacity }).formatHex8()) !== null && _h !== void 0 ? _h : color }, (isXString
1277
1361
  ? {}
1278
- : { xAxisCalloutData: "[".concat(bin.x0, " - ").concat(bin.x1, ")") })));
1362
+ : { xAxisCalloutData: "[".concat(bin.x0, " - ").concat(bin.x1, ")") })), (barLabel ? { barLabel: String(barLabel) } : {})));
1279
1363
  });
1280
1364
  });
1281
1365
  var annotations = getChartAnnotationsFromLayout(input.layout, input.data, isMultiPlot);
1282
- return tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({ data: vbcData, width: (_a = input.layout) === null || _a === void 0 ? void 0 : _a.width, height: (_c = (_b = input.layout) === null || _b === void 0 ? void 0 : _b.height) !== null && _c !== void 0 ? _c : 350, supportNegativeData: true, mode: 'histogram', hideTickOverlap: true, maxBarWidth: 50, hideLegend: hideLegend, roundCorners: true, wrapXAxisLables: typeof ((_d = vbcData[0]) === null || _d === void 0 ? void 0 : _d.x) === 'string', showYAxisLables: true }, getTitles(input.layout)), getAxisCategoryOrderProps(input.data, input.layout)), getYMinMaxValues(input.data[0], input.layout)), (annotations ? { annotations: annotations } : {}));
1366
+ return tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({ data: vbcData, width: (_a = input.layout) === null || _a === void 0 ? void 0 : _a.width, height: (_c = (_b = input.layout) === null || _b === void 0 ? void 0 : _b.height) !== null && _c !== void 0 ? _c : 350, supportNegativeData: true, mode: 'histogram', hideTickOverlap: true, maxBarWidth: 50, hideLegend: hideLegend, roundCorners: true, roundedTicks: true, showYAxisLables: true }, getXMinMaxValues(input.data[0], input.layout)), getTitles(input.layout)), getAxisCategoryOrderProps(input.data, input.layout)), getYMinMaxValues(input.data[0], input.layout)), (annotations ? { annotations: annotations } : {}));
1283
1367
  };
1284
1368
  exports.transformPlotlyJsonToVBCProps = transformPlotlyJsonToVBCProps;
1285
1369
  var transformPlotlyJsonToAreaChartProps = function (input, isMultiPlot,
@@ -1338,9 +1422,7 @@ define(["require", "exports", "tslib", "d3-array", "d3-scale", "d3-format", "../
1338
1422
  var mode = 'tonexty';
1339
1423
  var _q = getLegendProps(input.data, input.layout, isMultiPlot), legends = _q.legends, hideLegend = _q.hideLegend;
1340
1424
  var yAxisTickFormat = getYAxisTickFormat(input.data[0], input.layout);
1341
- var xAxisType = getAxisType(input.data, getAxisObjects(input.data, input.layout).x);
1342
- var resolveXValue = getAxisValueResolver(xAxisType);
1343
- var shouldWrapLabels = xAxisType === 'category';
1425
+ var resolveXValue = getAxisValueResolver(getAxisType(input.data, getAxisObjects(input.data, input.layout).x));
1344
1426
  var chartData = input.data
1345
1427
  .map(function (series, index) {
1346
1428
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
@@ -1475,12 +1557,12 @@ define(["require", "exports", "tslib", "d3-array", "d3-scale", "d3-format", "../
1475
1557
  scatterChartData: tslib_1.__spreadArray(tslib_1.__spreadArray([], chartData, true), lineShape, true),
1476
1558
  };
1477
1559
  var annotations = getChartAnnotationsFromLayout(input.layout, input.data, isMultiPlot);
1478
- var commonProps = tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({ supportNegativeData: true }, secondaryYAxisValues), { width: (_m = input.layout) === null || _m === void 0 ? void 0 : _m.width, height: (_p = (_o = input.layout) === null || _o === void 0 ? void 0 : _o.height) !== null && _p !== void 0 ? _p : 350, hideTickOverlap: true, hideLegend: hideLegend, useUTC: false, optimizeLargeData: numDataPoints > 1000, wrapXAxisLables: shouldWrapLabels, showYAxisLables: true }), getTitles(input.layout)), getXAxisTickFormat(input.data[0], input.layout)), yAxisTickFormat), getAxisScaleTypeProps(input.data, input.layout)), getAxisTickProps(input.data, input.layout)), (annotations ? { annotations: annotations } : {}));
1560
+ var commonProps = tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({ supportNegativeData: true }, secondaryYAxisValues), { width: (_m = input.layout) === null || _m === void 0 ? void 0 : _m.width, height: (_p = (_o = input.layout) === null || _o === void 0 ? void 0 : _o.height) !== null && _p !== void 0 ? _p : 350, hideTickOverlap: true, hideLegend: hideLegend, useUTC: false, optimizeLargeData: numDataPoints > 1000, showYAxisLables: true, roundedTicks: true }), getXMinMaxValues(input.data[0], input.layout)), getTitles(input.layout)), getXAxisTickFormat(input.data[0], input.layout)), yAxisTickFormat), getAxisScaleTypeProps(input.data, input.layout)), getAxisTickProps(input.data, input.layout)), (annotations ? { annotations: annotations } : {}));
1479
1561
  if (isAreaChart) {
1480
1562
  return tslib_1.__assign({ data: chartProps, mode: mode }, commonProps);
1481
1563
  }
1482
1564
  else {
1483
- return tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({ data: isScatterChart ? scatterChartProps : chartProps, roundedTicks: true, enableReflow: false }, commonProps), yMinMax), (isScatterChart
1565
+ return tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({ data: isScatterChart ? scatterChartProps : chartProps, enableReflow: false }, commonProps), yMinMax), (isScatterChart
1484
1566
  ? tslib_1.__assign({ showYAxisLablesTooltip: true }, getAxisCategoryOrderProps(input.data, input.layout)) : {})), (!isScatterChart &&
1485
1567
  (function () {
1486
1568
  var bars = mapColorFillBars(input.layout);
@@ -1503,7 +1585,7 @@ define(["require", "exports", "tslib", "d3-array", "d3-scale", "d3-format", "../
1503
1585
  var legend = legends[index];
1504
1586
  return series.y
1505
1587
  .map(function (yValue, i) {
1506
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
1588
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
1507
1589
  if ((0, chart_utilities_1.isInvalidValue)(yValue)) {
1508
1590
  return null;
1509
1591
  }
@@ -1514,12 +1596,7 @@ define(["require", "exports", "tslib", "d3-array", "d3-scale", "d3-format", "../
1514
1596
  : 0)
1515
1597
  : (0, PlotlyColorAdapter_1.resolveColor)(extractedColors, i, legend, colorMap, (_g = (_f = (_e = input.layout) === null || _e === void 0 ? void 0 : _e.template) === null || _f === void 0 ? void 0 : _f.layout) === null || _g === void 0 ? void 0 : _g.colorway, isDarkTheme);
1516
1598
  var opacity = (0, PlotlyColorAdapter_1.getOpacity)(series, i);
1517
- return {
1518
- x: (0, chart_utilities_1.isInvalidValue)((_h = series.x) === null || _h === void 0 ? void 0 : _h[i]) ? 0 : series.x[i],
1519
- y: yValue,
1520
- legend: legend,
1521
- color: (_j = (0, d3_color_1.rgb)(color).copy({ opacity: opacity }).formatHex8()) !== null && _j !== void 0 ? _j : color,
1522
- };
1599
+ return tslib_1.__assign({ x: (0, chart_utilities_1.isInvalidValue)((_h = series.x) === null || _h === void 0 ? void 0 : _h[i]) ? 0 : series.x[i], y: yValue, legend: legend, color: (_j = (0, d3_color_1.rgb)(color).copy({ opacity: opacity }).formatHex8()) !== null && _j !== void 0 ? _j : color }, (((_k = series.text) === null || _k === void 0 ? void 0 : _k[i]) ? { barLabel: series.text[i].toString() } : {}));
1523
1600
  })
1524
1601
  .filter(function (point) { return point !== null; });
1525
1602
  })
@@ -1532,9 +1609,9 @@ define(["require", "exports", "tslib", "d3-array", "d3-scale", "d3-format", "../
1532
1609
  var scalingFactor = 0.01;
1533
1610
  var gapFactor = 1 / (1 + scalingFactor * numberOfRows);
1534
1611
  var barHeight = availableHeight / (numberOfRows * (1 + gapFactor));
1535
- return tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({ data: chartData, secondaryYAxistitle: typeof ((_k = (_j = input.layout) === null || _j === void 0 ? void 0 : _j.yaxis2) === null || _k === void 0 ? void 0 : _k.title) === 'string'
1612
+ return tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({ data: chartData, secondaryYAxistitle: typeof ((_k = (_j = input.layout) === null || _j === void 0 ? void 0 : _j.yaxis2) === null || _k === void 0 ? void 0 : _k.title) === 'string'
1536
1613
  ? (_m = (_l = input.layout) === null || _l === void 0 ? void 0 : _l.yaxis2) === null || _m === void 0 ? void 0 : _m.title
1537
- : ((_q = (_p = (_o = input.layout) === null || _o === void 0 ? void 0 : _o.yaxis2) === null || _p === void 0 ? void 0 : _p.title) === null || _q === void 0 ? void 0 : _q.text) || '', barHeight: barHeight, showYAxisLables: true, height: chartHeight, width: (_r = input.layout) === null || _r === void 0 ? void 0 : _r.width, hideTickOverlap: true, hideLegend: hideLegend, noOfCharsToTruncate: 20, showYAxisLablesTooltip: true, roundCorners: true }, getTitles(input.layout)), getAxisCategoryOrderProps(input.data, input.layout)), getBarProps(input.data, input.layout, true)), getAxisTickProps(input.data, input.layout));
1614
+ : ((_q = (_p = (_o = input.layout) === null || _o === void 0 ? void 0 : _o.yaxis2) === null || _p === void 0 ? void 0 : _p.title) === null || _q === void 0 ? void 0 : _q.text) || '', barHeight: barHeight, showYAxisLables: true, height: chartHeight, width: (_r = input.layout) === null || _r === void 0 ? void 0 : _r.width, hideTickOverlap: true, hideLegend: hideLegend, noOfCharsToTruncate: 20, showYAxisLablesTooltip: true, roundCorners: true, roundedTicks: true }, getXMinMaxValues(input.data[0], input.layout)), getTitles(input.layout)), getAxisCategoryOrderProps(input.data, input.layout)), getBarProps(input.data, input.layout, true)), getAxisTickProps(input.data, input.layout));
1538
1615
  };
1539
1616
  exports.transformPlotlyJsonToHorizontalBarWithAxisProps = transformPlotlyJsonToHorizontalBarWithAxisProps;
1540
1617
  var transformPlotlyJsonToGanttChartProps = function (input, isMultiPlot,
@@ -1611,34 +1688,72 @@ define(["require", "exports", "tslib", "d3-array", "d3-scale", "d3-format", "../
1611
1688
  var transformPlotlyJsonToHeatmapProps = function (input, isMultiPlot,
1612
1689
  // eslint-disable-next-line @typescript-eslint/no-deprecated
1613
1690
  colorMap, colorwayType, isDarkTheme) {
1614
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8;
1691
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11;
1615
1692
  var firstData = input.data[0];
1616
1693
  var heatmapDataPoints = [];
1617
1694
  var zMin = Number.POSITIVE_INFINITY;
1618
1695
  var zMax = Number.NEGATIVE_INFINITY;
1696
+ // Build a 2D array of annotations based on their grid position
1697
+ var annotationGrid = [];
1698
+ var rawAnnotations = (_a = input.layout) === null || _a === void 0 ? void 0 : _a.annotations;
1699
+ if (rawAnnotations) {
1700
+ var annotationsArray = Array.isArray(rawAnnotations) ? rawAnnotations : [rawAnnotations];
1701
+ // Collect all unique x and y values from valid annotations
1702
+ var xSet_1 = new Set();
1703
+ var ySet_1 = new Set();
1704
+ var validAnnotations_1 = [];
1705
+ annotationsArray.forEach(function (a) {
1706
+ if (a &&
1707
+ typeof a.x === 'number' &&
1708
+ typeof a.y === 'number' &&
1709
+ typeof a.text === 'string' &&
1710
+ (a.xref === 'x' || a.xref === undefined) &&
1711
+ (a.yref === 'y' || a.yref === undefined)) {
1712
+ xSet_1.add(a.x);
1713
+ ySet_1.add(a.y);
1714
+ validAnnotations_1.push({ x: a.x, y: a.y, text: cleanText(a.text) });
1715
+ }
1716
+ });
1717
+ if (validAnnotations_1.length > 0) {
1718
+ // Get sorted unique x and y values
1719
+ var xValues_1 = Array.from(xSet_1).sort(function (a, b) { return a - b; });
1720
+ var yValues_1 = Array.from(ySet_1).sort(function (a, b) { return a - b; });
1721
+ // Initialize 2D grid and populate
1722
+ validAnnotations_1.forEach(function (annotation) {
1723
+ var xIdx = xValues_1.indexOf(annotation.x);
1724
+ var yIdx = yValues_1.indexOf(annotation.y);
1725
+ if (!annotationGrid[yIdx]) {
1726
+ annotationGrid[yIdx] = [];
1727
+ }
1728
+ annotationGrid[yIdx][xIdx] = annotation.text;
1729
+ });
1730
+ }
1731
+ }
1732
+ // Helper function to get annotation from 2D grid by index
1733
+ var getAnnotationByIndex = function (xIdx, yIdx) { var _a; return (_a = annotationGrid[yIdx]) === null || _a === void 0 ? void 0 : _a[xIdx]; };
1619
1734
  if (firstData.type === 'histogram2d') {
1620
- var xValues_1 = [];
1621
- var yValues_1 = [];
1735
+ var xValues_2 = [];
1736
+ var yValues_2 = [];
1622
1737
  var zValues_1 = [];
1623
- (_a = firstData.x) === null || _a === void 0 ? void 0 : _a.forEach(function (xVal, index) {
1738
+ (_b = firstData.x) === null || _b === void 0 ? void 0 : _b.forEach(function (xVal, index) {
1624
1739
  var _a, _b;
1625
1740
  var zVal = (_a = (0, exports.getNumberAtIndexOrDefault)(firstData.z, index)) !== null && _a !== void 0 ? _a : 0;
1626
1741
  if ((0, chart_utilities_1.isInvalidValue)(xVal) || (0, chart_utilities_1.isInvalidValue)((_b = firstData.y) === null || _b === void 0 ? void 0 : _b[index])) {
1627
1742
  return;
1628
1743
  }
1629
- xValues_1.push(xVal);
1630
- yValues_1.push(firstData.y[index]);
1744
+ xValues_2.push(xVal);
1745
+ yValues_2.push(firstData.y[index]);
1631
1746
  zValues_1.push(zVal);
1632
1747
  });
1633
- var isXString_1 = (0, chart_utilities_1.isStringArray)(xValues_1);
1634
- var isYString_1 = (0, chart_utilities_1.isStringArray)(yValues_1);
1635
- var xBins_1 = createBins(xValues_1, (_b = firstData.xbins) === null || _b === void 0 ? void 0 : _b.start, (_c = firstData.xbins) === null || _c === void 0 ? void 0 : _c.end, (_d = firstData.xbins) === null || _d === void 0 ? void 0 : _d.size);
1636
- var yBins_1 = createBins(yValues_1, (_e = firstData.ybins) === null || _e === void 0 ? void 0 : _e.start, (_f = firstData.ybins) === null || _f === void 0 ? void 0 : _f.end, (_g = firstData.ybins) === null || _g === void 0 ? void 0 : _g.size);
1748
+ var isXString_1 = (0, chart_utilities_1.isStringArray)(xValues_2);
1749
+ var isYString_1 = (0, chart_utilities_1.isStringArray)(yValues_2);
1750
+ var xBins_1 = createBins(xValues_2, (_c = firstData.xbins) === null || _c === void 0 ? void 0 : _c.start, (_d = firstData.xbins) === null || _d === void 0 ? void 0 : _d.end, (_e = firstData.xbins) === null || _e === void 0 ? void 0 : _e.size);
1751
+ var yBins_1 = createBins(yValues_2, (_f = firstData.ybins) === null || _f === void 0 ? void 0 : _f.start, (_g = firstData.ybins) === null || _g === void 0 ? void 0 : _g.end, (_h = firstData.ybins) === null || _h === void 0 ? void 0 : _h.size);
1637
1752
  var zBins_1 = yBins_1.map(function () { return xBins_1.map(function () { return []; }); });
1638
1753
  var total_1 = 0;
1639
- xValues_1.forEach(function (xVal, index) {
1754
+ xValues_2.forEach(function (xVal, index) {
1640
1755
  var xBinIdx = findBinIndex(xBins_1, xVal, isXString_1);
1641
- var yBinIdx = findBinIndex(yBins_1, yValues_1[index], isYString_1);
1756
+ var yBinIdx = findBinIndex(yBins_1, yValues_2[index], isYString_1);
1642
1757
  if (xBinIdx !== -1 && yBinIdx !== -1) {
1643
1758
  zBins_1[yBinIdx][xBinIdx].push(zValues_1[index]);
1644
1759
  }
@@ -1653,11 +1768,12 @@ define(["require", "exports", "tslib", "d3-array", "d3-scale", "d3-format", "../
1653
1768
  xBins_1.forEach(function (xBin, xIdx) {
1654
1769
  yBins_1.forEach(function (yBin, yIdx) {
1655
1770
  var zVal = calculateHistNorm(firstData.histnorm, z_1[yIdx][xIdx], total_1, isXString_1 ? xBin.length : getBinSize(xBin), isYString_1 ? yBin.length : getBinSize(yBin));
1771
+ var annotationText = getAnnotationByIndex(xIdx, yIdx);
1656
1772
  heatmapDataPoints.push({
1657
1773
  x: isXString_1 ? xBin.join(', ') : getBinCenter(xBin),
1658
1774
  y: isYString_1 ? yBin.join(', ') : getBinCenter(yBin),
1659
1775
  value: zVal,
1660
- rectText: zVal,
1776
+ rectText: annotationText || zVal,
1661
1777
  });
1662
1778
  if (typeof zVal === 'number') {
1663
1779
  zMin = Math.min(zMin, zVal);
@@ -1667,17 +1783,27 @@ define(["require", "exports", "tslib", "d3-array", "d3-scale", "d3-format", "../
1667
1783
  });
1668
1784
  }
1669
1785
  else {
1670
- (_h = firstData.x) === null || _h === void 0 ? void 0 : _h.forEach(function (xVal, xIdx) {
1671
- var _a;
1786
+ // If x and y are not provided, generate indices based on z dimensions
1787
+ var zArray_1 = firstData.z;
1788
+ var xValues = firstData.x;
1789
+ var yValues = firstData.y;
1790
+ // Determine the dimensions from z array
1791
+ var yLength_1 = (_j = zArray_1 === null || zArray_1 === void 0 ? void 0 : zArray_1.length) !== null && _j !== void 0 ? _j : 0;
1792
+ var xLength = (_l = (_k = zArray_1 === null || zArray_1 === void 0 ? void 0 : zArray_1[0]) === null || _k === void 0 ? void 0 : _k.length) !== null && _l !== void 0 ? _l : 0;
1793
+ // Use provided x/y values or generate indices
1794
+ var xData = xValues !== null && xValues !== void 0 ? xValues : Array.from({ length: xLength }, function (_, i) { return i; });
1795
+ var yData_1 = yValues !== null && yValues !== void 0 ? yValues : Array.from({ length: yLength_1 }, function (_, i) { return yLength_1 - 1 - i; });
1796
+ xData.forEach(function (xVal, xIdx) {
1672
1797
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
1673
- (_a = firstData.y) === null || _a === void 0 ? void 0 : _a.forEach(function (yVal, yIdx) {
1674
- var _a, _b, _c, _d, _e, _f;
1675
- var zVal = (_b = (_a = firstData.z) === null || _a === void 0 ? void 0 : _a[yIdx]) === null || _b === void 0 ? void 0 : _b[xIdx];
1798
+ yData_1.forEach(function (yVal, yIdx) {
1799
+ var _a, _b, _c, _d, _e;
1800
+ var zVal = (_a = zArray_1 === null || zArray_1 === void 0 ? void 0 : zArray_1[yIdx]) === null || _a === void 0 ? void 0 : _a[xIdx];
1801
+ var annotationText = getAnnotationByIndex(xIdx, yIdx);
1676
1802
  heatmapDataPoints.push({
1677
- x: ((_d = (_c = input.layout) === null || _c === void 0 ? void 0 : _c.xaxis) === null || _d === void 0 ? void 0 : _d.type) === 'date' ? xVal : xVal !== null && xVal !== void 0 ? xVal : 0,
1678
- y: ((_f = (_e = input.layout) === null || _e === void 0 ? void 0 : _e.yaxis) === null || _f === void 0 ? void 0 : _f.type) === 'date' ? yVal : yVal,
1803
+ x: ((_c = (_b = input.layout) === null || _b === void 0 ? void 0 : _b.xaxis) === null || _c === void 0 ? void 0 : _c.type) === 'date' ? xVal : xVal !== null && xVal !== void 0 ? xVal : 0,
1804
+ y: ((_e = (_d = input.layout) === null || _d === void 0 ? void 0 : _d.yaxis) === null || _e === void 0 ? void 0 : _e.type) === 'date' ? yVal : yVal,
1679
1805
  value: zVal,
1680
- rectText: zVal,
1806
+ rectText: annotationText || zVal,
1681
1807
  });
1682
1808
  if (typeof zVal === 'number') {
1683
1809
  zMin = Math.min(zMin, zVal);
@@ -1687,7 +1813,7 @@ define(["require", "exports", "tslib", "d3-array", "d3-scale", "d3-format", "../
1687
1813
  });
1688
1814
  }
1689
1815
  var heatmapData = {
1690
- legend: (_j = firstData.name) !== null && _j !== void 0 ? _j : '',
1816
+ legend: (_m = firstData.name) !== null && _m !== void 0 ? _m : '',
1691
1817
  data: heatmapDataPoints,
1692
1818
  value: 0,
1693
1819
  };
@@ -1698,7 +1824,7 @@ define(["require", "exports", "tslib", "d3-array", "d3-scale", "d3-format", "../
1698
1824
  (0, colors_1.getColorFromToken)(colors_1.DataVizPalette.color2),
1699
1825
  (0, colors_1.getColorFromToken)(colors_1.DataVizPalette.color3),
1700
1826
  ];
1701
- var colorscale = (_0 = (_u = (_q = (_m = (_k = firstData === null || firstData === void 0 ? void 0 : firstData.colorscale) !== null && _k !== void 0 ? _k : (_l = input.layout) === null || _l === void 0 ? void 0 : _l.colorscale) !== null && _m !== void 0 ? _m : (_p = (_o = input.layout) === null || _o === void 0 ? void 0 : _o.coloraxis) === null || _p === void 0 ? void 0 : _p.colorscale) !== null && _q !== void 0 ? _q : (_t = (_s = (_r = input.layout) === null || _r === void 0 ? void 0 : _r.template) === null || _s === void 0 ? void 0 : _s.layout) === null || _t === void 0 ? void 0 : _t.colorscale) !== null && _u !== void 0 ? _u : (firstData.type === 'histogram2d' && ((_z = (_y = (_x = (_w = (_v = input.layout) === null || _v === void 0 ? void 0 : _v.template) === null || _w === void 0 ? void 0 : _w.data) === null || _x === void 0 ? void 0 : _x.histogram2d) === null || _y === void 0 ? void 0 : _y[0]) === null || _z === void 0 ? void 0 : _z.colorscale))) !== null && _0 !== void 0 ? _0 : (_5 = (_4 = (_3 = (_2 = (_1 = input.layout) === null || _1 === void 0 ? void 0 : _1.template) === null || _2 === void 0 ? void 0 : _2.data) === null || _3 === void 0 ? void 0 : _3.heatmap) === null || _4 === void 0 ? void 0 : _4[0]) === null || _5 === void 0 ? void 0 : _5.colorscale;
1827
+ var colorscale = (_3 = (_x = (_t = (_q = (_o = firstData === null || firstData === void 0 ? void 0 : firstData.colorscale) !== null && _o !== void 0 ? _o : (_p = input.layout) === null || _p === void 0 ? void 0 : _p.colorscale) !== null && _q !== void 0 ? _q : (_s = (_r = input.layout) === null || _r === void 0 ? void 0 : _r.coloraxis) === null || _s === void 0 ? void 0 : _s.colorscale) !== null && _t !== void 0 ? _t : (_w = (_v = (_u = input.layout) === null || _u === void 0 ? void 0 : _u.template) === null || _v === void 0 ? void 0 : _v.layout) === null || _w === void 0 ? void 0 : _w.colorscale) !== null && _x !== void 0 ? _x : (firstData.type === 'histogram2d' && ((_2 = (_1 = (_0 = (_z = (_y = input.layout) === null || _y === void 0 ? void 0 : _y.template) === null || _z === void 0 ? void 0 : _z.data) === null || _0 === void 0 ? void 0 : _0.histogram2d) === null || _1 === void 0 ? void 0 : _1[0]) === null || _2 === void 0 ? void 0 : _2.colorscale))) !== null && _3 !== void 0 ? _3 : (_8 = (_7 = (_6 = (_5 = (_4 = input.layout) === null || _4 === void 0 ? void 0 : _4.template) === null || _5 === void 0 ? void 0 : _5.data) === null || _6 === void 0 ? void 0 : _6.heatmap) === null || _7 === void 0 ? void 0 : _7[0]) === null || _8 === void 0 ? void 0 : _8.colorscale;
1702
1828
  // determine if the types diverging, sequential or sequentialminus are present in colorscale
1703
1829
  if (colorscale &&
1704
1830
  typeof colorscale === 'object' &&
@@ -1722,14 +1848,14 @@ define(["require", "exports", "tslib", "d3-array", "d3-scale", "d3-format", "../
1722
1848
  var rangeValuesForColorScale = Array.isArray(colorscale)
1723
1849
  ? colorscale.map(function (arr) { return arr[1]; })
1724
1850
  : defaultRange;
1725
- return tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({ data: [heatmapData], domainValuesForColorScale: domainValuesForColorScale, rangeValuesForColorScale: rangeValuesForColorScale, hideLegend: true, showYAxisLables: true, sortOrder: 'none', width: (_6 = input.layout) === null || _6 === void 0 ? void 0 : _6.width, height: (_8 = (_7 = input.layout) === null || _7 === void 0 ? void 0 : _7.height) !== null && _8 !== void 0 ? _8 : 350, hideTickOverlap: true, noOfCharsToTruncate: 20, showYAxisLablesTooltip: true, wrapXAxisLables: true }, getTitles(input.layout)), getAxisCategoryOrderProps([firstData], input.layout)), getAxisTickProps(input.data, input.layout));
1851
+ return tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({ data: [heatmapData], domainValuesForColorScale: domainValuesForColorScale, rangeValuesForColorScale: rangeValuesForColorScale, hideLegend: true, showYAxisLables: true, sortOrder: 'none', width: (_9 = input.layout) === null || _9 === void 0 ? void 0 : _9.width, height: (_11 = (_10 = input.layout) === null || _10 === void 0 ? void 0 : _10.height) !== null && _11 !== void 0 ? _11 : 350, hideTickOverlap: true, noOfCharsToTruncate: 20, showYAxisLablesTooltip: true }, getTitles(input.layout)), getAxisCategoryOrderProps([firstData], input.layout)), getAxisTickProps(input.data, input.layout));
1726
1852
  };
1727
1853
  exports.transformPlotlyJsonToHeatmapProps = transformPlotlyJsonToHeatmapProps;
1728
1854
  var transformPlotlyJsonToSankeyProps = function (input, isMultiPlot,
1729
1855
  // eslint-disable-next-line @typescript-eslint/no-deprecated
1730
1856
  colorMap, colorwayType, isDarkTheme) {
1731
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
1732
- var _m = input.data[0], link = _m.link, node = _m.node;
1857
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
1858
+ var _r = input.data[0], link = _r.link, node = _r.node;
1733
1859
  var validLinks = ((_a = link === null || link === void 0 ? void 0 : link.value) !== null && _a !== void 0 ? _a : [])
1734
1860
  .map(function (val, index) {
1735
1861
  var _a, _b;
@@ -1745,8 +1871,9 @@ define(["require", "exports", "tslib", "d3-array", "d3-scale", "d3-format", "../
1745
1871
  // Filter out negative nodes, unequal nodes and self-references (circular links)
1746
1872
  .filter(function (x) { return x !== null && x.source >= 0 && x.target >= 0 && x.source !== x.target; });
1747
1873
  var extractedNodeColors = (0, PlotlyColorAdapter_1.extractColor)((_d = (_c = (_b = input.layout) === null || _b === void 0 ? void 0 : _b.template) === null || _c === void 0 ? void 0 : _c.layout) === null || _d === void 0 ? void 0 : _d.colorway, colorwayType, node === null || node === void 0 ? void 0 : node.color, colorMap, isDarkTheme);
1874
+ var extractedLinkColors = (0, PlotlyColorAdapter_1.extractColor)((_g = (_f = (_e = input.layout) === null || _e === void 0 ? void 0 : _e.template) === null || _f === void 0 ? void 0 : _f.layout) === null || _g === void 0 ? void 0 : _g.colorway, colorwayType, link === null || link === void 0 ? void 0 : link.color, colorMap, isDarkTheme);
1748
1875
  var sankeyChartData = {
1749
- nodes: (_e = node.label) === null || _e === void 0 ? void 0 : _e.map(function (label, index) {
1876
+ nodes: (_h = node.label) === null || _h === void 0 ? void 0 : _h.map(function (label, index) {
1750
1877
  var _a, _b, _c;
1751
1878
  var color = (0, PlotlyColorAdapter_1.resolveColor)(extractedNodeColors, index, label, colorMap, (_c = (_b = (_a = input.layout) === null || _a === void 0 ? void 0 : _a.template) === null || _b === void 0 ? void 0 : _b.layout) === null || _c === void 0 ? void 0 : _c.colorway, isDarkTheme);
1752
1879
  return {
@@ -1757,23 +1884,19 @@ define(["require", "exports", "tslib", "d3-array", "d3-scale", "d3-format", "../
1757
1884
  }),
1758
1885
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
1759
1886
  links: validLinks.map(function (validLink, index) {
1760
- return tslib_1.__assign({}, validLink);
1887
+ var _a, _b, _c;
1888
+ var color = (0, PlotlyColorAdapter_1.resolveColor)(extractedLinkColors, index, validLink.target, colorMap, (_c = (_b = (_a = input.layout) === null || _a === void 0 ? void 0 : _a.template) === null || _b === void 0 ? void 0 : _b.layout) === null || _c === void 0 ? void 0 : _c.colorway, isDarkTheme);
1889
+ return tslib_1.__assign(tslib_1.__assign({}, validLink), { color: color });
1761
1890
  }),
1762
1891
  };
1763
1892
  var styles = {
1764
- root: tslib_1.__assign({}, (((_g = (_f = input.layout) === null || _f === void 0 ? void 0 : _f.font) === null || _g === void 0 ? void 0 : _g.size) ? { fontSize: (_h = input.layout.font) === null || _h === void 0 ? void 0 : _h.size } : {})),
1893
+ root: tslib_1.__assign({}, (((_k = (_j = input.layout) === null || _j === void 0 ? void 0 : _j.font) === null || _k === void 0 ? void 0 : _k.size) ? { fontSize: (_l = input.layout.font) === null || _l === void 0 ? void 0 : _l.size } : {})),
1765
1894
  };
1766
- var chartTitle = getTitles(input.layout).chartTitle;
1767
- return {
1768
- data: {
1895
+ var _s = getTitles(input.layout), chartTitle = _s.chartTitle, titleStyles = _s.titleStyles;
1896
+ return tslib_1.__assign({ data: {
1769
1897
  chartTitle: chartTitle,
1770
1898
  SankeyChartData: sankeyChartData,
1771
- },
1772
- width: (_j = input.layout) === null || _j === void 0 ? void 0 : _j.width,
1773
- height: (_l = (_k = input.layout) === null || _k === void 0 ? void 0 : _k.height) !== null && _l !== void 0 ? _l : 468,
1774
- styles: styles,
1775
- enableReflow: false,
1776
- };
1899
+ }, width: (_m = input.layout) === null || _m === void 0 ? void 0 : _m.width, height: (_p = (_o = input.layout) === null || _o === void 0 ? void 0 : _o.height) !== null && _p !== void 0 ? _p : 468, styles: styles, enableReflow: false, hideLegend: isMultiPlot || ((_q = input.layout) === null || _q === void 0 ? void 0 : _q.showlegend) === false }, (titleStyles ? { titleStyles: titleStyles } : {}));
1777
1900
  };
1778
1901
  exports.transformPlotlyJsonToSankeyProps = transformPlotlyJsonToSankeyProps;
1779
1902
  var transformPlotlyJsonToGaugeProps = function (input, isMultiPlot,
@@ -1829,22 +1952,10 @@ define(["require", "exports", "tslib", "d3-array", "d3-scale", "d3-format", "../
1829
1952
  fill: sublabelColor,
1830
1953
  },
1831
1954
  };
1832
- var chartTitle = getTitles(input.layout).chartTitle;
1833
- return {
1834
- segments: segments,
1835
- chartValue: (_14 = firstData.value) !== null && _14 !== void 0 ? _14 : 0,
1836
- chartTitle: chartTitle,
1837
- sublabel: sublabel,
1955
+ var _32 = getTitles(input.layout), chartTitle = _32.chartTitle, titleStyles = _32.titleStyles;
1956
+ return tslib_1.__assign({ segments: segments, chartValue: (_14 = firstData.value) !== null && _14 !== void 0 ? _14 : 0, chartTitle: chartTitle, sublabel: sublabel,
1838
1957
  // range values can be null
1839
- minValue: typeof ((_17 = (_16 = (_15 = firstData.gauge) === null || _15 === void 0 ? void 0 : _15.axis) === null || _16 === void 0 ? void 0 : _16.range) === null || _17 === void 0 ? void 0 : _17[0]) === 'number' ? (_20 = (_19 = (_18 = firstData.gauge) === null || _18 === void 0 ? void 0 : _18.axis) === null || _19 === void 0 ? void 0 : _19.range) === null || _20 === void 0 ? void 0 : _20[0] : undefined,
1840
- maxValue: typeof ((_23 = (_22 = (_21 = firstData.gauge) === null || _21 === void 0 ? void 0 : _21.axis) === null || _22 === void 0 ? void 0 : _22.range) === null || _23 === void 0 ? void 0 : _23[1]) === 'number' ? (_26 = (_25 = (_24 = firstData.gauge) === null || _24 === void 0 ? void 0 : _24.axis) === null || _25 === void 0 ? void 0 : _25.range) === null || _26 === void 0 ? void 0 : _26[1] : undefined,
1841
- chartValueFormat: function () { var _a, _b; return (_b = (_a = firstData.value) === null || _a === void 0 ? void 0 : _a.toString()) !== null && _b !== void 0 ? _b : ''; },
1842
- width: (_27 = input.layout) === null || _27 === void 0 ? void 0 : _27.width,
1843
- height: (_29 = (_28 = input.layout) === null || _28 === void 0 ? void 0 : _28.height) !== null && _29 !== void 0 ? _29 : 220,
1844
- styles: styles,
1845
- variant: ((_31 = (_30 = firstData.gauge) === null || _30 === void 0 ? void 0 : _30.steps) === null || _31 === void 0 ? void 0 : _31.length) ? index_1.GaugeChartVariant.MultipleSegments : index_1.GaugeChartVariant.SingleSegment,
1846
- roundCorners: true,
1847
- };
1958
+ minValue: typeof ((_17 = (_16 = (_15 = firstData.gauge) === null || _15 === void 0 ? void 0 : _15.axis) === null || _16 === void 0 ? void 0 : _16.range) === null || _17 === void 0 ? void 0 : _17[0]) === 'number' ? (_20 = (_19 = (_18 = firstData.gauge) === null || _18 === void 0 ? void 0 : _18.axis) === null || _19 === void 0 ? void 0 : _19.range) === null || _20 === void 0 ? void 0 : _20[0] : undefined, maxValue: typeof ((_23 = (_22 = (_21 = firstData.gauge) === null || _21 === void 0 ? void 0 : _21.axis) === null || _22 === void 0 ? void 0 : _22.range) === null || _23 === void 0 ? void 0 : _23[1]) === 'number' ? (_26 = (_25 = (_24 = firstData.gauge) === null || _24 === void 0 ? void 0 : _24.axis) === null || _25 === void 0 ? void 0 : _25.range) === null || _26 === void 0 ? void 0 : _26[1] : undefined, chartValueFormat: function () { var _a, _b; return (_b = (_a = firstData.value) === null || _a === void 0 ? void 0 : _a.toString()) !== null && _b !== void 0 ? _b : ''; }, width: (_27 = input.layout) === null || _27 === void 0 ? void 0 : _27.width, height: (_29 = (_28 = input.layout) === null || _28 === void 0 ? void 0 : _28.height) !== null && _29 !== void 0 ? _29 : 220, styles: styles, variant: ((_31 = (_30 = firstData.gauge) === null || _30 === void 0 ? void 0 : _30.steps) === null || _31 === void 0 ? void 0 : _31.length) ? index_1.GaugeChartVariant.MultipleSegments : index_1.GaugeChartVariant.SingleSegment, roundCorners: true }, (titleStyles ? { titleStyles: titleStyles } : {}));
1848
1959
  };
1849
1960
  exports.transformPlotlyJsonToGaugeProps = transformPlotlyJsonToGaugeProps;
1850
1961
  var cleanText = function (text) {
@@ -1959,13 +2070,8 @@ define(["require", "exports", "tslib", "d3-array", "d3-scale", "d3-format", "../
1959
2070
  font: tslib_1.__assign(tslib_1.__assign({}, ((_t = templateHeader === null || templateHeader === void 0 ? void 0 : templateHeader.font) !== null && _t !== void 0 ? _t : {})), ((_u = tableHeader === null || tableHeader === void 0 ? void 0 : tableHeader.font) !== null && _u !== void 0 ? _u : {})),
1960
2071
  values: (_w = (_v = tableHeader === null || tableHeader === void 0 ? void 0 : tableHeader.values) !== null && _v !== void 0 ? _v : templateHeader === null || templateHeader === void 0 ? void 0 : templateHeader.values) !== null && _w !== void 0 ? _w : [],
1961
2072
  };
1962
- return {
1963
- headers: normalizeHeaders((_y = (_x = tableData.header) === null || _x === void 0 ? void 0 : _x.values) !== null && _y !== void 0 ? _y : [], header),
1964
- rows: rows,
1965
- width: (_z = input.layout) === null || _z === void 0 ? void 0 : _z.width,
1966
- height: (_0 = input.layout) === null || _0 === void 0 ? void 0 : _0.height,
1967
- styles: styles,
1968
- };
2073
+ var _1 = getTitles(input.layout), chartTitle = _1.chartTitle, titleStyles = _1.titleStyles;
2074
+ return tslib_1.__assign({ headers: normalizeHeaders((_y = (_x = tableData.header) === null || _x === void 0 ? void 0 : _x.values) !== null && _y !== void 0 ? _y : [], header), rows: rows, width: (_z = input.layout) === null || _z === void 0 ? void 0 : _z.width, height: (_0 = input.layout) === null || _0 === void 0 ? void 0 : _0.height, styles: styles, chartTitle: chartTitle }, (titleStyles ? { titleStyles: titleStyles } : {}));
1969
2075
  };
1970
2076
  exports.transformPlotlyJsonToChartTableProps = transformPlotlyJsonToChartTableProps;
1971
2077
  function getCategoriesAndValues(series) {
@@ -2083,144 +2189,62 @@ define(["require", "exports", "tslib", "d3-array", "d3-scale", "d3-format", "../
2083
2189
  });
2084
2190
  });
2085
2191
  }
2086
- return {
2087
- data: funnelData,
2088
- width: (_a = input.layout) === null || _a === void 0 ? void 0 : _a.width,
2089
- height: (_b = input.layout) === null || _b === void 0 ? void 0 : _b.height,
2090
- orientation: ((_c = input.data[0]) === null || _c === void 0 ? void 0 : _c.orientation) === 'v' ? 'horizontal' : 'vertical',
2091
- hideLegend: isMultiPlot || ((_d = input.layout) === null || _d === void 0 ? void 0 : _d.showlegend) === false,
2092
- };
2192
+ var _e = getTitles(input.layout), chartTitle = _e.chartTitle, titleStyles = _e.titleStyles;
2193
+ return tslib_1.__assign({ data: funnelData, chartTitle: chartTitle, width: (_a = input.layout) === null || _a === void 0 ? void 0 : _a.width, height: (_b = input.layout) === null || _b === void 0 ? void 0 : _b.height, orientation: ((_c = input.data[0]) === null || _c === void 0 ? void 0 : _c.orientation) === 'v' ? 'horizontal' : 'vertical', hideLegend: isMultiPlot || ((_d = input.layout) === null || _d === void 0 ? void 0 : _d.showlegend) === false }, (titleStyles ? { titleStyles: titleStyles } : {}));
2093
2194
  };
2094
2195
  exports.transformPlotlyJsonToFunnelChartProps = transformPlotlyJsonToFunnelChartProps;
2095
- var projectPolarToCartesian = function (input) {
2096
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
2097
- var projection = tslib_1.__assign({}, input);
2098
- // Find the global min and max radius across all series
2099
- var minRadius = 0;
2100
- var maxRadius = 0;
2101
- for (var sindex = 0; sindex < input.data.length; sindex++) {
2102
- var rVals = input.data[sindex].r;
2103
- if (rVals && (0, chart_utilities_1.isArrayOrTypedArray)(rVals)) {
2104
- for (var ptindex = 0; ptindex < rVals.length; ptindex++) {
2105
- if (!(0, chart_utilities_1.isInvalidValue)(rVals[ptindex])) {
2106
- minRadius = Math.min(minRadius, rVals[ptindex]);
2107
- maxRadius = Math.max(maxRadius, rVals[ptindex]);
2108
- }
2109
- }
2110
- }
2111
- }
2112
- // If there are negative radii, compute the shift
2113
- var radiusShift = minRadius < 0 ? -minRadius : 0;
2114
- // Collect all unique theta values from all scatterpolar series for equal spacing
2115
- var allThetaValues = new Set();
2116
- for (var sindex = 0; sindex < input.data.length; sindex++) {
2117
- var series = input.data[sindex];
2118
- if (series.theta && (0, chart_utilities_1.isArrayOrTypedArray)(series.theta)) {
2119
- series.theta.forEach(function (theta) { return allThetaValues.add(String(theta)); });
2120
- }
2121
- }
2122
- // Project all points and create a perfect square domain
2123
- var allX = [];
2124
- var allY = [];
2125
- var originX = null;
2126
- var _loop_1 = function (sindex) {
2127
- var series = input.data[sindex];
2128
- // If scatterpolar, set __axisLabel to all unique theta values for equal spacing
2129
- if ((0, chart_utilities_1.isArrayOrTypedArray)(series.theta)) {
2130
- series.__axisLabel = Array.from(allThetaValues);
2131
- }
2132
- series.x = [];
2133
- series.y = [];
2134
- var thetas = series.theta;
2135
- var rVals = series.r;
2136
- // Skip if rVals or thetas are not arrays
2137
- if (!(0, chart_utilities_1.isArrayOrTypedArray)(rVals) || !(0, chart_utilities_1.isArrayOrTypedArray)(thetas)) {
2138
- projection.data[sindex] = series;
2139
- return "continue";
2140
- }
2141
- // retrieve polar axis settings
2142
- var dirMultiplier = ((_c = (_b = (_a = input.layout) === null || _a === void 0 ? void 0 : _a.polar) === null || _b === void 0 ? void 0 : _b.angularaxis) === null || _c === void 0 ? void 0 : _c.direction) === 'clockwise' ? -1 : 1;
2143
- var startAngleInRad = (((_g = (_f = (_e = (_d = input.layout) === null || _d === void 0 ? void 0 : _d.polar) === null || _e === void 0 ? void 0 : _e.angularaxis) === null || _f === void 0 ? void 0 : _f.rotation) !== null && _g !== void 0 ? _g : 0) * Math.PI) / 180;
2144
- // Compute tick positions if categorical
2145
- var uniqueTheta = [];
2146
- var categorical = false;
2147
- if (!(0, chart_utilities_1.isNumberArray)(thetas)) {
2148
- uniqueTheta = Array.from(new Set(thetas));
2149
- categorical = true;
2150
- }
2151
- for (var ptindex = 0; ptindex < rVals.length; ptindex++) {
2152
- if ((0, chart_utilities_1.isInvalidValue)(thetas === null || thetas === void 0 ? void 0 : thetas[ptindex]) || (0, chart_utilities_1.isInvalidValue)(rVals === null || rVals === void 0 ? void 0 : rVals[ptindex])) {
2153
- continue;
2154
- }
2155
- // Map theta to angle in radians
2156
- var thetaRad = void 0;
2157
- if (categorical) {
2158
- var idx = uniqueTheta.indexOf(thetas[ptindex]);
2159
- var step = (2 * Math.PI) / uniqueTheta.length;
2160
- thetaRad = startAngleInRad + dirMultiplier * idx * step;
2196
+ var transformPlotlyJsonToPolarChartProps = function (input, isMultiPlot, colorMap, colorwayType, isDarkTheme) {
2197
+ var _a, _b, _c;
2198
+ var polarData = [];
2199
+ var _d = getLegendProps(input.data, input.layout, isMultiPlot), legends = _d.legends, hideLegend = _d.hideLegend;
2200
+ var resolveRValue = getAxisValueResolver(getPolarAxis(input.data, 'r', input.layout)._type);
2201
+ input.data.forEach(function (series, index) {
2202
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
2203
+ var legend = legends[index];
2204
+ if (series.type === 'scatterpolar') {
2205
+ var isAreaTrace = series.fill === 'toself' || series.fill === 'tonext';
2206
+ var isLineTrace = typeof series.mode === 'undefined' ? true : series.mode.includes('lines');
2207
+ var colors = isAreaTrace ? series.fillcolor : isLineTrace ? (_a = series.line) === null || _a === void 0 ? void 0 : _a.color : (_b = series.marker) === null || _b === void 0 ? void 0 : _b.color;
2208
+ var extractedColors_2 = (0, PlotlyColorAdapter_1.extractColor)((_e = (_d = (_c = input.layout) === null || _c === void 0 ? void 0 : _c.template) === null || _d === void 0 ? void 0 : _d.layout) === null || _e === void 0 ? void 0 : _e.colorway, colorwayType, colors, colorMap, isDarkTheme);
2209
+ var seriesColor = (0, PlotlyColorAdapter_1.resolveColor)(extractedColors_2, index, legend, colorMap, (_h = (_g = (_f = input.layout) === null || _f === void 0 ? void 0 : _f.template) === null || _g === void 0 ? void 0 : _g.layout) === null || _h === void 0 ? void 0 : _h.colorway, isDarkTheme);
2210
+ var seriesOpacity = (0, PlotlyColorAdapter_1.getOpacity)(series, index);
2211
+ var finalSeriesColor_1 = (0, d3_color_1.rgb)(seriesColor).copy({ opacity: seriesOpacity }).formatHex8();
2212
+ var lineOptions = getLineOptions(series.line);
2213
+ var thetaUnit_1 = series.thetaunit;
2214
+ var commonProps = {
2215
+ legend: legend,
2216
+ legendShape: getLegendShape(series),
2217
+ color: finalSeriesColor_1,
2218
+ data: ((_j = series.r) === null || _j === void 0 ? void 0 : _j.map(function (r, rIndex) {
2219
+ var _a, _b, _c, _d, _e, _f;
2220
+ var theta = (_a = series.theta) === null || _a === void 0 ? void 0 : _a[rIndex];
2221
+ var markerSize = Array.isArray((_b = series.marker) === null || _b === void 0 ? void 0 : _b.size) ? series.marker.size[rIndex] : (_c = series.marker) === null || _c === void 0 ? void 0 : _c.size;
2222
+ var text = Array.isArray(series.text) ? series.text[rIndex] : series.text;
2223
+ var markerColor = (0, PlotlyColorAdapter_1.resolveColor)(extractedColors_2, rIndex, legend, colorMap, (_f = (_e = (_d = input.layout) === null || _d === void 0 ? void 0 : _d.template) === null || _e === void 0 ? void 0 : _e.layout) === null || _f === void 0 ? void 0 : _f.colorway, isDarkTheme);
2224
+ var markerOpacity = (0, PlotlyColorAdapter_1.getOpacity)(series, rIndex);
2225
+ if ((0, chart_utilities_1.isInvalidValue)(resolveRValue(r)) || (0, chart_utilities_1.isInvalidValue)(theta)) {
2226
+ return;
2227
+ }
2228
+ return tslib_1.__assign(tslib_1.__assign({ r: resolveRValue(r), theta: typeof theta === 'number'
2229
+ ? thetaUnit_1 === 'radians'
2230
+ ? (theta * 180) / Math.PI
2231
+ : thetaUnit_1 === 'gradians'
2232
+ ? theta * 0.9
2233
+ : theta
2234
+ : theta, color: markerColor ? (0, d3_color_1.rgb)(markerColor).copy({ opacity: markerOpacity }).formatHex8() : finalSeriesColor_1 }, (typeof markerSize !== 'undefined' ? { markerSize: markerSize } : {})), (typeof text !== 'undefined' ? { text: text } : {}));
2235
+ }).filter(function (item) { return typeof item !== 'undefined'; })) || [],
2236
+ };
2237
+ if (isAreaTrace || isLineTrace) {
2238
+ polarData.push(tslib_1.__assign(tslib_1.__assign({ type: isAreaTrace ? 'areapolar' : 'linepolar' }, commonProps), { lineOptions: lineOptions }));
2161
2239
  }
2162
2240
  else {
2163
- thetaRad = startAngleInRad + dirMultiplier * ((thetas[ptindex] * Math.PI) / 180);
2164
- }
2165
- // Shift only the polar origin (not the cartesian)
2166
- var rawRadius = rVals[ptindex];
2167
- var polarRadius = rawRadius + radiusShift; // Only for projection
2168
- // Calculate cartesian coordinates (with shifted polar origin)
2169
- var x = polarRadius * Math.cos(thetaRad);
2170
- var y = polarRadius * Math.sin(thetaRad);
2171
- // Calculate the cartesian coordinates of the original polar origin (0,0)
2172
- // This is the point that should be mapped to (0,0) in cartesian coordinates
2173
- if (sindex === 0 && ptindex === 0) {
2174
- // For polar origin (r=0, θ=0), cartesian coordinates are (0,0)
2175
- // But since we shifted the radius by radiusShift, the cartesian origin is at (radiusShift, 0)
2176
- originX = radiusShift;
2241
+ polarData.push(tslib_1.__assign({ type: 'scatterpolar' }, commonProps));
2177
2242
  }
2178
- series.x.push(x);
2179
- series.y.push(y);
2180
- allX.push(x);
2181
- allY.push(y);
2182
2243
  }
2183
- // Map text to each data point for downstream chart rendering
2184
- if (series.x && series.y) {
2185
- series.data = series.x.map(function (xVal, idx) { return (tslib_1.__assign({ x: xVal, y: series.y[idx] }, (series.text ? { text: series.text[idx] } : {}))); });
2186
- }
2187
- projection.data[sindex] = series;
2188
- };
2189
- for (var sindex = 0; sindex < input.data.length; sindex++) {
2190
- _loop_1(sindex);
2191
- }
2192
- // 7. Recenter all cartesian coordinates
2193
- if (originX !== null) {
2194
- for (var sindex = 0; sindex < projection.data.length; sindex++) {
2195
- var series = projection.data[sindex];
2196
- if (series.x && series.y) {
2197
- series.x = series.x.map(function (v) { return v - originX; });
2198
- }
2199
- }
2200
- // Also recenter allX for normalization
2201
- for (var i = 0; i < allX.length; i++) {
2202
- allX[i] = allX[i] - originX;
2203
- }
2204
- }
2205
- // 8. Find the maximum absolute value among all x and y
2206
- var maxAbs = Math.max.apply(Math, tslib_1.__spreadArray(tslib_1.__spreadArray([], allX.map(Math.abs), false), allY.map(Math.abs), false));
2207
- maxAbs = maxAbs === 0 ? 1 : maxAbs;
2208
- // 9. Rescale all points so that the largest |x| or |y| is 0.5
2209
- for (var sindex = 0; sindex < projection.data.length; sindex++) {
2210
- var series = projection.data[sindex];
2211
- if (series.x && series.y) {
2212
- series.x = series.x.map(function (v) { return v / (2 * maxAbs); });
2213
- series.y = series.y.map(function (v) { return v / (2 * maxAbs); });
2214
- }
2215
- }
2216
- // 10. Customize layout for perfect square with absolute positioning
2217
- var size = ((_h = input.layout) === null || _h === void 0 ? void 0 : _h.width) || ((_j = input.layout) === null || _j === void 0 ? void 0 : _j.height) || 500;
2218
- projection.layout = tslib_1.__assign(tslib_1.__assign({}, projection.layout), { width: size, height: size });
2219
- // Attach originX as custom properties
2220
- projection.layout.__polarOriginX = originX !== null && originX !== void 0 ? originX : undefined;
2221
- return projection;
2244
+ });
2245
+ return tslib_1.__assign({ data: polarData, width: (_a = input.layout) === null || _a === void 0 ? void 0 : _a.width, height: (_c = (_b = input.layout) === null || _b === void 0 ? void 0 : _b.height) !== null && _c !== void 0 ? _c : 400, hideLegend: hideLegend }, getPolarAxisProps(input.data, input.layout));
2222
2246
  };
2223
- exports.projectPolarToCartesian = projectPolarToCartesian;
2247
+ exports.transformPlotlyJsonToPolarChartProps = transformPlotlyJsonToPolarChartProps;
2224
2248
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
2225
2249
  function isPlainObject(obj) {
2226
2250
  if (window && window.process && window.process.versions) {
@@ -2504,7 +2528,7 @@ define(["require", "exports", "tslib", "d3-array", "d3-scale", "d3-format", "../
2504
2528
  return parseInt(normalizedKey, 10) - 1;
2505
2529
  };
2506
2530
  var isNonPlotType = function (chartType) {
2507
- return ['donut', 'sankey', 'pie', 'annotation'].includes(chartType);
2531
+ return ['donut', 'sankey', 'pie', 'annotation', 'table', 'gauge', 'funnel'].includes(chartType);
2508
2532
  };
2509
2533
  exports.isNonPlotType = isNonPlotType;
2510
2534
  var getGridProperties = function (schema, isMultiPlot, validTracesInfo) {
@@ -2534,6 +2558,7 @@ define(["require", "exports", "tslib", "d3-array", "d3-scale", "d3-format", "../
2534
2558
  var domainXInfo = {
2535
2559
  start: (xAxisLayout === null || xAxisLayout === void 0 ? void 0 : xAxisLayout.domain) ? xAxisLayout.domain[0] : 0,
2536
2560
  end: (xAxisLayout === null || xAxisLayout === void 0 ? void 0 : xAxisLayout.domain) ? xAxisLayout.domain[1] : 1,
2561
+ cellName: "x".concat(domainX.length === 0 ? '' : domainX.length + 1),
2537
2562
  };
2538
2563
  domainX.push(domainXInfo);
2539
2564
  }
@@ -2552,6 +2577,7 @@ define(["require", "exports", "tslib", "d3-array", "d3-scale", "d3-format", "../
2552
2577
  var domainYInfo = {
2553
2578
  start: (yAxisLayout === null || yAxisLayout === void 0 ? void 0 : yAxisLayout.domain) ? yAxisLayout.domain[0] : 0,
2554
2579
  end: (yAxisLayout === null || yAxisLayout === void 0 ? void 0 : yAxisLayout.domain) ? yAxisLayout.domain[1] : 1,
2580
+ cellName: "x".concat(domainY.length === 0 ? '' : domainY.length + 1),
2555
2581
  };
2556
2582
  domainY.push(domainYInfo);
2557
2583
  }
@@ -2565,16 +2591,36 @@ define(["require", "exports", "tslib", "d3-array", "d3-scale", "d3-format", "../
2565
2591
  var domainXInfo = {
2566
2592
  start: ((_b = series.domain) === null || _b === void 0 ? void 0 : _b.x) ? series.domain.x[0] : 0,
2567
2593
  end: ((_c = series.domain) === null || _c === void 0 ? void 0 : _c.x) ? series.domain.x[1] : 1,
2594
+ cellName: "".concat(exports.NON_PLOT_KEY_PREFIX).concat(domainX.length - cartesianDomains + 1),
2568
2595
  };
2569
2596
  var domainYInfo = {
2570
2597
  start: ((_d = series.domain) === null || _d === void 0 ? void 0 : _d.y) ? series.domain.y[0] : 0,
2571
2598
  end: ((_e = series.domain) === null || _e === void 0 ? void 0 : _e.y) ? series.domain.y[1] : 1,
2599
+ cellName: "".concat(exports.NON_PLOT_KEY_PREFIX).concat(domainY.length - cartesianDomains + 1),
2572
2600
  };
2573
2601
  domainX.push(domainXInfo);
2574
2602
  domainY.push(domainYInfo);
2575
2603
  }
2576
2604
  });
2577
2605
  if (layout !== undefined && layout !== null && Object.keys(layout).length > 0) {
2606
+ Object.keys(layout !== null && layout !== void 0 ? layout : {}).forEach(function (key) {
2607
+ var _a, _b, _c, _d;
2608
+ if (key.startsWith('polar')) {
2609
+ var polarLayout = layout[key];
2610
+ var domainXInfo = {
2611
+ start: ((_a = polarLayout.domain) === null || _a === void 0 ? void 0 : _a.x) ? polarLayout.domain.x[0] : 0,
2612
+ end: ((_b = polarLayout.domain) === null || _b === void 0 ? void 0 : _b.x) ? polarLayout.domain.x[1] : 1,
2613
+ cellName: key,
2614
+ };
2615
+ var domainYInfo = {
2616
+ start: ((_c = polarLayout.domain) === null || _c === void 0 ? void 0 : _c.y) ? polarLayout.domain.y[0] : 0,
2617
+ end: ((_d = polarLayout.domain) === null || _d === void 0 ? void 0 : _d.y) ? polarLayout.domain.y[1] : 1,
2618
+ cellName: key,
2619
+ };
2620
+ domainX.push(domainXInfo);
2621
+ domainY.push(domainYInfo);
2622
+ }
2623
+ });
2578
2624
  (_a = layout.annotations) === null || _a === void 0 ? void 0 : _a.forEach(function (annotation) {
2579
2625
  var xMatches = domainX.flatMap(function (interval, idx) {
2580
2626
  return (annotation === null || annotation === void 0 ? void 0 : annotation.x) >= interval.start && (annotation === null || annotation === void 0 ? void 0 : annotation.x) <= interval.end ? [idx] : [];
@@ -2610,9 +2656,6 @@ define(["require", "exports", "tslib", "d3-array", "d3-scale", "d3-format", "../
2610
2656
  .sort();
2611
2657
  templateColumns = "repeat(".concat(sortedXStart_1.length, ", 1fr)");
2612
2658
  domainX.forEach(function (interval, index) {
2613
- var cellName = index >= cartesianDomains
2614
- ? "".concat(exports.NON_PLOT_KEY_PREFIX).concat(index - cartesianDomains + 1)
2615
- : "x".concat(index === 0 ? '' : index + 1);
2616
2659
  var columnIndex = sortedXStart_1.findIndex(function (start) { return start === interval.start; });
2617
2660
  var columnNumber = columnIndex + 1; // Column numbers are 1-based
2618
2661
  var annotationProps = annotations[index];
@@ -2624,7 +2667,7 @@ define(["require", "exports", "tslib", "d3-array", "d3-scale", "d3-format", "../
2624
2667
  xDomain: interval,
2625
2668
  yDomain: { start: 0, end: 1 }, // Default yDomain for x-axis
2626
2669
  };
2627
- gridLayout[cellName] = row;
2670
+ gridLayout[interval.cellName] = row;
2628
2671
  });
2629
2672
  }
2630
2673
  if (domainY.length > 0) {
@@ -2641,14 +2684,11 @@ define(["require", "exports", "tslib", "d3-array", "d3-scale", "d3-format", "../
2641
2684
  var numberOfRows_1 = sortedYStart_1.length;
2642
2685
  templateRows = "repeat(".concat(numberOfRows_1, ", 1fr)");
2643
2686
  domainY.forEach(function (interval, index) {
2644
- var cellName = index >= cartesianDomains
2645
- ? "".concat(exports.NON_PLOT_KEY_PREFIX).concat(index - cartesianDomains + 1)
2646
- : "x".concat(index === 0 ? '' : index + 1);
2647
2687
  var rowIndex = sortedYStart_1.findIndex(function (start) { return start === interval.start; });
2648
2688
  var rowNumber = numberOfRows_1 - rowIndex; // Rows are 1-based and we need to reverse the order for CSS grid
2649
2689
  var annotationProps = annotations[index];
2650
2690
  var yAnnotation = annotationProps === null || annotationProps === void 0 ? void 0 : annotationProps.yAnnotation;
2651
- var cell = gridLayout[cellName];
2691
+ var cell = gridLayout[interval.cellName];
2652
2692
  if (cell !== undefined) {
2653
2693
  cell.row = rowNumber;
2654
2694
  cell.yAnnotation = yAnnotation;
@@ -2800,19 +2840,20 @@ define(["require", "exports", "tslib", "d3-array", "d3-scale", "d3-format", "../
2800
2840
  return;
2801
2841
  }
2802
2842
  var axType = getAxisType(data, ax);
2843
+ if (axId === 'x' && axType === 'category') {
2844
+ props.xAxis = {
2845
+ tickLayout: 'auto',
2846
+ };
2847
+ }
2803
2848
  if ((!ax.tickmode || ax.tickmode === 'array') && (0, chart_utilities_1.isArrayOrTypedArray)(ax.tickvals)) {
2804
2849
  var tickValues = axType === 'date' ? ax.tickvals.map(function (v) { return new Date(v); }) : ax.tickvals;
2805
2850
  if (axId === 'x') {
2806
2851
  props.tickValues = tickValues;
2807
- props.xAxis = {
2808
- tickText: ax.ticktext,
2809
- };
2852
+ props.xAxis = tslib_1.__assign(tslib_1.__assign({}, props.xAxis), { tickText: ax.ticktext });
2810
2853
  }
2811
2854
  else if (axId === 'y') {
2812
2855
  props.yAxisTickValues = tickValues;
2813
- props.yAxis = {
2814
- tickText: ax.ticktext,
2815
- };
2856
+ props.yAxis = tslib_1.__assign(tslib_1.__assign({}, props.yAxis), { tickText: ax.ticktext });
2816
2857
  }
2817
2858
  return;
2818
2859
  }
@@ -2820,16 +2861,10 @@ define(["require", "exports", "tslib", "d3-array", "d3-scale", "d3-format", "../
2820
2861
  var dtick = plotlyDtick(ax.dtick, axType);
2821
2862
  var tick0 = plotlyTick0(ax.tick0, axType, dtick);
2822
2863
  if (axId === 'x') {
2823
- props.xAxis = {
2824
- tickStep: dtick,
2825
- tick0: tick0,
2826
- };
2864
+ props.xAxis = tslib_1.__assign(tslib_1.__assign({}, props.xAxis), { tickStep: dtick, tick0: tick0 });
2827
2865
  }
2828
2866
  else if (axId === 'y') {
2829
- props.yAxis = {
2830
- tickStep: dtick,
2831
- tick0: tick0,
2832
- };
2867
+ props.yAxis = tslib_1.__assign(tslib_1.__assign({}, props.yAxis), { tickStep: dtick, tick0: tick0 });
2833
2868
  }
2834
2869
  return;
2835
2870
  }
@@ -2982,5 +3017,93 @@ define(["require", "exports", "tslib", "d3-array", "d3-scale", "d3-format", "../
2982
3017
  }
2983
3018
  };
2984
3019
  };
3020
+ var POLAR_AXIS_BY_DATA_KEY = {
3021
+ r: 'radialAxis',
3022
+ theta: 'angularAxis',
3023
+ };
3024
+ exports.DEFAULT_POLAR_SUBPLOT = 'polar';
3025
+ var getPolarLayout = function (trace, layout) {
3026
+ var subplotId = ((trace === null || trace === void 0 ? void 0 : trace.subplot) || exports.DEFAULT_POLAR_SUBPLOT);
3027
+ return layout === null || layout === void 0 ? void 0 : layout[subplotId];
3028
+ };
3029
+ var getValidAxisValues = function (data, dataKey) {
3030
+ var values = [];
3031
+ data.forEach(function (series) {
3032
+ if ((0, chart_utilities_1.isArrayOrTypedArray)(series[dataKey])) {
3033
+ series[dataKey].forEach(function (val) {
3034
+ if (!(0, chart_utilities_1.isInvalidValue)(val)) {
3035
+ values.push(val);
3036
+ }
3037
+ });
3038
+ }
3039
+ });
3040
+ return values;
3041
+ };
3042
+ var getPolarAxisType = function (data, dataKey, declaredType) {
3043
+ if (['linear', 'log', 'date', 'category'].includes(declaredType !== null && declaredType !== void 0 ? declaredType : '')) {
3044
+ return declaredType;
3045
+ }
3046
+ var values = getValidAxisValues(data, dataKey);
3047
+ if ((0, chart_utilities_1.isNumberArray)(values) && !(0, chart_utilities_1.isYearArray)(values)) {
3048
+ return 'linear';
3049
+ }
3050
+ if ((0, chart_utilities_1.isDateArray)(values)) {
3051
+ return 'date';
3052
+ }
3053
+ return 'category';
3054
+ };
3055
+ var getPolarAxis = function (data, dataKey, layout) {
3056
+ var polarLayout = getPolarLayout(data[0], layout);
3057
+ var ax = polarLayout === null || polarLayout === void 0 ? void 0 : polarLayout[POLAR_AXIS_BY_DATA_KEY[dataKey].toLowerCase()];
3058
+ return tslib_1.__assign(tslib_1.__assign({}, ax), { _dataKey: dataKey, _type: getPolarAxisType(data, dataKey, ax === null || ax === void 0 ? void 0 : ax.type) });
3059
+ };
3060
+ var getPolarAxisTickProps = function (data, ax) {
3061
+ var props = {};
3062
+ if ((!ax.tickmode || ax.tickmode === 'array') && (0, chart_utilities_1.isArrayOrTypedArray)(ax.tickvals)) {
3063
+ var tickValues = ax._type === 'date' ? ax.tickvals.map(function (v) { return new Date(v); }) : ax.tickvals;
3064
+ props.tickValues = tickValues;
3065
+ props.tickText = ax.ticktext;
3066
+ return props;
3067
+ }
3068
+ if ((!ax.tickmode || ax.tickmode === 'linear') && ax.dtick) {
3069
+ var dtick = plotlyDtick(ax.dtick, ax._type);
3070
+ var tick0 = plotlyTick0(ax.tick0, ax._type, dtick);
3071
+ props.tickStep = dtick;
3072
+ props.tick0 = tick0;
3073
+ return props;
3074
+ }
3075
+ if ((!ax.tickmode || ax.tickmode === 'auto') && typeof ax.nticks === 'number' && ax.nticks >= 0) {
3076
+ props.tickCount = ax.nticks;
3077
+ }
3078
+ return props;
3079
+ };
3080
+ var getPolarAxisCategoryOrder = function (data, ax) {
3081
+ if (ax._type !== 'category') {
3082
+ return 'data';
3083
+ }
3084
+ var isValidArray = (0, chart_utilities_1.isArrayOrTypedArray)(ax.categoryarray) && ax.categoryarray.length > 0;
3085
+ if (isValidArray && (!ax.categoryorder || ax.categoryorder === 'array')) {
3086
+ return ax.categoryarray;
3087
+ }
3088
+ if (!ax.categoryorder || ax.categoryorder === 'trace' || ax.categoryorder === 'array') {
3089
+ var values = getValidAxisValues(data, ax._dataKey);
3090
+ var categoriesInTraceOrder = Array.from(new Set(values));
3091
+ return ax.autorange === 'reversed' ? categoriesInTraceOrder.reverse() : categoriesInTraceOrder;
3092
+ }
3093
+ return ax.categoryorder;
3094
+ };
3095
+ var getPolarAxisProps = function (data, layout) {
3096
+ var props = {};
3097
+ Object.keys(POLAR_AXIS_BY_DATA_KEY).forEach(function (dataKey) {
3098
+ var propName = POLAR_AXIS_BY_DATA_KEY[dataKey];
3099
+ var ax = getPolarAxis(data, dataKey, layout);
3100
+ props[propName] = tslib_1.__assign(tslib_1.__assign({ scaleType: ax._type === 'log' ? 'log' : 'default', categoryOrder: getPolarAxisCategoryOrder(data, ax), tickFormat: ax.tickformat }, getPolarAxisTickProps(data, ax)), ((0, chart_utilities_1.isArrayOrTypedArray)(ax.range) ? { rangeStart: ax.range[0], rangeEnd: ax.range[1] } : {}));
3101
+ if (propName === 'angularAxis') {
3102
+ props[propName].unit = ax.thetaunit;
3103
+ props.direction = ax.direction;
3104
+ }
3105
+ });
3106
+ return props;
3107
+ };
2985
3108
  });
2986
3109
  //# sourceMappingURL=PlotlySchemaAdapter.js.map