@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
@@ -0,0 +1 @@
1
+ export * from './components/AnnotationOnlyChart/index';
@@ -0,0 +1,6 @@
1
+ define(["require", "exports", "tslib", "./components/AnnotationOnlyChart/index"], function (require, exports, tslib_1, index_1) {
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ tslib_1.__exportStar(index_1, exports);
5
+ });
6
+ //# sourceMappingURL=AnnotationOnlyChart.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AnnotationOnlyChart.js","sourceRoot":"../src/","sources":["AnnotationOnlyChart.ts"],"names":[],"mappings":";;;IAAA,uCAAuD","sourcesContent":["export * from './components/AnnotationOnlyChart/index';\n"]}
@@ -0,0 +1,3 @@
1
+ import * as React from 'react';
2
+ import type { IAnnotationOnlyChartProps } from './AnnotationOnlyChart.types';
3
+ export declare const AnnotationOnlyChart: React.FC<IAnnotationOnlyChartProps>;
@@ -0,0 +1,159 @@
1
+ define(["require", "exports", "react", "@fluentui/react", "@fluentui/react/lib/Styling", "../CommonComponents/Annotations/ChartAnnotationLayer", "../../utilities/image-export-utils"], function (require, exports, React, react_1, Styling_1, ChartAnnotationLayer_1, image_export_utils_1) {
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.AnnotationOnlyChart = void 0;
5
+ var DEFAULT_HEIGHT = 650;
6
+ var FALLBACK_WIDTH = 400;
7
+ var buildPadding = function (margin) {
8
+ var _a, _b, _c, _d;
9
+ if (!margin) {
10
+ return undefined;
11
+ }
12
+ var top = (_a = margin.t) !== null && _a !== void 0 ? _a : 0;
13
+ var right = (_b = margin.r) !== null && _b !== void 0 ? _b : 0;
14
+ var bottom = (_c = margin.b) !== null && _c !== void 0 ? _c : 0;
15
+ var left = (_d = margin.l) !== null && _d !== void 0 ? _d : 0;
16
+ if (top === 0 && right === 0 && bottom === 0 && left === 0) {
17
+ return undefined;
18
+ }
19
+ return "".concat(top, "px ").concat(right, "px ").concat(bottom, "px ").concat(left, "px");
20
+ };
21
+ var AnnotationOnlyChart = function (props) {
22
+ var annotations = props.annotations, chartTitle = props.chartTitle, description = props.description, width = props.width, height = props.height, paperBackgroundColor = props.paperBackgroundColor, plotBackgroundColor = props.plotBackgroundColor, fontColor = props.fontColor, fontFamily = props.fontFamily, margin = props.margin, componentRef = props.componentRef;
23
+ var theme = (0, react_1.useTheme)();
24
+ var containerRef = React.useRef(null);
25
+ var contentRef = React.useRef(null);
26
+ var _a = React.useState(width !== null && width !== void 0 ? width : 0), measuredWidth = _a[0], setMeasuredWidth = _a[1];
27
+ var _b = React.useState(height !== null && height !== void 0 ? height : DEFAULT_HEIGHT), contentHeight = _b[0], setContentHeight = _b[1];
28
+ React.useEffect(function () {
29
+ if (typeof width === 'number' && width > 0) {
30
+ setMeasuredWidth(width);
31
+ return;
32
+ }
33
+ var node = containerRef.current;
34
+ if (!node || typeof ResizeObserver === 'undefined') {
35
+ var rect_1 = node === null || node === void 0 ? void 0 : node.getBoundingClientRect();
36
+ if (rect_1 && rect_1.width > 0) {
37
+ setMeasuredWidth(rect_1.width);
38
+ }
39
+ else {
40
+ setMeasuredWidth(function (prev) { return (prev > 0 ? prev : FALLBACK_WIDTH); });
41
+ }
42
+ return;
43
+ }
44
+ var observer = new ResizeObserver(function (entries) {
45
+ var entry = entries[0];
46
+ if (!entry) {
47
+ return;
48
+ }
49
+ var newWidth = entry.contentRect.width;
50
+ if (newWidth > 0 && Math.abs(newWidth - measuredWidth) > 0.5) {
51
+ setMeasuredWidth(newWidth);
52
+ }
53
+ });
54
+ var rect = node.getBoundingClientRect();
55
+ if (rect.width > 0) {
56
+ setMeasuredWidth(rect.width);
57
+ }
58
+ observer.observe(node);
59
+ return function () { return observer.disconnect(); };
60
+ }, [width, measuredWidth]);
61
+ var resolvedWidth = Math.max(measuredWidth || FALLBACK_WIDTH, 1);
62
+ var resolvedHeight = Math.max(height !== null && height !== void 0 ? height : DEFAULT_HEIGHT, 1);
63
+ React.useEffect(function () {
64
+ var node = contentRef.current;
65
+ if (!node) {
66
+ setContentHeight(function (prev) { return (prev > 0 ? prev : resolvedHeight); });
67
+ return;
68
+ }
69
+ if (typeof ResizeObserver === 'undefined') {
70
+ var rect_2 = node.getBoundingClientRect();
71
+ setContentHeight(function (prev) { return (rect_2.height > 0 ? rect_2.height : prev > 0 ? prev : resolvedHeight); });
72
+ return;
73
+ }
74
+ var observer = new ResizeObserver(function (entries) {
75
+ var entry = entries[0];
76
+ if (!entry) {
77
+ return;
78
+ }
79
+ var newHeight = entry.contentRect.height;
80
+ if (newHeight > 0) {
81
+ setContentHeight(function (prev) { return (Math.abs(prev - newHeight) > 0.5 ? newHeight : prev); });
82
+ }
83
+ });
84
+ var rect = node.getBoundingClientRect();
85
+ setContentHeight(function (prev) { return (rect.height > 0 ? rect.height : prev > 0 ? prev : resolvedHeight); });
86
+ observer.observe(node);
87
+ return function () { return observer.disconnect(); };
88
+ }, [
89
+ resolvedHeight,
90
+ resolvedWidth,
91
+ annotations,
92
+ chartTitle,
93
+ description,
94
+ margin,
95
+ plotBackgroundColor,
96
+ paperBackgroundColor,
97
+ fontColor,
98
+ fontFamily,
99
+ theme,
100
+ ]);
101
+ var svgHeight = Math.max(Math.ceil(contentHeight || 0), resolvedHeight);
102
+ var context = {
103
+ plotRect: { x: 0, y: 0, width: resolvedWidth, height: resolvedHeight },
104
+ svgRect: { width: resolvedWidth, height: resolvedHeight },
105
+ isRtl: theme === null || theme === void 0 ? void 0 : theme.rtl,
106
+ };
107
+ var padding = buildPadding(margin);
108
+ var rootClassName = React.useMemo(function () {
109
+ return (0, Styling_1.mergeStyles)({
110
+ position: 'relative',
111
+ width: width ? "".concat(width, "px") : '100%',
112
+ minHeight: resolvedHeight,
113
+ backgroundColor: paperBackgroundColor !== null && paperBackgroundColor !== void 0 ? paperBackgroundColor : theme.semanticColors.bodyBackground,
114
+ color: fontColor !== null && fontColor !== void 0 ? fontColor : theme.semanticColors.bodyText,
115
+ fontFamily: fontFamily !== null && fontFamily !== void 0 ? fontFamily : theme.fonts.medium.fontFamily,
116
+ padding: padding,
117
+ display: 'flex',
118
+ flexDirection: 'column',
119
+ rowGap: '8px',
120
+ });
121
+ }, [fontColor, fontFamily, paperBackgroundColor, padding, resolvedHeight, theme, width]);
122
+ var contentClassName = React.useMemo(function () {
123
+ var _a;
124
+ return (0, Styling_1.mergeStyles)({
125
+ position: 'relative',
126
+ flexGrow: 1,
127
+ backgroundColor: plotBackgroundColor !== null && plotBackgroundColor !== void 0 ? plotBackgroundColor : 'transparent',
128
+ borderRadius: (_a = theme.effects.roundedCorner2) !== null && _a !== void 0 ? _a : 4,
129
+ boxSizing: 'border-box',
130
+ });
131
+ }, [plotBackgroundColor, theme.effects.roundedCorner2]);
132
+ var titleClassName = React.useMemo(function () {
133
+ return (0, Styling_1.mergeStyles)({
134
+ textAlign: 'center',
135
+ });
136
+ }, []);
137
+ var resolvedAnnotations = annotations !== null && annotations !== void 0 ? annotations : [];
138
+ var hasAnnotations = resolvedAnnotations.length > 0;
139
+ var ariaLabel = hasAnnotations ? description !== null && description !== void 0 ? description : chartTitle : undefined;
140
+ React.useImperativeHandle(componentRef, function () {
141
+ var chartHandle = {
142
+ chartContainer: containerRef.current,
143
+ toImage: function (opts) {
144
+ return (0, image_export_utils_1.exportChartsAsImage)([{ container: containerRef.current }], undefined, (0, react_1.getRTL)(), opts);
145
+ },
146
+ };
147
+ return chartHandle;
148
+ }, []);
149
+ return (React.createElement("div", { ref: containerRef, "data-chart-annotation-container": "true" },
150
+ React.createElement("svg", { width: resolvedWidth, height: svgHeight, viewBox: "0 0 ".concat(resolvedWidth, " ").concat(svgHeight), style: { width: width ? "".concat(width, "px") : '100%', height: "".concat(svgHeight, "px"), display: 'block' }, role: ariaLabel ? 'img' : undefined, "aria-label": ariaLabel },
151
+ React.createElement("foreignObject", { x: 0, y: 0, width: resolvedWidth, height: svgHeight },
152
+ React.createElement("div", { ref: contentRef, className: rootClassName, "data-chart-annotation-only": "true", "aria-label": ariaLabel },
153
+ chartTitle && (React.createElement("span", { className: titleClassName, "aria-hidden": "true" }, chartTitle)),
154
+ React.createElement("div", { className: contentClassName, role: "presentation" }, hasAnnotations ? (React.createElement(ChartAnnotationLayer_1.ChartAnnotationLayer, { annotations: resolvedAnnotations, context: context, theme: theme })) : null))))));
155
+ };
156
+ exports.AnnotationOnlyChart = AnnotationOnlyChart;
157
+ exports.AnnotationOnlyChart.displayName = 'AnnotationOnlyChart';
158
+ });
159
+ //# sourceMappingURL=AnnotationOnlyChart.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AnnotationOnlyChart.js","sourceRoot":"../src/","sources":["components/AnnotationOnlyChart/AnnotationOnlyChart.tsx"],"names":[],"mappings":";;;;IASA,IAAM,cAAc,GAAG,GAAG,CAAC;IAC3B,IAAM,cAAc,GAAG,GAAG,CAAC;IAE3B,IAAM,YAAY,GAAG,UAAC,MAA2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AE,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,UAAG,KAAK,OAAI,CAAC,CAAC,CAAC,MAAM,EAAE,MAAM,EAAE,UAAG,SAAS,OAAI,EAAE,OAAO,EAAE,OAAO,EAAE,EAC3F,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,gBACvB,SAAS;gBAErB,uCAAe,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,EAAE,SAAS;oBAChE,6BAAK,GAAG,EAAE,UAAU,EAAE,SAAS,EAAE,aAAa,gCAA6B,MAAM,gBAAa,SAAS;wBACpG,UAAU,IAAI,CACb,8BAAM,SAAS,EAAE,cAAc,iBAAc,MAAM,IAChD,UAAU,CACN,CACR;wBACD,6BAAK,SAAS,EAAE,gBAAgB,EAAE,IAAI,EAAC,cAAc,IAClD,cAAc,CAAC,CAAC,CAAC,CAChB,oBAAC,2CAAoB,IAAC,WAAW,EAAE,mBAAmB,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,GAAI,CAC3F,CAAC,CAAC,CAAC,IAAI,CACJ,CACF,CACQ,CACZ,CACF,CACP,CAAC;IACJ,CAAC,CAAC;IAtMW,QAAA,mBAAmB,uBAsM9B;IAEF,2BAAmB,CAAC,WAAW,GAAG,qBAAqB,CAAC","sourcesContent":["import * as React from 'react';\nimport { getRTL, useTheme } from '@fluentui/react';\nimport { mergeStyles } from '@fluentui/react/lib/Styling';\nimport { ChartAnnotationLayer } from '../CommonComponents/Annotations/ChartAnnotationLayer';\nimport { exportChartsAsImage } from '../../utilities/image-export-utils';\nimport type { IAnnotationOnlyChartProps } from './AnnotationOnlyChart.types';\nimport type { IChart, IImageExportOptions } from '../../types/index';\nimport type { IChartAnnotationContext } from '../CommonComponents/Annotations/ChartAnnotationLayer.types';\n\nconst DEFAULT_HEIGHT = 650;\nconst FALLBACK_WIDTH = 400;\n\nconst buildPadding = (margin: IAnnotationOnlyChartProps['margin']): string | undefined => {\n if (!margin) {\n return undefined;\n }\n\n const top = margin.t ?? 0;\n const right = margin.r ?? 0;\n const bottom = margin.b ?? 0;\n const left = margin.l ?? 0;\n\n if (top === 0 && right === 0 && bottom === 0 && left === 0) {\n return undefined;\n }\n\n return `${top}px ${right}px ${bottom}px ${left}px`;\n};\n\nexport const AnnotationOnlyChart: React.FC<IAnnotationOnlyChartProps> = props => {\n const {\n annotations,\n chartTitle,\n description,\n width,\n height,\n paperBackgroundColor,\n plotBackgroundColor,\n fontColor,\n fontFamily,\n margin,\n componentRef,\n } = props;\n\n const theme = useTheme();\n const containerRef = React.useRef<HTMLDivElement | null>(null);\n const contentRef = React.useRef<HTMLDivElement | null>(null);\n const [measuredWidth, setMeasuredWidth] = React.useState<number>(width ?? 0);\n const [contentHeight, setContentHeight] = React.useState<number>(height ?? DEFAULT_HEIGHT);\n\n React.useEffect(() => {\n if (typeof width === 'number' && width > 0) {\n setMeasuredWidth(width);\n return;\n }\n\n const node = containerRef.current;\n if (!node || typeof ResizeObserver === 'undefined') {\n const rect = node?.getBoundingClientRect();\n if (rect && rect.width > 0) {\n setMeasuredWidth(rect.width);\n } else {\n setMeasuredWidth(prev => (prev > 0 ? prev : FALLBACK_WIDTH));\n }\n return;\n }\n\n const observer = new ResizeObserver(entries => {\n const entry = entries[0];\n if (!entry) {\n return;\n }\n const newWidth = entry.contentRect.width;\n if (newWidth > 0 && Math.abs(newWidth - measuredWidth) > 0.5) {\n setMeasuredWidth(newWidth);\n }\n });\n\n const rect = node.getBoundingClientRect();\n if (rect.width > 0) {\n setMeasuredWidth(rect.width);\n }\n\n observer.observe(node);\n return () => observer.disconnect();\n }, [width, measuredWidth]);\n\n const resolvedWidth = Math.max(measuredWidth || FALLBACK_WIDTH, 1);\n const resolvedHeight = Math.max(height ?? DEFAULT_HEIGHT, 1);\n\n React.useEffect(() => {\n const node = contentRef.current;\n if (!node) {\n setContentHeight(prev => (prev > 0 ? prev : resolvedHeight));\n return;\n }\n\n if (typeof ResizeObserver === 'undefined') {\n const rect = node.getBoundingClientRect();\n setContentHeight(prev => (rect.height > 0 ? rect.height : prev > 0 ? prev : resolvedHeight));\n return;\n }\n\n const observer = new ResizeObserver(entries => {\n const entry = entries[0];\n if (!entry) {\n return;\n }\n\n const newHeight = entry.contentRect.height;\n if (newHeight > 0) {\n setContentHeight(prev => (Math.abs(prev - newHeight) > 0.5 ? newHeight : prev));\n }\n });\n\n const rect = node.getBoundingClientRect();\n setContentHeight(prev => (rect.height > 0 ? rect.height : prev > 0 ? prev : resolvedHeight));\n\n observer.observe(node);\n return () => observer.disconnect();\n }, [\n resolvedHeight,\n resolvedWidth,\n annotations,\n chartTitle,\n description,\n margin,\n plotBackgroundColor,\n paperBackgroundColor,\n fontColor,\n fontFamily,\n theme,\n ]);\n\n const svgHeight = Math.max(Math.ceil(contentHeight || 0), resolvedHeight);\n\n const context: IChartAnnotationContext = {\n plotRect: { x: 0, y: 0, width: resolvedWidth, height: resolvedHeight },\n svgRect: { width: resolvedWidth, height: resolvedHeight },\n isRtl: theme?.rtl,\n };\n\n const padding = buildPadding(margin);\n\n const rootClassName = React.useMemo(\n () =>\n mergeStyles({\n position: 'relative',\n width: width ? `${width}px` : '100%',\n minHeight: resolvedHeight,\n backgroundColor: paperBackgroundColor ?? theme.semanticColors.bodyBackground,\n color: fontColor ?? theme.semanticColors.bodyText,\n fontFamily: fontFamily ?? theme.fonts.medium.fontFamily,\n padding,\n display: 'flex',\n flexDirection: 'column',\n rowGap: '8px',\n }),\n [fontColor, fontFamily, paperBackgroundColor, padding, resolvedHeight, theme, width],\n );\n\n const contentClassName = React.useMemo(\n () =>\n mergeStyles({\n position: 'relative',\n flexGrow: 1,\n backgroundColor: plotBackgroundColor ?? 'transparent',\n borderRadius: theme.effects.roundedCorner2 ?? 4,\n boxSizing: 'border-box',\n }),\n [plotBackgroundColor, theme.effects.roundedCorner2],\n );\n\n const titleClassName = React.useMemo(\n () =>\n mergeStyles({\n textAlign: 'center',\n }),\n [],\n );\n\n const resolvedAnnotations = annotations ?? [];\n const hasAnnotations = resolvedAnnotations.length > 0;\n const ariaLabel = hasAnnotations ? description ?? chartTitle : undefined;\n\n React.useImperativeHandle(\n componentRef,\n () => {\n const chartHandle: IChart = {\n chartContainer: containerRef.current,\n toImage: (opts?: IImageExportOptions) => {\n return exportChartsAsImage([{ container: containerRef.current }], undefined, getRTL(), opts);\n },\n };\n\n return chartHandle;\n },\n [],\n );\n\n return (\n <div ref={containerRef} data-chart-annotation-container=\"true\">\n <svg\n width={resolvedWidth}\n height={svgHeight}\n viewBox={`0 0 ${resolvedWidth} ${svgHeight}`}\n style={{ width: width ? `${width}px` : '100%', height: `${svgHeight}px`, display: 'block' }}\n role={ariaLabel ? 'img' : undefined}\n aria-label={ariaLabel}\n >\n <foreignObject x={0} y={0} width={resolvedWidth} height={svgHeight}>\n <div ref={contentRef} className={rootClassName} data-chart-annotation-only=\"true\" aria-label={ariaLabel}>\n {chartTitle && (\n <span className={titleClassName} aria-hidden=\"true\">\n {chartTitle}\n </span>\n )}\n <div className={contentClassName} role=\"presentation\">\n {hasAnnotations ? (\n <ChartAnnotationLayer annotations={resolvedAnnotations} context={context} theme={theme} />\n ) : null}\n </div>\n </div>\n </foreignObject>\n </svg>\n </div>\n );\n};\n\nAnnotationOnlyChart.displayName = 'AnnotationOnlyChart';\n"]}
@@ -0,0 +1,33 @@
1
+ import * as React from 'react';
2
+ import type { IChartAnnotation } from '../../types/IChartAnnotation';
3
+ import type { IChart } from '../../types/index';
4
+ import type { Margin } from '@fluentui/chart-utilities';
5
+ /**
6
+ * Props for the annotation-only chart renderer.
7
+ */
8
+ export interface IAnnotationOnlyChartProps {
9
+ /**
10
+ * Collection of annotations to render.
11
+ */
12
+ annotations: IChartAnnotation[];
13
+ /** Optional layout title extracted from the Plotly schema. */
14
+ chartTitle?: string;
15
+ /** Optional descriptive text for accessibility. */
16
+ description?: string;
17
+ /** Desired width in pixels (if absent the chart will grow to fit the container). */
18
+ width?: number;
19
+ /** Desired height in pixels. */
20
+ height?: number;
21
+ /** Paper/background colour specified in the Plotly layout. */
22
+ paperBackgroundColor?: string;
23
+ /** Plot area background colour specified in the Plotly layout. */
24
+ plotBackgroundColor?: string;
25
+ /** Global layout font colour. */
26
+ fontColor?: string;
27
+ /** Global layout font family. */
28
+ fontFamily?: string;
29
+ /** Layout margin converted to padding for the outer wrapper. */
30
+ margin?: Partial<Margin>;
31
+ /** Component ref propagated by the DeclarativeChart surface. */
32
+ componentRef?: React.RefObject<IChart>;
33
+ }
@@ -0,0 +1,5 @@
1
+ define(["require", "exports"], function (require, exports) {
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ });
5
+ //# sourceMappingURL=AnnotationOnlyChart.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AnnotationOnlyChart.types.js","sourceRoot":"../src/","sources":["components/AnnotationOnlyChart/AnnotationOnlyChart.types.ts"],"names":[],"mappings":"","sourcesContent":["import * as React from 'react';\nimport type { IChartAnnotation } from '../../types/IChartAnnotation';\nimport type { IChart } from '../../types/index';\nimport type { Margin } from '@fluentui/chart-utilities';\n\n/**\n * Props for the annotation-only chart renderer.\n */\nexport interface IAnnotationOnlyChartProps {\n /**\n * Collection of annotations to render.\n */\n annotations: IChartAnnotation[];\n /** Optional layout title extracted from the Plotly schema. */\n chartTitle?: string;\n /** Optional descriptive text for accessibility. */\n description?: string;\n /** Desired width in pixels (if absent the chart will grow to fit the container). */\n width?: number;\n /** Desired height in pixels. */\n height?: number;\n /** Paper/background colour specified in the Plotly layout. */\n paperBackgroundColor?: string;\n /** Plot area background colour specified in the Plotly layout. */\n plotBackgroundColor?: string;\n /** Global layout font colour. */\n fontColor?: string;\n /** Global layout font family. */\n fontFamily?: string;\n /** Layout margin converted to padding for the outer wrapper. */\n margin?: Partial<Margin>;\n /** Component ref propagated by the DeclarativeChart surface. */\n componentRef?: React.RefObject<IChart>;\n}\n"]}
@@ -0,0 +1,2 @@
1
+ export * from './AnnotationOnlyChart';
2
+ export * from './AnnotationOnlyChart.types';
@@ -0,0 +1,7 @@
1
+ define(["require", "exports", "tslib", "./AnnotationOnlyChart", "./AnnotationOnlyChart.types"], function (require, exports, tslib_1, AnnotationOnlyChart_1, AnnotationOnlyChart_types_1) {
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ tslib_1.__exportStar(AnnotationOnlyChart_1, exports);
5
+ tslib_1.__exportStar(AnnotationOnlyChart_types_1, exports);
6
+ });
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"../src/","sources":["components/AnnotationOnlyChart/index.ts"],"names":[],"mappings":";;;IAAA,qDAAsC;IACtC,2DAA4C","sourcesContent":["export * from './AnnotationOnlyChart';\nexport * from './AnnotationOnlyChart.types';\n"]}
@@ -21,7 +21,7 @@ define(["require", "exports", "tslib", "react", "d3-array", "d3-selection", "d3-
21
21
  _this._hasMissingXValues = false;
22
22
  _this.toImage = function (opts) {
23
23
  var _a, _b;
24
- return (0, image_export_utils_1.toImage)((_a = _this._cartesianChartRef.current) === null || _a === void 0 ? void 0 : _a.chartContainer, (_b = _this._legendsRef.current) === null || _b === void 0 ? void 0 : _b.toSVG, (0, Utilities_1.getRTL)(), opts);
24
+ return (0, image_export_utils_1.exportChartsAsImage)([{ container: (_a = _this._cartesianChartRef.current) === null || _a === void 0 ? void 0 : _a.chartContainer }], _this.props.hideLegend ? undefined : (_b = _this._legendsRef.current) === null || _b === void 0 ? void 0 : _b.toSVG, (0, Utilities_1.getRTL)(), opts);
25
25
  };
26
26
  _this._getMinMaxOfYAxis = function (points, yAxisType, useSecondaryYScale) {
27
27
  return (0, index_2.findNumericMinMaxOfY)(points, yAxisType, useSecondaryYScale);