@fluentui/react-charts 9.3.5 → 9.3.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (337) hide show
  1. package/CHANGELOG.md +42 -2
  2. package/dist/index.d.ts +239 -55
  3. package/lib/AnnotationOnlyChart.js +1 -0
  4. package/lib/AnnotationOnlyChart.js.map +1 -0
  5. package/lib/components/AnnotationOnlyChart/AnnotationOnlyChart.js +194 -0
  6. package/lib/components/AnnotationOnlyChart/AnnotationOnlyChart.js.map +1 -0
  7. package/lib/components/AnnotationOnlyChart/AnnotationOnlyChart.types.js +1 -0
  8. package/lib/components/AnnotationOnlyChart/AnnotationOnlyChart.types.js.map +1 -0
  9. package/lib/components/AnnotationOnlyChart/index.js +2 -0
  10. package/lib/components/AnnotationOnlyChart/index.js.map +1 -0
  11. package/lib/components/AnnotationOnlyChart/useAnnotationOnlyChartStyles.styles.js +31 -0
  12. package/lib/components/AnnotationOnlyChart/useAnnotationOnlyChartStyles.styles.js.map +1 -0
  13. package/lib/components/AnnotationOnlyChart/useAnnotationOnlyChartStyles.styles.raw.js +23 -0
  14. package/lib/components/AnnotationOnlyChart/useAnnotationOnlyChartStyles.styles.raw.js.map +1 -0
  15. package/lib/components/AreaChart/AreaChart.js +3 -16
  16. package/lib/components/AreaChart/AreaChart.js.map +1 -1
  17. package/lib/components/AreaChart/useAreaChartStyles.styles.js +11 -6
  18. package/lib/components/AreaChart/useAreaChartStyles.styles.js.map +1 -1
  19. package/lib/components/AreaChart/useAreaChartStyles.styles.raw.js +3 -1
  20. package/lib/components/AreaChart/useAreaChartStyles.styles.raw.js.map +1 -1
  21. package/lib/components/ChartTable/ChartTable.js +2 -10
  22. package/lib/components/ChartTable/ChartTable.js.map +1 -1
  23. package/lib/components/ChartTable/ChartTable.types.js.map +1 -1
  24. package/lib/components/ChartTable/useChartTableStyles.styles.js +59 -39
  25. package/lib/components/ChartTable/useChartTableStyles.styles.js.map +1 -1
  26. package/lib/components/ChartTable/useChartTableStyles.styles.raw.js +5 -5
  27. package/lib/components/ChartTable/useChartTableStyles.styles.raw.js.map +1 -1
  28. package/lib/components/CommonComponents/Annotations/ChartAnnotationLayer.js +617 -0
  29. package/lib/components/CommonComponents/Annotations/ChartAnnotationLayer.js.map +1 -0
  30. package/lib/components/CommonComponents/Annotations/ChartAnnotationLayer.types.js +1 -0
  31. package/lib/components/CommonComponents/Annotations/ChartAnnotationLayer.types.js.map +1 -0
  32. package/lib/components/CommonComponents/Annotations/index.js +2 -0
  33. package/lib/components/CommonComponents/Annotations/index.js.map +1 -0
  34. package/lib/components/CommonComponents/Annotations/useChartAnnotationLayer.styles.js +173 -0
  35. package/lib/components/CommonComponents/Annotations/useChartAnnotationLayer.styles.js.map +1 -0
  36. package/lib/components/CommonComponents/Annotations/useChartAnnotationLayer.styles.raw.js +126 -0
  37. package/lib/components/CommonComponents/Annotations/useChartAnnotationLayer.styles.raw.js.map +1 -0
  38. package/lib/components/CommonComponents/CartesianChart.js +159 -132
  39. package/lib/components/CommonComponents/CartesianChart.js.map +1 -1
  40. package/lib/components/CommonComponents/CartesianChart.types.js.map +1 -1
  41. package/lib/components/CommonComponents/ChartPopover.js +1 -2
  42. package/lib/components/CommonComponents/ChartPopover.js.map +1 -1
  43. package/lib/components/CommonComponents/index.js +2 -0
  44. package/lib/components/CommonComponents/index.js.map +1 -1
  45. package/lib/components/CommonComponents/useCartesianChartStyles.styles.js +32 -14
  46. package/lib/components/CommonComponents/useCartesianChartStyles.styles.js.map +1 -1
  47. package/lib/components/CommonComponents/useCartesianChartStyles.styles.raw.js +17 -2
  48. package/lib/components/CommonComponents/useCartesianChartStyles.styles.raw.js.map +1 -1
  49. package/lib/components/CommonComponents/useChartPopoverStyles.styles.js +2 -6
  50. package/lib/components/CommonComponents/useChartPopoverStyles.styles.js.map +1 -1
  51. package/lib/components/CommonComponents/useChartPopoverStyles.styles.raw.js +1 -2
  52. package/lib/components/CommonComponents/useChartPopoverStyles.styles.raw.js.map +1 -1
  53. package/lib/components/DeclarativeChart/DeclarativeChart.js +83 -40
  54. package/lib/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
  55. package/lib/components/DeclarativeChart/PlotlyColorAdapter.js +4 -8
  56. package/lib/components/DeclarativeChart/PlotlyColorAdapter.js.map +1 -1
  57. package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js +692 -94
  58. package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
  59. package/lib/components/DonutChart/Arc/useArcStyles.styles.js +23 -8
  60. package/lib/components/DonutChart/Arc/useArcStyles.styles.js.map +1 -1
  61. package/lib/components/DonutChart/Arc/useArcStyles.styles.raw.js +2 -2
  62. package/lib/components/DonutChart/Arc/useArcStyles.styles.raw.js.map +1 -1
  63. package/lib/components/DonutChart/DonutChart.js +3 -12
  64. package/lib/components/DonutChart/DonutChart.js.map +1 -1
  65. package/lib/components/DonutChart/DonutChart.types.js.map +1 -1
  66. package/lib/components/DonutChart/Pie/Pie.js +4 -2
  67. package/lib/components/DonutChart/Pie/Pie.js.map +1 -1
  68. package/lib/components/DonutChart/useDonutChartStyles.styles.js +2 -2
  69. package/lib/components/DonutChart/useDonutChartStyles.styles.js.map +1 -1
  70. package/lib/components/FunnelChart/FunnelChart.js +2 -10
  71. package/lib/components/FunnelChart/FunnelChart.js.map +1 -1
  72. package/lib/components/FunnelChart/FunnelChart.types.js.map +1 -1
  73. package/lib/components/GanttChart/GanttChart.js +6 -19
  74. package/lib/components/GanttChart/GanttChart.js.map +1 -1
  75. package/lib/components/GanttChart/GanttChart.types.js.map +1 -1
  76. package/lib/components/GanttChart/useGanttChartStyles.styles.js +3 -1
  77. package/lib/components/GanttChart/useGanttChartStyles.styles.js.map +1 -1
  78. package/lib/components/GanttChart/useGanttChartStyles.styles.raw.js +3 -1
  79. package/lib/components/GanttChart/useGanttChartStyles.styles.raw.js.map +1 -1
  80. package/lib/components/GaugeChart/GaugeChart.js +2 -10
  81. package/lib/components/GaugeChart/GaugeChart.js.map +1 -1
  82. package/lib/components/GaugeChart/GaugeChart.types.js.map +1 -1
  83. package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js +8 -20
  84. package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js.map +1 -1
  85. package/lib/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.js +11 -6
  86. package/lib/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.js.map +1 -1
  87. package/lib/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.raw.js +3 -1
  88. package/lib/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.raw.js.map +1 -1
  89. package/lib/components/HeatMapChart/HeatMapChart.js +4 -17
  90. package/lib/components/HeatMapChart/HeatMapChart.js.map +1 -1
  91. package/lib/components/HeatMapChart/HeatMapChart.types.js.map +1 -1
  92. package/lib/components/HeatMapChart/useHeatMapChartStyles.styles.js +3 -1
  93. package/lib/components/HeatMapChart/useHeatMapChartStyles.styles.js.map +1 -1
  94. package/lib/components/HeatMapChart/useHeatMapChartStyles.styles.raw.js +3 -1
  95. package/lib/components/HeatMapChart/useHeatMapChartStyles.styles.raw.js.map +1 -1
  96. package/lib/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.js +25 -12
  97. package/lib/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.js.map +1 -1
  98. package/lib/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.raw.js +4 -4
  99. package/lib/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.raw.js.map +1 -1
  100. package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js +5 -23
  101. package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js.map +1 -1
  102. package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.types.js.map +1 -1
  103. package/lib/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.js +3 -1
  104. package/lib/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.js.map +1 -1
  105. package/lib/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.raw.js +3 -1
  106. package/lib/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.raw.js.map +1 -1
  107. package/lib/components/Legends/Legends.types.js.map +1 -1
  108. package/lib/components/Legends/OverflowMenu.js.map +1 -1
  109. package/lib/components/Legends/useLegendsStyles.styles.js +97 -37
  110. package/lib/components/Legends/useLegendsStyles.styles.js.map +1 -1
  111. package/lib/components/Legends/useLegendsStyles.styles.raw.js +10 -11
  112. package/lib/components/Legends/useLegendsStyles.styles.raw.js.map +1 -1
  113. package/lib/components/LineChart/LineChart.js +11 -20
  114. package/lib/components/LineChart/LineChart.js.map +1 -1
  115. package/lib/components/LineChart/LineChart.types.js +1 -1
  116. package/lib/components/LineChart/LineChart.types.js.map +1 -1
  117. package/lib/components/LineChart/eventAnnotation/EventAnnotation.js +3 -4
  118. package/lib/components/LineChart/eventAnnotation/EventAnnotation.js.map +1 -1
  119. package/lib/components/LineChart/useLineChartStyles.styles.js +15 -10
  120. package/lib/components/LineChart/useLineChartStyles.styles.js.map +1 -1
  121. package/lib/components/LineChart/useLineChartStyles.styles.raw.js +3 -1
  122. package/lib/components/LineChart/useLineChartStyles.styles.raw.js.map +1 -1
  123. package/lib/components/SankeyChart/SankeyChart.js +3 -9
  124. package/lib/components/SankeyChart/SankeyChart.js.map +1 -1
  125. package/lib/components/SankeyChart/SankeyChart.types.js.map +1 -1
  126. package/lib/components/SankeyChart/useSankeyChartStyles.styles.js +13 -10
  127. package/lib/components/SankeyChart/useSankeyChartStyles.styles.js.map +1 -1
  128. package/lib/components/ScatterChart/ScatterChart.js +24 -24
  129. package/lib/components/ScatterChart/ScatterChart.js.map +1 -1
  130. package/lib/components/ScatterChart/ScatterChart.types.js.map +1 -1
  131. package/lib/components/ScatterChart/useScatterChartStyles.styles.js +13 -8
  132. package/lib/components/ScatterChart/useScatterChartStyles.styles.js.map +1 -1
  133. package/lib/components/ScatterChart/useScatterChartStyles.styles.raw.js +3 -1
  134. package/lib/components/ScatterChart/useScatterChartStyles.styles.raw.js.map +1 -1
  135. package/lib/components/Sparkline/Sparkline.js +11 -7
  136. package/lib/components/Sparkline/Sparkline.js.map +1 -1
  137. package/lib/components/VerticalBarChart/VerticalBarChart.js +3 -15
  138. package/lib/components/VerticalBarChart/VerticalBarChart.js.map +1 -1
  139. package/lib/components/VerticalBarChart/useVerticalBarChartStyles.styles.js +13 -8
  140. package/lib/components/VerticalBarChart/useVerticalBarChartStyles.styles.js.map +1 -1
  141. package/lib/components/VerticalBarChart/useVerticalBarChartStyles.styles.raw.js +3 -1
  142. package/lib/components/VerticalBarChart/useVerticalBarChartStyles.styles.raw.js.map +1 -1
  143. package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.js +8 -18
  144. package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.js.map +1 -1
  145. package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.types.js.map +1 -1
  146. package/lib/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.js +11 -6
  147. package/lib/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.js.map +1 -1
  148. package/lib/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.raw.js +3 -1
  149. package/lib/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.raw.js.map +1 -1
  150. package/lib/index.js +1 -0
  151. package/lib/index.js.map +1 -1
  152. package/lib/types/ChartAnnotation.js +1 -0
  153. package/lib/types/ChartAnnotation.js.map +1 -0
  154. package/lib/types/DataPoint.js.map +1 -1
  155. package/lib/types/index.js +1 -0
  156. package/lib/types/index.js.map +1 -1
  157. package/lib/utilities/Common.styles.js +1 -2
  158. package/lib/utilities/Common.styles.js.map +1 -1
  159. package/lib/utilities/Common.styles.raw.js +1 -2
  160. package/lib/utilities/Common.styles.raw.js.map +1 -1
  161. package/lib/utilities/FocusableTooltipText.js +1 -1
  162. package/lib/utilities/FocusableTooltipText.js.map +1 -1
  163. package/lib/utilities/getWindow.js +0 -1
  164. package/lib/utilities/getWindow.js.map +1 -1
  165. package/lib/utilities/hooks.js +34 -0
  166. package/lib/utilities/hooks.js.map +1 -0
  167. package/lib/utilities/image-export-utils.js +221 -73
  168. package/lib/utilities/image-export-utils.js.map +1 -1
  169. package/lib/utilities/utilities.js +39 -37
  170. package/lib/utilities/utilities.js.map +1 -1
  171. package/lib-commonjs/AnnotationOnlyChart.js +6 -0
  172. package/lib-commonjs/AnnotationOnlyChart.js.map +1 -0
  173. package/lib-commonjs/components/AnnotationOnlyChart/AnnotationOnlyChart.js +205 -0
  174. package/lib-commonjs/components/AnnotationOnlyChart/AnnotationOnlyChart.js.map +1 -0
  175. package/lib-commonjs/components/AnnotationOnlyChart/AnnotationOnlyChart.types.js +6 -0
  176. package/lib-commonjs/components/AnnotationOnlyChart/AnnotationOnlyChart.types.js.map +1 -0
  177. package/lib-commonjs/components/AnnotationOnlyChart/index.js +7 -0
  178. package/lib-commonjs/components/AnnotationOnlyChart/index.js.map +1 -0
  179. package/lib-commonjs/components/AnnotationOnlyChart/useAnnotationOnlyChartStyles.styles.js +56 -0
  180. package/lib-commonjs/components/AnnotationOnlyChart/useAnnotationOnlyChartStyles.styles.js.map +1 -0
  181. package/lib-commonjs/components/AnnotationOnlyChart/useAnnotationOnlyChartStyles.styles.raw.js +33 -0
  182. package/lib-commonjs/components/AnnotationOnlyChart/useAnnotationOnlyChartStyles.styles.raw.js.map +1 -0
  183. package/lib-commonjs/components/AreaChart/AreaChart.js +2 -15
  184. package/lib-commonjs/components/AreaChart/AreaChart.js.map +1 -1
  185. package/lib-commonjs/components/AreaChart/useAreaChartStyles.styles.js +14 -15
  186. package/lib-commonjs/components/AreaChart/useAreaChartStyles.styles.js.map +1 -1
  187. package/lib-commonjs/components/AreaChart/useAreaChartStyles.styles.raw.js +3 -1
  188. package/lib-commonjs/components/AreaChart/useAreaChartStyles.styles.raw.js.map +1 -1
  189. package/lib-commonjs/components/ChartTable/ChartTable.js +3 -10
  190. package/lib-commonjs/components/ChartTable/ChartTable.js.map +1 -1
  191. package/lib-commonjs/components/ChartTable/ChartTable.types.js.map +1 -1
  192. package/lib-commonjs/components/ChartTable/useChartTableStyles.styles.js +74 -102
  193. package/lib-commonjs/components/ChartTable/useChartTableStyles.styles.js.map +1 -1
  194. package/lib-commonjs/components/ChartTable/useChartTableStyles.styles.raw.js +4 -4
  195. package/lib-commonjs/components/ChartTable/useChartTableStyles.styles.raw.js.map +1 -1
  196. package/lib-commonjs/components/CommonComponents/Annotations/ChartAnnotationLayer.js +628 -0
  197. package/lib-commonjs/components/CommonComponents/Annotations/ChartAnnotationLayer.js.map +1 -0
  198. package/lib-commonjs/components/CommonComponents/Annotations/ChartAnnotationLayer.types.js +4 -0
  199. package/lib-commonjs/components/CommonComponents/Annotations/ChartAnnotationLayer.types.js.map +1 -0
  200. package/lib-commonjs/components/CommonComponents/Annotations/index.js +7 -0
  201. package/lib-commonjs/components/CommonComponents/Annotations/index.js.map +1 -0
  202. package/lib-commonjs/components/CommonComponents/Annotations/useChartAnnotationLayer.styles.js +265 -0
  203. package/lib-commonjs/components/CommonComponents/Annotations/useChartAnnotationLayer.styles.js.map +1 -0
  204. package/lib-commonjs/components/CommonComponents/Annotations/useChartAnnotationLayer.styles.raw.js +161 -0
  205. package/lib-commonjs/components/CommonComponents/Annotations/useChartAnnotationLayer.styles.raw.js.map +1 -0
  206. package/lib-commonjs/components/CommonComponents/CartesianChart.js +159 -131
  207. package/lib-commonjs/components/CommonComponents/CartesianChart.js.map +1 -1
  208. package/lib-commonjs/components/CommonComponents/CartesianChart.types.js.map +1 -1
  209. package/lib-commonjs/components/CommonComponents/ChartPopover.js +1 -2
  210. package/lib-commonjs/components/CommonComponents/ChartPopover.js.map +1 -1
  211. package/lib-commonjs/components/CommonComponents/index.js +2 -0
  212. package/lib-commonjs/components/CommonComponents/index.js.map +1 -1
  213. package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.js +35 -22
  214. package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.js.map +1 -1
  215. package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.raw.js +17 -2
  216. package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.raw.js.map +1 -1
  217. package/lib-commonjs/components/CommonComponents/useChartPopoverStyles.styles.js +0 -14
  218. package/lib-commonjs/components/CommonComponents/useChartPopoverStyles.styles.js.map +1 -1
  219. package/lib-commonjs/components/CommonComponents/useChartPopoverStyles.styles.raw.js +0 -1
  220. package/lib-commonjs/components/CommonComponents/useChartPopoverStyles.styles.raw.js.map +1 -1
  221. package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js +82 -39
  222. package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
  223. package/lib-commonjs/components/DeclarativeChart/PlotlyColorAdapter.js.map +1 -1
  224. package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js +678 -60
  225. package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
  226. package/lib-commonjs/components/DonutChart/Arc/useArcStyles.styles.js +25 -16
  227. package/lib-commonjs/components/DonutChart/Arc/useArcStyles.styles.js.map +1 -1
  228. package/lib-commonjs/components/DonutChart/Arc/useArcStyles.styles.raw.js +1 -1
  229. package/lib-commonjs/components/DonutChart/Arc/useArcStyles.styles.raw.js.map +1 -1
  230. package/lib-commonjs/components/DonutChart/DonutChart.js +2 -11
  231. package/lib-commonjs/components/DonutChart/DonutChart.js.map +1 -1
  232. package/lib-commonjs/components/DonutChart/DonutChart.types.js.map +1 -1
  233. package/lib-commonjs/components/DonutChart/Pie/Pie.js +4 -2
  234. package/lib-commonjs/components/DonutChart/Pie/Pie.js.map +1 -1
  235. package/lib-commonjs/components/DonutChart/useDonutChartStyles.styles.js +2 -2
  236. package/lib-commonjs/components/DonutChart/useDonutChartStyles.styles.js.map +1 -1
  237. package/lib-commonjs/components/FunnelChart/FunnelChart.js +2 -10
  238. package/lib-commonjs/components/FunnelChart/FunnelChart.js.map +1 -1
  239. package/lib-commonjs/components/FunnelChart/FunnelChart.types.js.map +1 -1
  240. package/lib-commonjs/components/GanttChart/GanttChart.js +5 -18
  241. package/lib-commonjs/components/GanttChart/GanttChart.js.map +1 -1
  242. package/lib-commonjs/components/GanttChart/GanttChart.types.js.map +1 -1
  243. package/lib-commonjs/components/GanttChart/useGanttChartStyles.styles.js +3 -1
  244. package/lib-commonjs/components/GanttChart/useGanttChartStyles.styles.js.map +1 -1
  245. package/lib-commonjs/components/GanttChart/useGanttChartStyles.styles.raw.js +3 -1
  246. package/lib-commonjs/components/GanttChart/useGanttChartStyles.styles.raw.js.map +1 -1
  247. package/lib-commonjs/components/GaugeChart/GaugeChart.js +2 -10
  248. package/lib-commonjs/components/GaugeChart/GaugeChart.js.map +1 -1
  249. package/lib-commonjs/components/GaugeChart/GaugeChart.types.js.map +1 -1
  250. package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js +8 -20
  251. package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js.map +1 -1
  252. package/lib-commonjs/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.js +14 -15
  253. package/lib-commonjs/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.js.map +1 -1
  254. package/lib-commonjs/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.raw.js +3 -1
  255. package/lib-commonjs/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.raw.js.map +1 -1
  256. package/lib-commonjs/components/HeatMapChart/HeatMapChart.js +3 -16
  257. package/lib-commonjs/components/HeatMapChart/HeatMapChart.js.map +1 -1
  258. package/lib-commonjs/components/HeatMapChart/HeatMapChart.types.js.map +1 -1
  259. package/lib-commonjs/components/HeatMapChart/useHeatMapChartStyles.styles.js +3 -1
  260. package/lib-commonjs/components/HeatMapChart/useHeatMapChartStyles.styles.js.map +1 -1
  261. package/lib-commonjs/components/HeatMapChart/useHeatMapChartStyles.styles.raw.js +3 -1
  262. package/lib-commonjs/components/HeatMapChart/useHeatMapChartStyles.styles.raw.js.map +1 -1
  263. package/lib-commonjs/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.js +47 -34
  264. package/lib-commonjs/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.js.map +1 -1
  265. package/lib-commonjs/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.raw.js +3 -3
  266. package/lib-commonjs/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.raw.js.map +1 -1
  267. package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js +4 -21
  268. package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js.map +1 -1
  269. package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.types.js.map +1 -1
  270. package/lib-commonjs/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.js +3 -1
  271. package/lib-commonjs/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.js.map +1 -1
  272. package/lib-commonjs/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.raw.js +3 -1
  273. package/lib-commonjs/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.raw.js.map +1 -1
  274. package/lib-commonjs/components/Legends/Legends.types.js.map +1 -1
  275. package/lib-commonjs/components/Legends/OverflowMenu.js.map +1 -1
  276. package/lib-commonjs/components/Legends/useLegendsStyles.styles.js +144 -86
  277. package/lib-commonjs/components/Legends/useLegendsStyles.styles.js.map +1 -1
  278. package/lib-commonjs/components/Legends/useLegendsStyles.styles.raw.js +9 -10
  279. package/lib-commonjs/components/Legends/useLegendsStyles.styles.raw.js.map +1 -1
  280. package/lib-commonjs/components/LineChart/LineChart.js +11 -20
  281. package/lib-commonjs/components/LineChart/LineChart.js.map +1 -1
  282. package/lib-commonjs/components/LineChart/LineChart.types.js +1 -1
  283. package/lib-commonjs/components/LineChart/LineChart.types.js.map +1 -1
  284. package/lib-commonjs/components/LineChart/eventAnnotation/EventAnnotation.js +2 -2
  285. package/lib-commonjs/components/LineChart/eventAnnotation/EventAnnotation.js.map +1 -1
  286. package/lib-commonjs/components/LineChart/useLineChartStyles.styles.js +18 -19
  287. package/lib-commonjs/components/LineChart/useLineChartStyles.styles.js.map +1 -1
  288. package/lib-commonjs/components/LineChart/useLineChartStyles.styles.raw.js +3 -1
  289. package/lib-commonjs/components/LineChart/useLineChartStyles.styles.raw.js.map +1 -1
  290. package/lib-commonjs/components/SankeyChart/SankeyChart.js +3 -9
  291. package/lib-commonjs/components/SankeyChart/SankeyChart.js.map +1 -1
  292. package/lib-commonjs/components/SankeyChart/SankeyChart.types.js.map +1 -1
  293. package/lib-commonjs/components/SankeyChart/useSankeyChartStyles.styles.js +16 -19
  294. package/lib-commonjs/components/SankeyChart/useSankeyChartStyles.styles.js.map +1 -1
  295. package/lib-commonjs/components/ScatterChart/ScatterChart.js +22 -22
  296. package/lib-commonjs/components/ScatterChart/ScatterChart.js.map +1 -1
  297. package/lib-commonjs/components/ScatterChart/ScatterChart.types.js.map +1 -1
  298. package/lib-commonjs/components/ScatterChart/useScatterChartStyles.styles.js +16 -17
  299. package/lib-commonjs/components/ScatterChart/useScatterChartStyles.styles.js.map +1 -1
  300. package/lib-commonjs/components/ScatterChart/useScatterChartStyles.styles.raw.js +3 -1
  301. package/lib-commonjs/components/ScatterChart/useScatterChartStyles.styles.raw.js.map +1 -1
  302. package/lib-commonjs/components/Sparkline/Sparkline.js +11 -7
  303. package/lib-commonjs/components/Sparkline/Sparkline.js.map +1 -1
  304. package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.js +3 -15
  305. package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.js.map +1 -1
  306. package/lib-commonjs/components/VerticalBarChart/useVerticalBarChartStyles.styles.js +16 -17
  307. package/lib-commonjs/components/VerticalBarChart/useVerticalBarChartStyles.styles.js.map +1 -1
  308. package/lib-commonjs/components/VerticalBarChart/useVerticalBarChartStyles.styles.raw.js +3 -1
  309. package/lib-commonjs/components/VerticalBarChart/useVerticalBarChartStyles.styles.raw.js.map +1 -1
  310. package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.js +7 -17
  311. package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.js.map +1 -1
  312. package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.types.js.map +1 -1
  313. package/lib-commonjs/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.js +14 -15
  314. package/lib-commonjs/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.js.map +1 -1
  315. package/lib-commonjs/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.raw.js +3 -1
  316. package/lib-commonjs/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.raw.js.map +1 -1
  317. package/lib-commonjs/index.js +1 -0
  318. package/lib-commonjs/index.js.map +1 -1
  319. package/lib-commonjs/types/ChartAnnotation.js +6 -0
  320. package/lib-commonjs/types/ChartAnnotation.js.map +1 -0
  321. package/lib-commonjs/types/DataPoint.js.map +1 -1
  322. package/lib-commonjs/types/index.js +1 -0
  323. package/lib-commonjs/types/index.js.map +1 -1
  324. package/lib-commonjs/utilities/Common.styles.js +1 -2
  325. package/lib-commonjs/utilities/Common.styles.js.map +1 -1
  326. package/lib-commonjs/utilities/Common.styles.raw.js +1 -2
  327. package/lib-commonjs/utilities/Common.styles.raw.js.map +1 -1
  328. package/lib-commonjs/utilities/FocusableTooltipText.js.map +1 -1
  329. package/lib-commonjs/utilities/getWindow.js +0 -1
  330. package/lib-commonjs/utilities/getWindow.js.map +1 -1
  331. package/lib-commonjs/utilities/hooks.js +45 -0
  332. package/lib-commonjs/utilities/hooks.js.map +1 -0
  333. package/lib-commonjs/utilities/image-export-utils.js +222 -74
  334. package/lib-commonjs/utilities/image-export-utils.js.map +1 -1
  335. package/lib-commonjs/utilities/utilities.js +37 -33
  336. package/lib-commonjs/utilities/utilities.js.map +1 -1
  337. package/package.json +11 -11
