@fluentui/react-charting 5.25.1 → 5.25.3

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 (285) hide show
  1. package/CHANGELOG.json +123 -1
  2. package/CHANGELOG.md +34 -2
  3. package/dist/react-charting.d.ts +48 -45
  4. package/dist/react-charting.js +1 -1
  5. package/dist/react-charting.min.js +1 -1
  6. package/etc/react-charting.api.md +24 -11
  7. package/lib/AnnotationOnlyChart.d.ts +1 -0
  8. package/lib/AnnotationOnlyChart.js +2 -0
  9. package/lib/AnnotationOnlyChart.js.map +1 -0
  10. package/lib/components/AnnotationOnlyChart/AnnotationOnlyChart.d.ts +3 -0
  11. package/lib/components/AnnotationOnlyChart/AnnotationOnlyChart.js +158 -0
  12. package/lib/components/AnnotationOnlyChart/AnnotationOnlyChart.js.map +1 -0
  13. package/lib/components/AnnotationOnlyChart/AnnotationOnlyChart.types.d.ts +33 -0
  14. package/lib/components/AnnotationOnlyChart/AnnotationOnlyChart.types.js +2 -0
  15. package/lib/components/AnnotationOnlyChart/AnnotationOnlyChart.types.js.map +1 -0
  16. package/lib/components/AnnotationOnlyChart/index.d.ts +2 -0
  17. package/lib/components/AnnotationOnlyChart/index.js +3 -0
  18. package/lib/components/AnnotationOnlyChart/index.js.map +1 -0
  19. package/lib/components/AreaChart/AreaChart.base.js +2 -2
  20. package/lib/components/AreaChart/AreaChart.base.js.map +1 -1
  21. package/lib/components/ChartTable/ChartTable.base.js +5 -3
  22. package/lib/components/ChartTable/ChartTable.base.js.map +1 -1
  23. package/lib/components/CommonComponents/Annotations/ChartAnnotationLayer.d.ts +1 -1
  24. package/lib/components/CommonComponents/Annotations/ChartAnnotationLayer.js +18 -14
  25. package/lib/components/CommonComponents/Annotations/ChartAnnotationLayer.js.map +1 -1
  26. package/lib/components/CommonComponents/Annotations/index.d.ts +2 -0
  27. package/lib/components/CommonComponents/Annotations/index.js +3 -0
  28. package/lib/components/CommonComponents/Annotations/index.js.map +1 -0
  29. package/lib/components/CommonComponents/CartesianChart.base.d.ts +6 -1
  30. package/lib/components/CommonComponents/CartesianChart.base.js +131 -157
  31. package/lib/components/CommonComponents/CartesianChart.base.js.map +1 -1
  32. package/lib/components/CommonComponents/CartesianChart.types.d.ts +11 -2
  33. package/lib/components/CommonComponents/CartesianChart.types.js.map +1 -1
  34. package/lib/components/DeclarativeChart/DeclarativeChart.js +85 -51
  35. package/lib/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
  36. package/lib/components/DeclarativeChart/PlotlyColorAdapter.js +12 -4
  37. package/lib/components/DeclarativeChart/PlotlyColorAdapter.js.map +1 -1
  38. package/lib/components/DeclarativeChart/PlotlySchemaAdapter.d.ts +2 -0
  39. package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js +176 -63
  40. package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
  41. package/lib/components/DonutChart/DonutChart.base.js +5 -3
  42. package/lib/components/DonutChart/DonutChart.base.js.map +1 -1
  43. package/lib/components/FunnelChart/FunnelChart.base.js +15 -18
  44. package/lib/components/FunnelChart/FunnelChart.base.js.map +1 -1
  45. package/lib/components/GanttChart/GanttChart.base.js +6 -6
  46. package/lib/components/GanttChart/GanttChart.base.js.map +1 -1
  47. package/lib/components/GanttChart/GanttChart.types.d.ts +0 -11
  48. package/lib/components/GanttChart/GanttChart.types.js.map +1 -1
  49. package/lib/components/GaugeChart/GaugeChart.base.js +5 -3
  50. package/lib/components/GaugeChart/GaugeChart.base.js.map +1 -1
  51. package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js +11 -6
  52. package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js.map +1 -1
  53. package/lib/components/HeatMapChart/HeatMapChart.base.js +3 -3
  54. package/lib/components/HeatMapChart/HeatMapChart.base.js.map +1 -1
  55. package/lib/components/HeatMapChart/HeatMapChart.types.d.ts +0 -9
  56. package/lib/components/HeatMapChart/HeatMapChart.types.js.map +1 -1
  57. package/lib/components/HorizontalBarChart/HorizontalBarChart.base.js.map +1 -1
  58. package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js +4 -4
  59. package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js.map +1 -1
  60. package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.types.d.ts +0 -9
  61. package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.types.js.map +1 -1
  62. package/lib/components/Legends/Legends.base.d.ts +1 -1
  63. package/lib/components/Legends/Legends.base.js +6 -2
  64. package/lib/components/Legends/Legends.base.js.map +1 -1
  65. package/lib/components/Legends/Legends.types.d.ts +1 -1
  66. package/lib/components/Legends/Legends.types.js.map +1 -1
  67. package/lib/components/LineChart/LineChart.base.js +3 -3
  68. package/lib/components/LineChart/LineChart.base.js.map +1 -1
  69. package/lib/components/LineChart/eventAnnotation/Textbox.js.map +1 -1
  70. package/lib/components/ResponsiveContainer/ResponsiveContainer.js +1 -1
  71. package/lib/components/ResponsiveContainer/ResponsiveContainer.js.map +1 -1
  72. package/lib/components/SankeyChart/SankeyChart.base.js +5 -3
  73. package/lib/components/SankeyChart/SankeyChart.base.js.map +1 -1
  74. package/lib/components/ScatterChart/ScatterChart.base.js +41 -31
  75. package/lib/components/ScatterChart/ScatterChart.base.js.map +1 -1
  76. package/lib/components/ScatterChart/ScatterChart.types.d.ts +0 -4
  77. package/lib/components/ScatterChart/ScatterChart.types.js.map +1 -1
  78. package/lib/components/StackedBarChart/MultiStackedBarChart.base.js.map +1 -1
  79. package/lib/components/StackedBarChart/StackedBarChart.base.js.map +1 -1
  80. package/lib/components/VerticalBarChart/VerticalBarChart.base.js +6 -4
  81. package/lib/components/VerticalBarChart/VerticalBarChart.base.js.map +1 -1
  82. package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js +22 -10
  83. package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js.map +1 -1
  84. package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.types.d.ts +0 -9
  85. package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.types.js.map +1 -1
  86. package/lib/index.d.ts +2 -0
  87. package/lib/index.js +1 -0
  88. package/lib/index.js.map +1 -1
  89. package/lib/types/IChartAnnotation.d.ts +2 -0
  90. package/lib/types/IChartAnnotation.js.map +1 -1
  91. package/lib/utilities/image-export-utils.d.ts +7 -2
  92. package/lib/utilities/image-export-utils.js +176 -86
  93. package/lib/utilities/image-export-utils.js.map +1 -1
  94. package/lib/utilities/utilities.d.ts +5 -4
  95. package/lib/utilities/utilities.js +18 -17
  96. package/lib/utilities/utilities.js.map +1 -1
  97. package/lib-amd/AnnotationOnlyChart.d.ts +1 -0
  98. package/lib-amd/AnnotationOnlyChart.js +6 -0
  99. package/lib-amd/AnnotationOnlyChart.js.map +1 -0
  100. package/lib-amd/components/AnnotationOnlyChart/AnnotationOnlyChart.d.ts +3 -0
  101. package/lib-amd/components/AnnotationOnlyChart/AnnotationOnlyChart.js +159 -0
  102. package/lib-amd/components/AnnotationOnlyChart/AnnotationOnlyChart.js.map +1 -0
  103. package/lib-amd/components/AnnotationOnlyChart/AnnotationOnlyChart.types.d.ts +33 -0
  104. package/lib-amd/components/AnnotationOnlyChart/AnnotationOnlyChart.types.js +5 -0
  105. package/lib-amd/components/AnnotationOnlyChart/AnnotationOnlyChart.types.js.map +1 -0
  106. package/lib-amd/components/AnnotationOnlyChart/index.d.ts +2 -0
  107. package/lib-amd/components/AnnotationOnlyChart/index.js +7 -0
  108. package/lib-amd/components/AnnotationOnlyChart/index.js.map +1 -0
  109. package/lib-amd/components/AreaChart/AreaChart.base.js +1 -1
  110. package/lib-amd/components/AreaChart/AreaChart.base.js.map +1 -1
  111. package/lib-amd/components/ChartTable/ChartTable.base.js +4 -2
  112. package/lib-amd/components/ChartTable/ChartTable.base.js.map +1 -1
  113. package/lib-amd/components/CommonComponents/Annotations/ChartAnnotationLayer.d.ts +1 -1
  114. package/lib-amd/components/CommonComponents/Annotations/ChartAnnotationLayer.js +18 -14
  115. package/lib-amd/components/CommonComponents/Annotations/ChartAnnotationLayer.js.map +1 -1
  116. package/lib-amd/components/CommonComponents/Annotations/index.d.ts +2 -0
  117. package/lib-amd/components/CommonComponents/Annotations/index.js +7 -0
  118. package/lib-amd/components/CommonComponents/Annotations/index.js.map +1 -0
  119. package/lib-amd/components/CommonComponents/CartesianChart.base.d.ts +6 -1
  120. package/lib-amd/components/CommonComponents/CartesianChart.base.js +131 -157
  121. package/lib-amd/components/CommonComponents/CartesianChart.base.js.map +1 -1
  122. package/lib-amd/components/CommonComponents/CartesianChart.types.d.ts +11 -2
  123. package/lib-amd/components/CommonComponents/CartesianChart.types.js.map +1 -1
  124. package/lib-amd/components/DeclarativeChart/DeclarativeChart.js +80 -50
  125. package/lib-amd/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
  126. package/lib-amd/components/DeclarativeChart/PlotlyColorAdapter.js +12 -4
  127. package/lib-amd/components/DeclarativeChart/PlotlyColorAdapter.js.map +1 -1
  128. package/lib-amd/components/DeclarativeChart/PlotlySchemaAdapter.d.ts +2 -0
  129. package/lib-amd/components/DeclarativeChart/PlotlySchemaAdapter.js +178 -64
  130. package/lib-amd/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
  131. package/lib-amd/components/DonutChart/DonutChart.base.js +4 -2
  132. package/lib-amd/components/DonutChart/DonutChart.base.js.map +1 -1
  133. package/lib-amd/components/FunnelChart/FunnelChart.base.js +13 -16
  134. package/lib-amd/components/FunnelChart/FunnelChart.base.js.map +1 -1
  135. package/lib-amd/components/GanttChart/GanttChart.base.js +5 -5
  136. package/lib-amd/components/GanttChart/GanttChart.base.js.map +1 -1
  137. package/lib-amd/components/GanttChart/GanttChart.types.d.ts +0 -11
  138. package/lib-amd/components/GanttChart/GanttChart.types.js.map +1 -1
  139. package/lib-amd/components/GaugeChart/GaugeChart.base.js +4 -2
  140. package/lib-amd/components/GaugeChart/GaugeChart.base.js.map +1 -1
  141. package/lib-amd/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js +10 -6
  142. package/lib-amd/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js.map +1 -1
  143. package/lib-amd/components/HeatMapChart/HeatMapChart.base.js +2 -2
  144. package/lib-amd/components/HeatMapChart/HeatMapChart.base.js.map +1 -1
  145. package/lib-amd/components/HeatMapChart/HeatMapChart.types.d.ts +0 -9
  146. package/lib-amd/components/HeatMapChart/HeatMapChart.types.js.map +1 -1
  147. package/lib-amd/components/HorizontalBarChart/HorizontalBarChart.base.js.map +1 -1
  148. package/lib-amd/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js +3 -3
  149. package/lib-amd/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js.map +1 -1
  150. package/lib-amd/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.types.d.ts +0 -9
  151. package/lib-amd/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.types.js.map +1 -1
  152. package/lib-amd/components/Legends/Legends.base.d.ts +1 -1
  153. package/lib-amd/components/Legends/Legends.base.js +6 -2
  154. package/lib-amd/components/Legends/Legends.base.js.map +1 -1
  155. package/lib-amd/components/Legends/Legends.types.d.ts +1 -1
  156. package/lib-amd/components/Legends/Legends.types.js.map +1 -1
  157. package/lib-amd/components/LineChart/LineChart.base.js +2 -2
  158. package/lib-amd/components/LineChart/LineChart.base.js.map +1 -1
  159. package/lib-amd/components/LineChart/eventAnnotation/Textbox.js.map +1 -1
  160. package/lib-amd/components/ResponsiveContainer/ResponsiveContainer.js +1 -1
  161. package/lib-amd/components/ResponsiveContainer/ResponsiveContainer.js.map +1 -1
  162. package/lib-amd/components/SankeyChart/SankeyChart.base.js +4 -2
  163. package/lib-amd/components/SankeyChart/SankeyChart.base.js.map +1 -1
  164. package/lib-amd/components/ScatterChart/ScatterChart.base.js +39 -29
  165. package/lib-amd/components/ScatterChart/ScatterChart.base.js.map +1 -1
  166. package/lib-amd/components/ScatterChart/ScatterChart.types.d.ts +0 -4
  167. package/lib-amd/components/ScatterChart/ScatterChart.types.js.map +1 -1
  168. package/lib-amd/components/StackedBarChart/MultiStackedBarChart.base.js.map +1 -1
  169. package/lib-amd/components/StackedBarChart/StackedBarChart.base.js.map +1 -1
  170. package/lib-amd/components/VerticalBarChart/VerticalBarChart.base.js +5 -3
  171. package/lib-amd/components/VerticalBarChart/VerticalBarChart.base.js.map +1 -1
  172. package/lib-amd/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js +20 -8
  173. package/lib-amd/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js.map +1 -1
  174. package/lib-amd/components/VerticalStackedBarChart/VerticalStackedBarChart.types.d.ts +0 -9
  175. package/lib-amd/components/VerticalStackedBarChart/VerticalStackedBarChart.types.js.map +1 -1
  176. package/lib-amd/index.d.ts +2 -0
  177. package/lib-amd/index.js +3 -2
  178. package/lib-amd/index.js.map +1 -1
  179. package/lib-amd/types/IChartAnnotation.d.ts +2 -0
  180. package/lib-amd/types/IChartAnnotation.js.map +1 -1
  181. package/lib-amd/utilities/image-export-utils.d.ts +7 -2
  182. package/lib-amd/utilities/image-export-utils.js +175 -85
  183. package/lib-amd/utilities/image-export-utils.js.map +1 -1
  184. package/lib-amd/utilities/utilities.d.ts +5 -4
  185. package/lib-amd/utilities/utilities.js +18 -17
  186. package/lib-amd/utilities/utilities.js.map +1 -1
  187. package/lib-commonjs/AnnotationOnlyChart.d.ts +1 -0
  188. package/lib-commonjs/AnnotationOnlyChart.js +5 -0
  189. package/lib-commonjs/AnnotationOnlyChart.js.map +1 -0
  190. package/lib-commonjs/components/AnnotationOnlyChart/AnnotationOnlyChart.d.ts +3 -0
  191. package/lib-commonjs/components/AnnotationOnlyChart/AnnotationOnlyChart.js +162 -0
  192. package/lib-commonjs/components/AnnotationOnlyChart/AnnotationOnlyChart.js.map +1 -0
  193. package/lib-commonjs/components/AnnotationOnlyChart/AnnotationOnlyChart.types.d.ts +33 -0
  194. package/lib-commonjs/components/AnnotationOnlyChart/AnnotationOnlyChart.types.js +3 -0
  195. package/lib-commonjs/components/AnnotationOnlyChart/AnnotationOnlyChart.types.js.map +1 -0
  196. package/lib-commonjs/components/AnnotationOnlyChart/index.d.ts +2 -0
  197. package/lib-commonjs/components/AnnotationOnlyChart/index.js +6 -0
  198. package/lib-commonjs/components/AnnotationOnlyChart/index.js.map +1 -0
  199. package/lib-commonjs/components/AreaChart/AreaChart.base.js +1 -1
  200. package/lib-commonjs/components/AreaChart/AreaChart.base.js.map +1 -1
  201. package/lib-commonjs/components/ChartTable/ChartTable.base.js +4 -2
  202. package/lib-commonjs/components/ChartTable/ChartTable.base.js.map +1 -1
  203. package/lib-commonjs/components/CommonComponents/Annotations/ChartAnnotationLayer.d.ts +1 -1
  204. package/lib-commonjs/components/CommonComponents/Annotations/ChartAnnotationLayer.js +18 -14
  205. package/lib-commonjs/components/CommonComponents/Annotations/ChartAnnotationLayer.js.map +1 -1
  206. package/lib-commonjs/components/CommonComponents/Annotations/index.d.ts +2 -0
  207. package/lib-commonjs/components/CommonComponents/Annotations/index.js +6 -0
  208. package/lib-commonjs/components/CommonComponents/Annotations/index.js.map +1 -0
  209. package/lib-commonjs/components/CommonComponents/CartesianChart.base.d.ts +6 -1
  210. package/lib-commonjs/components/CommonComponents/CartesianChart.base.js +131 -157
  211. package/lib-commonjs/components/CommonComponents/CartesianChart.base.js.map +1 -1
  212. package/lib-commonjs/components/CommonComponents/CartesianChart.types.d.ts +11 -2
  213. package/lib-commonjs/components/CommonComponents/CartesianChart.types.js.map +1 -1
  214. package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js +83 -49
  215. package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
  216. package/lib-commonjs/components/DeclarativeChart/PlotlyColorAdapter.js +12 -4
  217. package/lib-commonjs/components/DeclarativeChart/PlotlyColorAdapter.js.map +1 -1
  218. package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.d.ts +2 -0
  219. package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js +178 -64
  220. package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
  221. package/lib-commonjs/components/DonutChart/DonutChart.base.js +4 -2
  222. package/lib-commonjs/components/DonutChart/DonutChart.base.js.map +1 -1
  223. package/lib-commonjs/components/FunnelChart/FunnelChart.base.js +13 -16
  224. package/lib-commonjs/components/FunnelChart/FunnelChart.base.js.map +1 -1
  225. package/lib-commonjs/components/GanttChart/GanttChart.base.js +5 -5
  226. package/lib-commonjs/components/GanttChart/GanttChart.base.js.map +1 -1
  227. package/lib-commonjs/components/GanttChart/GanttChart.types.d.ts +0 -11
  228. package/lib-commonjs/components/GanttChart/GanttChart.types.js.map +1 -1
  229. package/lib-commonjs/components/GaugeChart/GaugeChart.base.js +4 -2
  230. package/lib-commonjs/components/GaugeChart/GaugeChart.base.js.map +1 -1
  231. package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js +10 -5
  232. package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js.map +1 -1
  233. package/lib-commonjs/components/HeatMapChart/HeatMapChart.base.js +2 -2
  234. package/lib-commonjs/components/HeatMapChart/HeatMapChart.base.js.map +1 -1
  235. package/lib-commonjs/components/HeatMapChart/HeatMapChart.types.d.ts +0 -9
  236. package/lib-commonjs/components/HeatMapChart/HeatMapChart.types.js.map +1 -1
  237. package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.base.js.map +1 -1
  238. package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js +3 -3
  239. package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js.map +1 -1
  240. package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.types.d.ts +0 -9
  241. package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.types.js.map +1 -1
  242. package/lib-commonjs/components/Legends/Legends.base.d.ts +1 -1
  243. package/lib-commonjs/components/Legends/Legends.base.js +6 -2
  244. package/lib-commonjs/components/Legends/Legends.base.js.map +1 -1
  245. package/lib-commonjs/components/Legends/Legends.types.d.ts +1 -1
  246. package/lib-commonjs/components/Legends/Legends.types.js.map +1 -1
  247. package/lib-commonjs/components/LineChart/LineChart.base.js +2 -2
  248. package/lib-commonjs/components/LineChart/LineChart.base.js.map +1 -1
  249. package/lib-commonjs/components/LineChart/eventAnnotation/Textbox.js.map +1 -1
  250. package/lib-commonjs/components/ResponsiveContainer/ResponsiveContainer.js +1 -1
  251. package/lib-commonjs/components/ResponsiveContainer/ResponsiveContainer.js.map +1 -1
  252. package/lib-commonjs/components/SankeyChart/SankeyChart.base.js +4 -2
  253. package/lib-commonjs/components/SankeyChart/SankeyChart.base.js.map +1 -1
  254. package/lib-commonjs/components/ScatterChart/ScatterChart.base.js +39 -29
  255. package/lib-commonjs/components/ScatterChart/ScatterChart.base.js.map +1 -1
  256. package/lib-commonjs/components/ScatterChart/ScatterChart.types.d.ts +0 -4
  257. package/lib-commonjs/components/ScatterChart/ScatterChart.types.js.map +1 -1
  258. package/lib-commonjs/components/StackedBarChart/MultiStackedBarChart.base.js.map +1 -1
  259. package/lib-commonjs/components/StackedBarChart/StackedBarChart.base.js.map +1 -1
  260. package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.base.js +5 -3
  261. package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.base.js.map +1 -1
  262. package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js +20 -8
  263. package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js.map +1 -1
  264. package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.types.d.ts +0 -9
  265. package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.types.js.map +1 -1
  266. package/lib-commonjs/index.d.ts +2 -0
  267. package/lib-commonjs/index.js +3 -1
  268. package/lib-commonjs/index.js.map +1 -1
  269. package/lib-commonjs/types/IChartAnnotation.d.ts +2 -0
  270. package/lib-commonjs/types/IChartAnnotation.js.map +1 -1
  271. package/lib-commonjs/utilities/image-export-utils.d.ts +7 -2
  272. package/lib-commonjs/utilities/image-export-utils.js +175 -85
  273. package/lib-commonjs/utilities/image-export-utils.js.map +1 -1
  274. package/lib-commonjs/utilities/utilities.d.ts +5 -4
  275. package/lib-commonjs/utilities/utilities.js +18 -17
  276. package/lib-commonjs/utilities/utilities.js.map +1 -1
  277. package/package.json +5 -5
  278. package/src/components/AnnotationOnlyChart/AnnotationOnlyChart.types.ts +34 -0
  279. package/src/components/CommonComponents/CartesianChart.types.ts +12 -1
  280. package/src/components/GanttChart/GanttChart.types.ts +0 -13
  281. package/src/components/HeatMapChart/HeatMapChart.types.ts +0 -11
  282. package/src/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.types.ts +0 -11
  283. package/src/components/Legends/Legends.types.ts +1 -1
  284. package/src/components/ScatterChart/ScatterChart.types.ts +0 -5
  285. package/src/components/VerticalStackedBarChart/VerticalStackedBarChart.types.ts +0 -11
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"../src/","sources":["index.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,kBAAkB,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAC;AAErF,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAW1C,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAS3C,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAUtC,OAAO,EAAE,oBAAoB,EAAE,2BAA2B,EAAE,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HorizontalBarChart, HorizontalBarChartVariant } from './HorizontalBarChart';\nexport type { IDonutChart, IDonutChartProps, IDonutChartStyleProps, IDonutChartStyles } from './DonutChart';\nexport { DonutChart } from './DonutChart';\nexport type {\n ILegend,\n ILegendOverflowData,\n ILegendStyleProps,\n ILegendSubComponentStyles,\n ILegendsProps,\n ILegendsStyles,\n IShapeProps,\n LegendShape,\n} from './Legends';\nexport { Legends, Shape } from './Legends';\nexport type {\n IColorFillBarData,\n IColorFillBarsProps,\n IEventsAnnotationProps,\n ILineChartProps,\n ILineChartStyleProps,\n ILineChartStyles,\n} from './LineChart';\nexport { LineChart, Textbox } from './LineChart';\nexport { ScatterChart } from './ScatterChart';\nexport type { IAreaChartProps, IAreaChartStyleProps, IAreaChartStyles } from './AreaChart';\nexport { AreaChart } from './AreaChart';\nexport type { IPieChart, IPieChartProps, IPieChartStyleProps, IPieChartStyles } from './PieChart';\nexport { PieChart } from './PieChart';\nexport type {\n IMultiStackedBarChartProps,\n IMultiStackedBarChartStyleProps,\n IMultiStackedBarChartStyles,\n IStackedBarChart,\n IStackedBarChartProps,\n IStackedBarChartStyleProps,\n IStackedBarChartStyles,\n} from './StackedBarChart';\nexport { MultiStackedBarChart, MultiStackedBarChartVariant, StackedBarChart } from './StackedBarChart';\nexport type { IVerticalBarChartProps, IVerticalBarChartStyleProps, IVerticalBarChartStyles } from './VerticalBarChart';\nexport { VerticalBarChart } from './VerticalBarChart';\nexport type {\n IVerticalStackedBarChartProps,\n IVerticalStackedBarChartStyleProps,\n IVerticalStackedBarChartStyles,\n} from './VerticalStackedBarChart';\nexport { VerticalStackedBarChart } from './VerticalStackedBarChart';\nexport type {\n IGroupedVerticalBarChartProps,\n IGroupedVerticalBarChartStyleProps,\n IGroupedVerticalBarChartStyles,\n} from './GroupedVerticalBarChart';\nexport { GroupedVerticalBarChart } from './GroupedVerticalBarChart';\nexport type {\n ICartesianChartProps,\n ICartesianChartStyleProps,\n ICartesianChartStyles,\n IChildProps,\n IModifiedCartesianChartProps,\n IYValueHover,\n} from './CartesianChart';\nexport { CartesianChart } from './CartesianChart';\nexport type {\n IAccessibilityProps,\n IBasestate,\n IChartDataPoint,\n IChartProps,\n ICustomizedCalloutData,\n ICustomizedCalloutDataPoint,\n IDataPoint,\n IGVBarChartSeriesPoint,\n IGVDataPoint,\n IGVForBarChart,\n IGVSingleDataPoint,\n IGroupedVerticalBarChartData,\n IHeatMapChartData,\n IHeatMapChartDataPoint,\n IHorizontalBarChartWithAxisDataPoint,\n IHorizontalDataPoint,\n ILegendDataItem,\n ILineChartDataPoint,\n ILineChartGap,\n ILineChartLineOptions,\n ILineChartPoints,\n ILineDataInVerticalBarChart,\n ILineDataInVerticalStackedBarChart,\n IMargins,\n IRefArrayData,\n ISankeyChartData,\n IVSChartDataPoint,\n IVerticalBarChartDataPoint,\n IVerticalStackedBarDataPoint,\n IVerticalStackedChartProps,\n SLink,\n SNode,\n IChart,\n IImageExportOptions,\n IScatterChartPoints,\n IScatterChartDataPoint,\n IBaseDataPoint,\n AxisCategoryOrder,\n IGanttChartDataPoint,\n AxisScaleType,\n AxisProps,\n IDataPointV2,\n IDataSeries,\n IBarSeries,\n ILineSeries,\n IChartAnnotation as ChartAnnotation,\n ChartAnnotationCoordinate,\n IChartAnnotationConnectorProps as ChartAnnotationConnectorProps,\n ChartAnnotationArrowHead,\n IChartAnnotationLayoutProps as ChartAnnotationLayoutProps,\n IChartAnnotationStyleProps as ChartAnnotationStyleProps,\n IChartAnnotationAccessibilityProps as ChartAnnotationAccessibilityProps,\n} from './types/index';\nexport type {\n IChartHoverCardProps,\n IChartHoverCardStyleProps,\n IChartHoverCardStyles,\n} from './utilities/ChartHoverCard/index';\nexport { ChartHoverCard, getChartHoverCardStyles } from './utilities/ChartHoverCard/index';\nexport type { IHeatMapChartProps, IHeatMapChartStyleProps, IHeatMapChartStyles } from './HeatMapChart';\nexport { HeatMapChart } from './HeatMapChart';\nexport type {\n ISankeyChartAccessibilityProps,\n ISankeyChartProps,\n ISankeyChartStrings,\n ISankeyChartStyleProps,\n ISankeyChartStyles,\n} from './SankeyChart';\nexport { SankeyChart } from './SankeyChart';\nexport type {\n ITreeChartDataPoint,\n ITreeDataStructure,\n ITreeProps,\n ITreeState,\n ITreeStyleProps,\n ITreeStyles,\n} from './TreeChart';\nexport { NodesComposition, TreeChart, TreeTraverse } from './TreeChart';\nexport type { ISparklineProps, ISparklineStyleProps, ISparklineStyles } from './Sparkline';\nexport { Sparkline } from './Sparkline';\nexport type { IChartTableProps, IChartTableStyleProps, IChartTableStyles } from './ChartTable';\nexport { ChartTable } from './ChartTable';\nexport type {\n IHorizontalBarChartWithAxisProps,\n IHorizontalBarChartWithAxisStyleProps,\n IHorizontalBarChartWithAxisStyles,\n} from './HorizontalBarChartWithAxis';\nexport { HorizontalBarChartWithAxis } from './HorizontalBarChartWithAxis';\nexport type { IFunnelChartProps, IFunnelChartStyleProps, IFunnelChartStyles } from './FunnelChart';\nexport { FunnelChart } from './FunnelChart';\nexport { DataVizPalette, getColorFromToken, getNextColor } from './utilities/colors';\nexport { DataVizGradientPalette, getGradientFromToken, getNextGradient } from './utilities/gradients';\nexport type { IGaugeChartProps, IGaugeChartSegment, IGaugeChartStyleProps, IGaugeChartStyles } from './GaugeChart';\nexport { GaugeChart, GaugeChartVariant, GaugeValueFormat } from './GaugeChart';\nexport type { DeclarativeChartProps, Schema, IDeclarativeChart } from './DeclarativeChart';\nexport { DeclarativeChart } from './DeclarativeChart';\nexport type { IResponsiveContainerProps, IResponsiveChildProps } from './ResponsiveContainer';\nexport { ResponsiveContainer, withResponsiveContainer } from './ResponsiveContainer';\nexport type { IScatterChartProps, IScatterChartStyleProps, IScatterChartStyles } from './ScatterChart';\nexport type { IGanttChartProps, IGanttChartStyleProps, IGanttChartStyles } from './GanttChart';\nexport { GanttChart } from './GanttChart';\n\nimport './version';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"../src/","sources":["index.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,kBA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Ae,EAAE,MAAM,uBAAuB,CAAC;AAEtG,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAE/E,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D,OAAO,EAAE,mBAAmB,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAGrF,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,OAAO,WAAW,CAAC","sourcesContent":["export type {\n ChartDataMode,\n IHorizontalBarChartProps,\n IHorizontalBarChartStyleProps,\n IHorizontalBarChartStyles,\n} from './HorizontalBarChart';\nexport { HorizontalBarChart, HorizontalBarChartVariant } from './HorizontalBarChart';\nexport type { IDonutChart, IDonutChartProps, IDonutChartStyleProps, IDonutChartStyles } from './DonutChart';\nexport { DonutChart } from './DonutChart';\nexport type {\n ILegend,\n ILegendOverflowData,\n ILegendStyleProps,\n ILegendSubComponentStyles,\n ILegendsProps,\n ILegendsStyles,\n IShapeProps,\n LegendShape,\n} from './Legends';\nexport { Legends, Shape } from './Legends';\nexport type {\n IColorFillBarData,\n IColorFillBarsProps,\n IEventsAnnotationProps,\n ILineChartProps,\n ILineChartStyleProps,\n ILineChartStyles,\n} from './LineChart';\nexport { LineChart, Textbox } from './LineChart';\nexport { ScatterChart } from './ScatterChart';\nexport type { IAreaChartProps, IAreaChartStyleProps, IAreaChartStyles } from './AreaChart';\nexport { AreaChart } from './AreaChart';\nexport type { IPieChart, IPieChartProps, IPieChartStyleProps, IPieChartStyles } from './PieChart';\nexport { PieChart } from './PieChart';\nexport type {\n IMultiStackedBarChartProps,\n IMultiStackedBarChartStyleProps,\n IMultiStackedBarChartStyles,\n IStackedBarChart,\n IStackedBarChartProps,\n IStackedBarChartStyleProps,\n IStackedBarChartStyles,\n} from './StackedBarChart';\nexport { MultiStackedBarChart, MultiStackedBarChartVariant, StackedBarChart } from './StackedBarChart';\nexport type { IVerticalBarChartProps, IVerticalBarChartStyleProps, IVerticalBarChartStyles } from './VerticalBarChart';\nexport { VerticalBarChart } from './VerticalBarChart';\nexport type {\n IVerticalStackedBarChartProps,\n IVerticalStackedBarChartStyleProps,\n IVerticalStackedBarChartStyles,\n} from './VerticalStackedBarChart';\nexport { VerticalStackedBarChart } from './VerticalStackedBarChart';\nexport type {\n IGroupedVerticalBarChartProps,\n IGroupedVerticalBarChartStyleProps,\n IGroupedVerticalBarChartStyles,\n} from './GroupedVerticalBarChart';\nexport { GroupedVerticalBarChart } from './GroupedVerticalBarChart';\nexport type {\n ICartesianChartProps,\n ICartesianChartStyleProps,\n ICartesianChartStyles,\n IChildProps,\n IModifiedCartesianChartProps,\n IYValueHover,\n} from './CartesianChart';\nexport { CartesianChart } from './CartesianChart';\nexport type {\n IAccessibilityProps,\n IBasestate,\n IChartDataPoint,\n IChartProps,\n ICustomizedCalloutData,\n ICustomizedCalloutDataPoint,\n IDataPoint,\n IGVBarChartSeriesPoint,\n IGVDataPoint,\n IGVForBarChart,\n IGVSingleDataPoint,\n IGroupedVerticalBarChartData,\n IHeatMapChartData,\n IHeatMapChartDataPoint,\n IHorizontalBarChartWithAxisDataPoint,\n IHorizontalDataPoint,\n ILegendDataItem,\n ILineChartDataPoint,\n ILineChartGap,\n ILineChartLineOptions,\n ILineChartPoints,\n ILineDataInVerticalBarChart,\n ILineDataInVerticalStackedBarChart,\n IMargins,\n IRefArrayData,\n ISankeyChartData,\n IVSChartDataPoint,\n IVerticalBarChartDataPoint,\n IVerticalStackedBarDataPoint,\n IVerticalStackedChartProps,\n SLink,\n SNode,\n IChart,\n IImageExportOptions,\n IScatterChartPoints,\n IScatterChartDataPoint,\n IBaseDataPoint,\n AxisCategoryOrder,\n IGanttChartDataPoint,\n AxisScaleType,\n AxisProps,\n IDataPointV2,\n IDataSeries,\n IBarSeries,\n ILineSeries,\n IChartAnnotation as ChartAnnotation,\n ChartAnnotationCoordinate,\n IChartAnnotationConnectorProps as ChartAnnotationConnectorProps,\n ChartAnnotationArrowHead,\n IChartAnnotationLayoutProps as ChartAnnotationLayoutProps,\n IChartAnnotationStyleProps as ChartAnnotationStyleProps,\n IChartAnnotationAccessibilityProps as ChartAnnotationAccessibilityProps,\n} from './types/index';\nexport type {\n IChartHoverCardProps,\n IChartHoverCardStyleProps,\n IChartHoverCardStyles,\n} from './utilities/ChartHoverCard/index';\nexport { ChartHoverCard, getChartHoverCardStyles } from './utilities/ChartHoverCard/index';\nexport type { IHeatMapChartProps, IHeatMapChartStyleProps, IHeatMapChartStyles } from './HeatMapChart';\nexport { HeatMapChart } from './HeatMapChart';\nexport type {\n ISankeyChartAccessibilityProps,\n ISankeyChartProps,\n ISankeyChartStrings,\n ISankeyChartStyleProps,\n ISankeyChartStyles,\n} from './SankeyChart';\nexport { SankeyChart } from './SankeyChart';\nexport type {\n ITreeChartDataPoint,\n ITreeDataStructure,\n ITreeProps,\n ITreeState,\n ITreeStyleProps,\n ITreeStyles,\n} from './TreeChart';\nexport { NodesComposition, TreeChart, TreeTraverse } from './TreeChart';\nexport type { ISparklineProps, ISparklineStyleProps, ISparklineStyles } from './Sparkline';\nexport { Sparkline } from './Sparkline';\nexport type { IChartTableProps, IChartTableStyleProps, IChartTableStyles } from './ChartTable';\nexport { ChartTable } from './ChartTable';\nexport type {\n IHorizontalBarChartWithAxisProps,\n IHorizontalBarChartWithAxisStyleProps,\n IHorizontalBarChartWithAxisStyles,\n} from './HorizontalBarChartWithAxis';\nexport { HorizontalBarChartWithAxis } from './HorizontalBarChartWithAxis';\nexport type { IFunnelChartProps, IFunnelChartStyleProps, IFunnelChartStyles } from './FunnelChart';\nexport { FunnelChart } from './FunnelChart';\nexport { DataVizPalette, getColorFromToken, getNextColor } from './utilities/colors';\nexport { DataVizGradientPalette, getGradientFromToken, getNextGradient } from './utilities/gradients';\nexport type { IGaugeChartProps, IGaugeChartSegment, IGaugeChartStyleProps, IGaugeChartStyles } from './GaugeChart';\nexport { GaugeChart, GaugeChartVariant, GaugeValueFormat } from './GaugeChart';\nexport type { DeclarativeChartProps, Schema, IDeclarativeChart } from './DeclarativeChart';\nexport { DeclarativeChart } from './DeclarativeChart';\nexport type { IAnnotationOnlyChartProps } from './AnnotationOnlyChart';\nexport { AnnotationOnlyChart } from './AnnotationOnlyChart';\nexport type { IResponsiveContainerProps, IResponsiveChildProps } from './ResponsiveContainer';\nexport { ResponsiveContainer, withResponsiveContainer } from './ResponsiveContainer';\nexport type { IScatterChartProps, IScatterChartStyleProps, IScatterChartStyles } from './ScatterChart';\nexport type { IGanttChartProps, IGanttChartStyleProps, IGanttChartStyles } from './GanttChart';\nexport { GanttChart } from './GanttChart';\n\nimport './version';\n"]}
@@ -70,6 +70,8 @@ export interface IChartAnnotationStyleProps {
70
70
  opacity?: number;
71
71
  /** Optional class name applied to the annotation element */
72
72
  className?: string;
73
+ /** Rotation, in degrees, applied to the annotation container */
74
+ rotation?: number;
73
75
  }
74
76
  export interface IChartAnnotationAccessibilityProps {
75
77
  /** Accessible label announced by assistive technologies */
@@ -1 +1 @@
1
- {"version":3,"file":"IChartAnnotation.js","sourceRoot":"../src/","sources":["types/IChartAnnotation.ts"],"names":[],"mappings":"","sourcesContent":["import * as React from 'react';\n\nexport type ChartAnnotationCoordinate = {\n /** Cartesian data coordinates mapped through the chart scales or\n * Normalised coordinates within the plot area (0-1) or\n * Absolute pixel position relative to the chart's SVG origin\n */\n type: 'data' | 'relative' | 'pixel';\n /** x-axis value in the data domain */\n x: number | string | Date;\n /** y-axis value in the data domain */\n y: number | string | Date;\n /** Use the secondary y scale when available */\n yAxis?: 'primary' | 'secondary';\n};\n\nexport type ChartAnnotationHorizontalAlign = 'start' | 'center' | 'end';\nexport type ChartAnnotationVerticalAlign = 'top' | 'middle' | 'bottom';\n\nexport type ChartAnnotationArrowHead = 'none' | 'start' | 'end' | 'both';\n\nexport interface IChartAnnotationConnectorProps {\n /** Distance in pixels between the annotation element and the start of the connector. */\n startPadding?: number;\n /** Distance in pixels between the anchor point and the end of the connector. */\n endPadding?: number;\n /** Stroke colour for the connector. */\n strokeColor?: string;\n /** Stroke width in pixels. */\n strokeWidth?: number;\n /** SVG stroke dash array for dashed connectors. */\n dashArray?: string;\n /** Arrow head placement. Defaults to `'end'`. */\n arrow?: ChartAnnotationArrowHead;\n}\n\nexport interface IChartAnnotationLayoutProps {\n /** Horizontal alignment of the annotation relative to the anchor point */\n align?: ChartAnnotationHorizontalAlign;\n /** Vertical alignment of the annotation relative to the anchor point */\n verticalAlign?: ChartAnnotationVerticalAlign;\n /** Horizontal offset in pixels applied after alignment */\n offsetX?: number;\n /** Vertical offset in pixels applied after alignment */\n offsetY?: number;\n /** Optional maximum width for wrapped text */\n maxWidth?: number;\n /** Whether the annotation should remain inside the plot area */\n clipToBounds?: boolean;\n /** Additional CSS classes applied to the annotation wrapper */\n className?: string;\n}\n\nexport interface IChartAnnotationStyleProps {\n /** Text colour */\n textColor?: string;\n /** Background colour for the annotation container */\n backgroundColor?: string;\n /** Border colour */\n borderColor?: string;\n /** Border width */\n borderWidth?: number;\n /** Border style (solid, dashed, etc.) */\n borderStyle?: React.CSSProperties['borderStyle'];\n /** Border radius */\n borderRadius?: number;\n /** Box shadow applied to annotation */\n boxShadow?: string;\n /** Font size override */\n fontSize?: string;\n /** Font weight override */\n fontWeight?: React.CSSProperties['fontWeight'];\n /** Padding around the text. Accepts CSS shorthand notation */\n padding?: string;\n /** Opacity for the annotation container */\n opacity?: number;\n /** Optional class name applied to the annotation element */\n className?: string;\n}\n\nexport interface IChartAnnotationAccessibilityProps {\n /** Accessible label announced by assistive technologies */\n ariaLabel?: string;\n /** Accessible description id */\n ariaDescribedBy?: string;\n /** Custom role */\n role?: string;\n}\n\nexport interface IChartAnnotation {\n /** Optional id for React reconciliation */\n id?: string;\n /** Primary textual content */\n text: string;\n /** Coordinates describing where the annotation should be anchored */\n coordinates: ChartAnnotationCoordinate;\n /** Layout customisation */\n layout?: IChartAnnotationLayoutProps;\n /** Visual styling */\n style?: IChartAnnotationStyleProps;\n /** Optional connector line that links the annotation to its anchor. */\n connector?: IChartAnnotationConnectorProps;\n /** Accessibility metadata */\n accessibility?: IChartAnnotationAccessibilityProps;\n /** Optional application specific metadata */\n data?: Record<string, unknown>;\n}\n"]}
1
+ {"version":3,"file":"IChartAnnotation.js","sourceRoot":"../src/","sources":["types/IChartAnnotation.ts"],"names":[],"mappings":"","sourcesContent":["import * as React from 'react';\n\nexport type ChartAnnotationCoordinate = {\n /** Cartesian data coordinates mapped through the chart scales or\n * Normalised coordinates within the plot area (0-1) or\n * Absolute pixel position relative to the chart's SVG origin\n */\n type: 'data' | 'relative' | 'pixel';\n /** x-axis value in the data domain */\n x: number | string | Date;\n /** y-axis value in the data domain */\n y: number | string | Date;\n /** Use the secondary y scale when available */\n yAxis?: 'primary' | 'secondary';\n};\n\nexport type ChartAnnotationHorizontalAlign = 'start' | 'center' | 'end';\nexport type ChartAnnotationVerticalAlign = 'top' | 'middle' | 'bottom';\n\nexport type ChartAnnotationArrowHead = 'none' | 'start' | 'end' | 'both';\n\nexport interface IChartAnnotationConnectorProps {\n /** Distance in pixels between the annotation element and the start of the connector. */\n startPadding?: number;\n /** Distance in pixels between the anchor point and the end of the connector. */\n endPadding?: number;\n /** Stroke colour for the connector. */\n strokeColor?: string;\n /** Stroke width in pixels. */\n strokeWidth?: number;\n /** SVG stroke dash array for dashed connectors. */\n dashArray?: string;\n /** Arrow head placement. Defaults to `'end'`. */\n arrow?: ChartAnnotationArrowHead;\n}\n\nexport interface IChartAnnotationLayoutProps {\n /** Horizontal alignment of the annotation relative to the anchor point */\n align?: ChartAnnotationHorizontalAlign;\n /** Vertical alignment of the annotation relative to the anchor point */\n verticalAlign?: ChartAnnotationVerticalAlign;\n /** Horizontal offset in pixels applied after alignment */\n offsetX?: number;\n /** Vertical offset in pixels applied after alignment */\n offsetY?: number;\n /** Optional maximum width for wrapped text */\n maxWidth?: number;\n /** Whether the annotation should remain inside the plot area */\n clipToBounds?: boolean;\n /** Additional CSS classes applied to the annotation wrapper */\n className?: string;\n}\n\nexport interface IChartAnnotationStyleProps {\n /** Text colour */\n textColor?: string;\n /** Background colour for the annotation container */\n backgroundColor?: string;\n /** Border colour */\n borderColor?: string;\n /** Border width */\n borderWidth?: number;\n /** Border style (solid, dashed, etc.) */\n borderStyle?: React.CSSProperties['borderStyle'];\n /** Border radius */\n borderRadius?: number;\n /** Box shadow applied to annotation */\n boxShadow?: string;\n /** Font size override */\n fontSize?: string;\n /** Font weight override */\n fontWeight?: React.CSSProperties['fontWeight'];\n /** Padding around the text. Accepts CSS shorthand notation */\n padding?: string;\n /** Opacity for the annotation container */\n opacity?: number;\n /** Optional class name applied to the annotation element */\n className?: string;\n /** Rotation, in degrees, applied to the annotation container */\n rotation?: number;\n}\n\nexport interface IChartAnnotationAccessibilityProps {\n /** Accessible label announced by assistive technologies */\n ariaLabel?: string;\n /** Accessible description id */\n ariaDescribedBy?: string;\n /** Custom role */\n role?: string;\n}\n\nexport interface IChartAnnotation {\n /** Optional id for React reconciliation */\n id?: string;\n /** Primary textual content */\n text: string;\n /** Coordinates describing where the annotation should be anchored */\n coordinates: ChartAnnotationCoordinate;\n /** Layout customisation */\n layout?: IChartAnnotationLayoutProps;\n /** Visual styling */\n style?: IChartAnnotationStyleProps;\n /** Optional connector line that links the annotation to its anchor. */\n connector?: IChartAnnotationConnectorProps;\n /** Accessibility metadata */\n accessibility?: IChartAnnotationAccessibilityProps;\n /** Optional application specific metadata */\n data?: Record<string, unknown>;\n}\n"]}
@@ -1,13 +1,18 @@
1
1
  import { IImageExportOptions } from '../types/index';
2
2
  import { ILegend, ILegendContainer } from '../Legends';
3
- export declare function toImage(chartContainer: HTMLElement | null | undefined, legendsToSvgCallback?: ILegendContainer['toSVG'], isRTL?: boolean, opts?: IImageExportOptions): Promise<string>;
3
+ export type GridChart = {
4
+ container: HTMLElement | null | undefined;
5
+ row?: number;
6
+ col?: number;
7
+ };
8
+ export declare function exportChartsAsImage(charts: GridChart[], legendsToSvg?: ILegendContainer['toSVG'], isRTL?: boolean, opts?: IImageExportOptions): Promise<string>;
4
9
  export declare function cloneLegendsToSVG(legends: ILegend[], svgWidth: number, config: {
5
10
  selectedLegends: Record<string, boolean>;
6
11
  centerLegends: boolean;
7
12
  textClassName: string;
8
13
  isRTL: boolean;
9
14
  }, legendContainer?: HTMLElement | null): {
10
- node: SVGGElement | null;
15
+ node: SVGSVGElement | null;
11
16
  width: number;
12
17
  height: number;
13
18
  };
@@ -1,40 +1,54 @@
1
- import { __spreadArray } from "tslib";
1
+ import { __assign, __awaiter, __generator, __spreadArray } from "tslib";
2
2
  import { create as d3Create, select as d3Select } from 'd3-selection';
3
- import { copyStyle, createMeasurementSpan, resolveCSSVariables } from './index';
3
+ import { copyStyle, createMeasurementSpan } from './index';
4
4
  import { LEGEND_CONTAINER_MARGIN_TOP, LEGEND_CONTAINER_MARGIN_START, LEGEND_PADDING, LEGEND_HEIGHT, LEGEND_SHAPE_BORDER, LEGEND_SHAPE_SIZE, LEGEND_SHAPE_MARGIN_END, INACTIVE_LEGEND_TEXT_OPACITY, } from '../components/Legends/Legends.styles';
5
- export function toImage(chartContainer, legendsToSvgCallback, isRTL, opts) {
6
- if (isRTL === void 0) { isRTL = false; }
7
- if (opts === void 0) { opts = {}; }
8
- return new Promise(function (resolve, reject) {
9
- if (!chartContainer) {
10
- return reject(new Error('Chart container is not defined'));
11
- }
12
- try {
13
- var background = typeof opts.background === 'string' ? resolveCSSVariables(chartContainer, opts.background) : 'transparent';
14
- var svg = toSVG(chartContainer, legendsToSvgCallback, isRTL, background);
15
- if (!svg.node) {
16
- return reject(new Error('SVG node is null'));
5
+ export function exportChartsAsImage(charts_1, legendsToSvg_1) {
6
+ return __awaiter(this, arguments, void 0, function (charts, legendsToSvg, isRTL, opts) {
7
+ var chartImages, grid, totalWidth_1, svg, svgDataUrl;
8
+ if (isRTL === void 0) { isRTL = false; }
9
+ if (opts === void 0) { opts = {}; }
10
+ return __generator(this, function (_a) {
11
+ switch (_a.label) {
12
+ case 0:
13
+ if (charts.length === 0 && !legendsToSvg) {
14
+ throw new Error('No charts or legends to export');
15
+ }
16
+ return [4 /*yield*/, Promise.all(charts.map(function (chart) {
17
+ return new Promise(function (resolve) {
18
+ var svg = cloneStyledSVG(chart.container, isRTL);
19
+ var svgDataUrl = svgToBase64(svg.node);
20
+ resolve({ dataUrl: svgDataUrl, width: svg.width, height: svg.height });
21
+ });
22
+ }))];
23
+ case 1:
24
+ chartImages = _a.sent();
25
+ grid = [];
26
+ charts.forEach(function (chart, i) {
27
+ var row = chart.row || 0;
28
+ var col = chart.col || 0;
29
+ if (!grid[row]) {
30
+ grid[row] = [];
31
+ }
32
+ grid[row][col] = chartImages[i];
33
+ });
34
+ if (legendsToSvg) {
35
+ totalWidth_1 = 0;
36
+ grid.forEach(function (row) {
37
+ var rowWidth = 0;
38
+ row.forEach(function (item) {
39
+ rowWidth += item.width;
40
+ });
41
+ totalWidth_1 = Math.max(totalWidth_1, rowWidth);
42
+ });
43
+ svg = legendsToSvg(totalWidth_1, isRTL);
44
+ if (svg.node) {
45
+ svgDataUrl = svgToBase64(svg.node);
46
+ grid.push([{ dataUrl: svgDataUrl, width: svg.width, height: svg.height }]);
47
+ }
48
+ }
49
+ return [2 /*return*/, svgToPng(grid, opts)];
17
50
  }
18
- var svgData = new XMLSerializer().serializeToString(svg.node);
19
- // This node is already detached from the DOM, so there's no need to call remove() on it.
20
- // Just clear the reference.
21
- svg.node = null;
22
- var svgDataUrl = 'data:image/svg+xml;base64,' + btoa(unescapePonyfill(encodeURIComponent(svgData)));
23
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
24
- svgData = null;
25
- svgToPng(svgDataUrl, {
26
- width: opts.width || svg.width,
27
- height: opts.height || svg.height,
28
- scale: opts.scale,
29
- })
30
- .then(resolve)
31
- .catch(reject);
32
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
33
- svgDataUrl = null;
34
- }
35
- catch (err) {
36
- return reject(err);
37
- }
51
+ });
38
52
  });
39
53
  }
40
54
  var SVG_STYLE_PROPERTIES = [
@@ -59,27 +73,55 @@ var SVG_TEXT_STYLE_PROPERTIES = [
59
73
  'border',
60
74
  ];
61
75
  var ANNOTATION_HTML_STYLE_PROPERTIES = [
76
+ 'align-items',
77
+ 'background',
62
78
  'background-color',
63
79
  'border',
64
80
  'border-radius',
65
81
  'box-shadow',
82
+ 'box-sizing',
66
83
  'color',
84
+ 'column-gap',
85
+ 'display',
86
+ 'flex',
87
+ 'flex-direction',
67
88
  'font-family',
68
89
  'font-size',
69
90
  'font-style',
70
91
  'font-weight',
92
+ 'gap',
93
+ 'height',
94
+ 'justify-content',
71
95
  'letter-spacing',
72
96
  'line-height',
97
+ 'margin',
98
+ 'max-height',
99
+ 'max-width',
100
+ 'min-height',
101
+ 'min-width',
73
102
  'opacity',
103
+ 'overflow',
74
104
  'padding',
75
105
  'pointer-events',
106
+ 'position',
107
+ 'row-gap',
76
108
  'text-align',
77
109
  'text-decoration',
78
110
  'text-transform',
111
+ 'top',
112
+ 'right',
113
+ 'bottom',
114
+ 'left',
115
+ 'visibility',
79
116
  'white-space',
117
+ 'width',
118
+ 'z-index',
80
119
  ];
81
120
  var ANNOTATION_FOREIGN_OBJECT_STYLE_PROPERTIES = ['overflow', 'pointer-events'];
82
- function toSVG(chartContainer, legendsToSvgCallback, isRTL, background) {
121
+ function cloneStyledSVG(chartContainer, isRTL) {
122
+ if (!chartContainer) {
123
+ throw new Error('Chart container is not defined');
124
+ }
83
125
  var svg = chartContainer.querySelector('svg');
84
126
  if (!svg) {
85
127
  throw new Error('SVG not found');
@@ -105,12 +147,27 @@ function toSVG(chartContainer, legendsToSvgCallback, isRTL, background) {
105
147
  svgElements = null;
106
148
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
107
149
  clonedSvgElements = null;
108
- var _a = svg.getBoundingClientRect(), svgWidth = _a.width, svgHeight = _a.height;
109
- var legendGroup = typeof legendsToSvgCallback === 'function'
110
- ? legendsToSvgCallback(svgWidth, isRTL)
111
- : { node: null, width: 0, height: 0 };
112
- var w1 = Math.max(svgWidth, legendGroup.width);
113
- var h1 = svgHeight + legendGroup.height;
150
+ var originalForeignObjects = svg.querySelectorAll('foreignObject');
151
+ var clonedForeignObjects = clonedSvg.node().querySelectorAll('foreignObject');
152
+ originalForeignObjects.forEach(function (originalFo, index) {
153
+ var clonedFo = clonedForeignObjects[index];
154
+ if (!clonedFo) {
155
+ return;
156
+ }
157
+ var originalRoot = originalFo.firstElementChild;
158
+ var clonedRoot = clonedFo.firstElementChild;
159
+ if (originalRoot && clonedRoot) {
160
+ copyStyle(ANNOTATION_HTML_STYLE_PROPERTIES, originalRoot, clonedRoot);
161
+ }
162
+ var originalHtmlElements = originalFo.querySelectorAll('*');
163
+ var clonedHtmlElements = clonedFo.querySelectorAll('*');
164
+ originalHtmlElements.forEach(function (originalEl, elementIndex) {
165
+ var clonedEl = clonedHtmlElements[elementIndex];
166
+ if (clonedEl) {
167
+ copyStyle(ANNOTATION_HTML_STYLE_PROPERTIES, originalEl, clonedEl);
168
+ }
169
+ });
170
+ });
114
171
  var annotationSvg = chartContainer.querySelector('[data-chart-annotation-svg="true"]');
115
172
  var annotationClone = null;
116
173
  if (annotationSvg) {
@@ -141,30 +198,21 @@ function toSVG(chartContainer, legendsToSvgCallback, isRTL, background) {
141
198
  }
142
199
  }
143
200
  }
144
- if (legendGroup.node) {
145
- d3Select(legendGroup.node).attr('transform', "translate(0, ".concat(svgHeight, ")"));
146
- clonedSvg.append(function () { return legendGroup.node; });
147
- }
148
- clonedSvg
149
- .insert('rect', ':first-child')
150
- .attr('x', 0)
151
- .attr('y', 0)
152
- .attr('width', w1)
153
- .attr('height', h1)
154
- .attr('fill', background);
201
+ var _a = svg.getBoundingClientRect(), width = _a.width, height = _a.height;
155
202
  clonedSvg
156
- .attr('width', w1)
157
- .attr('height', h1)
158
- .attr('viewBox', "0 0 ".concat(w1, " ").concat(h1))
203
+ .attr('width', width)
204
+ .attr('height', height)
205
+ .attr('viewBox', "0 0 ".concat(width, " ").concat(height))
159
206
  .attr('direction', isRTL ? 'rtl' : 'ltr');
160
207
  if (annotationClone) {
161
- d3Select(annotationClone).attr('x', 0).attr('y', 0).attr('width', svgWidth).attr('height', svgHeight);
208
+ clonedSvg.selectAll('[data-chart-annotation-layer="true"]').remove();
209
+ d3Select(annotationClone).attr('x', 0).attr('y', 0).attr('width', width).attr('height', height);
162
210
  clonedSvg.append(function () { return annotationClone; });
163
211
  }
164
212
  var result = {
165
213
  node: clonedSvg.node(),
166
- width: w1,
167
- height: h1,
214
+ width: width,
215
+ height: height,
168
216
  };
169
217
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
170
218
  clonedSvg = null;
@@ -258,40 +306,82 @@ export function cloneLegendsToSVG(legends, svgWidth, config, legendContainer) {
258
306
  });
259
307
  });
260
308
  }
309
+ var w1 = Math.max.apply(Math, __spreadArray([svgWidth], legendLineWidths, false));
310
+ var h1 = legendY;
311
+ var svg = d3Create('svg').attr('width', w1).attr('height', h1).attr('viewBox', "0 0 ".concat(w1, " ").concat(h1));
312
+ svg.append(function () { return legendGroup.node(); });
261
313
  return {
262
- node: legendGroup.node(),
263
- width: Math.max.apply(Math, legendLineWidths),
264
- height: legendY,
314
+ node: svg.node(),
315
+ width: w1,
316
+ height: h1,
265
317
  };
266
318
  }
267
- function svgToPng(svgDataUrl, opts) {
268
- if (opts === void 0) { opts = {}; }
269
- return new Promise(function (resolve, reject) {
270
- var scale = opts.scale || 1;
271
- var w0 = opts.width || 300;
272
- var h0 = opts.height || 150;
273
- var w1 = scale * w0;
274
- var h1 = scale * h0;
275
- var canvas = document.createElement('canvas');
276
- var img = new Image();
277
- canvas.width = w1;
278
- canvas.height = h1;
279
- img.onload = function () {
280
- var ctx = canvas.getContext('2d');
281
- if (!ctx) {
282
- return reject(new Error('Canvas context is null'));
319
+ function svgToPng(grid_1) {
320
+ return __awaiter(this, arguments, void 0, function (grid, opts) {
321
+ var totalWidth, totalHeight, positionedImages, scale, w0, h0, scaleX, scaleY, canvas, ctx;
322
+ if (opts === void 0) { opts = {}; }
323
+ return __generator(this, function (_a) {
324
+ switch (_a.label) {
325
+ case 0:
326
+ totalWidth = 0;
327
+ totalHeight = 0;
328
+ positionedImages = grid
329
+ .map(function (row) {
330
+ var rowWidth = 0;
331
+ var rowHeight = 0;
332
+ var items = row.map(function (item) {
333
+ var positioned = __assign(__assign({}, item), { x: rowWidth, y: totalHeight });
334
+ rowWidth += item.width;
335
+ rowHeight = Math.max(rowHeight, item.height);
336
+ return positioned;
337
+ });
338
+ totalWidth = Math.max(totalWidth, rowWidth);
339
+ totalHeight += rowHeight;
340
+ return items;
341
+ })
342
+ .flat();
343
+ scale = opts.scale || 1;
344
+ w0 = opts.width || totalWidth;
345
+ h0 = opts.height || totalHeight;
346
+ scaleX = (scale * w0) / totalWidth;
347
+ scaleY = (scale * h0) / totalHeight;
348
+ totalWidth = scaleX * totalWidth;
349
+ totalHeight = scaleY * totalHeight;
350
+ canvas = document.createElement('canvas');
351
+ canvas.width = totalWidth;
352
+ canvas.height = totalHeight;
353
+ ctx = canvas.getContext('2d');
354
+ if (!ctx) {
355
+ throw new Error('Canvas context is null');
356
+ }
357
+ ctx.fillStyle = opts.background || 'transparent';
358
+ ctx.fillRect(0, 0, totalWidth, totalHeight);
359
+ return [4 /*yield*/, Promise.all(positionedImages.map(function (item) {
360
+ return new Promise(function (resolve, reject) {
361
+ var img = new Image();
362
+ img.onload = function () {
363
+ ctx.drawImage(img, scaleX * item.x, scaleY * item.y, scaleX * item.width, scaleY * item.height);
364
+ resolve();
365
+ };
366
+ img.onerror = reject;
367
+ img.src = item.dataUrl;
368
+ });
369
+ }))];
370
+ case 1:
371
+ _a.sent();
372
+ return [2 /*return*/, canvas.toDataURL('image/png')];
283
373
  }
284
- ctx.clearRect(0, 0, w1, h1);
285
- ctx.drawImage(img, 0, 0, w1, h1);
286
- var imgData = canvas.toDataURL('image/png');
287
- resolve(imgData);
288
- };
289
- img.onerror = function (err) {
290
- reject(err);
291
- };
292
- img.src = svgDataUrl;
374
+ });
293
375
  });
294
376
  }
377
+ function svgToBase64(svgNode) {
378
+ if (!svgNode) {
379
+ throw new Error('SVG node is null');
380
+ }
381
+ var svgData = new XMLSerializer().serializeToString(svgNode);
382
+ var svgDataUrl = 'data:image/svg+xml;base64,' + btoa(unescapePonyfill(encodeURIComponent(svgData)));
383
+ return svgDataUrl;
384
+ }
295
385
  var hex2 = /^[\da-f]{2}$/i;
296
386
  var hex4 = /^[\da-f]{4}$/i;
297
387
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"image-export-utils.js","sourceRoot":"../src/","sources":["utilities/image-export-utils.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,IAAI,QAAQ,EAAE,MAAM,IAAI,QAAQ,EAAa,MAAM,cAAc,CAAC;AACjF,OAAO,EAAE,SAAS,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAGhF,OAAO,EACL,2BAA2B,EAC3B,6BAA6B,EAC7B,cAAc,EACd,aAAa,EACb,mBAAmB,EACnB,iBAAiB,EACjB,uBAAuB,EACvB,4BAA4B,GAC7B,MAAM,sCAAsC,CAAC;AAE9C,MAAM,UAAU,OAAO,CACrB,cAA8C,EAC9C,oBAAgD,EAChD,KAAsB,EACtB,IAA8B;IAD9B,sBAAA,EAAA,aAAsB;IACtB,qBAAA,EAAA,SAA8B;IAE9B,OAAO,IAAI,OAAO,CAAC,UAAC,OAAO,EAAE,MAAM;QACjC,IAAI,CAAC,cAAc,EAAE,CAAC;YACpB,OAAO,MAAM,CAAC,IAAI,KAAK,CAAC,gCAAgC,CAAC,CAAC,CAAC;QAC7D,CAAC;QAED,IAAI,CAAC;YACH,IAAM,UAAU,GACd,OAAO,IAAI,CAAC,UAAU,KAAK,QAAQ,CAAC,CAAC,CAAC,mBAAmB,CAAC,cAAc,EAAE,IAAI,CAAC,UAAU,CAAC,CAA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E7B;;;;GAIG;AACH,SAAS,gBAAgB,CAAC,GAAW;IACnC,IAAI,MAAM,GAAG,EAAE,CAAC;IAChB,IAAM,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC;IAC1B,IAAI,KAAK,GAAG,CAAC,CAAC;IACd,IAAI,GAAG,CAAC;IACR,IAAI,IAAI,CAAC;IACT,OAAO,KAAK,GAAG,MAAM,EAAE,CAAC;QACtB,GAAG,GAAG,GAAG,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC;QAC1B,IAAI,GAAG,KAAK,GAAG,EAAE,CAAC;YAChB,IAAI,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,GAAG,EAAE,CAAC;gBAC9B,IAAI,GAAG,GAAG,CAAC,KAAK,CAAC,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,CAAC,CAAC,CAAC;gBACvC,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;oBACpB,MAAM,IAAI,MAAM,CAAC,YAAY,CAAC,QAAQ,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC;oBAClD,KAAK,IAAI,CAAC,CAAC;oBACX,SAAS;gBACX,CAAC;YACH,CAAC;iBAAM,CAAC;gBACN,IAAI,GAAG,GAAG,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,GAAG,CAAC,CAAC,CAAC;gBACnC,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;oBACpB,MAAM,IAAI,MAAM,CAAC,YAAY,CAAC,QAAQ,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC;oBAClD,KAAK,IAAI,CAAC,CAAC;oBACX,SAAS;gBACX,CAAC;YACH,CAAC;QACH,CAAC;QACD,MAAM,IAAI,GAAG,CAAC;IAChB,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["import { create as d3Create, select as d3Select, Selection } from 'd3-selection';\nimport { copyStyle, createMeasurementSpan, resolveCSSVariables } from './index';\nimport { IImageExportOptions } from '../types/index';\nimport { ILegend, ILegendContainer } from '../Legends';\nimport {\n LEGEND_CONTAINER_MARGIN_TOP,\n LEGEND_CONTAINER_MARGIN_START,\n LEGEND_PADDING,\n LEGEND_HEIGHT,\n LEGEND_SHAPE_BORDER,\n LEGEND_SHAPE_SIZE,\n LEGEND_SHAPE_MARGIN_END,\n INACTIVE_LEGEND_TEXT_OPACITY,\n} from '../components/Legends/Legends.styles';\n\nexport function toImage(\n chartContainer: HTMLElement | null | undefined,\n legendsToSvgCallback?: ILegendContainer['toSVG'],\n isRTL: boolean = false,\n opts: IImageExportOptions = {},\n): Promise<string> {\n return new Promise((resolve, reject) => {\n if (!chartContainer) {\n return reject(new Error('Chart container is not defined'));\n }\n\n try {\n const background =\n typeof opts.background === 'string' ? resolveCSSVariables(chartContainer, opts.background) : 'transparent';\n\n const svg = toSVG(chartContainer, legendsToSvgCallback, isRTL, background);\n if (!svg.node) {\n return reject(new Error('SVG node is null'));\n }\n\n let svgData = new XMLSerializer().serializeToString(svg.node);\n // This node is already detached from the DOM, so there's no need to call remove() on it.\n // Just clear the reference.\n svg.node = null;\n\n let svgDataUrl = 'data:image/svg+xml;base64,' + btoa(unescapePonyfill(encodeURIComponent(svgData)));\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n svgData = null as any;\n\n svgToPng(svgDataUrl, {\n width: opts.width || svg.width,\n height: opts.height || svg.height,\n scale: opts.scale,\n })\n .then(resolve)\n .catch(reject);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n svgDataUrl = null as any;\n } catch (err) {\n return reject(err);\n }\n });\n}\n\nconst SVG_STYLE_PROPERTIES = [\n 'display',\n 'fill',\n 'fill-opacity',\n 'opacity',\n 'stroke',\n 'stroke-width',\n 'transform',\n 'border-collapse',\n];\nconst SVG_TEXT_STYLE_PROPERTIES = [\n 'font-family',\n 'font-size',\n 'font-weight',\n 'text-anchor',\n 'background-color',\n 'color',\n 'padding',\n 'text-align',\n 'border',\n];\nconst ANNOTATION_HTML_STYLE_PROPERTIES = [\n 'background-color',\n 'border',\n 'border-radius',\n 'box-shadow',\n 'color',\n 'font-family',\n 'font-size',\n 'font-style',\n 'font-weight',\n 'letter-spacing',\n 'line-height',\n 'opacity',\n 'padding',\n 'pointer-events',\n 'text-align',\n 'text-decoration',\n 'text-transform',\n 'white-space',\n];\nconst ANNOTATION_FOREIGN_OBJECT_STYLE_PROPERTIES = ['overflow', 'pointer-events'];\n\nfunction toSVG(\n chartContainer: HTMLElement,\n legendsToSvgCallback: ILegendContainer['toSVG'] | undefined,\n isRTL: boolean,\n background: string,\n) {\n const svg = chartContainer.querySelector<SVGSVGElement>('svg');\n if (!svg) {\n throw new Error('SVG not found');\n }\n\n let clonedSvg = d3Select(svg.cloneNode(true) as SVGSVGElement)\n .attr('width', null)\n .attr('height', null)\n .attr('viewBox', null);\n let svgElements = svg.getElementsByTagName('*');\n let clonedSvgElements = clonedSvg.node()!.getElementsByTagName('*');\n\n const TEXT_ELEMENTS = ['text'];\n const TABLE_ELEMENTS = ['table', 'thead', 'tbody', 'tr', 'th', 'td'];\n\n for (let i = 0; i < svgElements.length; i++) {\n const tag = svgElements[i].tagName.toLowerCase();\n\n if (TEXT_ELEMENTS.includes(tag) || TABLE_ELEMENTS.includes(tag)) {\n copyStyle([...SVG_STYLE_PROPERTIES, ...SVG_TEXT_STYLE_PROPERTIES], svgElements[i], clonedSvgElements[i]);\n } else {\n copyStyle(SVG_STYLE_PROPERTIES, svgElements[i], clonedSvgElements[i]);\n }\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n svgElements = null as any;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n clonedSvgElements = null as any;\n\n const { width: svgWidth, height: svgHeight } = svg.getBoundingClientRect();\n const legendGroup =\n typeof legendsToSvgCallback === 'function'\n ? legendsToSvgCallback(svgWidth, isRTL)\n : { node: null, width: 0, height: 0 };\n const w1 = Math.max(svgWidth, legendGroup.width);\n const h1 = svgHeight + legendGroup.height;\n\n const annotationSvg = chartContainer.querySelector<SVGSVGElement>('[data-chart-annotation-svg=\"true\"]');\n let annotationClone: SVGSVGElement | null = null;\n\n if (annotationSvg) {\n annotationClone = annotationSvg.cloneNode(true) as SVGSVGElement;\n copyStyle(SVG_STYLE_PROPERTIES, annotationSvg, annotationClone);\n\n const annotationElements = annotationSvg.getElementsByTagName('*');\n const clonedAnnotationElements = annotationClone.getElementsByTagName('*');\n\n for (let i = 0; i < annotationElements.length; i++) {\n const original = annotationElements[i];\n const cloned = clonedAnnotationElements[i];\n const tag = original.tagName.toLowerCase();\n const isSvgElement = original instanceof SVGElement;\n const isTextElement = tag === 'text';\n const isHtmlElement = original instanceof HTMLElement;\n\n if (isSvgElement) {\n if (isTextElement) {\n copyStyle([...SVG_STYLE_PROPERTIES, ...SVG_TEXT_STYLE_PROPERTIES], original, cloned);\n } else {\n copyStyle(SVG_STYLE_PROPERTIES, original, cloned);\n }\n }\n\n if (isHtmlElement) {\n copyStyle(ANNOTATION_HTML_STYLE_PROPERTIES, original, cloned);\n }\n\n if (tag === 'foreignobject') {\n copyStyle(ANNOTATION_FOREIGN_OBJECT_STYLE_PROPERTIES, original, cloned);\n }\n }\n }\n\n if (legendGroup.node) {\n d3Select(legendGroup.node).attr('transform', `translate(0, ${svgHeight})`);\n clonedSvg.append(() => legendGroup.node);\n }\n clonedSvg\n .insert('rect', ':first-child')\n .attr('x', 0)\n .attr('y', 0)\n .attr('width', w1)\n .attr('height', h1)\n .attr('fill', background);\n clonedSvg\n .attr('width', w1)\n .attr('height', h1)\n .attr('viewBox', `0 0 ${w1} ${h1}`)\n .attr('direction', isRTL ? 'rtl' : 'ltr');\n\n if (annotationClone) {\n d3Select(annotationClone).attr('x', 0).attr('y', 0).attr('width', svgWidth).attr('height', svgHeight);\n clonedSvg.append(() => annotationClone as SVGSVGElement);\n }\n\n const result = {\n node: clonedSvg.node(),\n width: w1,\n height: h1,\n };\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n clonedSvg = null as any;\n\n return result;\n}\n\nconst LEGEND_TEXT_STYLE_PROPERTIES_MAP = {\n color: 'fill',\n 'font-family': 'font-family',\n 'font-size': 'font-size',\n 'font-weight': 'font-weight',\n};\n\nexport function cloneLegendsToSVG(\n legends: ILegend[],\n svgWidth: number,\n config: {\n selectedLegends: Record<string, boolean>;\n centerLegends: boolean;\n textClassName: string;\n isRTL: boolean;\n },\n legendContainer?: HTMLElement | null,\n): { node: SVGGElement | null; width: number; height: number } {\n if (legends.length === 0) {\n return {\n node: null,\n width: 0,\n height: 0,\n };\n }\n\n const { selectedLegends, centerLegends, textClassName, isRTL } = config;\n const legendGroup = d3Create<SVGGElement>('svg:g');\n let legendX = centerLegends ? 0 : LEGEND_CONTAINER_MARGIN_START;\n let legendY = LEGEND_CONTAINER_MARGIN_TOP;\n let legendLine: { elem: Selection<SVGGElement, unknown, null, undefined>; width: number }[] = [];\n const legendLines: (typeof legendLine)[] = [];\n const legendLineWidths: number[] = [];\n const noLegendsSelected = Object.keys(selectedLegends).length === 0;\n\n for (let i = 0; i < legends.length; i++) {\n const textOffset = LEGEND_PADDING + LEGEND_SHAPE_SIZE + LEGEND_SHAPE_MARGIN_END;\n const legendText = createMeasurementSpan(legends[i].title, textClassName, legendContainer);\n const legendWidth = textOffset + legendText.getBoundingClientRect().width + LEGEND_PADDING;\n const legendItem = legendGroup.append('g');\n\n legendLine.push({ elem: legendItem, width: legendWidth });\n if (legendX + legendWidth > svgWidth && legendLine.length > 1) {\n legendLine.pop();\n legendLines.push(legendLine);\n legendLineWidths.push(legendX);\n\n legendLine = [{ elem: legendItem, width: legendWidth }];\n legendX = centerLegends ? 0 : LEGEND_CONTAINER_MARGIN_START;\n legendY += LEGEND_HEIGHT;\n }\n\n const isLegendActive = selectedLegends[legends[i].title] || noLegendsSelected;\n\n legendItem\n .append('rect')\n .attr('x', legendX + (isRTL ? legendWidth - LEGEND_PADDING - LEGEND_SHAPE_SIZE : LEGEND_PADDING))\n .attr('y', legendY + LEGEND_PADDING)\n .attr('width', LEGEND_SHAPE_SIZE)\n .attr('height', LEGEND_SHAPE_SIZE)\n .style('fill', isLegendActive ? legends[i].color : 'transparent')\n .style('stroke-width', LEGEND_SHAPE_BORDER)\n .style('stroke', legends[i].color);\n\n legendItem\n .append('text')\n .attr('x', legendX + (isRTL ? legendWidth - textOffset : textOffset))\n .attr('y', legendY + LEGEND_PADDING)\n .attr('dominant-baseline', 'hanging')\n .style('opacity', isLegendActive ? 1 : INACTIVE_LEGEND_TEXT_OPACITY)\n .text(legends[i].title)\n .call(selection => copyStyle(LEGEND_TEXT_STYLE_PROPERTIES_MAP, legendText, selection.node()!));\n\n legendX += legendWidth;\n }\n\n legendLines.push(legendLine);\n legendLineWidths.push(legendX);\n legendY += LEGEND_HEIGHT;\n\n if (centerLegends) {\n legendLines.forEach((ln, idx) => {\n const lineOffsetX = Math.max((svgWidth - legendLineWidths[idx]) / 2, 0);\n let remLineWidth = legendLineWidths[idx];\n let itemOffsetX = 0;\n ln.forEach(item => {\n const newOffsetX = lineOffsetX + (isRTL ? remLineWidth - item.width - itemOffsetX : 0);\n item.elem.attr('transform', `translate(${newOffsetX}, 0)`);\n remLineWidth -= item.width;\n itemOffsetX += item.width;\n });\n });\n } else if (isRTL) {\n const w1 = Math.max(svgWidth, ...legendLineWidths);\n legendLines.forEach(ln => {\n let remLineWidth = w1 - LEGEND_CONTAINER_MARGIN_START;\n let itemOffsetX = LEGEND_CONTAINER_MARGIN_START;\n ln.forEach(item => {\n const newOffsetX = remLineWidth - item.width - itemOffsetX;\n item.elem.attr('transform', `translate(${newOffsetX}, 0)`);\n remLineWidth -= item.width;\n itemOffsetX += item.width;\n });\n });\n }\n\n return {\n node: legendGroup.node(),\n width: Math.max(...legendLineWidths),\n height: legendY,\n };\n}\n\nfunction svgToPng(svgDataUrl: string, opts: IImageExportOptions = {}): Promise<string> {\n return new Promise((resolve, reject) => {\n const scale = opts.scale || 1;\n const w0 = opts.width || 300;\n const h0 = opts.height || 150;\n const w1 = scale * w0;\n const h1 = scale * h0;\n\n const canvas = document.createElement('canvas');\n const img = new Image();\n\n canvas.width = w1;\n canvas.height = h1;\n\n img.onload = function () {\n const ctx = canvas.getContext('2d');\n if (!ctx) {\n return reject(new Error('Canvas context is null'));\n }\n\n ctx.clearRect(0, 0, w1, h1);\n ctx.drawImage(img, 0, 0, w1, h1);\n\n const imgData = canvas.toDataURL('image/png');\n resolve(imgData);\n };\n\n img.onerror = function (err) {\n reject(err);\n };\n\n img.src = svgDataUrl;\n });\n}\n\nconst hex2 = /^[\\da-f]{2}$/i;\nconst hex4 = /^[\\da-f]{4}$/i;\n\n/**\n * A ponyfill for the deprecated `unescape` method, taken from the `core-js` library.\n *\n * Source: {@link https://github.com/zloirock/core-js/blob/167136f479d3b8519953f2e4c534ecdd1031d3cf/packages/core-js/modules/es.unescape.js core-js/packages/core-js/modules/es.unescape.js}\n */\nfunction unescapePonyfill(str: string) {\n let result = '';\n const length = str.length;\n let index = 0;\n let chr;\n let part;\n while (index < length) {\n chr = str.charAt(index++);\n if (chr === '%') {\n if (str.charAt(index) === 'u') {\n part = str.slice(index + 1, index + 5);\n if (hex4.exec(part)) {\n result += String.fromCharCode(parseInt(part, 16));\n index += 5;\n continue;\n }\n } else {\n part = str.slice(index, index + 2);\n if (hex2.exec(part)) {\n result += String.fromCharCode(parseInt(part, 16));\n index += 2;\n continue;\n }\n }\n }\n result += chr;\n }\n return result;\n}\n"]}
1
+ {"version":3,"file":"image-export-utils.js","sourceRoot":"../src/","sources":["utilities/image-export-utils.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,IAAI,QAAQ,EAAE,MAAM,IAAI,QAAQ,EAAa,MAAM,cAAc,CAAC;AACjF,OAAO,EAAE,SAAS,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAG3D,OAAO,EACL,2BAA2B,EAC3B,6BAA6B,EAC7B,cAAc,EACd,aAAa,EACb,mBAAmB,EACnB,iBAAiB,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,EAAE,CAAC;gBAC9B,IAAI,GAAG,GAAG,CAAC,KAAK,CAAC,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,CAAC,CAAC,CAAC;gBACvC,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;oBACpB,MAAM,IAAI,MAAM,CAAC,YAAY,CAAC,QAAQ,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC;oBAClD,KAAK,IAAI,CAAC,CAAC;oBACX,SAAS;gBACX,CAAC;YACH,CAAC;iBAAM,CAAC;gBACN,IAAI,GAAG,GAAG,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,GAAG,CAAC,CAAC,CAAC;gBACnC,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;oBACpB,MAAM,IAAI,MAAM,CAAC,YAAY,CAAC,QAAQ,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC;oBAClD,KAAK,IAAI,CAAC,CAAC;oBACX,SAAS;gBACX,CAAC;YACH,CAAC;QACH,CAAC;QACD,MAAM,IAAI,GAAG,CAAC;IAChB,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["import { create as d3Create, select as d3Select, Selection } from 'd3-selection';\nimport { copyStyle, createMeasurementSpan } from './index';\nimport { IImageExportOptions } from '../types/index';\nimport { ILegend, ILegendContainer } from '../Legends';\nimport {\n LEGEND_CONTAINER_MARGIN_TOP,\n LEGEND_CONTAINER_MARGIN_START,\n LEGEND_PADDING,\n LEGEND_HEIGHT,\n LEGEND_SHAPE_BORDER,\n LEGEND_SHAPE_SIZE,\n LEGEND_SHAPE_MARGIN_END,\n INACTIVE_LEGEND_TEXT_OPACITY,\n} from '../components/Legends/Legends.styles';\n\nexport type GridChart = {\n container: HTMLElement | null | undefined;\n row?: number;\n col?: number;\n};\n\ntype SvgImage = {\n dataUrl: string;\n width: number;\n height: number;\n};\n\nexport async function exportChartsAsImage(\n charts: GridChart[],\n legendsToSvg?: ILegendContainer['toSVG'],\n isRTL: boolean = false,\n opts: IImageExportOptions = {},\n): Promise<string> {\n if (charts.length === 0 && !legendsToSvg) {\n throw new Error('No charts or legends to export');\n }\n\n const chartImages = await Promise.all(\n charts.map(chart => {\n return new Promise<SvgImage>(resolve => {\n const svg = cloneStyledSVG(chart.container, isRTL);\n const svgDataUrl = svgToBase64(svg.node);\n resolve({ dataUrl: svgDataUrl, width: svg.width, height: svg.height });\n });\n }),\n );\n\n const grid: SvgImage[][] = []; // Sparse 2D array\n charts.forEach((chart, i) => {\n const row = chart.row || 0;\n const col = chart.col || 0;\n if (!grid[row]) {\n grid[row] = [];\n }\n grid[row][col] = chartImages[i];\n });\n\n if (legendsToSvg) {\n let totalWidth = 0;\n grid.forEach(row => {\n let rowWidth = 0;\n row.forEach(item => {\n rowWidth += item.width;\n });\n totalWidth = Math.max(totalWidth, rowWidth);\n });\n\n const svg = legendsToSvg(totalWidth, isRTL);\n if (svg.node) {\n const svgDataUrl = svgToBase64(svg.node);\n grid.push([{ dataUrl: svgDataUrl, width: svg.width, height: svg.height }]);\n }\n }\n\n return svgToPng(grid, opts);\n}\n\nconst SVG_STYLE_PROPERTIES = [\n 'display',\n 'fill',\n 'fill-opacity',\n 'opacity',\n 'stroke',\n 'stroke-width',\n 'transform',\n 'border-collapse',\n];\nconst SVG_TEXT_STYLE_PROPERTIES = [\n 'font-family',\n 'font-size',\n 'font-weight',\n 'text-anchor',\n 'background-color',\n 'color',\n 'padding',\n 'text-align',\n 'border',\n];\nconst ANNOTATION_HTML_STYLE_PROPERTIES = [\n 'align-items',\n 'background',\n 'background-color',\n 'border',\n 'border-radius',\n 'box-shadow',\n 'box-sizing',\n 'color',\n 'column-gap',\n 'display',\n 'flex',\n 'flex-direction',\n 'font-family',\n 'font-size',\n 'font-style',\n 'font-weight',\n 'gap',\n 'height',\n 'justify-content',\n 'letter-spacing',\n 'line-height',\n 'margin',\n 'max-height',\n 'max-width',\n 'min-height',\n 'min-width',\n 'opacity',\n 'overflow',\n 'padding',\n 'pointer-events',\n 'position',\n 'row-gap',\n 'text-align',\n 'text-decoration',\n 'text-transform',\n 'top',\n 'right',\n 'bottom',\n 'left',\n 'visibility',\n 'white-space',\n 'width',\n 'z-index',\n];\nconst ANNOTATION_FOREIGN_OBJECT_STYLE_PROPERTIES = ['overflow', 'pointer-events'];\n\nfunction cloneStyledSVG(chartContainer: HTMLElement | null | undefined, isRTL: boolean) {\n if (!chartContainer) {\n throw new Error('Chart container is not defined');\n }\n\n const svg = chartContainer.querySelector<SVGSVGElement>('svg');\n if (!svg) {\n throw new Error('SVG not found');\n }\n\n let clonedSvg = d3Select(svg.cloneNode(true) as SVGSVGElement)\n .attr('width', null)\n .attr('height', null)\n .attr('viewBox', null);\n let svgElements = svg.getElementsByTagName('*');\n let clonedSvgElements = clonedSvg.node()!.getElementsByTagName('*');\n\n const TEXT_ELEMENTS = ['text'];\n const TABLE_ELEMENTS = ['table', 'thead', 'tbody', 'tr', 'th', 'td'];\n\n for (let i = 0; i < svgElements.length; i++) {\n const tag = svgElements[i].tagName.toLowerCase();\n\n if (TEXT_ELEMENTS.includes(tag) || TABLE_ELEMENTS.includes(tag)) {\n copyStyle([...SVG_STYLE_PROPERTIES, ...SVG_TEXT_STYLE_PROPERTIES], svgElements[i], clonedSvgElements[i]);\n } else {\n copyStyle(SVG_STYLE_PROPERTIES, svgElements[i], clonedSvgElements[i]);\n }\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n svgElements = null as any;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n clonedSvgElements = null as any;\n\n const originalForeignObjects = svg.querySelectorAll('foreignObject');\n const clonedForeignObjects = clonedSvg.node()!.querySelectorAll('foreignObject');\n\n originalForeignObjects.forEach((originalFo, index) => {\n const clonedFo = clonedForeignObjects[index];\n if (!clonedFo) {\n return;\n }\n\n const originalRoot = originalFo.firstElementChild as HTMLElement | null;\n const clonedRoot = clonedFo.firstElementChild as HTMLElement | null;\n\n if (originalRoot && clonedRoot) {\n copyStyle(ANNOTATION_HTML_STYLE_PROPERTIES, originalRoot, clonedRoot);\n }\n\n const originalHtmlElements = originalFo.querySelectorAll<HTMLElement>('*');\n const clonedHtmlElements = clonedFo.querySelectorAll<HTMLElement>('*');\n\n originalHtmlElements.forEach((originalEl, elementIndex) => {\n const clonedEl = clonedHtmlElements[elementIndex];\n if (clonedEl) {\n copyStyle(ANNOTATION_HTML_STYLE_PROPERTIES, originalEl, clonedEl);\n }\n });\n });\n\n const annotationSvg = chartContainer.querySelector<SVGSVGElement>('[data-chart-annotation-svg=\"true\"]');\n let annotationClone: SVGSVGElement | null = null;\n\n if (annotationSvg) {\n annotationClone = annotationSvg.cloneNode(true) as SVGSVGElement;\n copyStyle(SVG_STYLE_PROPERTIES, annotationSvg, annotationClone);\n\n const annotationElements = annotationSvg.getElementsByTagName('*');\n const clonedAnnotationElements = annotationClone.getElementsByTagName('*');\n\n for (let i = 0; i < annotationElements.length; i++) {\n const original = annotationElements[i];\n const cloned = clonedAnnotationElements[i];\n const tag = original.tagName.toLowerCase();\n const isSvgElement = original instanceof SVGElement;\n const isTextElement = tag === 'text';\n const isHtmlElement = original instanceof HTMLElement;\n\n if (isSvgElement) {\n if (isTextElement) {\n copyStyle([...SVG_STYLE_PROPERTIES, ...SVG_TEXT_STYLE_PROPERTIES], original, cloned);\n } else {\n copyStyle(SVG_STYLE_PROPERTIES, original, cloned);\n }\n }\n\n if (isHtmlElement) {\n copyStyle(ANNOTATION_HTML_STYLE_PROPERTIES, original, cloned);\n }\n\n if (tag === 'foreignobject') {\n copyStyle(ANNOTATION_FOREIGN_OBJECT_STYLE_PROPERTIES, original, cloned);\n }\n }\n }\n\n const { width, height } = svg.getBoundingClientRect();\n\n clonedSvg\n .attr('width', width)\n .attr('height', height)\n .attr('viewBox', `0 0 ${width} ${height}`)\n .attr('direction', isRTL ? 'rtl' : 'ltr');\n\n if (annotationClone) {\n clonedSvg.selectAll('[data-chart-annotation-layer=\"true\"]').remove();\n d3Select(annotationClone).attr('x', 0).attr('y', 0).attr('width', width).attr('height', height);\n clonedSvg.append(() => annotationClone as SVGSVGElement);\n }\n\n const result = {\n node: clonedSvg.node(),\n width,\n height,\n };\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n clonedSvg = null as any;\n\n return result;\n}\n\nconst LEGEND_TEXT_STYLE_PROPERTIES_MAP = {\n color: 'fill',\n 'font-family': 'font-family',\n 'font-size': 'font-size',\n 'font-weight': 'font-weight',\n};\n\nexport function cloneLegendsToSVG(\n legends: ILegend[],\n svgWidth: number,\n config: {\n selectedLegends: Record<string, boolean>;\n centerLegends: boolean;\n textClassName: string;\n isRTL: boolean;\n },\n legendContainer?: HTMLElement | null,\n): { node: SVGSVGElement | null; width: number; height: number } {\n if (legends.length === 0) {\n return {\n node: null,\n width: 0,\n height: 0,\n };\n }\n\n const { selectedLegends, centerLegends, textClassName, isRTL } = config;\n const legendGroup = d3Create<SVGGElement>('svg:g');\n let legendX = centerLegends ? 0 : LEGEND_CONTAINER_MARGIN_START;\n let legendY = LEGEND_CONTAINER_MARGIN_TOP;\n let legendLine: { elem: Selection<SVGGElement, unknown, null, undefined>; width: number }[] = [];\n const legendLines: (typeof legendLine)[] = [];\n const legendLineWidths: number[] = [];\n const noLegendsSelected = Object.keys(selectedLegends).length === 0;\n\n for (let i = 0; i < legends.length; i++) {\n const textOffset = LEGEND_PADDING + LEGEND_SHAPE_SIZE + LEGEND_SHAPE_MARGIN_END;\n const legendText = createMeasurementSpan(legends[i].title, textClassName, legendContainer);\n const legendWidth = textOffset + legendText.getBoundingClientRect().width + LEGEND_PADDING;\n const legendItem = legendGroup.append('g');\n\n legendLine.push({ elem: legendItem, width: legendWidth });\n if (legendX + legendWidth > svgWidth && legendLine.length > 1) {\n legendLine.pop();\n legendLines.push(legendLine);\n legendLineWidths.push(legendX);\n\n legendLine = [{ elem: legendItem, width: legendWidth }];\n legendX = centerLegends ? 0 : LEGEND_CONTAINER_MARGIN_START;\n legendY += LEGEND_HEIGHT;\n }\n\n const isLegendActive = selectedLegends[legends[i].title] || noLegendsSelected;\n\n legendItem\n .append('rect')\n .attr('x', legendX + (isRTL ? legendWidth - LEGEND_PADDING - LEGEND_SHAPE_SIZE : LEGEND_PADDING))\n .attr('y', legendY + LEGEND_PADDING)\n .attr('width', LEGEND_SHAPE_SIZE)\n .attr('height', LEGEND_SHAPE_SIZE)\n .style('fill', isLegendActive ? legends[i].color : 'transparent')\n .style('stroke-width', LEGEND_SHAPE_BORDER)\n .style('stroke', legends[i].color);\n\n legendItem\n .append('text')\n .attr('x', legendX + (isRTL ? legendWidth - textOffset : textOffset))\n .attr('y', legendY + LEGEND_PADDING)\n .attr('dominant-baseline', 'hanging')\n .style('opacity', isLegendActive ? 1 : INACTIVE_LEGEND_TEXT_OPACITY)\n .text(legends[i].title)\n .call(selection => copyStyle(LEGEND_TEXT_STYLE_PROPERTIES_MAP, legendText, selection.node()!));\n\n legendX += legendWidth;\n }\n\n legendLines.push(legendLine);\n legendLineWidths.push(legendX);\n legendY += LEGEND_HEIGHT;\n\n if (centerLegends) {\n legendLines.forEach((ln, idx) => {\n const lineOffsetX = Math.max((svgWidth - legendLineWidths[idx]) / 2, 0);\n let remLineWidth = legendLineWidths[idx];\n let itemOffsetX = 0;\n ln.forEach(item => {\n const newOffsetX = lineOffsetX + (isRTL ? remLineWidth - item.width - itemOffsetX : 0);\n item.elem.attr('transform', `translate(${newOffsetX}, 0)`);\n remLineWidth -= item.width;\n itemOffsetX += item.width;\n });\n });\n } else if (isRTL) {\n const w1 = Math.max(svgWidth, ...legendLineWidths);\n legendLines.forEach(ln => {\n let remLineWidth = w1 - LEGEND_CONTAINER_MARGIN_START;\n let itemOffsetX = LEGEND_CONTAINER_MARGIN_START;\n ln.forEach(item => {\n const newOffsetX = remLineWidth - item.width - itemOffsetX;\n item.elem.attr('transform', `translate(${newOffsetX}, 0)`);\n remLineWidth -= item.width;\n itemOffsetX += item.width;\n });\n });\n }\n\n const w1 = Math.max(svgWidth, ...legendLineWidths);\n const h1 = legendY;\n const svg = d3Create<SVGSVGElement>('svg').attr('width', w1).attr('height', h1).attr('viewBox', `0 0 ${w1} ${h1}`);\n svg.append(() => legendGroup.node()!);\n\n return {\n node: svg.node(),\n width: w1,\n height: h1,\n };\n}\n\ntype PositionedImage = SvgImage & {\n x: number;\n y: number;\n};\n\nasync function svgToPng(grid: SvgImage[][], opts: IImageExportOptions = {}): Promise<string> {\n let totalWidth = 0;\n let totalHeight = 0;\n\n const positionedImages: PositionedImage[] = grid\n .map(row => {\n let rowWidth = 0;\n let rowHeight = 0;\n\n const items = row.map(item => {\n const positioned = { ...item, x: rowWidth, y: totalHeight };\n rowWidth += item.width;\n rowHeight = Math.max(rowHeight, item.height);\n return positioned;\n });\n\n totalWidth = Math.max(totalWidth, rowWidth);\n totalHeight += rowHeight;\n\n return items;\n })\n .flat();\n\n const scale = opts.scale || 1;\n const w0 = opts.width || totalWidth;\n const h0 = opts.height || totalHeight;\n const scaleX = (scale * w0) / totalWidth;\n const scaleY = (scale * h0) / totalHeight;\n totalWidth = scaleX * totalWidth;\n totalHeight = scaleY * totalHeight;\n\n const canvas = document.createElement('canvas');\n canvas.width = totalWidth;\n canvas.height = totalHeight;\n\n const ctx = canvas.getContext('2d');\n if (!ctx) {\n throw new Error('Canvas context is null');\n }\n\n ctx.fillStyle = opts.background || 'transparent';\n ctx.fillRect(0, 0, totalWidth, totalHeight);\n\n await Promise.all(\n positionedImages.map(\n item =>\n new Promise<void>((resolve, reject) => {\n const img = new Image();\n img.onload = () => {\n ctx.drawImage(img, scaleX * item.x, scaleY * item.y, scaleX * item.width, scaleY * item.height);\n resolve();\n };\n img.onerror = reject;\n img.src = item.dataUrl;\n }),\n ),\n );\n\n return canvas.toDataURL('image/png');\n}\n\nfunction svgToBase64(svgNode: SVGSVGElement | null) {\n if (!svgNode) {\n throw new Error('SVG node is null');\n }\n\n const svgData = new XMLSerializer().serializeToString(svgNode);\n const svgDataUrl = 'data:image/svg+xml;base64,' + btoa(unescapePonyfill(encodeURIComponent(svgData)));\n return svgDataUrl;\n}\n\nconst hex2 = /^[\\da-f]{2}$/i;\nconst hex4 = /^[\\da-f]{4}$/i;\n\n/**\n * A ponyfill for the deprecated `unescape` method, taken from the `core-js` library.\n *\n * Source: {@link https://github.com/zloirock/core-js/blob/167136f479d3b8519953f2e4c534ecdd1031d3cf/packages/core-js/modules/es.unescape.js core-js/packages/core-js/modules/es.unescape.js}\n */\nfunction unescapePonyfill(str: string) {\n let result = '';\n const length = str.length;\n let index = 0;\n let chr;\n let part;\n while (index < length) {\n chr = str.charAt(index++);\n if (chr === '%') {\n if (str.charAt(index) === 'u') {\n part = str.slice(index + 1, index + 5);\n if (hex4.exec(part)) {\n result += String.fromCharCode(parseInt(part, 16));\n index += 5;\n continue;\n }\n } else {\n part = str.slice(index, index + 2);\n if (hex2.exec(part)) {\n result += String.fromCharCode(parseInt(part, 16));\n index += 2;\n continue;\n }\n }\n }\n result += chr;\n }\n return result;\n}\n"]}
@@ -46,6 +46,7 @@ export interface IRotateLabelProps {
46
46
  }
47
47
  export interface IAxisData {
48
48
  yAxisDomainValues: number[];
49
+ yAxisTickText: string[];
49
50
  }
50
51
  export interface IMargins {
51
52
  /**
@@ -164,7 +165,7 @@ export declare function createStringXAxis(xAxisParams: IXAxisParams, tickParams:
164
165
  * @returns {number[]}
165
166
  */
166
167
  export declare function prepareDatapoints(maxVal: number, minVal: number, splitInto: number, isIntegralDataset: boolean, roundedTicks?: boolean): number[];
167
- export declare function createYAxisForHorizontalBarChartWithAxis(yAxisParams: IYAxisParams, isRtl: boolean): ScaleLinear<number, number>;
168
+ export declare function createYAxisForHorizontalBarChartWithAxis(yAxisParams: IYAxisParams, isRtl: boolean, axisData: IAxisData): ScaleLinear<number, number>;
168
169
  export declare function createNumericYAxis(yAxisParams: IYAxisParams, isRtl: boolean, axisData: IAxisData, isIntegralDataset: boolean, useSecondaryYScale?: boolean, supportNegativeData?: boolean, roundedTicks?: boolean, scaleType?: AxisScaleType): ScaleLinear<number, number, never>;
169
170
  /**
170
171
  * Creating String Y axis of the chart for Horizontal Bar Chart With Axis
@@ -172,14 +173,14 @@ export declare function createNumericYAxis(yAxisParams: IYAxisParams, isRtl: boo
172
173
  * @param dataPoints
173
174
  * @param isRtl
174
175
  */
175
- export declare const createStringYAxisForHorizontalBarChartWithAxis: (yAxisParams: IYAxisParams, dataPoints: string[], isRtl: boolean, barWidth: number) => ScaleBand<string>;
176
+ export declare const createStringYAxisForHorizontalBarChartWithAxis: (yAxisParams: IYAxisParams, dataPoints: string[], isRtl: boolean, axisData: IAxisData, barWidth: number) => ScaleBand<string>;
176
177
  /**
177
178
  * Creating String Y axis of the chart for other chart except Horizontal Bar Chart With Axis
178
179
  * @param yAxisParams
179
180
  * @param dataPoints
180
181
  * @param isRtl
181
182
  */
182
- export declare const createStringYAxis: (yAxisParams: IYAxisParams, dataPoints: string[], isRtl: boolean, barWidth?: number, chartType?: ChartTypes) => ScaleBand<string>;
183
+ export declare const createStringYAxis: (yAxisParams: IYAxisParams, dataPoints: string[], isRtl: boolean, axisData: IAxisData, barWidth?: number, chartType?: ChartTypes) => ScaleBand<string>;
183
184
  /**
184
185
  * For area chart and line chart, while displaying stackCallout, Need to form a callout data object.
185
186
  * This methos creates an object for those 2 charts.
@@ -306,7 +307,7 @@ export declare function computeLongestBars(stackedChartData: IHorizontalBarChart
306
307
  * @param {boolean} isRTL
307
308
  * @returns {IDomainNRange}
308
309
  */
309
- export declare function domainRangeOfNumericForHorizontalBarChartWithAxis(points: IHorizontalBarChartWithAxisDataPoint[], margins: IMargins, containerWidth: number, isRTL: boolean, shiftX: number, X_ORIGIN: number): IDomainNRange;
310
+ export declare function domainRangeOfNumericForHorizontalBarChartWithAxis(points: IHorizontalBarChartWithAxisDataPoint[], margins: IMargins, containerWidth: number, isRTL: boolean, X_ORIGIN: number): IDomainNRange;
310
311
  /**
311
312
  * Calculates Range values of x Axis string axis
312
313
  * For String axis, we need to give domain values (Not start and end array values)