@@ -88,6 +88,18 @@ const getYMinMaxValues = (series, layout)=>{
88
88
  }
89
89
  return {};
90
90
  };
91
+ const getXMinMaxValues = (series, layout)=>{
92
+ var _getXAxisProperties;
93
+ const range = (_getXAxisProperties = getXAxisProperties(series, layout)) === null || _getXAxisProperties === void 0 ? void 0 : _getXAxisProperties.range;
94
+ if (range && range.length === 2) {
95
+ return {
96
+ xMinValue: range[0],
97
+ xMaxValue: range[1],
98
+ showRoundOffXTickValues: false
99
+ };
100
+ }
101
+ return {};
102
+ };
91
103
  const getYAxisProperties = (series, layout)=>{
92
104
  return layout === null || layout === void 0 ? void 0 : layout.yaxis;
93
105
  };
@@ -182,8 +194,7 @@ const getSecondaryYAxisValues = (data, layout)=>{
182
194
  }
183
195
  };
184
196
  };
185
- export const _getGaugeAxisColor = (colorway, colorwayType, color, // eslint-disable-next-line @typescript-eslint/no-deprecated
186
- colorMap, isDarkTheme)=>{
197
+ export const _getGaugeAxisColor = (colorway, colorwayType, color, colorMap, isDarkTheme)=>{
187
198
  const extractedColors = extractColor(colorway, colorwayType, color, colorMap, isDarkTheme);
188
199
  return resolveColor(extractedColors, 0, '', colorMap, colorway, isDarkTheme);
189
200
  };
@@ -206,6 +217,24 @@ export const resolveXAxisPoint = (x, isXYearCategory, isXString, isXDate, isXNum
206
217
  }
207
218
  return x;
208
219
  };
220
+ /**
221
+ * Extracts unique X-axis categories from Plotly data traces
222
+ * @param data Array of Plotly data traces
223
+ * @returns Array of unique x values
224
+ */ const extractXCategories = (data)=>{
225
+ return Array.from(new Set((data !== null && data !== void 0 ? data : []).flatMap((trace)=>{
226
+ const xData = trace.x;
227
+ if (!xData) {
228
+ return [];
229
+ }
230
+ if (Array.isArray(xData)) {
231
+ return xData.flat().map((x)=>{
232
+ return x;
233
+ });
234
+ }
235
+ return [];
236
+ }).filter((x)=>x !== undefined && x !== null)));
237
+ };
209
238
  /**
210
239
  * Checks if a key should be ignored during normalization
211
240
  * @param key The key to check
@@ -244,6 +273,526 @@ export const resolveXAxisPoint = (x, isXYearCategory, isXString, isXDate, isXNum
244
273
  }
245
274
  return flattened;
246
275
  };
276
+ const encodeHtmlEntities = (value)=>value.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/"/g, '&quot;').replace(/'/g, '&#39;');
277
+ const toFiniteNumber = (value)=>{
278
+ if (value === undefined || value === null) {
279
+ return undefined;
280
+ }
281
+ const numeric = typeof value === 'number' ? value : Number(value);
282
+ return Number.isFinite(numeric) ? numeric : undefined;
283
+ };
284
+ /**
285
+ * Normalizes Plotly axis reference strings so equivalent aliases (e.g. `xaxis1`, `x1`) collapse to the base axis id.
286
+ */ const normalizeAxisRef = (ref, axis)=>{
287
+ if (!ref) {
288
+ return axis;
289
+ }
290
+ const normalized = ref.toLowerCase();
291
+ if (normalized === axis || normalized === `${axis}axis` || normalized === `${axis}axis1` || normalized === `${axis}1`) {
292
+ return axis;
293
+ }
294
+ const match = normalized.match(/^([xy])(axis)?(\d+)$/);
295
+ if (match && match[1] === axis && match[3]) {
296
+ return match[3] === '1' ? axis : `${axis}${match[3]}`;
297
+ }
298
+ return normalized;
299
+ };
300
+ /**
301
+ * Scans the data traces bound to a given axis and returns the numeric min/max values plotted on that axis.
302
+ */ const getAxisNumericRangeFromData = (axis, ref, layout, data)=>{
303
+ if (!data || data.length === 0) {
304
+ return undefined;
305
+ }
306
+ const axisLayout = getAxisLayoutByRef(layout, ref, axis);
307
+ const targetRef = normalizeAxisRef(ref, axis);
308
+ const traceAxisKey = axis === 'x' ? 'xaxis' : 'yaxis';
309
+ let minValue;
310
+ let maxValue;
311
+ data.forEach((trace)=>{
312
+ const plotTrace = trace;
313
+ const traceAxisRef = normalizeAxisRef(plotTrace[traceAxisKey], axis);
314
+ if (traceAxisRef !== targetRef) {
315
+ return;
316
+ }
317
+ const values = axis === 'x' ? plotTrace.x : plotTrace.y;
318
+ if (!isArrayOrTypedArray(values)) {
319
+ return;
320
+ }
321
+ const arrayLike = values;
322
+ for(let index = 0; index < arrayLike.length; index++){
323
+ const value = arrayLike[index];
324
+ const numeric = toNumericValue(convertDataValue(value, axisLayout));
325
+ if (numeric === undefined || Number.isNaN(numeric)) {
326
+ continue;
327
+ }
328
+ minValue = minValue === undefined ? numeric : Math.min(minValue, numeric);
329
+ maxValue = maxValue === undefined ? numeric : Math.max(maxValue, numeric);
330
+ }
331
+ });
332
+ if (minValue === undefined || maxValue === undefined || minValue === maxValue) {
333
+ return undefined;
334
+ }
335
+ return [
336
+ minValue,
337
+ maxValue
338
+ ];
339
+ };
340
+ /**
341
+ * Converts Plotly's bottom-origin relative Y coordinate into the SVG top-origin space used by our overlay.
342
+ */ const transformRelativeYForChart = (value)=>{
343
+ if (value === undefined) {
344
+ return undefined;
345
+ }
346
+ if (!Number.isFinite(value)) {
347
+ return undefined;
348
+ }
349
+ return 1 - value;
350
+ };
351
+ const mapHorizontalAlign = (anchor)=>{
352
+ switch((anchor !== null && anchor !== void 0 ? anchor : '').toLowerCase()){
353
+ case 'left':
354
+ return 'start';
355
+ case 'center':
356
+ return 'center';
357
+ case 'right':
358
+ return 'end';
359
+ default:
360
+ return undefined;
361
+ }
362
+ };
363
+ const mapVerticalAlign = (anchor)=>{
364
+ switch((anchor !== null && anchor !== void 0 ? anchor : '').toLowerCase()){
365
+ case 'top':
366
+ return 'top';
367
+ case 'middle':
368
+ return 'middle';
369
+ case 'bottom':
370
+ return 'bottom';
371
+ default:
372
+ return undefined;
373
+ }
374
+ };
375
+ const appendPx = (value)=>{
376
+ if (value === undefined || value === null) {
377
+ return undefined;
378
+ }
379
+ if (typeof value === 'string') {
380
+ return value;
381
+ }
382
+ if (typeof value === 'number' && Number.isFinite(value)) {
383
+ return `${value}px`;
384
+ }
385
+ return undefined;
386
+ };
387
+ /**
388
+ * Maps Plotly's axis reference string to one of our coordinate interpretation modes (axis, relative, or pixel).
389
+ */ const resolveRefType = (ref, axis)=>{
390
+ if (!ref) {
391
+ return 'axis';
392
+ }
393
+ const normalized = ref.toLowerCase();
394
+ if (normalized === 'pixel') {
395
+ return 'pixel';
396
+ }
397
+ if (normalized === 'paper') {
398
+ return 'relative';
399
+ }
400
+ if (normalized.endsWith(' domain')) {
401
+ return normalized.startsWith(axis) ? 'relative' : undefined;
402
+ }
403
+ const match = normalized.match(/^([xy])(\d*)$/);
404
+ if (match && match[1] === axis) {
405
+ return 'axis';
406
+ }
407
+ return undefined;
408
+ };
409
+ /**
410
+ * Retrieves the appropriate axis layout section from Plotly's layout given an axis reference alias.
411
+ */ const getAxisLayoutByRef = (layout, ref, axis)=>{
412
+ if (!layout) {
413
+ return undefined;
414
+ }
415
+ const defaultAxisKey = `${axis}axis`;
416
+ if (!ref) {
417
+ return layout[defaultAxisKey];
418
+ }
419
+ const normalized = ref.toLowerCase();
420
+ if (normalized === 'paper' || normalized === 'pixel' || normalized.endsWith(' domain')) {
421
+ return layout[defaultAxisKey];
422
+ }
423
+ const match = normalized.match(/^([xy])(\d*)$/);
424
+ if (match && match[1] === axis) {
425
+ const index = match[2];
426
+ if (index && index !== '' && index !== '1') {
427
+ const axisKey = `${axis}axis${index}`;
428
+ return layout[axisKey];
429
+ }
430
+ return layout[defaultAxisKey];
431
+ }
432
+ return layout[defaultAxisKey];
433
+ };
434
+ /**
435
+ * Normalizes raw Plotly data values into canonical number/date/string types based on axis configuration.
436
+ */ const convertDataValue = (value, axisLayout)=>{
437
+ if (value === undefined || value === null) {
438
+ return undefined;
439
+ }
440
+ if ((axisLayout === null || axisLayout === void 0 ? void 0 : axisLayout.type) === 'date' || isDate(value)) {
441
+ const dateValue = value instanceof Date ? value : new Date(value);
442
+ return Number.isNaN(dateValue.getTime()) ? undefined : dateValue;
443
+ }
444
+ if (typeof value === 'number') {
445
+ return value;
446
+ }
447
+ if ((axisLayout === null || axisLayout === void 0 ? void 0 : axisLayout.type) === 'linear' || (axisLayout === null || axisLayout === void 0 ? void 0 : axisLayout.type) === 'log') {
448
+ const numeric = Number(value);
449
+ return Number.isFinite(numeric) ? numeric : undefined;
450
+ }
451
+ if (value instanceof Date) {
452
+ return value;
453
+ }
454
+ return value;
455
+ };
456
+ const toNumericValue = (value)=>{
457
+ if (value instanceof Date) {
458
+ const timestamp = value.getTime();
459
+ return Number.isFinite(timestamp) ? timestamp : undefined;
460
+ }
461
+ if (typeof value === 'number') {
462
+ return Number.isFinite(value) ? value : undefined;
463
+ }
464
+ if (typeof value === 'string') {
465
+ const numeric = Number(value);
466
+ return Number.isFinite(numeric) ? numeric : undefined;
467
+ }
468
+ return undefined;
469
+ };
470
+ const toRelativeCoordinate = (value, axisLayout, fallbackRange)=>{
471
+ const range = Array.isArray(axisLayout === null || axisLayout === void 0 ? void 0 : axisLayout.range) ? axisLayout.range : undefined;
472
+ let start = range && range.length >= 2 ? toNumericValue(convertDataValue(range[0], axisLayout)) : undefined;
473
+ let end = range && range.length >= 2 ? toNumericValue(convertDataValue(range[1], axisLayout)) : undefined;
474
+ if ((start === undefined || end === undefined || start === end) && fallbackRange) {
475
+ [start, end] = fallbackRange;
476
+ }
477
+ const current = toNumericValue(convertDataValue(value, axisLayout));
478
+ if (start === undefined || end === undefined || current === undefined || start === end) {
479
+ return undefined;
480
+ }
481
+ const relative = (current - start) / (end - start);
482
+ return Number.isFinite(relative) ? relative : undefined;
483
+ };
484
+ const createAnnotationId = (text, index)=>{
485
+ const normalized = text.replace(/\s+/g, ' ').trim();
486
+ if (normalized) {
487
+ const slug = normalized.toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/^-+|-+$/g, '').slice(0, 32);
488
+ if (slug) {
489
+ return `annotation-${index}-${slug}`;
490
+ }
491
+ }
492
+ return `annotation-${index}`;
493
+ };
494
+ const DEFAULT_ARROW_OFFSET = -40;
495
+ const mapArrowsideToArrow = (annotation)=>{
496
+ let includeStart = false;
497
+ let includeEnd = false;
498
+ const arrowSide = typeof (annotation === null || annotation === void 0 ? void 0 : annotation.arrowside) === 'string' ? annotation === null || annotation === void 0 ? void 0 : annotation.arrowside.toLowerCase() : undefined;
499
+ if (arrowSide) {
500
+ includeStart = arrowSide.includes('start');
501
+ includeEnd = arrowSide.includes('end');
502
+ }
503
+ const endHead = toFiniteNumber(annotation === null || annotation === void 0 ? void 0 : annotation.arrowhead);
504
+ const startHead = toFiniteNumber(annotation.startarrowhead);
505
+ if (endHead !== undefined && endHead > 0) {
506
+ includeEnd = true;
507
+ }
508
+ if (startHead !== undefined && startHead > 0) {
509
+ includeStart = true;
510
+ }
511
+ if (includeStart && includeEnd) {
512
+ return 'both';
513
+ }
514
+ if (includeStart) {
515
+ return 'start';
516
+ }
517
+ if (includeEnd) {
518
+ return 'end';
519
+ }
520
+ return 'none';
521
+ };
522
+ const mapArrowDashToPattern = (value)=>{
523
+ if (!value) {
524
+ return undefined;
525
+ }
526
+ const normalized = value.trim().toLowerCase();
527
+ switch(normalized){
528
+ case 'solid':
529
+ return undefined;
530
+ case 'dot':
531
+ return '1, 5';
532
+ case 'dash':
533
+ return '5, 5';
534
+ case 'longdash':
535
+ return '10, 5';
536
+ case 'dashdot':
537
+ return '5, 5, 1, 5';
538
+ case 'longdashdot':
539
+ return '10, 5, 1, 5';
540
+ default:
541
+ if (/^\d+(\s|,)*\d*$/.test(normalized.replace(/\s+/g, ' '))) {
542
+ return normalized.replace(/\s+/g, ' ');
543
+ }
544
+ return value;
545
+ }
546
+ };
547
+ /**
548
+ * Converts a Plotly annotation definition into the internal `ChartAnnotation` format, translating coordinates,
549
+ * layout alignment, styling, and connector metadata while skipping unsupported configurations.
550
+ */ const convertPlotlyAnnotation = (annotation, layout, data, index)=>{
551
+ if (!annotation || annotation.visible === false) {
552
+ return undefined;
553
+ }
554
+ const xRefType = resolveRefType(annotation.xref, 'x');
555
+ const yRefType = resolveRefType(annotation.yref, 'y');
556
+ if (!xRefType || !yRefType) {
557
+ return undefined;
558
+ }
559
+ let coordinates;
560
+ if (xRefType === 'axis' && yRefType === 'axis') {
561
+ const xAxisLayout = getAxisLayoutByRef(layout, annotation.xref, 'x');
562
+ const yAxisLayout = getAxisLayoutByRef(layout, annotation.yref, 'y');
563
+ const xValue = convertDataValue(annotation.x, xAxisLayout);
564
+ const yValue = convertDataValue(annotation.y, yAxisLayout);
565
+ if (xValue === undefined || yValue === undefined) {
566
+ return undefined;
567
+ }
568
+ const yRefNormalized = typeof annotation.yref === 'string' ? annotation.yref.toLowerCase() : undefined;
569
+ coordinates = {
570
+ type: 'data',
571
+ x: xValue,
572
+ y: yValue,
573
+ ...yRefNormalized === 'y2' ? {
574
+ yAxis: 'secondary'
575
+ } : {}
576
+ };
577
+ } else if (xRefType === 'relative' && yRefType === 'relative') {
578
+ const xValue = toFiniteNumber(annotation.x);
579
+ const yValue = toFiniteNumber(annotation.y);
580
+ const chartRelativeY = transformRelativeYForChart(yValue);
581
+ if (xValue === undefined || chartRelativeY === undefined) {
582
+ return undefined;
583
+ }
584
+ coordinates = {
585
+ type: 'relative',
586
+ x: xValue,
587
+ y: chartRelativeY
588
+ };
589
+ } else if (xRefType === 'relative' && yRefType === 'axis') {
590
+ const xValue = toFiniteNumber(annotation.x);
591
+ const yAxisLayout = getAxisLayoutByRef(layout, annotation.yref, 'y');
592
+ const yFallbackRange = getAxisNumericRangeFromData('y', annotation.yref, layout, data);
593
+ const yRelative = toRelativeCoordinate(annotation.y, yAxisLayout, yFallbackRange);
594
+ const chartRelativeY = transformRelativeYForChart(yRelative);
595
+ if (xValue === undefined || chartRelativeY === undefined) {
596
+ return undefined;
597
+ }
598
+ coordinates = {
599
+ type: 'relative',
600
+ x: xValue,
601
+ y: chartRelativeY
602
+ };
603
+ } else if (xRefType === 'axis' && yRefType === 'relative') {
604
+ const yValue = toFiniteNumber(annotation.y);
605
+ const xAxisLayout = getAxisLayoutByRef(layout, annotation.xref, 'x');
606
+ const xFallbackRange = getAxisNumericRangeFromData('x', annotation.xref, layout, data);
607
+ const xRelative = toRelativeCoordinate(annotation.x, xAxisLayout, xFallbackRange);
608
+ const chartRelativeY = transformRelativeYForChart(yValue);
609
+ if (xRelative === undefined || chartRelativeY === undefined) {
610
+ return undefined;
611
+ }
612
+ coordinates = {
613
+ type: 'relative',
614
+ x: xRelative,
615
+ y: chartRelativeY
616
+ };
617
+ } else if (xRefType === 'pixel' && yRefType === 'pixel') {
618
+ const xValue = toFiniteNumber(annotation.x);
619
+ const yValue = toFiniteNumber(annotation.y);
620
+ if (xValue === undefined || yValue === undefined) {
621
+ return undefined;
622
+ }
623
+ coordinates = {
624
+ type: 'pixel',
625
+ x: xValue,
626
+ y: yValue
627
+ };
628
+ } else {
629
+ return undefined;
630
+ }
631
+ const textValue = annotation.text;
632
+ const rawText = textValue === undefined || textValue === null ? '' : String(textValue);
633
+ const encodedText = encodeHtmlEntities(rawText);
634
+ const chartAnnotation = {
635
+ id: createAnnotationId(encodedText, index),
636
+ text: encodedText,
637
+ coordinates
638
+ };
639
+ const layoutProps = {};
640
+ const styleProps = {};
641
+ const showArrow = annotation.showarrow === undefined ? false : !!annotation.showarrow;
642
+ const clipOnAxis = annotation.cliponaxis;
643
+ if (clipOnAxis !== undefined) {
644
+ layoutProps.clipToBounds = !!clipOnAxis;
645
+ } else if (coordinates.type === 'data') {
646
+ layoutProps.clipToBounds = true;
647
+ }
648
+ const horizontalAlign = mapHorizontalAlign(annotation.xanchor);
649
+ if (horizontalAlign) {
650
+ layoutProps.align = horizontalAlign;
651
+ }
652
+ if (!layoutProps.align) {
653
+ const alignProp = mapHorizontalAlign(annotation.align);
654
+ if (alignProp) {
655
+ layoutProps.align = alignProp;
656
+ }
657
+ }
658
+ const verticalAlign = mapVerticalAlign(annotation.yanchor);
659
+ if (verticalAlign) {
660
+ layoutProps.verticalAlign = verticalAlign;
661
+ }
662
+ if (!layoutProps.verticalAlign) {
663
+ const valignProp = mapVerticalAlign(annotation.valign);
664
+ if (valignProp) {
665
+ layoutProps.verticalAlign = valignProp;
666
+ }
667
+ }
668
+ const offsetXComponents = [];
669
+ let hasExplicitOffset = false;
670
+ const ax = toFiniteNumber(annotation.ax);
671
+ const axRef = typeof annotation.axref === 'string' ? annotation.axref.toLowerCase() : undefined;
672
+ if (ax !== undefined && (axRef === undefined || axRef === 'pixel')) {
673
+ offsetXComponents.push(ax);
674
+ hasExplicitOffset = true;
675
+ }
676
+ const xShift = toFiniteNumber(annotation.xshift);
677
+ if (xShift !== undefined) {
678
+ offsetXComponents.push(xShift);
679
+ hasExplicitOffset = true;
680
+ }
681
+ if (offsetXComponents.length > 0) {
682
+ const offsetX = offsetXComponents.reduce((sum, value)=>sum + value, 0);
683
+ if (offsetX !== 0) {
684
+ layoutProps.offsetX = offsetX;
685
+ }
686
+ }
687
+ const offsetYComponents = [];
688
+ const ay = toFiniteNumber(annotation.ay);
689
+ const ayRef = typeof annotation.ayref === 'string' ? annotation.ayref.toLowerCase() : undefined;
690
+ if (ay !== undefined && (ayRef === undefined || ayRef === 'pixel')) {
691
+ offsetYComponents.push(ay);
692
+ hasExplicitOffset = true;
693
+ }
694
+ const yShift = toFiniteNumber(annotation.yshift);
695
+ if (yShift !== undefined) {
696
+ offsetYComponents.push(yShift);
697
+ hasExplicitOffset = true;
698
+ }
699
+ if (offsetYComponents.length > 0) {
700
+ const offsetY = offsetYComponents.reduce((sum, value)=>sum + value, 0);
701
+ if (offsetY !== 0) {
702
+ layoutProps.offsetY = offsetY;
703
+ }
704
+ }
705
+ if (showArrow && !hasExplicitOffset && layoutProps.offsetY === undefined) {
706
+ layoutProps.offsetY = DEFAULT_ARROW_OFFSET;
707
+ }
708
+ const maxWidth = toFiniteNumber(annotation.width);
709
+ if (maxWidth !== undefined) {
710
+ layoutProps.maxWidth = maxWidth;
711
+ }
712
+ if (annotation.bgcolor) {
713
+ styleProps.backgroundColor = annotation.bgcolor;
714
+ }
715
+ if (annotation.bordercolor) {
716
+ styleProps.borderColor = annotation.bordercolor;
717
+ }
718
+ const borderWidth = toFiniteNumber(annotation.borderwidth);
719
+ if (borderWidth !== undefined) {
720
+ styleProps.borderWidth = borderWidth;
721
+ }
722
+ const borderPad = appendPx(annotation.borderpad);
723
+ if (borderPad) {
724
+ styleProps.padding = borderPad;
725
+ }
726
+ const opacity = toFiniteNumber(annotation.opacity);
727
+ if (opacity !== undefined) {
728
+ styleProps.opacity = opacity;
729
+ }
730
+ if (annotation.font) {
731
+ const font = annotation.font;
732
+ if (font === null || font === void 0 ? void 0 : font.color) {
733
+ styleProps.textColor = font.color;
734
+ }
735
+ const fontSize = appendPx(font === null || font === void 0 ? void 0 : font.size);
736
+ if (fontSize) {
737
+ styleProps.fontSize = fontSize;
738
+ }
739
+ if (font === null || font === void 0 ? void 0 : font.weight) {
740
+ styleProps.fontWeight = font.weight;
741
+ }
742
+ }
743
+ const textAngle = annotation === null || annotation === void 0 ? void 0 : annotation.textangle;
744
+ if (typeof textAngle === 'number' && !Number.isNaN(textAngle)) {
745
+ styleProps.rotation = textAngle;
746
+ } else if (typeof textAngle === 'string' && textAngle.toLowerCase() !== 'auto') {
747
+ const parsedAngle = Number(textAngle);
748
+ if (!Number.isNaN(parsedAngle)) {
749
+ styleProps.rotation = parsedAngle;
750
+ }
751
+ }
752
+ if (Object.keys(layoutProps).length > 0) {
753
+ chartAnnotation.layout = layoutProps;
754
+ }
755
+ if (Object.keys(styleProps).length > 0) {
756
+ chartAnnotation.style = styleProps;
757
+ }
758
+ if (showArrow) {
759
+ var _annotation_arrowcolor;
760
+ const arrowColor = (_annotation_arrowcolor = annotation.arrowcolor) !== null && _annotation_arrowcolor !== void 0 ? _annotation_arrowcolor : styleProps.textColor;
761
+ const arrowWidth = toFiniteNumber(annotation.arrowwidth);
762
+ const endPadding = toFiniteNumber(annotation.standoff);
763
+ const startPadding = toFiniteNumber(annotation.startstandoff);
764
+ const dashPattern = mapArrowDashToPattern(annotation.arrowdash);
765
+ chartAnnotation.connector = {
766
+ ...arrowColor ? {
767
+ strokeColor: arrowColor
768
+ } : {},
769
+ ...arrowWidth !== undefined ? {
770
+ strokeWidth: arrowWidth
771
+ } : {},
772
+ ...endPadding !== undefined ? {
773
+ endPadding: Math.max(endPadding, 0)
774
+ } : {},
775
+ ...startPadding !== undefined ? {
776
+ startPadding: Math.max(startPadding, 0)
777
+ } : {},
778
+ ...dashPattern ? {
779
+ dashArray: dashPattern
780
+ } : {},
781
+ arrow: mapArrowsideToArrow(annotation)
782
+ };
783
+ }
784
+ return chartAnnotation;
785
+ };
786
+ const getChartAnnotationsFromLayout = (layout, data, isMultiPlot)=>{
787
+ if (isMultiPlot || !(layout === null || layout === void 0 ? void 0 : layout.annotations)) {
788
+ return undefined;
789
+ }
790
+ const annotationsArray = Array.isArray(layout.annotations) ? layout.annotations : [
791
+ layout.annotations
792
+ ];
793
+ const converted = annotationsArray.map((annotation, index)=>convertPlotlyAnnotation(annotation, layout, data, index)).filter((annotation)=>annotation !== undefined);
794
+ return converted.length > 0 ? converted : undefined;
795
+ };
247
796
  /**
248
797
  * Normalizes an array of objects by flattening nested structures and creating grouped data
249
798
  * Uses json_normalize approach with D3 color detection and filtering
@@ -320,8 +869,35 @@ export const resolveXAxisPoint = (x, isXYearCategory, isXString, isXDate, isXNum
320
869
  x
321
870
  };
322
871
  };
323
- export const transformPlotlyJsonToDonutProps = (input, isMultiPlot, // eslint-disable-next-line @typescript-eslint/no-deprecated
324
- colorMap, colorwayType, isDarkTheme)=>{
872
+ export const transformPlotlyJsonToAnnotationChartProps = (input, isMultiPlot, _colorMap, _colorwayType, _isDarkTheme)=>{
873
+ var _layoutWithMeta_meta, _input_layout, _input_layout1, _input_layout2, _input_layout3, _input_layout_font, _input_layout4, _input_layout_font1, _input_layout5, _input_layout6;
874
+ var _getChartAnnotationsFromLayout;
875
+ const annotations = (_getChartAnnotationsFromLayout = getChartAnnotationsFromLayout(input.layout, input.data, isMultiPlot)) !== null && _getChartAnnotationsFromLayout !== void 0 ? _getChartAnnotationsFromLayout : [];
876
+ const titles = getTitles(input.layout);
877
+ const layoutTitle = titles.chartTitle || undefined;
878
+ const layoutWithMeta = input.layout;
879
+ const description = typeof (layoutWithMeta === null || layoutWithMeta === void 0 ? void 0 : (_layoutWithMeta_meta = layoutWithMeta.meta) === null || _layoutWithMeta_meta === void 0 ? void 0 : _layoutWithMeta_meta.description) === 'string' ? layoutWithMeta.meta.description : undefined;
880
+ const width = typeof ((_input_layout = input.layout) === null || _input_layout === void 0 ? void 0 : _input_layout.width) === 'number' ? input.layout.width : undefined;
881
+ const height = typeof ((_input_layout1 = input.layout) === null || _input_layout1 === void 0 ? void 0 : _input_layout1.height) === 'number' ? input.layout.height : undefined;
882
+ const paperBackgroundColor = typeof ((_input_layout2 = input.layout) === null || _input_layout2 === void 0 ? void 0 : _input_layout2.paper_bgcolor) === 'string' ? input.layout.paper_bgcolor : undefined;
883
+ const plotBackgroundColor = typeof ((_input_layout3 = input.layout) === null || _input_layout3 === void 0 ? void 0 : _input_layout3.plot_bgcolor) === 'string' ? input.layout.plot_bgcolor : undefined;
884
+ const fontColor = typeof ((_input_layout4 = input.layout) === null || _input_layout4 === void 0 ? void 0 : (_input_layout_font = _input_layout4.font) === null || _input_layout_font === void 0 ? void 0 : _input_layout_font.color) === 'string' ? input.layout.font.color : undefined;
885
+ const fontFamily = typeof ((_input_layout5 = input.layout) === null || _input_layout5 === void 0 ? void 0 : (_input_layout_font1 = _input_layout5.font) === null || _input_layout_font1 === void 0 ? void 0 : _input_layout_font1.family) === 'string' ? input.layout.font.family : undefined;
886
+ const margin = (_input_layout6 = input.layout) === null || _input_layout6 === void 0 ? void 0 : _input_layout6.margin;
887
+ return {
888
+ annotations,
889
+ chartTitle: layoutTitle,
890
+ description,
891
+ width,
892
+ height,
893
+ paperBackgroundColor,
894
+ plotBackgroundColor,
895
+ fontColor,
896
+ fontFamily,
897
+ margin
898
+ };
899
+ };
900
+ export const transformPlotlyJsonToDonutProps = (input, isMultiPlot, colorMap, colorwayType, isDarkTheme)=>{
325
901
  var _input_layout, _input_layout_template_layout, _input_layout_template, _input_layout1, _input_layout2, _firstData_marker, _input_layout3, _input_layout4, _input_layout5, _input_layout6;
326
902
  const firstData = input.data[0];
327
903
  var _input_layout_piecolorway, _input_layout_piecolorway1;
@@ -410,8 +986,7 @@ colorMap, colorwayType, isDarkTheme)=>{
410
986
  order: 'sorted'
411
987
  };
412
988
  };
413
- export const transformPlotlyJsonToVSBCProps = (input, isMultiPlot, // eslint-disable-next-line @typescript-eslint/no-deprecated
414
- colorMap, colorwayType, isDarkTheme, fallbackVSBC)=>{
989
+ export const transformPlotlyJsonToVSBCProps = (input, isMultiPlot, colorMap, colorwayType, isDarkTheme, fallbackVSBC)=>{
415
990
  var _input_layout, _input_layout1, _input_layout2, _vsbcData_;
416
991
  const mapXToDataPoints = {};
417
992
  let yMaxValue = 0;
@@ -489,19 +1064,7 @@ colorMap, colorwayType, isDarkTheme, fallbackVSBC)=>{
489
1064
  });
490
1065
  });
491
1066
  });
492
- var _input_data;
493
- const xCategories = Array.from(new Set(((_input_data = input.data) !== null && _input_data !== void 0 ? _input_data : []).flatMap((trace)=>{
494
- const xData = trace.x;
495
- if (!xData) {
496
- return [];
497
- }
498
- if (Array.isArray(xData)) {
499
- return xData.flat().map((x)=>{
500
- return x;
501
- });
502
- }
503
- return [];
504
- }).filter((x)=>x !== undefined && x !== null)));
1067
+ const xCategories = extractXCategories(input.data);
505
1068
  var _input_layout_shapes;
506
1069
  ((_input_layout_shapes = (_input_layout = input.layout) === null || _input_layout === void 0 ? void 0 : _input_layout.shapes) !== null && _input_layout_shapes !== void 0 ? _input_layout_shapes : []).filter((shape)=>shape.type === 'line').forEach((shape, shapeIdx)=>{
507
1070
  var _shape_line;
@@ -543,24 +1106,29 @@ colorMap, colorwayType, isDarkTheme, fallbackVSBC)=>{
543
1106
  };
544
1107
  const y0Val = resolveY(shape.y0);
545
1108
  const y1Val = resolveY(shape.y1);
546
- var _rgb_formatHex8;
547
- mapXToDataPoints[x0Key].lineData.push({
548
- legend: `Reference_${shapeIdx}`,
549
- y: y0Val,
550
- color: (_rgb_formatHex8 = rgb(lineColor).formatHex8()) !== null && _rgb_formatHex8 !== void 0 ? _rgb_formatHex8 : lineColor,
551
- lineOptions: getLineOptions(shape.line),
552
- useSecondaryYScale: false
553
- });
554
- var _rgb_formatHex81;
555
- mapXToDataPoints[x1Key].lineData.push({
556
- legend: `Reference_${shapeIdx}`,
557
- y: y1Val,
558
- color: (_rgb_formatHex81 = rgb(lineColor).formatHex8()) !== null && _rgb_formatHex81 !== void 0 ? _rgb_formatHex81 : lineColor,
559
- lineOptions: getLineOptions(shape.line),
560
- useSecondaryYScale: false
561
- });
1109
+ if (mapXToDataPoints[x0Key]) {
1110
+ var _rgb_formatHex8;
1111
+ mapXToDataPoints[x0Key].lineData.push({
1112
+ legend: `Reference_${shapeIdx}`,
1113
+ y: y0Val,
1114
+ color: (_rgb_formatHex8 = rgb(lineColor).formatHex8()) !== null && _rgb_formatHex8 !== void 0 ? _rgb_formatHex8 : lineColor,
1115
+ lineOptions: getLineOptions(shape.line),
1116
+ useSecondaryYScale: false
1117
+ });
1118
+ }
1119
+ if (mapXToDataPoints[x1Key]) {
1120
+ var _rgb_formatHex81;
1121
+ mapXToDataPoints[x1Key].lineData.push({
1122
+ legend: `Reference_${shapeIdx}`,
1123
+ y: y1Val,
1124
+ color: (_rgb_formatHex81 = rgb(lineColor).formatHex8()) !== null && _rgb_formatHex81 !== void 0 ? _rgb_formatHex81 : lineColor,
1125
+ lineOptions: getLineOptions(shape.line),
1126
+ useSecondaryYScale: false
1127
+ });
1128
+ }
562
1129
  });
563
1130
  const vsbcData = Object.values(mapXToDataPoints);
1131
+ const annotations = getChartAnnotationsFromLayout(input.layout, input.data, isMultiPlot);
564
1132
  var _input_layout_height;
565
1133
  return {
566
1134
  data: vsbcData,
@@ -579,17 +1147,21 @@ colorMap, colorwayType, isDarkTheme, fallbackVSBC)=>{
579
1147
  showYAxisLables: true,
580
1148
  noOfCharsToTruncate: 20,
581
1149
  showYAxisLablesTooltip: true,
1150
+ roundedTicks: true,
1151
+ ...getXMinMaxValues(input.data[0], input.layout),
582
1152
  ...getTitles(input.layout),
583
1153
  ...getXAxisTickFormat(input.data[0], input.layout),
584
1154
  ...yAxisTickFormat,
585
1155
  ...getAxisCategoryOrderProps(input.data, input.layout),
586
1156
  ...getBarProps(input.data, input.layout),
587
1157
  ...getYMinMaxValues(input.data[0], input.layout),
588
- ...getAxisTickProps(input.data, input.layout)
1158
+ ...getAxisTickProps(input.data, input.layout),
1159
+ ...annotations ? {
1160
+ annotations
1161
+ } : {}
589
1162
  };
590
1163
  };
591
- export const transformPlotlyJsonToGVBCProps = (input, isMultiPlot, // eslint-disable-next-line @typescript-eslint/no-deprecated
592
- colorMap, colorwayType, isDarkTheme)=>{
1164
+ export const transformPlotlyJsonToGVBCProps = (input, isMultiPlot, colorMap, colorwayType, isDarkTheme)=>{
593
1165
  var _processedInput_layout, _processedInput_layout1;
594
1166
  // Handle object arrays in y values by normalizing the data first
595
1167
  let processedInput = {
@@ -693,6 +1265,7 @@ colorMap, colorwayType, isDarkTheme)=>{
693
1265
  });
694
1266
  }
695
1267
  });
1268
+ const annotations = getChartAnnotationsFromLayout(processedInput.layout, processedInput.data, isMultiPlot);
696
1269
  var _processedInput_layout_height;
697
1270
  return {
698
1271
  dataV2: gvbcDataV2,
@@ -705,17 +1278,22 @@ colorMap, colorwayType, isDarkTheme)=>{
705
1278
  wrapXAxisLables: true,
706
1279
  hideLegend,
707
1280
  roundCorners: true,
1281
+ showYAxisLables: true,
1282
+ roundedTicks: true,
1283
+ ...getXMinMaxValues(processedInput.data[0], processedInput.layout),
708
1284
  ...getTitles(processedInput.layout),
709
1285
  ...getAxisCategoryOrderProps(processedInput.data, processedInput.layout),
710
1286
  ...getYMinMaxValues(processedInput.data[0], processedInput.layout),
711
1287
  ...getXAxisTickFormat(processedInput.data[0], processedInput.layout),
712
1288
  ...yAxisTickFormat,
713
1289
  ...getBarProps(processedInput.data, processedInput.layout),
714
- ...getAxisTickProps(processedInput.data, processedInput.layout)
1290
+ ...getAxisTickProps(processedInput.data, processedInput.layout),
1291
+ ...annotations ? {
1292
+ annotations
1293
+ } : {}
715
1294
  };
716
1295
  };
717
- export const transformPlotlyJsonToVBCProps = (input, isMultiPlot, // eslint-disable-next-line @typescript-eslint/no-deprecated
718
- colorMap, colorwayType, isDarkTheme)=>{
1296
+ export const transformPlotlyJsonToVBCProps = (input, isMultiPlot, colorMap, colorwayType, isDarkTheme)=>{
719
1297
  var _input_layout, _input_layout1, _vbcData_;
720
1298
  const vbcData = [];
721
1299
  const { legends, hideLegend } = getLegendProps(input.data, input.layout, isMultiPlot);
@@ -777,6 +1355,7 @@ colorMap, colorwayType, isDarkTheme)=>{
777
1355
  });
778
1356
  });
779
1357
  });
1358
+ const annotations = getChartAnnotationsFromLayout(input.layout, input.data, isMultiPlot);
780
1359
  var _input_layout_height;
781
1360
  return {
782
1361
  data: vbcData,
@@ -788,21 +1367,24 @@ colorMap, colorwayType, isDarkTheme)=>{
788
1367
  maxBarWidth: 50,
789
1368
  hideLegend,
790
1369
  roundCorners: true,
1370
+ showYAxisLables: true,
1371
+ roundedTicks: true,
1372
+ ...getXMinMaxValues(input.data[0], input.layout),
791
1373
  ...getTitles(input.layout),
792
1374
  ...getYMinMaxValues(input.data[0], input.layout),
793
- ...getAxisCategoryOrderProps(input.data, input.layout)
1375
+ ...getAxisCategoryOrderProps(input.data, input.layout),
1376
+ ...annotations ? {
1377
+ annotations
1378
+ } : {}
794
1379
  };
795
1380
  };
796
- export const transformPlotlyJsonToAreaChartProps = (input, isMultiPlot, // eslint-disable-next-line @typescript-eslint/no-deprecated
797
- colorMap, colorwayType, isDarkTheme)=>{
1381
+ export const transformPlotlyJsonToAreaChartProps = (input, isMultiPlot, colorMap, colorwayType, isDarkTheme)=>{
798
1382
  return transformPlotlyJsonToScatterTraceProps(input, isMultiPlot, 'area', colorMap, colorwayType, isDarkTheme);
799
1383
  };
800
- export const transformPlotlyJsonToLineChartProps = (input, isMultiPlot, // eslint-disable-next-line @typescript-eslint/no-deprecated
801
- colorMap, colorwayType, isDarkTheme)=>{
1384
+ export const transformPlotlyJsonToLineChartProps = (input, isMultiPlot, colorMap, colorwayType, isDarkTheme)=>{
802
1385
  return transformPlotlyJsonToScatterTraceProps(input, isMultiPlot, 'line', colorMap, colorwayType, isDarkTheme);
803
1386
  };
804
- export const transformPlotlyJsonToScatterChartProps = (input, isMultiPlot, // eslint-disable-next-line @typescript-eslint/no-deprecated
805
- colorMap, colorwayType, isDarkTheme)=>{
1387
+ export const transformPlotlyJsonToScatterChartProps = (input, isMultiPlot, colorMap, colorwayType, isDarkTheme)=>{
806
1388
  return transformPlotlyJsonToScatterTraceProps(input, isMultiPlot, 'scatter', colorMap, colorwayType, isDarkTheme);
807
1389
  };
808
1390
  const mapColorFillBars = (layout)=>{
@@ -826,8 +1408,7 @@ const mapColorFillBars = (layout)=>{
826
1408
  };
827
1409
  });
828
1410
  };
829
- const transformPlotlyJsonToScatterTraceProps = (input, isMultiPlot, chartType, // eslint-disable-next-line @typescript-eslint/no-deprecated
830
- colorMap, colorwayType, isDarkTheme)=>{
1411
+ const transformPlotlyJsonToScatterTraceProps = (input, isMultiPlot, chartType, colorMap, colorwayType, isDarkTheme)=>{
831
1412
  var _input_data_, _chartData__data_, _chartData_, _chartData__data_1, _chartData_1, _chartData__data_2, _chartData_2, _chartData__data_3, _chartData_3, _input_layout, _input_layout1, _input_layout2;
832
1413
  const isScatterMarkers = [
833
1414
  'text',
@@ -917,11 +1498,19 @@ colorMap, colorwayType, isDarkTheme)=>{
917
1498
  const xMaxValue = (_chartData_1 = chartData[0]) === null || _chartData_1 === void 0 ? void 0 : (_chartData__data_1 = _chartData_1.data[chartData[0].data.length - 1]) === null || _chartData__data_1 === void 0 ? void 0 : _chartData__data_1.x;
918
1499
  const yMinValue = (_chartData_2 = chartData[0]) === null || _chartData_2 === void 0 ? void 0 : (_chartData__data_2 = _chartData_2.data[0]) === null || _chartData__data_2 === void 0 ? void 0 : _chartData__data_2.y;
919
1500
  const yMaxValue = (_chartData_3 = chartData[0]) === null || _chartData_3 === void 0 ? void 0 : (_chartData__data_3 = _chartData_3.data[chartData[0].data.length - 1]) === null || _chartData__data_3 === void 0 ? void 0 : _chartData__data_3.y;
1501
+ const xCategories = extractXCategories(input.data);
920
1502
  var _input_layout_shapes;
921
1503
  const lineShape = ((_input_layout_shapes = (_input_layout = input.layout) === null || _input_layout === void 0 ? void 0 : _input_layout.shapes) !== null && _input_layout_shapes !== void 0 ? _input_layout_shapes : []).filter((shape)=>shape.type === 'line').map((shape, shapeIdx)=>{
922
1504
  var _shape_line;
923
1505
  const lineColor = (_shape_line = shape.line) === null || _shape_line === void 0 ? void 0 : _shape_line.color;
924
1506
  const resolveX = (val)=>{
1507
+ if (typeof val === 'number' && Array.isArray(xCategories)) {
1508
+ if (xCategories[val] !== undefined) {
1509
+ return xCategories[val];
1510
+ } else {
1511
+ return xCategories[shapeIdx];
1512
+ }
1513
+ }
925
1514
  if (shape.xref === 'paper') {
926
1515
  if (val === 0) {
927
1516
  return xMinValue;
@@ -956,11 +1545,11 @@ colorMap, colorwayType, isDarkTheme)=>{
956
1545
  legend: `Reference_${shapeIdx}`,
957
1546
  data: [
958
1547
  {
959
- x: resolveX(shape.x0),
1548
+ x: resolveXValue(resolveX(shape.x0)),
960
1549
  y: resolveY(shape.y0)
961
1550
  },
962
1551
  {
963
- x: resolveX(shape.x1),
1552
+ x: resolveXValue(resolveX(shape.x1)),
964
1553
  y: resolveY(shape.y1)
965
1554
  }
966
1555
  ],
@@ -983,8 +1572,12 @@ colorMap, colorwayType, isDarkTheme)=>{
983
1572
  ]
984
1573
  };
985
1574
  const scatterChartProps = {
986
- scatterChartData: chartData
1575
+ scatterChartData: [
1576
+ ...chartData,
1577
+ ...lineShape
1578
+ ]
987
1579
  };
1580
+ const annotations = getChartAnnotationsFromLayout(input.layout, input.data, isMultiPlot);
988
1581
  var _input_layout_height;
989
1582
  const commonProps = {
990
1583
  supportNegativeData: true,
@@ -994,13 +1587,19 @@ colorMap, colorwayType, isDarkTheme)=>{
994
1587
  hideTickOverlap: true,
995
1588
  hideLegend,
996
1589
  useUTC: false,
997
- wrapXAxisLables: shouldWrapLabels,
1590
+ wrapXAxisLabels: shouldWrapLabels,
998
1591
  optimizeLargeData: numDataPoints > 1000,
1592
+ showYAxisLables: true,
1593
+ roundedTicks: true,
1594
+ ...getXMinMaxValues(input.data[0], input.layout),
999
1595
  ...getTitles(input.layout),
1000
1596
  ...getXAxisTickFormat(input.data[0], input.layout),
1001
1597
  ...yAxisTickFormat,
1002
1598
  ...getAxisScaleTypeProps(input.data, input.layout),
1003
- ...getAxisTickProps(input.data, input.layout)
1599
+ ...getAxisTickProps(input.data, input.layout),
1600
+ ...annotations ? {
1601
+ annotations
1602
+ } : {}
1004
1603
  };
1005
1604
  if (isAreaChart) {
1006
1605
  return {
@@ -1011,7 +1610,6 @@ colorMap, colorwayType, isDarkTheme)=>{
1011
1610
  } else {
1012
1611
  return {
1013
1612
  data: isScatterChart ? scatterChartProps : chartProps,
1014
- roundedTicks: true,
1015
1613
  ...commonProps,
1016
1614
  ...yMinMax,
1017
1615
  ...isScatterChart ? {
@@ -1027,8 +1625,7 @@ colorMap, colorwayType, isDarkTheme)=>{
1027
1625
  };
1028
1626
  }
1029
1627
  };
1030
- export const transformPlotlyJsonToHorizontalBarWithAxisProps = (input, isMultiPlot, // eslint-disable-next-line @typescript-eslint/no-deprecated
1031
- colorMap, colorwayType, isDarkTheme)=>{
1628
+ export const transformPlotlyJsonToHorizontalBarWithAxisProps = (input, isMultiPlot, colorMap, colorwayType, isDarkTheme)=>{
1032
1629
  var _input_layout, _input_layout_margin, _input_layout1, _input_layout_margin1, _input_layout2, _input_layout_yaxis2, _input_layout3, _input_layout_yaxis21, _input_layout4, _input_layout_yaxis2_title, _input_layout_yaxis22, _input_layout5, _input_layout6;
1033
1630
  const { legends, hideLegend } = getLegendProps(input.data, input.layout, isMultiPlot);
1034
1631
  let colorScale = undefined;
@@ -1080,14 +1677,15 @@ colorMap, colorwayType, isDarkTheme)=>{
1080
1677
  showYAxisLablesTooltip: true,
1081
1678
  hideLegend,
1082
1679
  roundCorners: true,
1680
+ roundedTicks: true,
1681
+ ...getXMinMaxValues(input.data[0], input.layout),
1083
1682
  ...getTitles(input.layout),
1084
1683
  ...getAxisCategoryOrderProps(input.data, input.layout),
1085
1684
  ...getBarProps(input.data, input.layout, true),
1086
1685
  ...getAxisTickProps(input.data, input.layout)
1087
1686
  };
1088
1687
  };
1089
- export const transformPlotlyJsonToGanttChartProps = (input, isMultiPlot, // eslint-disable-next-line @typescript-eslint/no-deprecated
1090
- colorMap, colorwayType, isDarkTheme)=>{
1688
+ export const transformPlotlyJsonToGanttChartProps = (input, isMultiPlot, colorMap, colorwayType, isDarkTheme)=>{
1091
1689
  var _input_layout, _input_layout1;
1092
1690
  const data = input.data.filter((series)=>series.type !== 'scatter' || series.mode !== 'markers');
1093
1691
  const { legends, hideLegend } = getLegendProps(data, input.layout, isMultiPlot);
@@ -1169,8 +1767,7 @@ colorMap, colorwayType, isDarkTheme)=>{
1169
1767
  ...getAxisTickProps(data, input.layout)
1170
1768
  };
1171
1769
  };
1172
- export const transformPlotlyJsonToHeatmapProps = (input, isMultiPlot, // eslint-disable-next-line @typescript-eslint/no-deprecated
1173
- colorMap, colorwayType, isDarkTheme)=>{
1770
+ export const transformPlotlyJsonToHeatmapProps = (input, isMultiPlot, colorMap, colorwayType, isDarkTheme)=>{
1174
1771
  var _input_layout, _input_layout_coloraxis, _input_layout1, _input_layout_template_layout, _input_layout_template, _input_layout2, _input_layout_template_data_histogram2d_, _input_layout_template_data_histogram2d, _input_layout_template_data, _input_layout_template1, _input_layout3, _input_layout_template_data_heatmap_, _input_layout_template_data_heatmap, _input_layout_template_data1, _input_layout_template2, _input_layout4, _input_layout5, _input_layout6;
1175
1772
  const firstData = input.data[0];
1176
1773
  const heatmapDataPoints = [];
@@ -1305,9 +1902,8 @@ colorMap, colorwayType, isDarkTheme)=>{
1305
1902
  ...getAxisTickProps(input.data, input.layout)
1306
1903
  };
1307
1904
  };
1308
- export const transformPlotlyJsonToSankeyProps = (input, isMultiPlot, // eslint-disable-next-line @typescript-eslint/no-deprecated
1309
- colorMap, colorwayType, isDarkTheme)=>{
1310
- var _input_layout_template_layout, _input_layout_template, _input_layout, _node_label, _input_layout1, _input_layout2;
1905
+ export const transformPlotlyJsonToSankeyProps = (input, isMultiPlot, colorMap, colorwayType, isDarkTheme)=>{
1906
+ var _input_layout_template_layout, _input_layout_template, _input_layout, _input_layout_template_layout1, _input_layout_template1, _input_layout1, _node_label, _input_layout2, _input_layout3;
1311
1907
  const { link, node } = input.data[0];
1312
1908
  var _link_value;
1313
1909
  const validLinks = ((_link_value = link === null || link === void 0 ? void 0 : link.value) !== null && _link_value !== void 0 ? _link_value : []).map((val, index)=>{
@@ -1323,6 +1919,7 @@ colorMap, colorwayType, isDarkTheme)=>{
1323
1919
  })// Filter out negative nodes, unequal nodes and self-references (circular links)
1324
1920
  .filter((x)=>x !== null && x.source >= 0 && x.target >= 0 && x.source !== x.target);
1325
1921
  const extractedNodeColors = extractColor((_input_layout = input.layout) === null || _input_layout === void 0 ? void 0 : (_input_layout_template = _input_layout.template) === null || _input_layout_template === void 0 ? void 0 : (_input_layout_template_layout = _input_layout_template.layout) === null || _input_layout_template_layout === void 0 ? void 0 : _input_layout_template_layout.colorway, colorwayType, node === null || node === void 0 ? void 0 : node.color, colorMap, isDarkTheme);
1922
+ const extractedLinkColors = extractColor((_input_layout1 = input.layout) === null || _input_layout1 === void 0 ? void 0 : (_input_layout_template1 = _input_layout1.template) === null || _input_layout_template1 === void 0 ? void 0 : (_input_layout_template_layout1 = _input_layout_template1.layout) === null || _input_layout_template_layout1 === void 0 ? void 0 : _input_layout_template_layout1.colorway, colorwayType, link === null || link === void 0 ? void 0 : link.color, colorMap, isDarkTheme);
1326
1923
  const sankeyChartData = {
1327
1924
  nodes: (_node_label = node.label) === null || _node_label === void 0 ? void 0 : _node_label.map((label, index)=>{
1328
1925
  var _input_layout_template_layout, _input_layout_template, _input_layout;
@@ -1335,8 +1932,11 @@ colorMap, colorwayType, isDarkTheme)=>{
1335
1932
  }),
1336
1933
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
1337
1934
  links: validLinks.map((validLink, index)=>{
1935
+ var _input_layout_template_layout, _input_layout_template, _input_layout;
1936
+ const color = resolveColor(extractedLinkColors, index, validLink.target, colorMap, (_input_layout = input.layout) === null || _input_layout === void 0 ? void 0 : (_input_layout_template = _input_layout.template) === null || _input_layout_template === void 0 ? void 0 : (_input_layout_template_layout = _input_layout_template.layout) === null || _input_layout_template_layout === void 0 ? void 0 : _input_layout_template_layout.colorway, isDarkTheme);
1338
1937
  return {
1339
- ...validLink
1938
+ ...validLink,
1939
+ color
1340
1940
  };
1341
1941
  })
1342
1942
  };
@@ -1352,12 +1952,11 @@ colorMap, colorwayType, isDarkTheme)=>{
1352
1952
  chartTitle,
1353
1953
  SankeyChartData: sankeyChartData
1354
1954
  },
1355
- width: (_input_layout1 = input.layout) === null || _input_layout1 === void 0 ? void 0 : _input_layout1.width,
1356
- height: (_input_layout_height = (_input_layout2 = input.layout) === null || _input_layout2 === void 0 ? void 0 : _input_layout2.height) !== null && _input_layout_height !== void 0 ? _input_layout_height : 468
1955
+ width: (_input_layout2 = input.layout) === null || _input_layout2 === void 0 ? void 0 : _input_layout2.width,
1956
+ height: (_input_layout_height = (_input_layout3 = input.layout) === null || _input_layout3 === void 0 ? void 0 : _input_layout3.height) !== null && _input_layout_height !== void 0 ? _input_layout_height : 468
1357
1957
  };
1358
1958
  };
1359
- export const transformPlotlyJsonToGaugeProps = (input, isMultiPlot, // eslint-disable-next-line @typescript-eslint/no-deprecated
1360
- colorMap, colorwayType, isDarkTheme)=>{
1959
+ export const transformPlotlyJsonToGaugeProps = (input, isMultiPlot, colorMap, colorwayType, isDarkTheme)=>{
1361
1960
  var _firstData_gauge, _input_layout_template_layout, _input_layout_template, _input_layout, _firstData_gauge_steps, _firstData_gauge1, _firstData_gauge_axis_range, _firstData_gauge_axis, _firstData_gauge2, _input_layout_template_layout1, _input_layout_template1, _input_layout1, _firstData_gauge_axis1, _firstData_gauge3, _firstData_gauge_axis_range1, _firstData_gauge_axis2, _firstData_gauge4, _firstData_delta, _firstData_gauge_axis_range2, _firstData_gauge_axis3, _firstData_gauge5, _firstData_gauge_axis_range3, _firstData_gauge_axis4, _firstData_gauge6, _firstData_gauge_axis_range4, _firstData_gauge_axis5, _firstData_gauge7, _firstData_gauge_axis_range5, _firstData_gauge_axis6, _firstData_gauge8, _input_layout2, _input_layout3, _firstData_gauge_steps1, _firstData_gauge9;
1362
1961
  const firstData = input.data[0];
1363
1962
  const stepsColors = ((_firstData_gauge = firstData.gauge) === null || _firstData_gauge === void 0 ? void 0 : _firstData_gauge.steps) ? firstData.gauge.steps.map((step)=>step.color) : undefined;
@@ -1483,8 +2082,7 @@ function mergeCells(tableCells, templateCells) {
1483
2082
  suffix: (_tableCells_suffix = tableCells === null || tableCells === void 0 ? void 0 : tableCells.suffix) !== null && _tableCells_suffix !== void 0 ? _tableCells_suffix : templateCells === null || templateCells === void 0 ? void 0 : templateCells.suffix
1484
2083
  };
1485
2084
  }
1486
- export const transformPlotlyJsonToChartTableProps = (input, isMultiPlot, // eslint-disable-next-line @typescript-eslint/no-deprecated
1487
- colorMap, colorwayType, isDarkTheme)=>{
2085
+ export const transformPlotlyJsonToChartTableProps = (input, isMultiPlot, colorMap, colorwayType, isDarkTheme)=>{
1488
2086
  var _tableData_cells, _input_layout_template_data_table_, _input_layout_template_data_table, _input_layout_template_data, _input_layout_template, _input_layout, _input_layout_font, _input_layout1, _input_layout_template_data_table_1, _input_layout_template_data_table1, _input_layout_template_data1, _input_layout_template1, _input_layout2, _tableData_header, _input_layout3, _input_layout4;
1489
2087
  const tableData = input.data[0];
1490
2088
  const normalizeHeaders = (values, header)=>{
@@ -1637,8 +2235,7 @@ function getCategoriesAndValues(series) {
1637
2235
  }
1638
2236
  }
1639
2237
  }
1640
- export const transformPlotlyJsonToFunnelChartProps = (input, isMultiPlot, // eslint-disable-next-line @typescript-eslint/no-deprecated
1641
- colorMap, colorwayType, isDarkTheme)=>{
2238
+ export const transformPlotlyJsonToFunnelChartProps = (input, isMultiPlot, colorMap, colorwayType, isDarkTheme)=>{
1642
2239
  var _input_layout, _input_layout1, _input_data_, _input_layout2;
1643
2240
  const funnelData = [];
1644
2241
  // Determine if data is stacked based on multiple series with multiple values per series
@@ -2035,8 +2632,7 @@ const getLegendShape = (series)=>{
2035
2632
  }
2036
2633
  return 'default';
2037
2634
  };
2038
- export const getAllupLegendsProps = (input, // eslint-disable-next-line @typescript-eslint/no-deprecated
2039
- colorMap, colorwayType, traceInfo, isDarkTheme)=>{
2635
+ export const getAllupLegendsProps = (input, colorMap, colorwayType, traceInfo, isDarkTheme)=>{
2040
2636
  const allupLegends = [];
2041
2637
  // reduce on showlegend boolean propperty. reduce should return true if at least one series has showlegend true
2042
2638
  const toShowLegend = input.data.reduce((acc, series)=>{
@@ -2045,23 +2641,25 @@ colorMap, colorwayType, traceInfo, isDarkTheme)=>{
2045
2641
  if (toShowLegend) {
2046
2642
  input.data.forEach((series, index)=>{
2047
2643
  if (traceInfo[index].type === 'donut') {
2048
- var _input_layout, _input_layout_template_layout, _input_layout_template, _input_layout1, _input_layout2, _pieSeries_marker, _pieSeries_labels;
2644
+ var _input_layout, _input_layout_template_layout, _input_layout_template, _input_layout1, _input_layout2, _pieSeries_marker;
2049
2645
  const pieSeries = series;
2050
2646
  var _input_layout_piecolorway, _input_layout_piecolorway1;
2051
2647
  const colors = extractColor((_input_layout_piecolorway = (_input_layout = input.layout) === null || _input_layout === void 0 ? void 0 : _input_layout.piecolorway) !== null && _input_layout_piecolorway !== void 0 ? _input_layout_piecolorway : (_input_layout1 = input.layout) === null || _input_layout1 === void 0 ? void 0 : (_input_layout_template = _input_layout1.template) === null || _input_layout_template === void 0 ? void 0 : (_input_layout_template_layout = _input_layout_template.layout) === null || _input_layout_template_layout === void 0 ? void 0 : _input_layout_template_layout.colorway, colorwayType, (_input_layout_piecolorway1 = (_input_layout2 = input.layout) === null || _input_layout2 === void 0 ? void 0 : _input_layout2.piecolorway) !== null && _input_layout_piecolorway1 !== void 0 ? _input_layout_piecolorway1 : pieSeries === null || pieSeries === void 0 ? void 0 : (_pieSeries_marker = pieSeries.marker) === null || _pieSeries_marker === void 0 ? void 0 : _pieSeries_marker.colors, colorMap, isDarkTheme, true);
2052
- (_pieSeries_labels = pieSeries.labels) === null || _pieSeries_labels === void 0 ? void 0 : _pieSeries_labels.forEach((label, labelIndex)=>{
2053
- var _input_layout, _input_layout_template_layout, _input_layout_template, _input_layout1;
2054
- const legend = `${label}`;
2055
- var _input_layout_piecolorway;
2056
- // resolve color for each legend from the extracted colors
2057
- const color = resolveColor(colors, labelIndex, legend, colorMap, (_input_layout_piecolorway = (_input_layout = input.layout) === null || _input_layout === void 0 ? void 0 : _input_layout.piecolorway) !== null && _input_layout_piecolorway !== void 0 ? _input_layout_piecolorway : (_input_layout1 = input.layout) === null || _input_layout1 === void 0 ? void 0 : (_input_layout_template = _input_layout1.template) === null || _input_layout_template === void 0 ? void 0 : (_input_layout_template_layout = _input_layout_template.layout) === null || _input_layout_template_layout === void 0 ? void 0 : _input_layout_template_layout.colorway, isDarkTheme, true);
2058
- if (legend !== '' && allupLegends.some((group)=>group.title === legend) === false) {
2059
- allupLegends.push({
2060
- title: legend,
2061
- color
2062
- });
2063
- }
2064
- });
2648
+ if (isArrayOrTypedArray(pieSeries.labels)) {
2649
+ pieSeries.labels.forEach((label, labelIndex)=>{
2650
+ var _input_layout, _input_layout_template_layout, _input_layout_template, _input_layout1;
2651
+ const legend = `${label}`;
2652
+ var _input_layout_piecolorway;
2653
+ // resolve color for each legend from the extracted colors
2654
+ const color = resolveColor(colors, labelIndex, legend, colorMap, (_input_layout_piecolorway = (_input_layout = input.layout) === null || _input_layout === void 0 ? void 0 : _input_layout.piecolorway) !== null && _input_layout_piecolorway !== void 0 ? _input_layout_piecolorway : (_input_layout1 = input.layout) === null || _input_layout1 === void 0 ? void 0 : (_input_layout_template = _input_layout1.template) === null || _input_layout_template === void 0 ? void 0 : (_input_layout_template_layout = _input_layout_template.layout) === null || _input_layout_template_layout === void 0 ? void 0 : _input_layout_template_layout.colorway, isDarkTheme, true);
2655
+ if (legend !== '' && allupLegends.some((group)=>group.title === legend) === false) {
2656
+ allupLegends.push({
2657
+ title: legend,
2658
+ color
2659
+ });
2660
+ }
2661
+ });
2662
+ }
2065
2663
  } else if (isNonPlotType(traceInfo[index].type) === false) {
2066
2664
  var _plotSeries_line, _plotSeries_marker, _input_layout_template_layout1, _input_layout_template1, _input_layout3;
2067
2665
  const plotSeries = series;
@@ -2145,7 +2743,8 @@ export const isNonPlotType = (chartType)=>{
2145
2743
  return [
2146
2744
  'donut',
2147
2745
  'sankey',
2148
- 'pie'
2746
+ 'pie',
2747
+ 'annotation'
2149
2748
  ].includes(chartType);
2150
2749
  };
2151
2750
  export const getGridProperties = (schema, isMultiPlot, validTracesInfo)=>{
@@ -2545,9 +3144,8 @@ const getAxisType = (data, ax)=>{
2545
3144
  const values = [];
2546
3145
  data.forEach((series)=>{
2547
3146
  const axId = series[`${axLetter}axis`];
2548
- if (axId === ax._id || !axId && ax._id === axLetter) {
2549
- var _series_axLetter;
2550
- (_series_axLetter = series[axLetter]) === null || _series_axLetter === void 0 ? void 0 : _series_axLetter.forEach((val)=>{
3147
+ if ((axId === ax._id || !axId && ax._id === axLetter) && isArrayOrTypedArray(series[axLetter])) {
3148
+ series[axLetter].forEach((val)=>{
2551
3149
  if (!isInvalidValue(val)) {
2552
3150
  values.push(val);
2553
3151
  }