@fluentui/react-charts 9.3.16 → 9.3.18

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 (259) hide show
  1. package/CHANGELOG.md +27 -2
  2. package/dist/index.d.ts +11 -11
  3. package/lib/components/AnnotationOnlyChart/AnnotationOnlyChart.types.js +3 -1
  4. package/lib/components/AnnotationOnlyChart/AnnotationOnlyChart.types.js.map +1 -1
  5. package/lib/components/AreaChart/AreaChart.js +3 -5
  6. package/lib/components/AreaChart/AreaChart.js.map +1 -1
  7. package/lib/components/AreaChart/AreaChart.types.js.map +1 -1
  8. package/lib/components/AreaChart/useAreaChartStyles.styles.raw.js.map +1 -1
  9. package/lib/components/ChartTable/ChartTable.js.map +1 -1
  10. package/lib/components/ChartTable/ChartTable.types.js +4 -1
  11. package/lib/components/ChartTable/ChartTable.types.js.map +1 -1
  12. package/lib/components/ChartTable/useChartTableStyles.styles.raw.js.map +1 -1
  13. package/lib/components/CommonComponents/Annotations/ChartAnnotationLayer.types.js.map +1 -1
  14. package/lib/components/CommonComponents/Annotations/useChartAnnotationLayer.styles.raw.js.map +1 -1
  15. package/lib/components/CommonComponents/CartesianChart.js +6 -6
  16. package/lib/components/CommonComponents/CartesianChart.js.map +1 -1
  17. package/lib/components/CommonComponents/CartesianChart.types.js +2 -1
  18. package/lib/components/CommonComponents/CartesianChart.types.js.map +1 -1
  19. package/lib/components/CommonComponents/ChartPopover.js.map +1 -1
  20. package/lib/components/CommonComponents/ChartPopover.types.js.map +1 -1
  21. package/lib/components/CommonComponents/useCartesianChartStyles.styles.raw.js.map +1 -1
  22. package/lib/components/CommonComponents/useChartPopoverStyles.styles.raw.js.map +1 -1
  23. package/lib/components/DeclarativeChart/DeclarativeChart.js +0 -1
  24. package/lib/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
  25. package/lib/components/DeclarativeChart/PlotlyColorAdapter.js +0 -1
  26. package/lib/components/DeclarativeChart/PlotlyColorAdapter.js.map +1 -1
  27. package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js +0 -1
  28. package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
  29. package/lib/components/DonutChart/Arc/Arc.js.map +1 -1
  30. package/lib/components/DonutChart/Arc/Arc.types.js.map +1 -1
  31. package/lib/components/DonutChart/Arc/useArcStyles.styles.raw.js.map +1 -1
  32. package/lib/components/DonutChart/DonutChart.js +1 -2
  33. package/lib/components/DonutChart/DonutChart.js.map +1 -1
  34. package/lib/components/DonutChart/DonutChart.types.js +4 -1
  35. package/lib/components/DonutChart/DonutChart.types.js.map +1 -1
  36. package/lib/components/DonutChart/Pie/Pie.js +2 -5
  37. package/lib/components/DonutChart/Pie/Pie.js.map +1 -1
  38. package/lib/components/DonutChart/Pie/Pie.types.js.map +1 -1
  39. package/lib/components/DonutChart/Pie/usePieStyles.styles.raw.js.map +1 -1
  40. package/lib/components/DonutChart/useDonutChartStyles.styles.raw.js.map +1 -1
  41. package/lib/components/FunnelChart/FunnelChart.js.map +1 -1
  42. package/lib/components/FunnelChart/FunnelChart.types.js +4 -1
  43. package/lib/components/FunnelChart/FunnelChart.types.js.map +1 -1
  44. package/lib/components/FunnelChart/funnelGeometry.js +0 -1
  45. package/lib/components/FunnelChart/funnelGeometry.js.map +1 -1
  46. package/lib/components/FunnelChart/useFunnelChartStyles.styles.raw.js.map +1 -1
  47. package/lib/components/GanttChart/GanttChart.js.map +1 -1
  48. package/lib/components/GanttChart/GanttChart.types.js.map +1 -1
  49. package/lib/components/GanttChart/useGanttChartStyles.styles.raw.js.map +1 -1
  50. package/lib/components/GaugeChart/GaugeChart.js +1 -4
  51. package/lib/components/GaugeChart/GaugeChart.js.map +1 -1
  52. package/lib/components/GaugeChart/GaugeChart.types.js.map +1 -1
  53. package/lib/components/GaugeChart/useGaugeChartStyles.styles.raw.js.map +1 -1
  54. package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js +2 -3
  55. package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js.map +1 -1
  56. package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.types.js.map +1 -1
  57. package/lib/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.raw.js.map +1 -1
  58. package/lib/components/HeatMapChart/HeatMapChart.js.map +1 -1
  59. package/lib/components/HorizontalBarChart/HorizontalBarChart.js +1 -1
  60. package/lib/components/HorizontalBarChart/HorizontalBarChart.js.map +1 -1
  61. package/lib/components/HorizontalBarChart/HorizontalBarChart.types.js +0 -1
  62. package/lib/components/HorizontalBarChart/HorizontalBarChart.types.js.map +1 -1
  63. package/lib/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.raw.js.map +1 -1
  64. package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js +1 -2
  65. package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js.map +1 -1
  66. package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.types.js.map +1 -1
  67. package/lib/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.raw.js.map +1 -1
  68. package/lib/components/Legends/Legends.js +1 -1
  69. package/lib/components/Legends/Legends.js.map +1 -1
  70. package/lib/components/Legends/Legends.types.js +3 -1
  71. package/lib/components/Legends/Legends.types.js.map +1 -1
  72. package/lib/components/Legends/shape.js.map +1 -1
  73. package/lib/components/Legends/useLegendsStyles.styles.raw.js.map +1 -1
  74. package/lib/components/LineChart/LineChart.js +16 -16
  75. package/lib/components/LineChart/LineChart.js.map +1 -1
  76. package/lib/components/LineChart/LineChart.types.js.map +1 -1
  77. package/lib/components/LineChart/eventAnnotation/EventAnnotation.js.map +1 -1
  78. package/lib/components/LineChart/eventAnnotation/LabelLink.js.map +1 -1
  79. package/lib/components/LineChart/useLineChartStyles.styles.raw.js.map +1 -1
  80. package/lib/components/PolarChart/PolarChart.js.map +1 -1
  81. package/lib/components/PolarChart/PolarChart.types.js +4 -1
  82. package/lib/components/PolarChart/PolarChart.types.js.map +1 -1
  83. package/lib/components/PolarChart/PolarChart.utils.js.map +1 -1
  84. package/lib/components/PolarChart/usePolarChartStyles.styles.raw.js.map +1 -1
  85. package/lib/components/ResponsiveContainer/ResponsiveContainer.js.map +1 -1
  86. package/lib/components/ResponsiveContainer/ResponsiveContainer.types.js +4 -1
  87. package/lib/components/ResponsiveContainer/ResponsiveContainer.types.js.map +1 -1
  88. package/lib/components/ResponsiveContainer/useResponsiveChildStyles.styles.raw.js.map +1 -1
  89. package/lib/components/ResponsiveContainer/withResponsiveContainer.js.map +1 -1
  90. package/lib/components/SankeyChart/SankeyChart.js +2 -2
  91. package/lib/components/SankeyChart/SankeyChart.js.map +1 -1
  92. package/lib/components/SankeyChart/SankeyChart.types.js.map +1 -1
  93. package/lib/components/SankeyChart/useSankeyChartStyles.styles.raw.js.map +1 -1
  94. package/lib/components/ScatterChart/ScatterChart.js +3 -4
  95. package/lib/components/ScatterChart/ScatterChart.js.map +1 -1
  96. package/lib/components/ScatterChart/ScatterChart.types.js +1 -1
  97. package/lib/components/ScatterChart/ScatterChart.types.js.map +1 -1
  98. package/lib/components/ScatterChart/useScatterChartStyles.styles.raw.js.map +1 -1
  99. package/lib/components/Sparkline/Sparkline.js +3 -4
  100. package/lib/components/Sparkline/Sparkline.js.map +1 -1
  101. package/lib/components/Sparkline/Sparkline.types.js.map +1 -1
  102. package/lib/components/Sparkline/useSparklineStyles.styles.raw.js.map +1 -1
  103. package/lib/components/VegaDeclarativeChart/VegaDeclarativeChartHooks.js.map +1 -1
  104. package/lib/components/VegaDeclarativeChart/VegaLiteSchemaAdapter.js +1 -1
  105. package/lib/components/VegaDeclarativeChart/VegaLiteSchemaAdapter.js.map +1 -1
  106. package/lib/components/VerticalBarChart/VerticalBarChart.js +5 -8
  107. package/lib/components/VerticalBarChart/VerticalBarChart.js.map +1 -1
  108. package/lib/components/VerticalBarChart/VerticalBarChart.types.js.map +1 -1
  109. package/lib/components/VerticalBarChart/useVerticalBarChartStyles.styles.raw.js.map +1 -1
  110. package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.js +5 -5
  111. package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.js.map +1 -1
  112. package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.types.js +4 -1
  113. package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.types.js.map +1 -1
  114. package/lib/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.raw.js.map +1 -1
  115. package/lib/types/ChartAnnotation.js +1 -1
  116. package/lib/types/ChartAnnotation.js.map +1 -1
  117. package/lib/types/DataPoint.js.map +1 -1
  118. package/lib/types/EventAnnotation.js +1 -1
  119. package/lib/types/EventAnnotation.js.map +1 -1
  120. package/lib/utilities/ChartTitle.js.map +1 -1
  121. package/lib/utilities/FocusableTooltipText.js.map +1 -1
  122. package/lib/utilities/async-utils.js +20 -20
  123. package/lib/utilities/async-utils.js.map +1 -1
  124. package/lib/utilities/hooks.js.map +1 -1
  125. package/lib/utilities/image-export-utils.js.map +1 -1
  126. package/lib/utilities/scatterpolar-utils.js.map +1 -1
  127. package/lib/utilities/test-data.js.map +1 -1
  128. package/lib/utilities/utilities.js +4 -7
  129. package/lib/utilities/utilities.js.map +1 -1
  130. package/lib/utilities/vbc-utils.js.map +1 -1
  131. package/lib-commonjs/components/AnnotationOnlyChart/AnnotationOnlyChart.types.js +3 -3
  132. package/lib-commonjs/components/AnnotationOnlyChart/AnnotationOnlyChart.types.js.map +1 -1
  133. package/lib-commonjs/components/AreaChart/AreaChart.js +3 -5
  134. package/lib-commonjs/components/AreaChart/AreaChart.js.map +1 -1
  135. package/lib-commonjs/components/AreaChart/AreaChart.types.js.map +1 -1
  136. package/lib-commonjs/components/AreaChart/useAreaChartStyles.styles.raw.js.map +1 -1
  137. package/lib-commonjs/components/ChartTable/ChartTable.js.map +1 -1
  138. package/lib-commonjs/components/ChartTable/ChartTable.types.js +4 -3
  139. package/lib-commonjs/components/ChartTable/ChartTable.types.js.map +1 -1
  140. package/lib-commonjs/components/ChartTable/useChartTableStyles.styles.raw.js.map +1 -1
  141. package/lib-commonjs/components/CommonComponents/Annotations/ChartAnnotationLayer.types.js.map +1 -1
  142. package/lib-commonjs/components/CommonComponents/Annotations/useChartAnnotationLayer.styles.raw.js.map +1 -1
  143. package/lib-commonjs/components/CommonComponents/CartesianChart.js +6 -6
  144. package/lib-commonjs/components/CommonComponents/CartesianChart.js.map +1 -1
  145. package/lib-commonjs/components/CommonComponents/CartesianChart.types.js +1 -2
  146. package/lib-commonjs/components/CommonComponents/CartesianChart.types.js.map +1 -1
  147. package/lib-commonjs/components/CommonComponents/ChartPopover.js.map +1 -1
  148. package/lib-commonjs/components/CommonComponents/ChartPopover.types.js.map +1 -1
  149. package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.raw.js.map +1 -1
  150. package/lib-commonjs/components/CommonComponents/useChartPopoverStyles.styles.raw.js.map +1 -1
  151. package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js +0 -1
  152. package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
  153. package/lib-commonjs/components/DeclarativeChart/PlotlyColorAdapter.js +0 -2
  154. package/lib-commonjs/components/DeclarativeChart/PlotlyColorAdapter.js.map +1 -1
  155. package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js +0 -2
  156. package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
  157. package/lib-commonjs/components/DonutChart/Arc/Arc.js.map +1 -1
  158. package/lib-commonjs/components/DonutChart/Arc/Arc.types.js.map +1 -1
  159. package/lib-commonjs/components/DonutChart/Arc/useArcStyles.styles.raw.js.map +1 -1
  160. package/lib-commonjs/components/DonutChart/DonutChart.js +1 -2
  161. package/lib-commonjs/components/DonutChart/DonutChart.js.map +1 -1
  162. package/lib-commonjs/components/DonutChart/DonutChart.types.js +4 -3
  163. package/lib-commonjs/components/DonutChart/DonutChart.types.js.map +1 -1
  164. package/lib-commonjs/components/DonutChart/Pie/Pie.js +2 -5
  165. package/lib-commonjs/components/DonutChart/Pie/Pie.js.map +1 -1
  166. package/lib-commonjs/components/DonutChart/Pie/Pie.types.js.map +1 -1
  167. package/lib-commonjs/components/DonutChart/Pie/usePieStyles.styles.raw.js.map +1 -1
  168. package/lib-commonjs/components/DonutChart/useDonutChartStyles.styles.raw.js.map +1 -1
  169. package/lib-commonjs/components/FunnelChart/FunnelChart.js.map +1 -1
  170. package/lib-commonjs/components/FunnelChart/FunnelChart.types.js +4 -3
  171. package/lib-commonjs/components/FunnelChart/FunnelChart.types.js.map +1 -1
  172. package/lib-commonjs/components/FunnelChart/funnelGeometry.js +0 -2
  173. package/lib-commonjs/components/FunnelChart/funnelGeometry.js.map +1 -1
  174. package/lib-commonjs/components/FunnelChart/useFunnelChartStyles.styles.raw.js.map +1 -1
  175. package/lib-commonjs/components/GanttChart/GanttChart.js.map +1 -1
  176. package/lib-commonjs/components/GanttChart/GanttChart.types.js.map +1 -1
  177. package/lib-commonjs/components/GanttChart/useGanttChartStyles.styles.raw.js.map +1 -1
  178. package/lib-commonjs/components/GaugeChart/GaugeChart.js +1 -4
  179. package/lib-commonjs/components/GaugeChart/GaugeChart.js.map +1 -1
  180. package/lib-commonjs/components/GaugeChart/GaugeChart.types.js.map +1 -1
  181. package/lib-commonjs/components/GaugeChart/useGaugeChartStyles.styles.raw.js.map +1 -1
  182. package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js +2 -3
  183. package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js.map +1 -1
  184. package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.types.js.map +1 -1
  185. package/lib-commonjs/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.raw.js.map +1 -1
  186. package/lib-commonjs/components/HeatMapChart/HeatMapChart.js.map +1 -1
  187. package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.js +1 -1
  188. package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.js.map +1 -1
  189. package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.types.js +3 -3
  190. package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.types.js.map +1 -1
  191. package/lib-commonjs/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.raw.js.map +1 -1
  192. package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js +1 -2
  193. package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js.map +1 -1
  194. package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.types.js.map +1 -1
  195. package/lib-commonjs/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.raw.js.map +1 -1
  196. package/lib-commonjs/components/Legends/Legends.js +1 -1
  197. package/lib-commonjs/components/Legends/Legends.js.map +1 -1
  198. package/lib-commonjs/components/Legends/Legends.types.js +3 -3
  199. package/lib-commonjs/components/Legends/Legends.types.js.map +1 -1
  200. package/lib-commonjs/components/Legends/shape.js.map +1 -1
  201. package/lib-commonjs/components/Legends/useLegendsStyles.styles.raw.js.map +1 -1
  202. package/lib-commonjs/components/LineChart/LineChart.js +16 -16
  203. package/lib-commonjs/components/LineChart/LineChart.js.map +1 -1
  204. package/lib-commonjs/components/LineChart/LineChart.types.js.map +1 -1
  205. package/lib-commonjs/components/LineChart/eventAnnotation/EventAnnotation.js.map +1 -1
  206. package/lib-commonjs/components/LineChart/eventAnnotation/LabelLink.js.map +1 -1
  207. package/lib-commonjs/components/LineChart/useLineChartStyles.styles.raw.js.map +1 -1
  208. package/lib-commonjs/components/PolarChart/PolarChart.js.map +1 -1
  209. package/lib-commonjs/components/PolarChart/PolarChart.types.js +4 -3
  210. package/lib-commonjs/components/PolarChart/PolarChart.types.js.map +1 -1
  211. package/lib-commonjs/components/PolarChart/PolarChart.utils.js.map +1 -1
  212. package/lib-commonjs/components/PolarChart/usePolarChartStyles.styles.raw.js.map +1 -1
  213. package/lib-commonjs/components/ResponsiveContainer/ResponsiveContainer.js.map +1 -1
  214. package/lib-commonjs/components/ResponsiveContainer/ResponsiveContainer.types.js +4 -3
  215. package/lib-commonjs/components/ResponsiveContainer/ResponsiveContainer.types.js.map +1 -1
  216. package/lib-commonjs/components/ResponsiveContainer/useResponsiveChildStyles.styles.raw.js.map +1 -1
  217. package/lib-commonjs/components/ResponsiveContainer/withResponsiveContainer.js.map +1 -1
  218. package/lib-commonjs/components/SankeyChart/SankeyChart.js +2 -2
  219. package/lib-commonjs/components/SankeyChart/SankeyChart.js.map +1 -1
  220. package/lib-commonjs/components/SankeyChart/SankeyChart.types.js.map +1 -1
  221. package/lib-commonjs/components/SankeyChart/useSankeyChartStyles.styles.raw.js.map +1 -1
  222. package/lib-commonjs/components/ScatterChart/ScatterChart.js +3 -4
  223. package/lib-commonjs/components/ScatterChart/ScatterChart.js.map +1 -1
  224. package/lib-commonjs/components/ScatterChart/ScatterChart.types.js +1 -1
  225. package/lib-commonjs/components/ScatterChart/ScatterChart.types.js.map +1 -1
  226. package/lib-commonjs/components/ScatterChart/useScatterChartStyles.styles.raw.js.map +1 -1
  227. package/lib-commonjs/components/Sparkline/Sparkline.js +3 -4
  228. package/lib-commonjs/components/Sparkline/Sparkline.js.map +1 -1
  229. package/lib-commonjs/components/Sparkline/Sparkline.types.js.map +1 -1
  230. package/lib-commonjs/components/Sparkline/useSparklineStyles.styles.raw.js.map +1 -1
  231. package/lib-commonjs/components/VegaDeclarativeChart/VegaDeclarativeChartHooks.js.map +1 -1
  232. package/lib-commonjs/components/VegaDeclarativeChart/VegaLiteSchemaAdapter.js +1 -1
  233. package/lib-commonjs/components/VegaDeclarativeChart/VegaLiteSchemaAdapter.js.map +1 -1
  234. package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.js +5 -8
  235. package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.js.map +1 -1
  236. package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.types.js.map +1 -1
  237. package/lib-commonjs/components/VerticalBarChart/useVerticalBarChartStyles.styles.raw.js.map +1 -1
  238. package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.js +5 -5
  239. package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.js.map +1 -1
  240. package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.types.js +4 -3
  241. package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.types.js.map +1 -1
  242. package/lib-commonjs/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.raw.js.map +1 -1
  243. package/lib-commonjs/types/ChartAnnotation.js +0 -2
  244. package/lib-commonjs/types/ChartAnnotation.js.map +1 -1
  245. package/lib-commonjs/types/DataPoint.js.map +1 -1
  246. package/lib-commonjs/types/EventAnnotation.js +0 -2
  247. package/lib-commonjs/types/EventAnnotation.js.map +1 -1
  248. package/lib-commonjs/utilities/ChartTitle.js.map +1 -1
  249. package/lib-commonjs/utilities/FocusableTooltipText.js.map +1 -1
  250. package/lib-commonjs/utilities/async-utils.js +20 -20
  251. package/lib-commonjs/utilities/async-utils.js.map +1 -1
  252. package/lib-commonjs/utilities/hooks.js.map +1 -1
  253. package/lib-commonjs/utilities/image-export-utils.js.map +1 -1
  254. package/lib-commonjs/utilities/scatterpolar-utils.js.map +1 -1
  255. package/lib-commonjs/utilities/test-data.js.map +1 -1
  256. package/lib-commonjs/utilities/utilities.js +2 -2
  257. package/lib-commonjs/utilities/utilities.js.map +1 -1
  258. package/lib-commonjs/utilities/vbc-utils.js.map +1 -1
  259. package/package.json +8 -8
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/types/DataPoint.ts"],"sourcesContent":["import { SVGProps } from 'react';\nimport { LegendShape } from '../components/Legends/Legends.types';\nimport { CurveFactory } from 'd3-shape';\nimport { SankeyLink, SankeyNode } from 'd3-sankey';\n\nexport interface Basestate {\n _width?: number;\n _height?: number;\n activeLegend?: string;\n color?: string;\n dataForHoverCard?: number | string;\n isCalloutVisible: boolean;\n isLegendSelected?: boolean;\n isLegendHovered?: boolean;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n refSelected?: any;\n YValueHover?: { legend?: string; y?: number | string; color?: string }[];\n hoverYValue?: string | number | null;\n hoverXValue?: string | number | null;\n xCalloutValue?: string;\n yCalloutValue?: string;\n lineColor?: string;\n hoveredLineColor?: string;\n selectedLegend?: string;\n containerWidth?: number;\n containerHeight?: number;\n}\n\nexport interface RefArrayData {\n index?: string;\n refElement?: SVGGElement;\n}\n\n/**\n * {@docCategory ChartProps}\n */\nexport interface Margins {\n /**\n * left margin for the chart.\n */\n left?: number;\n /**\n * Right margin for the chart.\n */\n right?: number;\n /**\n * Top margin for the chart.\n */\n top?: number;\n /**\n * Bottom margin for the chart.\n */\n bottom?: number;\n}\n\n/**\n * {@docCategory ChartData}\n */\nexport interface DataPoint {\n /**\n * Independent value of the data point, rendered along the x-axis.\n * If x is a number, then each y-coordinate is plotted at its x-coordinate.\n * If x is a string, then the data is evenly spaced along the x-axis.\n */\n x: number | string;\n\n /**\n * Dependent value of the data point, rendered along the y-axis.\n */\n y: number;\n\n // NOTE: VerticalStackedBarChart, PieChart\n /**\n * onClick action for each datapoint in the chart\n */\n onClick?: VoidFunction;\n}\n\n/**\n * {@docCategory ChartData}\n */\nexport interface VerticalStackedBarDataPoint extends Omit<DataPoint, 'x'> {\n /**\n * Independent value of the data point, rendered along the x-axis.\n * If x is a number, then each y-coordinate is plotted at its x-coordinate.\n * If x is a string, then the data is evenly spaced along the x-axis.\n * If data type on x is Date, then the data is spaced evenly by d3-scale.\n */\n x: number | string | Date;\n}\n\n/**\n * {@docCategory ChartData}\n */\nexport interface HorizontalDataPoint {\n /**\n * Independent value of the data point, rendered along the x-axis.\n * If x is a number, then each y-coordinate is plotted at its x-coordinate.\n * If x is a string, then the data is evenly spaced along the x-axis.\n */\n x: number;\n\n /**\n * Total value of a single point bar chart.\n */\n total?: number;\n}\n\n/**\n * {@docCategory ChartData}\n */\nexport interface ChartDataPoint {\n /**\n * Legend text for the datapoint in the chart\n */\n legend?: string;\n\n /**\n * data the datapoint in the chart\n */\n data?: number;\n\n /**\n * data the datapoint in the chart\n */\n horizontalBarChartdata?: HorizontalDataPoint;\n\n /**\n * onClick action for each datapoint in the chart\n */\n onClick?: VoidFunction;\n\n /**\n * Color for the legend in the chart. If not provided, it will fallback on the default color palette.\n */\n color?: string;\n\n /**\n * placeholder data point\n */\n placeHolder?: boolean;\n\n /**\n * Callout data for x axis\n * This is an optional prop, If haven't given legend will take\n */\n xAxisCalloutData?: string;\n\n /**\n * Callout data for y axis\n * This is an optional prop, If haven't given data will take\n */\n yAxisCalloutData?: string;\n\n /**\n * Accessibility data for callout\n */\n callOutAccessibilityData?: AccessibilityProps;\n}\n\n/**\n * {@docCategory ChartData}\n */\nexport interface VerticalBarChartDataPoint {\n /**\n * Independent value of the data point, rendered along the x-axis.\n * If x is a number, then each y-coordinate is plotted at its x-coordinate.\n * If x is a string, then the data is evenly spaced along the x-axis.\n */\n x: number | string | Date;\n\n /**\n * Dependent value of the data point, rendered along the y-axis.\n */\n y: number;\n\n /**\n * Legend text for the datapoint in the chart\n */\n legend?: string;\n\n /**\n * color for the legend in the chart\n */\n color?: string;\n\n /**\n * Callout data for x axis\n * This is an optional prop, If haven't given legend will take\n */\n xAxisCalloutData?: string;\n\n /**\n * Callout data for y axis\n * This is an optional prop, If haven't given data will take\n */\n yAxisCalloutData?: string;\n\n /**\n * data to render the line along with bars\n */\n lineData?: LineDataInVerticalBarChart;\n\n /**\n * onClick action for each datapoint in the chart\n */\n onClick?: VoidFunction;\n\n /**\n * Accessibility data for callout\n */\n callOutAccessibilityData?: AccessibilityProps;\n\n /**\n * Label to display on the bar\n * This is an optional prop that can be used to show custom text on bars\n */\n barLabel?: string;\n}\n\n/**\n * {@docCategory ChartData}\n */\nexport interface HorizontalBarChartWithAxisDataPoint {\n /**\n * Dependent value of the data point, rendered along the x-axis.\n */\n x: number;\n\n /**\n * Independent value of the data point, rendered along the y-axis.\n * If y is a number, then each y-coordinate is plotted at its y-coordinate.\n * If y is a string, then the data is evenly spaced along the y-axis.\n */\n y: number | string;\n\n /**\n * Legend text for the datapoint in the chart\n */\n legend?: string;\n\n /**\n * color for the legend in the chart\n */\n color?: string;\n\n /**\n * Callout data for x axis\n * This is an optional prop, If haven't given legend will take\n */\n xAxisCalloutData?: string;\n\n /**\n * Callout data for y axis\n * This is an optional prop, If haven't given data will take\n */\n yAxisCalloutData?: string;\n\n /**\n * Label to display on the bar\n */\n barLabel?: string;\n\n /**\n * onClick action for each datapoint in the chart\n */\n onClick?: VoidFunction;\n\n /**\n * Accessibility data for callout\n */\n callOutAccessibilityData?: AccessibilityProps;\n}\n\n/**\n * {@docCategory ChartData}\n */\nexport interface LineDataInVerticalBarChart {\n y: VerticalBarChartDataPoint['y'];\n yAxisCalloutData?: string | undefined;\n\n /**\n * onClick action for each datapoint in the chart\n */\n onClick?: VoidFunction;\n /**\n * Whether to use the secondary y scale or not\n * False by default.\n */\n useSecondaryYScale?: boolean;\n}\n\n/**\n * {@docCategory ChartData}\n */\ninterface BaseDataPoint {\n /**\n * Defines the function that is executed on clicking line\n */\n onDataPointClick?: () => void;\n\n /**\n * Callout data for x axis\n */\n xAxisCalloutData?: string;\n\n /**\n * Callout data for y axis\n */\n yAxisCalloutData?: string | { [id: string]: number };\n\n /**\n * Whether to hide callout data for the point.\n */\n hideCallout?: boolean;\n\n /**\n * Accessibility data for callout\n */\n callOutAccessibilityData?: AccessibilityProps;\n\n /**\n * X axis Accessibility data for callout\n */\n xAxisCalloutAccessibilityData?: AccessibilityProps;\n\n /**\n * Marker size of the points\n */\n markerSize?: number;\n}\n\n/**\n * {@docCategory ChartData}\n */\nexport interface LineChartDataPoint extends BaseDataPoint {\n /**\n * Independent value of the data point, rendered along the x-axis.\n */\n x: number | Date;\n\n /**\n * Dependent value of the data point, rendered along the y-axis.\n */\n y: number;\n\n /**\n * text labels of marker points\n */\n text?: string;\n\n /**\n * Per-point marker color (overrides series color when present)\n */\n markerColor?: string;\n}\n\n/**\n * {@docCategory ChartData}\n * ScatterChartDataPoint interface.\n */\nexport interface ScatterChartDataPoint extends BaseDataPoint {\n /**\n * Independent value of the data point, rendered along the x-axis.\n */\n x: number | Date | string;\n\n /**\n * Dependent value of the data point, rendered along the y-axis.\n */\n y: number;\n\n /**\n * Marker size of the points\n */\n markerSize?: number;\n\n /**\n * text labels of marker points\n */\n text?: string;\n\n /**\n * Per-point marker color (overrides series color when present)\n */\n markerColor?: string;\n}\n\n/**\n * {@docCategory ChartData}\n */\nexport interface LineChartGap {\n /**\n * Starting index of the gap.\n */\n startIndex: number;\n\n /**\n * Ending index of the gap.\n */\n endIndex: number;\n}\n\n/**\n * {@docCategory ChartProps}\n */\nexport interface LineChartLineOptions extends SVGProps<SVGPathElement> {\n /**\n * Width of the line/stroke.\n * Overrides the strokeWidth set on ICartesianChartProps level.\n * @see https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-width\n */\n strokeWidth?: number | string;\n\n /**\n * Pattern of dashes and gaps.\n * @see https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-dasharray\n */\n strokeDasharray?: string | number;\n\n /**\n * Offset on rendering of stroke dash array.\n * @see https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-dashoffset\n */\n strokeDashoffset?: string | number;\n\n /**\n * Shape at the end of a subpath.\n * Default round.\n * @see https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-linecap\n */\n strokeLinecap?: 'butt' | 'round' | 'square' | 'inherit';\n\n /**\n * Width of border around the line. Default no border.\n */\n lineBorderWidth?: string | number;\n\n /**\n * Color of border around the line. Default white.\n */\n lineBorderColor?: string;\n\n /**\n * Defines the type of interpolation used to render the line.\n * @default 'linear'\n */\n curve?: 'linear' | 'natural' | 'step' | 'stepAfter' | 'stepBefore' | CurveFactory;\n\n /**\n * Defines the mode of points to be rendered.\n */\n mode?:\n | 'lines'\n | 'markers'\n | 'text'\n | 'lines+markers'\n | 'text+markers'\n | 'text+lines'\n | 'text+lines+markers'\n | 'none'\n | 'gauge'\n | 'number'\n | 'delta'\n | 'number+delta'\n | 'gauge+number'\n | 'gauge+number+delta'\n | 'gauge+delta'\n | 'markers+text'\n | 'lines+text'\n | 'lines+markers+text';\n}\n\n/**\n * {@docCategory ChartData}\n */\nexport interface LineChartPoints {\n /**\n * Legend text for the datapoint in the chart\n */\n legend: string;\n\n /**\n * The shape for the legend\n * default: show the rect legend\n */\n legendShape?: LegendShape;\n\n /**\n * dataPoints for the line chart\n */\n data: LineChartDataPoint[] | ScatterChartDataPoint[];\n\n /**\n * gaps in the line chart where a line is not drawn\n */\n gaps?: LineChartGap[];\n\n /**\n * color for the legend in the chart\n */\n color?: string;\n\n /**\n * opacity for chart fill color\n */\n opacity?: number;\n\n /**\n * options for the line drawn\n */\n lineOptions?: LineChartLineOptions;\n\n /**\n * hide dots for points that are not active\n */\n hideNonActiveDots?: boolean;\n\n /**\n * Defines the function that is executed on clicking this legend\n */\n onLegendClick?: (selectedLegend: string | null | string[]) => void;\n\n /**\n * Defines the function that is executed on clicking line\n */\n onLineClick?: () => void;\n\n /**\n * Whether to use the secondary y scale or not\n * False by default.\n */\n useSecondaryYScale?: boolean;\n}\n\n/**\n * {@docCategory ChartProps}\n */\nexport interface ChartProps {\n /**\n * chart title for the chart\n */\n chartTitle?: string;\n\n /**\n * Accessibility data for chart title\n */\n chartTitleAccessibilityData?: AccessibilityProps;\n /**\n * data for the points in the chart\n */\n chartData?: ChartDataPoint[];\n\n /**\n * Accessibility data for chart data\n */\n chartDataAccessibilityData?: AccessibilityProps;\n\n /**\n * data for the points in the line chart\n */\n lineChartData?: LineChartPoints[];\n\n /**\n * data for the points in the scatter chart\n */\n scatterChartData?: ScatterChartPoints[];\n\n /**\n * data for the points in the line chart\n */\n SankeyChartData?: SankeyChartData;\n\n /**\n * data for the points in the line chart\n */\n pointOptions?: SVGProps<SVGCircleElement>;\n\n /**\n * data for the dotted line on hovering the point\n */\n pointLineOptions?: SVGProps<SVGLineElement>;\n}\n\n/**\n * {@docCategory ChartProps}\n */\nexport interface AccessibilityProps {\n /**\n * Accessibility aria-label\n */\n ariaLabel?: string;\n\n /**\n * Accessibility aria-labelledBy\n */\n ariaLabelledBy?: string;\n\n /**\n * Accessibility aria-describedBy\n */\n ariaDescribedBy?: string;\n}\n\n/**\n * {@docCategory ChartData}\n */\nexport interface VSChartDataPoint {\n /**\n * data the datapoint in the chart\n */\n data: number | string;\n\n /**\n * Legend text for the datapoint in the chart\n */\n legend: string;\n\n /**\n * color for the legend in the chart\n */\n color?: string;\n\n /**\n * Callout data for x axis\n * This is an optional prop, If haven't given legend will take\n */\n xAxisCalloutData?: string;\n\n /**\n * Callout data for y axis\n * This is an optional prop, If haven't given data will take\n */\n yAxisCalloutData?: string;\n\n /**\n * Accessibility data for callout\n */\n callOutAccessibilityData?: AccessibilityProps;\n\n /**\n * The prop used to define the culture to localized the numbers\n */\n culture?: string;\n\n /**\n * Label to display on the bar\n * This is an optional prop that can be used to show custom text on bars\n */\n barLabel?: string;\n}\n\n/**\n * {@docCategory ChartProps}\n */\nexport interface VerticalStackedChartProps {\n /**\n * data for the points in the chart\n */\n chartData: VSChartDataPoint[];\n\n /**\n * Data for x axis label for multistacked Vertical bar chart\n */\n xAxisPoint: number | string | Date;\n\n /**\n * Callout data for x axis\n * This is an optional prop, If haven't given, legend will take\n */\n xAxisCalloutData?: string;\n /**\n * line data to render lines on stacked bar chart\n */\n lineData?: LineDataInVerticalStackedBarChart[];\n /**\n * Accessibility data for Whole stack callout\n */\n stackCallOutAccessibilityData?: AccessibilityProps;\n}\n\n/**\n * {@docCategory ChartData}\n */\nexport interface LineDataInVerticalStackedBarChart {\n y: number | string;\n color: string;\n legend: string;\n /**\n * The shape for the legend\n * default: show the rect legend\n */\n legendShape?: LegendShape;\n /**\n * Data to show in callout\n */\n data?: number | string;\n yAxisCalloutData?: string;\n /**\n * Whether to use the secondary y scale or not\n * False by default.\n */\n useSecondaryYScale?: boolean;\n /**\n * options for the line drawn\n */\n lineOptions?: LineChartLineOptions;\n}\n\n/**\n * {@docCategory ChartData}\n */\nexport interface GVBarChartSeriesPoint {\n /**\n * Text for // need to check use of this\n */\n key: string;\n\n /**\n * Data for bar height of Grouped vertical bar chart\n */\n data: number;\n\n /**\n * Color for the legend in the chart\n */\n color?: string;\n\n /**\n * Legend text in the chart\n */\n legend: string;\n\n /**\n * Callout data for x axis\n * This is an optional prop, If haven't given legend will take\n */\n xAxisCalloutData?: string;\n\n /**\n * Callout data for y axis\n * This is an optional prop, If haven't given data will take\n */\n yAxisCalloutData?: string;\n\n /**\n * onClick action for each datapoint in the chart\n */\n onClick?: VoidFunction;\n\n /**\n * Accessibility data for callout\n */\n callOutAccessibilityData?: AccessibilityProps;\n\n /**\n * Whether to use the secondary y scale or not\n * False by default.\n */\n useSecondaryYScale?: boolean;\n\n /**\n * Label to display on the bar\n */\n barLabel?: string;\n}\n\n/**\n * {@docCategory ChartData}\n */\nexport interface GroupedVerticalBarChartData {\n /**\n * Data for X axis label\n */\n name: string;\n\n /**\n * Data points for Grouped vertical bar chart\n */\n series: GVBarChartSeriesPoint[];\n\n /**\n * Accessibility data for Group Bars Stack Callout\n */\n stackCallOutAccessibilityData?: AccessibilityProps;\n}\n\nexport interface GVDataPoint {\n /**\n * This interface used for - While forming datapoints from given prop \"data\" in code\n * datapoints are used for to draw graph\n */\n [key: string]: number | string;\n}\n\nexport interface GVSingleDataPoint {\n /**\n * While forming datapoints from given prop \"data\" in code.\n * These datapoints are used for to draw graph easily.\n */\n [key: string]: GVDataPoint;\n}\n\nexport interface GVForBarChart {\n /**\n * While forming datapoints from given prop \"data\"\n * These datapoints are used for to draw graph.\n */\n [key: string]: GVBarChartSeriesPoint;\n}\n\n/**\n * {@docCategory ChartData}\n */\nexport interface CustomizedCalloutDataPoint {\n legend: string;\n y: number;\n color: string;\n xAxisCalloutData?: string;\n yAxisCalloutData?: string | { [id: string]: number };\n}\n\n/**\n * Used for custom callout data interface. As Area chart callout data will be prepared from given props.data,\n * Those required data passing to onRenderCalloutPerDataPoint and onRenderCalloutPerStack.\n * {@docCategory ChartData}\n */\nexport interface CustomizedCalloutData {\n x: number | string | Date;\n values: CustomizedCalloutDataPoint[];\n}\n\n/**\n * {@docCategory Chart}\n */\nexport interface Chart {\n chartContainer: HTMLElement | null;\n toImage?: (opts?: ImageExportOptions) => Promise<string>;\n}\n\n/**\n * {@docCategory Chart}\n */\nexport interface ImageExportOptions {\n width?: number;\n height?: number;\n scale?: number;\n background?: string;\n}\n\nexport interface HeatMapChartDataPoint {\n x: string | Date | number;\n y: string | Date | number;\n value: number;\n /**\n * The value/ text to be rendered in the rectange\n */\n rectText?: string | number;\n /**\n * denomination to show in the callout\n */\n ratio?: [number, number];\n /**\n * description message to the callout\n */\n descriptionMessage?: string;\n\n /**\n * onClick action for each datapoint in the chart\n */\n onClick?: VoidFunction;\n /**\n * Accessibility data for callout\n */\n callOutAccessibilityData?: AccessibilityProps;\n}\n\n/**\n * {@docCategory ChartData}\n */\nexport interface HeatMapChartData {\n /**\n * name of the legend\n */\n legend: string;\n data: HeatMapChartDataPoint[];\n /**\n * This number will be used to get the color for the legend\n */\n value: number;\n}\n\n/**\n * {@docCategory ChartData}\n */\nexport interface SankeyChartData {\n nodes: SNode[];\n links: SLink[];\n}\n\ninterface SNodeExtra {\n /**\n * A unique identifier for this node.\n */\n nodeId: number | string;\n /**\n * The display name for this node in the UX.\n */\n name: string;\n color?: string;\n borderColor?: string;\n actualValue?: number;\n layer?: number;\n}\n\ninterface SLinkExtra {\n /**\n * The index within `ISankeyChartData.nodes` of the source node.\n */\n source: number;\n /**\n * The index within `ISankeyChartData.nodes` of the target node.\n */\n target: number;\n /**\n * The weight of this link between the two nodes.\n */\n value: number;\n unnormalizedValue?: number;\n color?: string;\n}\n\nexport type SNode = SankeyNode<SNodeExtra, SLinkExtra>;\nexport type SLink = SankeyLink<SNodeExtra, SLinkExtra>;\n\n/**\n * Specifies the ordering options for axis categories in Cartesian charts.\n *\n * - `'default'`: Uses the original order before custom ordering was supported.\n * In some charts, this behaves the same as `'data'`.\n * - `'data'`: Preserves the order of categories as provided in the input data.\n * - `string[]`: Explicitly defines the custom order of categories as an array of category names.\n * - `'category ascending' | 'category descending'`: Orders categories alphanumerically.\n * - `'total ascending' | 'total descending'`: Orders categories by the total of their associated values.\n * - `'min ascending' | 'min descending'`: Orders by the minimum value within each category.\n * - `'max ascending' | 'max descending'`: Orders by the maximum value within each category.\n * - `'sum ascending' | 'sum descending'`: Orders by the sum of values for each category (same as 'total').\n * - `'mean ascending' | 'mean descending'`: Orders by the average of values in each category.\n * - `'median ascending' | 'median descending'`: Orders by the median value of each category.\n *\n * {@docCategory CartesianChart}\n */\nexport type AxisCategoryOrder =\n | 'default'\n | 'data'\n | string[]\n | 'category ascending'\n | 'category descending'\n | 'total ascending'\n | 'total descending'\n | 'min ascending'\n | 'min descending'\n | 'max ascending'\n | 'max descending'\n | 'sum ascending'\n | 'sum descending'\n | 'mean ascending'\n | 'mean descending'\n | 'median ascending'\n | 'median descending';\n\n/**\n * {@docCategory IChartData}\n */\nexport interface GanttChartDataPoint {\n /**\n * Dependent value of the data point, rendered along the x-axis.\n */\n x: {\n start: Date | number;\n end: Date | number;\n };\n\n /**\n * Independent value of the data point, rendered along the y-axis.\n * If y is a number, then each y-coordinate is plotted at its y-coordinate.\n * If y is a string, then the data is evenly spaced along the y-axis.\n */\n y: number | string;\n\n /**\n * Legend text for the datapoint in the chart\n */\n legend?: string;\n\n /**\n * color for the legend in the chart\n */\n color?: string;\n\n /**\n * Gradient for the legend in the chart. If not provided, it will fallback on the default color palette.\n * If provided, it will override the color prop. granted `enableGradient` is set to true for the chart.\n */\n gradient?: [string, string];\n\n /**\n * Callout data for x axis\n * This is an optional prop, If haven't given legend will take\n */\n xAxisCalloutData?: string;\n\n /**\n * Callout data for y axis\n * This is an optional prop, If haven't given data will take\n */\n yAxisCalloutData?: string;\n\n /**\n * onClick action for each datapoint in the chart\n */\n onClick?: VoidFunction;\n\n /**\n * Accessibility data for callout\n */\n callOutAccessibilityData?: AccessibilityProps;\n}\n\n/**\n * {@docCategory IChartData}\n */\nexport interface ScatterChartPoints {\n /**\n * Legend text for the datapoint in the chart\n */\n legend: string;\n\n /**\n * The shape for the legend\n * default: show the rect legend\n */\n legendShape?: LegendShape;\n\n /**\n * dataPoints for the line chart\n */\n data: ScatterChartDataPoint[];\n\n /**\n * color for the legend in the chart\n */\n color?: string;\n\n /**\n * opacity for chart fill color\n */\n opacity?: number;\n\n /**\n * hide dots for points that are not active\n */\n hideNonActiveDots?: boolean;\n\n /**\n * Defines the function that is executed on clicking this legend\n */\n onLegendClick?: (selectedLegend: string | null | string[]) => void;\n\n /**\n * Whether to use the secondary y scale or not\n * False by default.\n */\n useSecondaryYScale?: boolean;\n}\n\n/**\n * Available scale types for axes.\n *\n * - `'default'`: Uses an automatic scale (linear, band, or time) based on axis data type.\n * - `'log'`: Uses a logarithmic scale. Only supported for numeric axes in LineChart and ScatterChart.\n *\n * {@docCategory CartesianChart}\n */\nexport type AxisScaleType = 'default' | 'log';\n\n/**\n * Configuration options for an axis.\n *\n * {@docCategory CartesianChart}\n */\nexport type AxisProps = {\n /**\n * Defines the step between tick marks on the axis.\n * Works in combination with `tick0`.\n * Must be a positive number.\n *\n * - **Log scale**:\n * - Ticks are placed at `10^(n * tickStep)` where `n` is the tick index.\n * - Example: `tickStep = 2` → ticks at 1, 100, 10,000...\n * - Example: `tickStep = log10(5)` → ticks at 1, 5, 25, 125...\n * - Special format `\"L<f>\"`: Creates ticks that are linearly spaced in value (not position).\n * - Example: `tick0 = 0.1`, `tickStep = \"L0.5\"` → ticks at 0.1, 0.6, 1.1, 1.6...\n *\n * - **Date axis**:\n * - Must be in milliseconds.\n * - Example: one day = `tickStep = 86400000`.\n * - Special format `\"M<n>\"`: Places ticks every `n` months.\n * - Example: `tick0 = \"2000-01-15\"`, `tickStep = \"M3\"` → ticks on the 15th every third month.\n * - Example: `tickStep = \"M48\"` → ticks every 4 years.\n */\n tickStep?: number | string;\n\n /**\n * Sets the reference value for axis ticks.\n * Works in combination with `tickStep`.\n *\n * - **Log scale**:\n * - `tick0` must be given as the logarithm of the reference tick.\n * - Example: to align ticks with 100, use `tick0 = 2`.\n * - Exception: when `tickStep` uses `\"L<f>\"`, you can specify the raw value directly.\n */\n tick0?: number | Date;\n\n /**\n * Sets the text displayed at each tick position specified by `tickValues`. Used with `tickValues`.\n */\n tickText?: string[];\n};\n\n/**\n * Represents a single data point in a series.\n */\nexport interface DataPointV2<X extends string | number | Date, Y extends string | number | Date> {\n /**\n * X-axis value of the data point.\n */\n x: X;\n\n /**\n * Y-axis value of the data point.\n */\n y: Y;\n\n /**\n * Optional click handler for the data point.\n */\n onClick?: () => void;\n\n /**\n * Custom text to show in the callout in place of the x-axis value.\n */\n xAxisCalloutData?: string;\n\n /**\n * Custom text to show in the callout in place of the y-axis value.\n */\n yAxisCalloutData?: string;\n\n /**\n * Accessibility properties for the data point.\n */\n callOutAccessibilityData?: AccessibilityProps;\n\n /**\n * Custom marker size for the data point.\n */\n markerSize?: number;\n\n /**\n * Optional text to annotate or label the data point.\n */\n text?: string;\n\n /**\n * Color of the data point. If not provided, it will inherit the series color.\n */\n color?: string;\n}\n\n/**\n * Base interface for a series.\n */\nexport interface DataSeries {\n /**\n * Name of the series to be displayed in the legend.\n */\n legend: string;\n\n /**\n * Shape used in the legend (e.g., circle, square).\n */\n legendShape?: LegendShape;\n\n /**\n * Color of the series.\n */\n color?: string;\n\n /**\n * Opacity of the series.\n */\n opacity?: number;\n\n /**\n * Gradient fill for the series (start and end colors).\n */\n gradient?: [string, string];\n\n /**\n * Whether this series should be plotted against a secondary Y-axis.\n */\n useSecondaryYScale?: boolean;\n\n /**\n * Callback invoked when the legend item is clicked.\n */\n onLegendClick?: (selectedLegend: string | null | string[]) => void;\n}\n\n/**\n * Represents a bar series.\n */\nexport interface BarSeries<X extends string | number | Date, Y extends string | number | Date> extends DataSeries {\n /**\n * Type discriminator: always 'bar' for this series.\n */\n type: 'bar';\n\n /**\n * Array of data points for the series.\n */\n data: DataPointV2<X, Y>[];\n\n /**\n * Optional group identifier for the series.\n */\n key?: string;\n}\n\n/**\n * Represents a line series.\n */\nexport interface LineSeries<X extends string | number | Date, Y extends string | number | Date> extends DataSeries {\n /**\n * Type discriminator: always 'line' for this series.\n */\n type: 'line';\n\n /**\n * Array of data points for the series.\n */\n data: DataPointV2<X, Y>[];\n\n /**\n * Optional gaps to render in the line.\n */\n gaps?: LineChartGap[];\n\n /**\n * Additional line rendering options (e.g., stroke width, curve type).\n */\n lineOptions?: LineChartLineOptions;\n\n /**\n * If true, hides dots for inactive (unfocused/unhovered) data points.\n */\n hideInactiveDots?: boolean;\n\n /**\n * Callback invoked when the line itself is clicked.\n */\n onLineClick?: () => void;\n}\n\n/**\n * Represents a single data point in a polar series.\n */\nexport interface PolarDataPoint {\n /**\n * Radial value of the data point.\n */\n r: string | number | Date;\n\n /**\n * Angular value of the data point, specified as a category or in degrees.\n */\n theta: string | number;\n\n /**\n * Optional click handler for the data point.\n */\n onClick?: () => void;\n\n /**\n * Custom text to show in the callout in place of the radial axis value.\n */\n radialAxisCalloutData?: string;\n\n /**\n * Custom text to show in the callout in place of the angular axis value.\n */\n angularAxisCalloutData?: string;\n\n /**\n * Accessibility properties for the data point.\n */\n callOutAccessibilityData?: AccessibilityProps;\n\n /**\n * Custom marker size for the data point.\n */\n markerSize?: number;\n\n /**\n * Optional text to annotate or label the data point.\n */\n text?: string;\n\n /**\n * Color of the data point. If not provided, it will inherit the series color.\n */\n color?: string;\n}\n\n/**\n * Represents a scatterpolar series.\n */\nexport interface ScatterPolarSeries extends DataSeries {\n /**\n * Type discriminator: always 'scatterpolar' for this series.\n */\n type: 'scatterpolar';\n\n /**\n * Array of data points for the series.\n */\n data: PolarDataPoint[];\n}\n\n/**\n * Represents a linepolar series.\n */\nexport interface LinePolarSeries extends DataSeries {\n /**\n * Type discriminator: always 'linepolar' for this series.\n */\n type: 'linepolar';\n\n /**\n * Array of data points for the series.\n */\n data: PolarDataPoint[];\n\n /**\n * Additional line rendering options (e.g., stroke width, curve type).\n */\n lineOptions?: LineChartLineOptions;\n}\n\n/**\n * Represents a areapolar series.\n */\nexport interface AreaPolarSeries extends DataSeries {\n /**\n * Type discriminator: always 'areapolar' for this series.\n */\n type: 'areapolar';\n\n /**\n * Array of data points for the series.\n */\n data: PolarDataPoint[];\n\n /**\n * Additional line rendering options (e.g., stroke width, curve type).\n */\n lineOptions?: LineChartLineOptions;\n}\n"],"names":[],"mappings":"AAg1CA;;CAEC,GACD,WAeC"}
1
+ {"version":3,"sources":["../src/types/DataPoint.ts"],"sourcesContent":["import type { SVGProps } from 'react';\nimport type { LegendShape } from '../components/Legends/Legends.types';\nimport type { CurveFactory } from 'd3-shape';\nimport type { SankeyLink, SankeyNode } from 'd3-sankey';\n\nexport interface Basestate {\n _width?: number;\n _height?: number;\n activeLegend?: string;\n color?: string;\n dataForHoverCard?: number | string;\n isCalloutVisible: boolean;\n isLegendSelected?: boolean;\n isLegendHovered?: boolean;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n refSelected?: any;\n YValueHover?: { legend?: string; y?: number | string; color?: string }[];\n hoverYValue?: string | number | null;\n hoverXValue?: string | number | null;\n xCalloutValue?: string;\n yCalloutValue?: string;\n lineColor?: string;\n hoveredLineColor?: string;\n selectedLegend?: string;\n containerWidth?: number;\n containerHeight?: number;\n}\n\nexport interface RefArrayData {\n index?: string;\n refElement?: SVGGElement;\n}\n\n/**\n * {@docCategory ChartProps}\n */\nexport interface Margins {\n /**\n * left margin for the chart.\n */\n left?: number;\n /**\n * Right margin for the chart.\n */\n right?: number;\n /**\n * Top margin for the chart.\n */\n top?: number;\n /**\n * Bottom margin for the chart.\n */\n bottom?: number;\n}\n\n/**\n * {@docCategory ChartData}\n */\nexport interface DataPoint {\n /**\n * Independent value of the data point, rendered along the x-axis.\n * If x is a number, then each y-coordinate is plotted at its x-coordinate.\n * If x is a string, then the data is evenly spaced along the x-axis.\n */\n x: number | string;\n\n /**\n * Dependent value of the data point, rendered along the y-axis.\n */\n y: number;\n\n // NOTE: VerticalStackedBarChart, PieChart\n /**\n * onClick action for each datapoint in the chart\n */\n onClick?: VoidFunction;\n}\n\n/**\n * {@docCategory ChartData}\n */\nexport interface VerticalStackedBarDataPoint extends Omit<DataPoint, 'x'> {\n /**\n * Independent value of the data point, rendered along the x-axis.\n * If x is a number, then each y-coordinate is plotted at its x-coordinate.\n * If x is a string, then the data is evenly spaced along the x-axis.\n * If data type on x is Date, then the data is spaced evenly by d3-scale.\n */\n x: number | string | Date;\n}\n\n/**\n * {@docCategory ChartData}\n */\nexport interface HorizontalDataPoint {\n /**\n * Independent value of the data point, rendered along the x-axis.\n * If x is a number, then each y-coordinate is plotted at its x-coordinate.\n * If x is a string, then the data is evenly spaced along the x-axis.\n */\n x: number;\n\n /**\n * Total value of a single point bar chart.\n */\n total?: number;\n}\n\n/**\n * {@docCategory ChartData}\n */\nexport interface ChartDataPoint {\n /**\n * Legend text for the datapoint in the chart\n */\n legend?: string;\n\n /**\n * data the datapoint in the chart\n */\n data?: number;\n\n /**\n * data the datapoint in the chart\n */\n horizontalBarChartdata?: HorizontalDataPoint;\n\n /**\n * onClick action for each datapoint in the chart\n */\n onClick?: VoidFunction;\n\n /**\n * Color for the legend in the chart. If not provided, it will fallback on the default color palette.\n */\n color?: string;\n\n /**\n * placeholder data point\n */\n placeHolder?: boolean;\n\n /**\n * Callout data for x axis\n * This is an optional prop, If haven't given legend will take\n */\n xAxisCalloutData?: string;\n\n /**\n * Callout data for y axis\n * This is an optional prop, If haven't given data will take\n */\n yAxisCalloutData?: string;\n\n /**\n * Accessibility data for callout\n */\n callOutAccessibilityData?: AccessibilityProps;\n}\n\n/**\n * {@docCategory ChartData}\n */\nexport interface VerticalBarChartDataPoint {\n /**\n * Independent value of the data point, rendered along the x-axis.\n * If x is a number, then each y-coordinate is plotted at its x-coordinate.\n * If x is a string, then the data is evenly spaced along the x-axis.\n */\n x: number | string | Date;\n\n /**\n * Dependent value of the data point, rendered along the y-axis.\n */\n y: number;\n\n /**\n * Legend text for the datapoint in the chart\n */\n legend?: string;\n\n /**\n * color for the legend in the chart\n */\n color?: string;\n\n /**\n * Callout data for x axis\n * This is an optional prop, If haven't given legend will take\n */\n xAxisCalloutData?: string;\n\n /**\n * Callout data for y axis\n * This is an optional prop, If haven't given data will take\n */\n yAxisCalloutData?: string;\n\n /**\n * data to render the line along with bars\n */\n lineData?: LineDataInVerticalBarChart;\n\n /**\n * onClick action for each datapoint in the chart\n */\n onClick?: VoidFunction;\n\n /**\n * Accessibility data for callout\n */\n callOutAccessibilityData?: AccessibilityProps;\n\n /**\n * Label to display on the bar\n * This is an optional prop that can be used to show custom text on bars\n */\n barLabel?: string;\n}\n\n/**\n * {@docCategory ChartData}\n */\nexport interface HorizontalBarChartWithAxisDataPoint {\n /**\n * Dependent value of the data point, rendered along the x-axis.\n */\n x: number;\n\n /**\n * Independent value of the data point, rendered along the y-axis.\n * If y is a number, then each y-coordinate is plotted at its y-coordinate.\n * If y is a string, then the data is evenly spaced along the y-axis.\n */\n y: number | string;\n\n /**\n * Legend text for the datapoint in the chart\n */\n legend?: string;\n\n /**\n * color for the legend in the chart\n */\n color?: string;\n\n /**\n * Callout data for x axis\n * This is an optional prop, If haven't given legend will take\n */\n xAxisCalloutData?: string;\n\n /**\n * Callout data for y axis\n * This is an optional prop, If haven't given data will take\n */\n yAxisCalloutData?: string;\n\n /**\n * Label to display on the bar\n */\n barLabel?: string;\n\n /**\n * onClick action for each datapoint in the chart\n */\n onClick?: VoidFunction;\n\n /**\n * Accessibility data for callout\n */\n callOutAccessibilityData?: AccessibilityProps;\n}\n\n/**\n * {@docCategory ChartData}\n */\nexport interface LineDataInVerticalBarChart {\n y: VerticalBarChartDataPoint['y'];\n yAxisCalloutData?: string | undefined;\n\n /**\n * onClick action for each datapoint in the chart\n */\n onClick?: VoidFunction;\n /**\n * Whether to use the secondary y scale or not\n * False by default.\n */\n useSecondaryYScale?: boolean;\n}\n\n/**\n * {@docCategory ChartData}\n */\ninterface BaseDataPoint {\n /**\n * Defines the function that is executed on clicking line\n */\n onDataPointClick?: () => void;\n\n /**\n * Callout data for x axis\n */\n xAxisCalloutData?: string;\n\n /**\n * Callout data for y axis\n */\n yAxisCalloutData?: string | { [id: string]: number };\n\n /**\n * Whether to hide callout data for the point.\n */\n hideCallout?: boolean;\n\n /**\n * Accessibility data for callout\n */\n callOutAccessibilityData?: AccessibilityProps;\n\n /**\n * X axis Accessibility data for callout\n */\n xAxisCalloutAccessibilityData?: AccessibilityProps;\n\n /**\n * Marker size of the points\n */\n markerSize?: number;\n}\n\n/**\n * {@docCategory ChartData}\n */\nexport interface LineChartDataPoint extends BaseDataPoint {\n /**\n * Independent value of the data point, rendered along the x-axis.\n */\n x: number | Date;\n\n /**\n * Dependent value of the data point, rendered along the y-axis.\n */\n y: number;\n\n /**\n * text labels of marker points\n */\n text?: string;\n\n /**\n * Per-point marker color (overrides series color when present)\n */\n markerColor?: string;\n}\n\n/**\n * {@docCategory ChartData}\n * ScatterChartDataPoint interface.\n */\nexport interface ScatterChartDataPoint extends BaseDataPoint {\n /**\n * Independent value of the data point, rendered along the x-axis.\n */\n x: number | Date | string;\n\n /**\n * Dependent value of the data point, rendered along the y-axis.\n */\n y: number;\n\n /**\n * Marker size of the points\n */\n markerSize?: number;\n\n /**\n * text labels of marker points\n */\n text?: string;\n\n /**\n * Per-point marker color (overrides series color when present)\n */\n markerColor?: string;\n}\n\n/**\n * {@docCategory ChartData}\n */\nexport interface LineChartGap {\n /**\n * Starting index of the gap.\n */\n startIndex: number;\n\n /**\n * Ending index of the gap.\n */\n endIndex: number;\n}\n\n/**\n * {@docCategory ChartProps}\n */\nexport interface LineChartLineOptions extends SVGProps<SVGPathElement> {\n /**\n * Width of the line/stroke.\n * Overrides the strokeWidth set on ICartesianChartProps level.\n * @see https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-width\n */\n strokeWidth?: number | string;\n\n /**\n * Pattern of dashes and gaps.\n * @see https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-dasharray\n */\n strokeDasharray?: string | number;\n\n /**\n * Offset on rendering of stroke dash array.\n * @see https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-dashoffset\n */\n strokeDashoffset?: string | number;\n\n /**\n * Shape at the end of a subpath.\n * Default round.\n * @see https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-linecap\n */\n strokeLinecap?: 'butt' | 'round' | 'square' | 'inherit';\n\n /**\n * Width of border around the line. Default no border.\n */\n lineBorderWidth?: string | number;\n\n /**\n * Color of border around the line. Default white.\n */\n lineBorderColor?: string;\n\n /**\n * Defines the type of interpolation used to render the line.\n * @default 'linear'\n */\n curve?: 'linear' | 'natural' | 'step' | 'stepAfter' | 'stepBefore' | CurveFactory;\n\n /**\n * Defines the mode of points to be rendered.\n */\n mode?:\n | 'lines'\n | 'markers'\n | 'text'\n | 'lines+markers'\n | 'text+markers'\n | 'text+lines'\n | 'text+lines+markers'\n | 'none'\n | 'gauge'\n | 'number'\n | 'delta'\n | 'number+delta'\n | 'gauge+number'\n | 'gauge+number+delta'\n | 'gauge+delta'\n | 'markers+text'\n | 'lines+text'\n | 'lines+markers+text';\n}\n\n/**\n * {@docCategory ChartData}\n */\nexport interface LineChartPoints {\n /**\n * Legend text for the datapoint in the chart\n */\n legend: string;\n\n /**\n * The shape for the legend\n * default: show the rect legend\n */\n legendShape?: LegendShape;\n\n /**\n * dataPoints for the line chart\n */\n data: LineChartDataPoint[] | ScatterChartDataPoint[];\n\n /**\n * gaps in the line chart where a line is not drawn\n */\n gaps?: LineChartGap[];\n\n /**\n * color for the legend in the chart\n */\n color?: string;\n\n /**\n * opacity for chart fill color\n */\n opacity?: number;\n\n /**\n * options for the line drawn\n */\n lineOptions?: LineChartLineOptions;\n\n /**\n * hide dots for points that are not active\n */\n hideNonActiveDots?: boolean;\n\n /**\n * Defines the function that is executed on clicking this legend\n */\n onLegendClick?: (selectedLegend: string | null | string[]) => void;\n\n /**\n * Defines the function that is executed on clicking line\n */\n onLineClick?: () => void;\n\n /**\n * Whether to use the secondary y scale or not\n * False by default.\n */\n useSecondaryYScale?: boolean;\n}\n\n/**\n * {@docCategory ChartProps}\n */\nexport interface ChartProps {\n /**\n * chart title for the chart\n */\n chartTitle?: string;\n\n /**\n * Accessibility data for chart title\n */\n chartTitleAccessibilityData?: AccessibilityProps;\n /**\n * data for the points in the chart\n */\n chartData?: ChartDataPoint[];\n\n /**\n * Accessibility data for chart data\n */\n chartDataAccessibilityData?: AccessibilityProps;\n\n /**\n * data for the points in the line chart\n */\n lineChartData?: LineChartPoints[];\n\n /**\n * data for the points in the scatter chart\n */\n scatterChartData?: ScatterChartPoints[];\n\n /**\n * data for the points in the line chart\n */\n SankeyChartData?: SankeyChartData;\n\n /**\n * data for the points in the line chart\n */\n pointOptions?: SVGProps<SVGCircleElement>;\n\n /**\n * data for the dotted line on hovering the point\n */\n pointLineOptions?: SVGProps<SVGLineElement>;\n}\n\n/**\n * {@docCategory ChartProps}\n */\nexport interface AccessibilityProps {\n /**\n * Accessibility aria-label\n */\n ariaLabel?: string;\n\n /**\n * Accessibility aria-labelledBy\n */\n ariaLabelledBy?: string;\n\n /**\n * Accessibility aria-describedBy\n */\n ariaDescribedBy?: string;\n}\n\n/**\n * {@docCategory ChartData}\n */\nexport interface VSChartDataPoint {\n /**\n * data the datapoint in the chart\n */\n data: number | string;\n\n /**\n * Legend text for the datapoint in the chart\n */\n legend: string;\n\n /**\n * color for the legend in the chart\n */\n color?: string;\n\n /**\n * Callout data for x axis\n * This is an optional prop, If haven't given legend will take\n */\n xAxisCalloutData?: string;\n\n /**\n * Callout data for y axis\n * This is an optional prop, If haven't given data will take\n */\n yAxisCalloutData?: string;\n\n /**\n * Accessibility data for callout\n */\n callOutAccessibilityData?: AccessibilityProps;\n\n /**\n * The prop used to define the culture to localized the numbers\n */\n culture?: string;\n\n /**\n * Label to display on the bar\n * This is an optional prop that can be used to show custom text on bars\n */\n barLabel?: string;\n}\n\n/**\n * {@docCategory ChartProps}\n */\nexport interface VerticalStackedChartProps {\n /**\n * data for the points in the chart\n */\n chartData: VSChartDataPoint[];\n\n /**\n * Data for x axis label for multistacked Vertical bar chart\n */\n xAxisPoint: number | string | Date;\n\n /**\n * Callout data for x axis\n * This is an optional prop, If haven't given, legend will take\n */\n xAxisCalloutData?: string;\n /**\n * line data to render lines on stacked bar chart\n */\n lineData?: LineDataInVerticalStackedBarChart[];\n /**\n * Accessibility data for Whole stack callout\n */\n stackCallOutAccessibilityData?: AccessibilityProps;\n}\n\n/**\n * {@docCategory ChartData}\n */\nexport interface LineDataInVerticalStackedBarChart {\n y: number | string;\n color: string;\n legend: string;\n /**\n * The shape for the legend\n * default: show the rect legend\n */\n legendShape?: LegendShape;\n /**\n * Data to show in callout\n */\n data?: number | string;\n yAxisCalloutData?: string;\n /**\n * Whether to use the secondary y scale or not\n * False by default.\n */\n useSecondaryYScale?: boolean;\n /**\n * options for the line drawn\n */\n lineOptions?: LineChartLineOptions;\n}\n\n/**\n * {@docCategory ChartData}\n */\nexport interface GVBarChartSeriesPoint {\n /**\n * Text for // need to check use of this\n */\n key: string;\n\n /**\n * Data for bar height of Grouped vertical bar chart\n */\n data: number;\n\n /**\n * Color for the legend in the chart\n */\n color?: string;\n\n /**\n * Legend text in the chart\n */\n legend: string;\n\n /**\n * Callout data for x axis\n * This is an optional prop, If haven't given legend will take\n */\n xAxisCalloutData?: string;\n\n /**\n * Callout data for y axis\n * This is an optional prop, If haven't given data will take\n */\n yAxisCalloutData?: string;\n\n /**\n * onClick action for each datapoint in the chart\n */\n onClick?: VoidFunction;\n\n /**\n * Accessibility data for callout\n */\n callOutAccessibilityData?: AccessibilityProps;\n\n /**\n * Whether to use the secondary y scale or not\n * False by default.\n */\n useSecondaryYScale?: boolean;\n\n /**\n * Label to display on the bar\n */\n barLabel?: string;\n}\n\n/**\n * {@docCategory ChartData}\n */\nexport interface GroupedVerticalBarChartData {\n /**\n * Data for X axis label\n */\n name: string;\n\n /**\n * Data points for Grouped vertical bar chart\n */\n series: GVBarChartSeriesPoint[];\n\n /**\n * Accessibility data for Group Bars Stack Callout\n */\n stackCallOutAccessibilityData?: AccessibilityProps;\n}\n\nexport interface GVDataPoint {\n /**\n * This interface used for - While forming datapoints from given prop \"data\" in code\n * datapoints are used for to draw graph\n */\n [key: string]: number | string;\n}\n\nexport interface GVSingleDataPoint {\n /**\n * While forming datapoints from given prop \"data\" in code.\n * These datapoints are used for to draw graph easily.\n */\n [key: string]: GVDataPoint;\n}\n\nexport interface GVForBarChart {\n /**\n * While forming datapoints from given prop \"data\"\n * These datapoints are used for to draw graph.\n */\n [key: string]: GVBarChartSeriesPoint;\n}\n\n/**\n * {@docCategory ChartData}\n */\nexport interface CustomizedCalloutDataPoint {\n legend: string;\n y: number;\n color: string;\n xAxisCalloutData?: string;\n yAxisCalloutData?: string | { [id: string]: number };\n}\n\n/**\n * Used for custom callout data interface. As Area chart callout data will be prepared from given props.data,\n * Those required data passing to onRenderCalloutPerDataPoint and onRenderCalloutPerStack.\n * {@docCategory ChartData}\n */\nexport interface CustomizedCalloutData {\n x: number | string | Date;\n values: CustomizedCalloutDataPoint[];\n}\n\n/**\n * {@docCategory Chart}\n */\nexport interface Chart {\n chartContainer: HTMLElement | null;\n toImage?: (opts?: ImageExportOptions) => Promise<string>;\n}\n\n/**\n * {@docCategory Chart}\n */\nexport interface ImageExportOptions {\n width?: number;\n height?: number;\n scale?: number;\n background?: string;\n}\n\nexport interface HeatMapChartDataPoint {\n x: string | Date | number;\n y: string | Date | number;\n value: number;\n /**\n * The value/ text to be rendered in the rectange\n */\n rectText?: string | number;\n /**\n * denomination to show in the callout\n */\n ratio?: [number, number];\n /**\n * description message to the callout\n */\n descriptionMessage?: string;\n\n /**\n * onClick action for each datapoint in the chart\n */\n onClick?: VoidFunction;\n /**\n * Accessibility data for callout\n */\n callOutAccessibilityData?: AccessibilityProps;\n}\n\n/**\n * {@docCategory ChartData}\n */\nexport interface HeatMapChartData {\n /**\n * name of the legend\n */\n legend: string;\n data: HeatMapChartDataPoint[];\n /**\n * This number will be used to get the color for the legend\n */\n value: number;\n}\n\n/**\n * {@docCategory ChartData}\n */\nexport interface SankeyChartData {\n nodes: SNode[];\n links: SLink[];\n}\n\ninterface SNodeExtra {\n /**\n * A unique identifier for this node.\n */\n nodeId: number | string;\n /**\n * The display name for this node in the UX.\n */\n name: string;\n color?: string;\n borderColor?: string;\n actualValue?: number;\n layer?: number;\n}\n\ninterface SLinkExtra {\n /**\n * The index within `ISankeyChartData.nodes` of the source node.\n */\n source: number;\n /**\n * The index within `ISankeyChartData.nodes` of the target node.\n */\n target: number;\n /**\n * The weight of this link between the two nodes.\n */\n value: number;\n unnormalizedValue?: number;\n color?: string;\n}\n\nexport type SNode = SankeyNode<SNodeExtra, SLinkExtra>;\nexport type SLink = SankeyLink<SNodeExtra, SLinkExtra>;\n\n/**\n * Specifies the ordering options for axis categories in Cartesian charts.\n *\n * - `'default'`: Uses the original order before custom ordering was supported.\n * In some charts, this behaves the same as `'data'`.\n * - `'data'`: Preserves the order of categories as provided in the input data.\n * - `string[]`: Explicitly defines the custom order of categories as an array of category names.\n * - `'category ascending' | 'category descending'`: Orders categories alphanumerically.\n * - `'total ascending' | 'total descending'`: Orders categories by the total of their associated values.\n * - `'min ascending' | 'min descending'`: Orders by the minimum value within each category.\n * - `'max ascending' | 'max descending'`: Orders by the maximum value within each category.\n * - `'sum ascending' | 'sum descending'`: Orders by the sum of values for each category (same as 'total').\n * - `'mean ascending' | 'mean descending'`: Orders by the average of values in each category.\n * - `'median ascending' | 'median descending'`: Orders by the median value of each category.\n *\n * {@docCategory CartesianChart}\n */\nexport type AxisCategoryOrder =\n | 'default'\n | 'data'\n | string[]\n | 'category ascending'\n | 'category descending'\n | 'total ascending'\n | 'total descending'\n | 'min ascending'\n | 'min descending'\n | 'max ascending'\n | 'max descending'\n | 'sum ascending'\n | 'sum descending'\n | 'mean ascending'\n | 'mean descending'\n | 'median ascending'\n | 'median descending';\n\n/**\n * {@docCategory IChartData}\n */\nexport interface GanttChartDataPoint {\n /**\n * Dependent value of the data point, rendered along the x-axis.\n */\n x: {\n start: Date | number;\n end: Date | number;\n };\n\n /**\n * Independent value of the data point, rendered along the y-axis.\n * If y is a number, then each y-coordinate is plotted at its y-coordinate.\n * If y is a string, then the data is evenly spaced along the y-axis.\n */\n y: number | string;\n\n /**\n * Legend text for the datapoint in the chart\n */\n legend?: string;\n\n /**\n * color for the legend in the chart\n */\n color?: string;\n\n /**\n * Gradient for the legend in the chart. If not provided, it will fallback on the default color palette.\n * If provided, it will override the color prop. granted `enableGradient` is set to true for the chart.\n */\n gradient?: [string, string];\n\n /**\n * Callout data for x axis\n * This is an optional prop, If haven't given legend will take\n */\n xAxisCalloutData?: string;\n\n /**\n * Callout data for y axis\n * This is an optional prop, If haven't given data will take\n */\n yAxisCalloutData?: string;\n\n /**\n * onClick action for each datapoint in the chart\n */\n onClick?: VoidFunction;\n\n /**\n * Accessibility data for callout\n */\n callOutAccessibilityData?: AccessibilityProps;\n}\n\n/**\n * {@docCategory IChartData}\n */\nexport interface ScatterChartPoints {\n /**\n * Legend text for the datapoint in the chart\n */\n legend: string;\n\n /**\n * The shape for the legend\n * default: show the rect legend\n */\n legendShape?: LegendShape;\n\n /**\n * dataPoints for the line chart\n */\n data: ScatterChartDataPoint[];\n\n /**\n * color for the legend in the chart\n */\n color?: string;\n\n /**\n * opacity for chart fill color\n */\n opacity?: number;\n\n /**\n * hide dots for points that are not active\n */\n hideNonActiveDots?: boolean;\n\n /**\n * Defines the function that is executed on clicking this legend\n */\n onLegendClick?: (selectedLegend: string | null | string[]) => void;\n\n /**\n * Whether to use the secondary y scale or not\n * False by default.\n */\n useSecondaryYScale?: boolean;\n}\n\n/**\n * Available scale types for axes.\n *\n * - `'default'`: Uses an automatic scale (linear, band, or time) based on axis data type.\n * - `'log'`: Uses a logarithmic scale. Only supported for numeric axes in LineChart and ScatterChart.\n *\n * {@docCategory CartesianChart}\n */\nexport type AxisScaleType = 'default' | 'log';\n\n/**\n * Configuration options for an axis.\n *\n * {@docCategory CartesianChart}\n */\nexport type AxisProps = {\n /**\n * Defines the step between tick marks on the axis.\n * Works in combination with `tick0`.\n * Must be a positive number.\n *\n * - **Log scale**:\n * - Ticks are placed at `10^(n * tickStep)` where `n` is the tick index.\n * - Example: `tickStep = 2` → ticks at 1, 100, 10,000...\n * - Example: `tickStep = log10(5)` → ticks at 1, 5, 25, 125...\n * - Special format `\"L<f>\"`: Creates ticks that are linearly spaced in value (not position).\n * - Example: `tick0 = 0.1`, `tickStep = \"L0.5\"` → ticks at 0.1, 0.6, 1.1, 1.6...\n *\n * - **Date axis**:\n * - Must be in milliseconds.\n * - Example: one day = `tickStep = 86400000`.\n * - Special format `\"M<n>\"`: Places ticks every `n` months.\n * - Example: `tick0 = \"2000-01-15\"`, `tickStep = \"M3\"` → ticks on the 15th every third month.\n * - Example: `tickStep = \"M48\"` → ticks every 4 years.\n */\n tickStep?: number | string;\n\n /**\n * Sets the reference value for axis ticks.\n * Works in combination with `tickStep`.\n *\n * - **Log scale**:\n * - `tick0` must be given as the logarithm of the reference tick.\n * - Example: to align ticks with 100, use `tick0 = 2`.\n * - Exception: when `tickStep` uses `\"L<f>\"`, you can specify the raw value directly.\n */\n tick0?: number | Date;\n\n /**\n * Sets the text displayed at each tick position specified by `tickValues`. Used with `tickValues`.\n */\n tickText?: string[];\n};\n\n/**\n * Represents a single data point in a series.\n */\nexport interface DataPointV2<X extends string | number | Date, Y extends string | number | Date> {\n /**\n * X-axis value of the data point.\n */\n x: X;\n\n /**\n * Y-axis value of the data point.\n */\n y: Y;\n\n /**\n * Optional click handler for the data point.\n */\n onClick?: () => void;\n\n /**\n * Custom text to show in the callout in place of the x-axis value.\n */\n xAxisCalloutData?: string;\n\n /**\n * Custom text to show in the callout in place of the y-axis value.\n */\n yAxisCalloutData?: string;\n\n /**\n * Accessibility properties for the data point.\n */\n callOutAccessibilityData?: AccessibilityProps;\n\n /**\n * Custom marker size for the data point.\n */\n markerSize?: number;\n\n /**\n * Optional text to annotate or label the data point.\n */\n text?: string;\n\n /**\n * Color of the data point. If not provided, it will inherit the series color.\n */\n color?: string;\n}\n\n/**\n * Base interface for a series.\n */\nexport interface DataSeries {\n /**\n * Name of the series to be displayed in the legend.\n */\n legend: string;\n\n /**\n * Shape used in the legend (e.g., circle, square).\n */\n legendShape?: LegendShape;\n\n /**\n * Color of the series.\n */\n color?: string;\n\n /**\n * Opacity of the series.\n */\n opacity?: number;\n\n /**\n * Gradient fill for the series (start and end colors).\n */\n gradient?: [string, string];\n\n /**\n * Whether this series should be plotted against a secondary Y-axis.\n */\n useSecondaryYScale?: boolean;\n\n /**\n * Callback invoked when the legend item is clicked.\n */\n onLegendClick?: (selectedLegend: string | null | string[]) => void;\n}\n\n/**\n * Represents a bar series.\n */\nexport interface BarSeries<X extends string | number | Date, Y extends string | number | Date> extends DataSeries {\n /**\n * Type discriminator: always 'bar' for this series.\n */\n type: 'bar';\n\n /**\n * Array of data points for the series.\n */\n data: DataPointV2<X, Y>[];\n\n /**\n * Optional group identifier for the series.\n */\n key?: string;\n}\n\n/**\n * Represents a line series.\n */\nexport interface LineSeries<X extends string | number | Date, Y extends string | number | Date> extends DataSeries {\n /**\n * Type discriminator: always 'line' for this series.\n */\n type: 'line';\n\n /**\n * Array of data points for the series.\n */\n data: DataPointV2<X, Y>[];\n\n /**\n * Optional gaps to render in the line.\n */\n gaps?: LineChartGap[];\n\n /**\n * Additional line rendering options (e.g., stroke width, curve type).\n */\n lineOptions?: LineChartLineOptions;\n\n /**\n * If true, hides dots for inactive (unfocused/unhovered) data points.\n */\n hideInactiveDots?: boolean;\n\n /**\n * Callback invoked when the line itself is clicked.\n */\n onLineClick?: () => void;\n}\n\n/**\n * Represents a single data point in a polar series.\n */\nexport interface PolarDataPoint {\n /**\n * Radial value of the data point.\n */\n r: string | number | Date;\n\n /**\n * Angular value of the data point, specified as a category or in degrees.\n */\n theta: string | number;\n\n /**\n * Optional click handler for the data point.\n */\n onClick?: () => void;\n\n /**\n * Custom text to show in the callout in place of the radial axis value.\n */\n radialAxisCalloutData?: string;\n\n /**\n * Custom text to show in the callout in place of the angular axis value.\n */\n angularAxisCalloutData?: string;\n\n /**\n * Accessibility properties for the data point.\n */\n callOutAccessibilityData?: AccessibilityProps;\n\n /**\n * Custom marker size for the data point.\n */\n markerSize?: number;\n\n /**\n * Optional text to annotate or label the data point.\n */\n text?: string;\n\n /**\n * Color of the data point. If not provided, it will inherit the series color.\n */\n color?: string;\n}\n\n/**\n * Represents a scatterpolar series.\n */\nexport interface ScatterPolarSeries extends DataSeries {\n /**\n * Type discriminator: always 'scatterpolar' for this series.\n */\n type: 'scatterpolar';\n\n /**\n * Array of data points for the series.\n */\n data: PolarDataPoint[];\n}\n\n/**\n * Represents a linepolar series.\n */\nexport interface LinePolarSeries extends DataSeries {\n /**\n * Type discriminator: always 'linepolar' for this series.\n */\n type: 'linepolar';\n\n /**\n * Array of data points for the series.\n */\n data: PolarDataPoint[];\n\n /**\n * Additional line rendering options (e.g., stroke width, curve type).\n */\n lineOptions?: LineChartLineOptions;\n}\n\n/**\n * Represents a areapolar series.\n */\nexport interface AreaPolarSeries extends DataSeries {\n /**\n * Type discriminator: always 'areapolar' for this series.\n */\n type: 'areapolar';\n\n /**\n * Array of data points for the series.\n */\n data: PolarDataPoint[];\n\n /**\n * Additional line rendering options (e.g., stroke width, curve type).\n */\n lineOptions?: LineChartLineOptions;\n}\n"],"names":[],"mappings":"AAg1CA;;CAEC,GACD,WAeC"}
@@ -2,5 +2,3 @@
2
2
  Object.defineProperty(exports, "__esModule", {
3
3
  value: true
4
4
  });
5
- const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
6
- const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/types/EventAnnotation.ts"],"sourcesContent":["import * as React from 'react';\n\nexport interface EventAnnotation {\n date: Date;\n event: string;\n onRenderCard?: () => React.ReactNode;\n}\n"],"names":["React"],"mappings":";;;;;iEAAuB,QAAQ"}
1
+ {"version":3,"sources":["../src/types/EventAnnotation.ts"],"sourcesContent":["import type * as React from 'react';\n\nexport interface EventAnnotation {\n date: Date;\n event: string;\n onRenderCard?: () => React.ReactNode;\n}\n"],"names":[],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/utilities/ChartTitle.tsx"],"sourcesContent":["import * as React from 'react';\nimport { SVGTooltipText, SVGTooltipTextProps } from './SVGTooltipText';\nimport { CHART_TITLE_PADDING, getChartTitleInlineStyles, TitleStyles } from './Common.styles';\nimport { wrapContent } from './utilities';\n\nconst AXIS_TITLE_PADDING = 8;\n\n/**\n * Props for the ChartTitle component\n */\nexport interface ChartTitleProps {\n /**\n * The title text to display\n */\n title: string;\n /**\n * The x position for the title (typically center of chart)\n */\n x: number;\n /**\n * Optional custom y position. If not provided, calculated based on font size.\n */\n y?: number;\n /**\n * Maximum width for the title text before wrapping/truncation\n */\n maxWidth?: number;\n /**\n * CSS class name for the title text element\n */\n className?: string;\n /**\n * Title styles configuration (font, anchors, padding)\n */\n titleStyles?: TitleStyles;\n /**\n * Text anchor for SVG text element\n * @default 'middle'\n */\n textAnchor?: 'start' | 'middle' | 'end';\n /**\n * Additional SVGTooltipText props to pass through\n */\n tooltipProps?: Partial<SVGTooltipTextProps>;\n /**\n * CSS class for the tooltip\n */\n tooltipClassName?: string;\n}\n\n/**\n * A reusable chart title component that renders an SVG text element with tooltip support.\n * This component encapsulates the common pattern for rendering chart titles across all chart types.\n */\nexport const ChartTitle: React.FunctionComponent<ChartTitleProps> = props => {\n const { title, x, y, maxWidth, className, titleStyles, tooltipProps, tooltipClassName } = props;\n\n const { titleFont, titleXAnchor, titleYAnchor, titlePad } = titleStyles ?? {};\n const computedTextAnchor = titleXAnchor === 'left' ? 'start' : titleXAnchor === 'right' ? 'end' : 'middle';\n\n // Calculate dominantBaseline from titleYAnchor for vertical alignment\n // 'top' means text hangs below the y position (text-before-edge/hanging)\n // 'bottom' means text sits above the y position (text-after-edge/alphabetic)\n // 'middle' means text is centered on the y position (central)\n const computedDominantBaseline =\n titleYAnchor === 'top'\n ? 'hanging'\n : titleYAnchor === 'bottom'\n ? 'alphabetic'\n : titleYAnchor === 'middle'\n ? 'central'\n : 'auto';\n\n // Calculate x position with padding adjustments\n const computedX = x + (titlePad?.l ?? 0) - (titlePad?.r ?? 0);\n\n // Calculate y position with padding adjustments\n const calculatedY =\n (y ??\n Math.max(\n (typeof titleFont?.size === 'number' ? titleFont.size : 13) + AXIS_TITLE_PADDING,\n CHART_TITLE_PADDING - AXIS_TITLE_PADDING,\n )) +\n (titlePad?.t ?? 0) -\n (titlePad?.b ?? 0);\n\n const commonSvgToolTipProps: Partial<SVGTooltipTextProps> = {\n wrapContent,\n showBackground: true,\n className: tooltipClassName,\n ...tooltipProps,\n };\n return (\n <SVGTooltipText\n {...commonSvgToolTipProps}\n content={title}\n textProps={{\n x: computedX,\n y: calculatedY,\n textAnchor: computedTextAnchor,\n dominantBaseline: computedDominantBaseline,\n className,\n 'aria-hidden': true,\n style: getChartTitleInlineStyles(titleFont),\n }}\n maxWidth={maxWidth}\n />\n );\n};\n\nChartTitle.displayName = 'ChartTitle';\n"],"names":["React","SVGTooltipText","CHART_TITLE_PADDING","getChartTitleInlineStyles","wrapContent","AXIS_TITLE_PADDING","ChartTitle","props","title","x","y","maxWidth","className","titleStyles","tooltipProps","tooltipClassName","titleFont","titleXAnchor","titleYAnchor","titlePad","computedTextAnchor","computedDominantBaseline","computedX","l","r","calculatedY","Math","max","size","t","b","commonSvgToolTipProps","showBackground","content","textProps","textAnchor","dominantBaseline","style","displayName"],"mappings":";;;;+BAsDaM;;;;;;;iEAtDU,QAAQ;gCACqB,mBAAmB;8BACK,kBAAkB;2BAClE,cAAc;A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AAXV,gBAAAA,KAAAA,IAAAA,eAAe,CAAA,IACfA,CAAAA,cAAAA,aAAAA,QAAAA,aAAAA,KAAAA,IAAAA,KAAAA,IAAAA,UAAUW,AAAC,MAAA,QAAXX,gBAAAA,KAAAA,IAAAA,eAAe,CAAA;IAElB,MAAMY,wBAAsD;qBAC1D3B,sBAAAA;QACA4B,gBAAgB;QAChBpB,WAAWG;QACX,GAAGD,YAAY;IACjB;IACA,OAAA,WAAA,GACE,OAAA,aAAA,CAACb,8BAAAA,EAAAA;QACE,GAAG8B,qBAAqB;QACzBE,SAASzB;QACT0B,WAAW;YACTzB,GAAGa;YACHZ,GAAGe;YACHU,YAAYf;YACZgB,kBAAkBf;YAClBT;YACA,eAAe;YACfyB,WAAOlC,uCAAAA,EAA0Ba;QACnC;QACAL,UAAUA;;AAGhB,EAAE;AAEFL,WAAWgC,WAAW,GAAG"}
1
+ {"version":3,"sources":["../src/utilities/ChartTitle.tsx"],"sourcesContent":["import * as React from 'react';\nimport type { SVGTooltipTextProps } from './SVGTooltipText';\nimport { SVGTooltipText } from './SVGTooltipText';\nimport type { TitleStyles } from './Common.styles';\nimport { CHART_TITLE_PADDING, getChartTitleInlineStyles } from './Common.styles';\nimport { wrapContent } from './utilities';\n\nconst AXIS_TITLE_PADDING = 8;\n\n/**\n * Props for the ChartTitle component\n */\nexport interface ChartTitleProps {\n /**\n * The title text to display\n */\n title: string;\n /**\n * The x position for the title (typically center of chart)\n */\n x: number;\n /**\n * Optional custom y position. If not provided, calculated based on font size.\n */\n y?: number;\n /**\n * Maximum width for the title text before wrapping/truncation\n */\n maxWidth?: number;\n /**\n * CSS class name for the title text element\n */\n className?: string;\n /**\n * Title styles configuration (font, anchors, padding)\n */\n titleStyles?: TitleStyles;\n /**\n * Text anchor for SVG text element\n * @default 'middle'\n */\n textAnchor?: 'start' | 'middle' | 'end';\n /**\n * Additional SVGTooltipText props to pass through\n */\n tooltipProps?: Partial<SVGTooltipTextProps>;\n /**\n * CSS class for the tooltip\n */\n tooltipClassName?: string;\n}\n\n/**\n * A reusable chart title component that renders an SVG text element with tooltip support.\n * This component encapsulates the common pattern for rendering chart titles across all chart types.\n */\nexport const ChartTitle: React.FunctionComponent<ChartTitleProps> = props => {\n const { title, x, y, maxWidth, className, titleStyles, tooltipProps, tooltipClassName } = props;\n\n const { titleFont, titleXAnchor, titleYAnchor, titlePad } = titleStyles ?? {};\n const computedTextAnchor = titleXAnchor === 'left' ? 'start' : titleXAnchor === 'right' ? 'end' : 'middle';\n\n // Calculate dominantBaseline from titleYAnchor for vertical alignment\n // 'top' means text hangs below the y position (text-before-edge/hanging)\n // 'bottom' means text sits above the y position (text-after-edge/alphabetic)\n // 'middle' means text is centered on the y position (central)\n const computedDominantBaseline =\n titleYAnchor === 'top'\n ? 'hanging'\n : titleYAnchor === 'bottom'\n ? 'alphabetic'\n : titleYAnchor === 'middle'\n ? 'central'\n : 'auto';\n\n // Calculate x position with padding adjustments\n const computedX = x + (titlePad?.l ?? 0) - (titlePad?.r ?? 0);\n\n // Calculate y position with padding adjustments\n const calculatedY =\n (y ??\n Math.max(\n (typeof titleFont?.size === 'number' ? titleFont.size : 13) + AXIS_TITLE_PADDING,\n CHART_TITLE_PADDING - AXIS_TITLE_PADDING,\n )) +\n (titlePad?.t ?? 0) -\n (titlePad?.b ?? 0);\n\n const commonSvgToolTipProps: Partial<SVGTooltipTextProps> = {\n wrapContent,\n showBackground: true,\n className: tooltipClassName,\n ...tooltipProps,\n };\n return (\n <SVGTooltipText\n {...commonSvgToolTipProps}\n content={title}\n textProps={{\n x: computedX,\n y: calculatedY,\n textAnchor: computedTextAnchor,\n dominantBaseline: computedDominantBaseline,\n className,\n 'aria-hidden': true,\n style: getChartTitleInlineStyles(titleFont),\n }}\n maxWidth={maxWidth}\n />\n );\n};\n\nChartTitle.displayName = 'ChartTitle';\n"],"names":["React","SVGTooltipText","CHART_TITLE_PADDING","getChartTitleInlineStyles","wrapContent","AXIS_TITLE_PADDING","ChartTitle","props","title","x","y","maxWidth","className","titleStyles","tooltipProps","tooltipClassName","titleFont","titleXAnchor","titleYAnchor","titlePad","computedTextAnchor","computedDominantBaseline","computedX","l","r","calculatedY","Math","max","size","t","b","commonSvgToolTipProps","showBackground","content","textProps","textAnchor","dominantBaseline","style","displayName"],"mappings":";;;;+BAwDaM;;;;;;;iEAxDU,QAAQ;gCAEA,mBAAmB;8BAEa,kBAAkB;2BACrD,cAAc;AAE1C,MAAMD,qBAAqB;AAiDpB,mBAA6DE,CAAAA;IAClE,MAAM,EAAEC,KAAK,EAAEC,CAAC,EAAEC,CAAC,EAAEC,QAAQ,EAAEC,SAAS,EAAEC,WAAW,EAAEC,YAAY,EAAEC,gBAAgB,EAAE,GAAGR;IAE1F,MAAM,EAAES,SAAS,EAAEC,YAAY,EAAEC,YAAY,EAAEC,QAAQ,EAAE,GAAGN,gBAAAA,QAAAA,gBAAAA,KAAAA,IAAAA,cAAe,CAAC;IAC5E,MAAMO,qBAAqBH,iBAAiB,SAAS,UAAUA,iBAAiB,UAAU,QAAQ;IAElG,sEAAsE;IACtE,yEAAyE;IACzE,6EAA6E;IAC7E,8DAA8D;IAC9D,MAAMI,2BACJH,iBAAiB,QACb,YACAA,iBAAiB,WACjB,eACAA,iBAAiB,WACjB,YACA;QAGiBC,aAAqBA;IAD5C,gDAAgD;IAChD,MAAMG,YAAYb,IAAKU,CAAAA,CAAAA,cAAAA,aAAAA,QAAAA,aAAAA,KAAAA,IAAAA,KAAAA,IAAAA,UAAUI,AAAC,MAAA,QAAXJ,gBAAAA,KAAAA,IAAAA,eAAe,CAAA,IAAMA,CAAAA,cAAAA,aAAAA,QAAAA,aAAAA,KAAAA,IAAAA,KAAAA,IAAAA,UAAUK,AAAC,MAAA,QAAXL,gBAAAA,KAAAA,IAAAA,eAAe,CAAA;QASxDA,aACAA;IARH,gDAAgD;IAChD,MAAMM,cACHf,CAAAA,MAAAA,QAAAA,MAAAA,KAAAA,IAAAA,IACCgB,KAAKC,GAAG,CACL,CAAA,OAAOX,eAAAA,QAAAA,cAAAA,KAAAA,IAAAA,KAAAA,IAAAA,UAAWY,IAAAA,AAAI,MAAK,WAAWZ,UAAUY,IAAI,GAAG,EAAA,CAAC,GAAKvB,oBAC9DH,iCAAAA,GAAsBG,mBAAAA,CACxB,IACDc,CAAAA,cAAAA,aAAAA,QAAAA,aAAAA,KAAAA,IAAAA,KAAAA,IAAAA,UAAUU,AAAC,MAAA,QAAXV,gBAAAA,KAAAA,IAAAA,eAAe,CAAA,IACfA,CAAAA,cAAAA,aAAAA,QAAAA,aAAAA,KAAAA,IAAAA,KAAAA,IAAAA,UAAUW,AAAC,MAAA,QAAXX,gBAAAA,KAAAA,IAAAA,eAAe,CAAA;IAElB,MAAMY,wBAAsD;qBAC1D3B,sBAAAA;QACA4B,gBAAgB;QAChBpB,WAAWG;QACX,GAAGD,YAAY;IACjB;IACA,OAAA,WAAA,GACE,OAAA,aAAA,CAACb,8BAAAA,EAAAA;QACE,GAAG8B,qBAAqB;QACzBE,SAASzB;QACT0B,WAAW;YACTzB,GAAGa;YACHZ,GAAGe;YACHU,YAAYf;YACZgB,kBAAkBf;YAClBT;YACA,eAAe;YACfyB,WAAOlC,uCAAAA,EAA0Ba;QACnC;QACAL,UAAUA;;AAGhB,EAAE;AAEFL,WAAWgC,WAAW,GAAG"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/utilities/FocusableTooltipText.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { useCallback, useState, useEffect, useRef } from 'react';\nimport { Tooltip } from '@fluentui/react-tooltip';\nimport type { JSXElement } from '@fluentui/react-utilities';\nimport { hasOverflow } from './overflow-utils';\nimport { getAccessibleDataObject } from './index';\nimport { AccessibilityProps } from '../types/index';\nimport { Async } from './async-utils';\n\ninterface IFocusableTooltipTextProps {\n className?: string;\n content: string | JSXElement | JSXElement[];\n accessibilityData?: AccessibilityProps;\n}\n\nexport const FocusableTooltipText: React.FunctionComponent<IFocusableTooltipTextProps> = React.forwardRef<\n HTMLDivElement,\n IFocusableTooltipTextProps\n>((props, forwardedRef) => {\n const [textOverflow, setTextOverflow] = useState(false);\n const tooltipChild = useRef<HTMLSpanElement>(null);\n const async = useRef(new Async()).current;\n const resizeObserver = useRef<ResizeObserver | undefined>(undefined);\n\n const getTargetElement = useCallback((): HTMLElement | undefined => {\n if (!tooltipChild.current || !tooltipChild.current.parentElement) {\n return undefined;\n }\n return tooltipChild.current.parentElement;\n }, [tooltipChild]);\n\n const checkTextOverflow = useCallback(() => {\n const overflowElement = getTargetElement();\n const isTextOverflow = !!overflowElement && hasOverflow(overflowElement);\n if (isTextOverflow !== textOverflow) {\n setTextOverflow(isTextOverflow);\n }\n }, [getTargetElement, textOverflow, setTextOverflow]);\n\n useEffect(() => {\n checkTextOverflow();\n }, [checkTextOverflow]);\n\n useEffect(() => {\n // setup part executed only when the component mounts/updates\n const overflowElement = getTargetElement();\n if (window.ResizeObserver && overflowElement) {\n resizeObserver.current = new window.ResizeObserver(async.debounce(checkTextOverflow, 500));\n resizeObserver.current.observe(overflowElement);\n }\n // cleanup part executed only when the component unmounts\n return () => {\n resizeObserver.current?.disconnect();\n async.dispose();\n };\n }, [async, checkTextOverflow, getTargetElement]);\n\n return (\n <div className={props.className}>\n <Tooltip content={props.content} relationship=\"description\">\n <span {...getAccessibleDataObject(props.accessibilityData)} ref={tooltipChild} data-is-focusable={textOverflow}>\n {props.content}\n </span>\n </Tooltip>\n </div>\n );\n});\n"],"names":["React","useCallback","useState","useEffect","useRef","Tooltip","hasOverflow","getAccessibleDataObject","Async","FocusableTooltipText","forwardRef","props","forwardedRef","textOverflow","setTextOverflow","tooltipChild","async","current","resizeObserver","undefined","getTargetElement","parentElement","checkTextOverflow","overflowElement","isTextOverflow","window","ResizeObserver","debounce","observe","disconnect","dispose","div","className","content","relationship","span","accessibilityData","ref","data-is-focusable"],"mappings":"AAAA;;;;;+BAiBaS;;;;;;;iEAfU,QAAQ;8BAEP,0BAA0B;+BAEtB,mBAAmB;uB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AAA;QAAIC,WAAWrB,MAAMqB,SAAS;qBAC7B,OAAA,aAAA,CAAC3B,qBAAAA,EAAAA;QAAQ4B,SAAStB,MAAMsB,OAAO;QAAEC,cAAa;qBAC5C,OAAA,aAAA,CAACC,QAAAA;QAAM,OAAG5B,8BAAAA,EAAwBI,MAAMyB,iBAAiB,CAAC;QAAEC,KAAKtB;QAAcuB,qBAAmBzB;OAC/FF,MAAMsB,OAAO;AAKxB,GAAG"}
1
+ {"version":3,"sources":["../src/utilities/FocusableTooltipText.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { useCallback, useState, useEffect, useRef } from 'react';\nimport { Tooltip } from '@fluentui/react-tooltip';\nimport type { JSXElement } from '@fluentui/react-utilities';\nimport { hasOverflow } from './overflow-utils';\nimport { getAccessibleDataObject } from './index';\nimport type { AccessibilityProps } from '../types/index';\nimport { Async } from './async-utils';\n\ninterface IFocusableTooltipTextProps {\n className?: string;\n content: string | JSXElement | JSXElement[];\n accessibilityData?: AccessibilityProps;\n}\n\nexport const FocusableTooltipText: React.FunctionComponent<IFocusableTooltipTextProps> = React.forwardRef<\n HTMLDivElement,\n IFocusableTooltipTextProps\n>((props, forwardedRef) => {\n const [textOverflow, setTextOverflow] = useState(false);\n const tooltipChild = useRef<HTMLSpanElement>(null);\n const async = useRef(new Async()).current;\n const resizeObserver = useRef<ResizeObserver | undefined>(undefined);\n\n const getTargetElement = useCallback((): HTMLElement | undefined => {\n if (!tooltipChild.current || !tooltipChild.current.parentElement) {\n return undefined;\n }\n return tooltipChild.current.parentElement;\n }, [tooltipChild]);\n\n const checkTextOverflow = useCallback(() => {\n const overflowElement = getTargetElement();\n const isTextOverflow = !!overflowElement && hasOverflow(overflowElement);\n if (isTextOverflow !== textOverflow) {\n setTextOverflow(isTextOverflow);\n }\n }, [getTargetElement, textOverflow, setTextOverflow]);\n\n useEffect(() => {\n checkTextOverflow();\n }, [checkTextOverflow]);\n\n useEffect(() => {\n // setup part executed only when the component mounts/updates\n const overflowElement = getTargetElement();\n if (window.ResizeObserver && overflowElement) {\n resizeObserver.current = new window.ResizeObserver(async.debounce(checkTextOverflow, 500));\n resizeObserver.current.observe(overflowElement);\n }\n // cleanup part executed only when the component unmounts\n return () => {\n resizeObserver.current?.disconnect();\n async.dispose();\n };\n }, [async, checkTextOverflow, getTargetElement]);\n\n return (\n <div className={props.className}>\n <Tooltip content={props.content} relationship=\"description\">\n <span {...getAccessibleDataObject(props.accessibilityData)} ref={tooltipChild} data-is-focusable={textOverflow}>\n {props.content}\n </span>\n </Tooltip>\n </div>\n );\n});\n"],"names":["React","useCallback","useState","useEffect","useRef","Tooltip","hasOverflow","getAccessibleDataObject","Async","FocusableTooltipText","forwardRef","props","forwardedRef","textOverflow","setTextOverflow","tooltipChild","async","current","resizeObserver","undefined","getTargetElement","parentElement","checkTextOverflow","overflowElement","isTextOverflow","window","ResizeObserver","debounce","observe","disconnect","dispose","div","className","content","relationship","span","accessibilityData","ref","data-is-focusable"],"mappings":"AAAA;;;;;+BAiBaS;;;;;;;iEAfU,QAAQ;8BAEP,0BAA0B;+BAEtB,mBAAmB;uBACP,UAAU;4BAE5B,gBAAgB;AAQ/B,6BAAMA,WAAAA,GAA4ET,OAAMU,UAAU,CAGvG,CAACC,OAAOC;IACR,MAAM,CAACC,cAAcC,gBAAgB,OAAGZ,eAAAA,EAAS;IACjD,MAAMa,mBAAeX,aAAAA,EAAwB;IAC7C,MAAMY,YAAQZ,aAAAA,EAAO,IAAII,iBAAAA,IAASS,OAAO;IACzC,MAAMC,qBAAiBd,aAAAA,EAAmCe;IAE1D,MAAMC,uBAAmBnB,kBAAAA,EAAY;QACnC,IAAI,CAACc,aAAaE,OAAO,IAAI,CAACF,aAAaE,OAAO,CAACI,aAAa,EAAE;YAChE,OAAOF;QACT;QACA,OAAOJ,aAAaE,OAAO,CAACI,aAAa;IAC3C,GAAG;QAACN;KAAa;IAEjB,MAAMO,wBAAoBrB,kBAAAA,EAAY;QACpC,MAAMsB,kBAAkBH;QACxB,MAAMI,iBAAiB,CAAC,CAACD,uBAAmBjB,0BAAAA,EAAYiB;QACxD,IAAIC,mBAAmBX,cAAc;YACnCC,gBAAgBU;QAClB;IACF,GAAG;QAACJ;QAAkBP;QAAcC;KAAgB;QAEpDX,gBAAAA,EAAU;QACRmB;IACF,GAAG;QAACA;KAAkB;QAEtBnB,gBAAAA,EAAU;QACR,6DAA6D;QAC7D,MAAMoB,kBAAkBH;QACxB,IAAIK,OAAOC,cAAc,IAAIH,iBAAiB;YAC5CL,eAAeD,OAAO,GAAG,IAAIQ,OAAOC,cAAc,CAACV,MAAMW,QAAQ,CAACL,mBAAmB;YACrFJ,eAAeD,OAAO,CAACW,OAAO,CAACL;QACjC;QACA,yDAAyD;QACzD,OAAO;gBACLL;aAAAA,0BAAAA,eAAeD,OAAAA,AAAO,MAAA,QAAtBC,4BAAAA,KAAAA,IAAAA,KAAAA,IAAAA,wBAAwBW,UAAU;YAClCb,MAAMc,OAAO;QACf;IACF,GAAG;QAACd;QAAOM;QAAmBF;KAAiB;IAE/C,OAAA,WAAA,GACE,OAAA,aAAA,CAACW,OAAAA;QAAIC,WAAWrB,MAAMqB,SAAS;qBAC7B,OAAA,aAAA,CAAC3B,qBAAAA,EAAAA;QAAQ4B,SAAStB,MAAMsB,OAAO;QAAEC,cAAa;qBAC5C,OAAA,aAAA,CAACC,QAAAA;QAAM,OAAG5B,8BAAAA,EAAwBI,MAAMyB,iBAAiB,CAAC;QAAEC,KAAKtB;QAAcuB,qBAAmBzB;OAC/FF,MAAMsB,OAAO;AAKxB,GAAG"}
@@ -102,7 +102,7 @@ class Async {
102
102
  if (!this._immediateIds) {
103
103
  this._immediateIds = {};
104
104
  }
105
- let setImmediateCallback = ()=>{
105
+ const setImmediateCallback = ()=>{
106
106
  // Time to execute the timeout, enqueue it as a foreground task to be executed.
107
107
  try {
108
108
  // Now delete the record and call the callback.
@@ -180,7 +180,7 @@ class Async {
180
180
  if (this._isDisposed) {
181
181
  return this._noop;
182
182
  }
183
- let waitMS = wait || 0;
183
+ const waitMS = wait || 0;
184
184
  let leading = true;
185
185
  let trailing = true;
186
186
  let lastExecuteTime = 0;
@@ -194,10 +194,10 @@ class Async {
194
194
  if (options && typeof options.trailing === 'boolean') {
195
195
  trailing = options.trailing;
196
196
  }
197
- let callback = (userCall)=>{
198
- let now = Date.now();
199
- let delta = now - lastExecuteTime;
200
- let waitLength = leading ? waitMS - delta : waitMS;
197
+ const callback = (userCall)=>{
198
+ const now = Date.now();
199
+ const delta = now - lastExecuteTime;
200
+ const waitLength = leading ? waitMS - delta : waitMS;
201
201
  if (delta >= waitMS && (!userCall || leading)) {
202
202
  lastExecuteTime = now;
203
203
  if (timeoutId) {
@@ -211,7 +211,7 @@ class Async {
211
211
  return lastResult;
212
212
  };
213
213
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
214
- let resultFunction = (...args)=>{
214
+ const resultFunction = (...args)=>{
215
215
  lastArgs = args;
216
216
  return callback(true);
217
217
  };
@@ -234,7 +234,7 @@ class Async {
234
234
  */ // eslint-disable-next-line @typescript-eslint/no-explicit-any
235
235
  debounce(func, wait, options) {
236
236
  if (this._isDisposed) {
237
- let noOpFunction = ()=>{
237
+ const noOpFunction = ()=>{
238
238
  /** Do nothing */ };
239
239
  noOpFunction.cancel = ()=>{
240
240
  return;
@@ -243,7 +243,7 @@ class Async {
243
243
  noOpFunction.pending = ()=>false;
244
244
  return noOpFunction;
245
245
  }
246
- let waitMS = wait || 0;
246
+ const waitMS = wait || 0;
247
247
  let leading = false;
248
248
  let trailing = true;
249
249
  let maxWait = null;
@@ -262,19 +262,19 @@ class Async {
262
262
  if (options && typeof options.maxWait === 'number' && !isNaN(options.maxWait)) {
263
263
  maxWait = options.maxWait;
264
264
  }
265
- let markExecuted = (time)=>{
265
+ const markExecuted = (time)=>{
266
266
  if (timeoutId) {
267
267
  this.clearTimeout(timeoutId);
268
268
  timeoutId = null;
269
269
  }
270
270
  lastExecuteTime = time;
271
271
  };
272
- let invokeFunction = (time)=>{
272
+ const invokeFunction = (time)=>{
273
273
  markExecuted(time);
274
274
  lastResult = func.apply(this._parent, lastArgs);
275
275
  };
276
- let callback = (userCall)=>{
277
- let now = Date.now();
276
+ const callback = (userCall)=>{
277
+ const now = Date.now();
278
278
  let executeImmediately = false;
279
279
  if (userCall) {
280
280
  if (leading && now - lastCallTime >= waitMS) {
@@ -282,9 +282,9 @@ class Async {
282
282
  }
283
283
  lastCallTime = now;
284
284
  }
285
- let delta = now - lastCallTime;
285
+ const delta = now - lastCallTime;
286
286
  let waitLength = waitMS - delta;
287
- let maxWaitDelta = now - lastExecuteTime;
287
+ const maxWaitDelta = now - lastExecuteTime;
288
288
  let maxWaitExpired = false;
289
289
  if (maxWait !== null) {
290
290
  // maxWait only matters when there is a pending callback
@@ -301,23 +301,23 @@ class Async {
301
301
  }
302
302
  return lastResult;
303
303
  };
304
- let pending = ()=>{
304
+ const pending = ()=>{
305
305
  return !!timeoutId;
306
306
  };
307
- let cancel = ()=>{
307
+ const cancel = ()=>{
308
308
  if (pending()) {
309
309
  // Mark the debounced function as having executed
310
310
  markExecuted(Date.now());
311
311
  }
312
312
  };
313
- let flush = ()=>{
313
+ const flush = ()=>{
314
314
  if (pending()) {
315
315
  invokeFunction(Date.now());
316
316
  }
317
317
  return lastResult;
318
318
  };
319
319
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
320
- let resultFunction = (...args)=>{
320
+ const resultFunction = (...args)=>{
321
321
  lastArgs = args;
322
322
  return callback(true);
323
323
  };
@@ -333,7 +333,7 @@ class Async {
333
333
  if (!this._animationFrameIds) {
334
334
  this._animationFrameIds = {};
335
335
  }
336
- let animationFrameCallback = ()=>{
336
+ const animationFrameCallback = ()=>{
337
337
  try {
338
338
  // Now delete the record and call the callback.
339
339
  if (this._animationFrameIds) {
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/utilities/async-utils.ts"],"sourcesContent":["import { getWindow } from './getWindow';\n\ndeclare function setTimeout(cb: Function, delay: number): number;\ndeclare function setInterval(cb: Function, delay: number): number;\n\n/**\n * Bugs often appear in async code when stuff gets disposed, but async operations don't get canceled.\n * This Async helper class solves these issues by tying async code to the lifetime of a disposable object.\n *\n * Usage: Anything class extending from BaseModel can access this helper via this.async. Otherwise create a\n * new instance of the class and remember to call dispose() during your code's dispose handler.\n *\n * @public\n */\nexport class Async {\n private _timeoutIds: { [id: number]: boolean } | null = null;\n private _immediateIds: { [id: number]: boolean } | null = null;\n private _intervalIds: { [id: number]: boolean } | null = null;\n private _animationFrameIds: { [id: number]: boolean } | null = null;\n private _isDisposed: boolean;\n private _parent: object | null;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private _onErrorHandler: ((e: any) => void) | undefined;\n private _noop: () => void;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n constructor(parent?: object, onError?: (e: any) => void) {\n this._isDisposed = false;\n this._parent = parent || null;\n this._onErrorHandler = onError;\n this._noop = () => {\n /* do nothing */\n };\n }\n\n /**\n * Dispose function, clears all async operations.\n */\n public dispose(): void {\n let id;\n\n this._isDisposed = true;\n this._parent = null;\n\n // Clear timeouts.\n if (this._timeoutIds) {\n for (id in this._timeoutIds) {\n if (this._timeoutIds.hasOwnProperty(id)) {\n this.clearTimeout(parseInt(id, 10));\n }\n }\n\n this._timeoutIds = null;\n }\n\n // Clear immediates.\n if (this._immediateIds) {\n for (id in this._immediateIds) {\n if (this._immediateIds.hasOwnProperty(id)) {\n this.clearImmediate(parseInt(id, 10));\n }\n }\n\n this._immediateIds = null;\n }\n\n // Clear intervals.\n if (this._intervalIds) {\n for (id in this._intervalIds) {\n if (this._intervalIds.hasOwnProperty(id)) {\n this.clearInterval(parseInt(id, 10));\n }\n }\n this._intervalIds = null;\n }\n\n // Clear animation frames.\n if (this._animationFrameIds) {\n for (id in this._animationFrameIds) {\n if (this._animationFrameIds.hasOwnProperty(id)) {\n this.cancelAnimationFrame(parseInt(id, 10));\n }\n }\n\n this._animationFrameIds = null;\n }\n }\n\n /**\n * SetTimeout override, which will auto cancel the timeout during dispose.\n * @param callback - Callback to execute.\n * @param duration - Duration in milliseconds.\n * @returns The setTimeout id.\n */\n public setTimeout(callback: () => void, duration: number): number {\n let timeoutId = 0;\n\n if (!this._isDisposed) {\n if (!this._timeoutIds) {\n this._timeoutIds = {};\n }\n\n timeoutId = setTimeout(() => {\n // Time to execute the timeout, enqueue it as a foreground task to be executed.\n\n try {\n // Now delete the record and call the callback.\n if (this._timeoutIds) {\n delete this._timeoutIds[timeoutId];\n }\n callback.apply(this._parent);\n } catch (e) {\n this._logError(e);\n }\n }, duration);\n\n this._timeoutIds[timeoutId] = true;\n }\n\n return timeoutId;\n }\n\n /**\n * Clears the timeout.\n * @param id - Id to cancel.\n */\n public clearTimeout(id: number): void {\n if (this._timeoutIds && this._timeoutIds[id]) {\n clearTimeout(id);\n delete this._timeoutIds[id];\n }\n }\n\n /**\n * SetImmediate override, which will auto cancel the immediate during dispose.\n * @param callback - Callback to execute.\n * @param targetElement - Optional target element to use for identifying the correct window.\n * @returns The setTimeout id.\n */\n public setImmediate(callback: () => void, targetElement?: Element | null): number {\n let immediateId = 0;\n const win = getWindow(targetElement)!;\n\n if (!this._isDisposed) {\n if (!this._immediateIds) {\n this._immediateIds = {};\n }\n\n let setImmediateCallback = () => {\n // Time to execute the timeout, enqueue it as a foreground task to be executed.\n\n try {\n // Now delete the record and call the callback.\n if (this._immediateIds) {\n delete this._immediateIds[immediateId];\n }\n callback.apply(this._parent);\n } catch (e) {\n this._logError(e);\n }\n };\n\n immediateId = win.setTimeout(setImmediateCallback, 0);\n\n this._immediateIds[immediateId] = true;\n }\n\n return immediateId;\n }\n\n /**\n * Clears the immediate.\n * @param id - Id to cancel.\n * @param targetElement - Optional target element to use for identifying the correct window.\n */\n public clearImmediate(id: number, targetElement?: Element | null): void {\n const win = getWindow(targetElement)!;\n\n if (this._immediateIds && this._immediateIds[id]) {\n win.clearTimeout(id);\n delete this._immediateIds[id];\n }\n }\n\n /**\n * SetInterval override, which will auto cancel the timeout during dispose.\n * @param callback - Callback to execute.\n * @param duration - Duration in milliseconds.\n * @returns The setTimeout id.\n */\n public setInterval(callback: () => void, duration: number): number {\n let intervalId = 0;\n\n if (!this._isDisposed) {\n if (!this._intervalIds) {\n this._intervalIds = {};\n }\n\n intervalId = setInterval(() => {\n // Time to execute the interval callback, enqueue it as a foreground task to be executed.\n try {\n callback.apply(this._parent);\n } catch (e) {\n this._logError(e);\n }\n }, duration);\n\n this._intervalIds[intervalId] = true;\n }\n\n return intervalId;\n }\n\n /**\n * Clears the interval.\n * @param id - Id to cancel.\n */\n public clearInterval(id: number): void {\n if (this._intervalIds && this._intervalIds[id]) {\n clearInterval(id);\n delete this._intervalIds[id];\n }\n }\n\n /**\n * Creates a function that, when executed, will only call the func function at most once per\n * every wait milliseconds. Provide an options object to indicate that func should be invoked\n * on the leading and/or trailing edge of the wait timeout. Subsequent calls to the throttled\n * function will return the result of the last func call.\n *\n * Note: If leading and trailing options are true func will be called on the trailing edge of\n * the timeout only if the throttled function is invoked more than once during the wait timeout.\n *\n * @param func - The function to throttle.\n * @param wait - The number of milliseconds to throttle executions to. Defaults to 0.\n * @param options - The options object.\n * @returns The new throttled function.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n public throttle<T extends (...args: any[]) => any>(\n func: T,\n wait?: number,\n options?: {\n leading?: boolean;\n trailing?: boolean;\n },\n ): T {\n if (this._isDisposed) {\n return this._noop as T;\n }\n\n let waitMS = wait || 0;\n let leading = true;\n let trailing = true;\n let lastExecuteTime = 0;\n let lastResult: T;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n let lastArgs: any[];\n let timeoutId: number | null = null;\n\n if (options && typeof options.leading === 'boolean') {\n leading = options.leading;\n }\n\n if (options && typeof options.trailing === 'boolean') {\n trailing = options.trailing;\n }\n\n let callback = (userCall?: boolean) => {\n let now = Date.now();\n let delta = now - lastExecuteTime;\n let waitLength = leading ? waitMS - delta : waitMS;\n if (delta >= waitMS && (!userCall || leading)) {\n lastExecuteTime = now;\n if (timeoutId) {\n this.clearTimeout(timeoutId);\n timeoutId = null;\n }\n lastResult = func.apply(this._parent, lastArgs);\n } else if (timeoutId === null && trailing) {\n timeoutId = this.setTimeout(callback, waitLength);\n }\n\n return lastResult;\n };\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n let resultFunction = ((...args: any[]): any => {\n lastArgs = args;\n return callback(true);\n }) as T;\n\n return resultFunction;\n }\n\n /**\n * Creates a function that will delay the execution of func until after wait milliseconds have\n * elapsed since the last time it was invoked. Provide an options object to indicate that func\n * should be invoked on the leading and/or trailing edge of the wait timeout. Subsequent calls\n * to the debounced function will return the result of the last func call.\n *\n * Note: If leading and trailing options are true func will be called on the trailing edge of\n * the timeout only if the debounced function is invoked more than once during the wait\n * timeout.\n *\n * @param func - The function to debounce.\n * @param wait - The number of milliseconds to delay.\n * @param options - The options object.\n * @returns The new debounced function.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n public debounce<T extends (...args: any[]) => any>(\n func: T,\n wait?: number,\n options?: {\n leading?: boolean;\n maxWait?: number;\n trailing?: boolean;\n },\n ): ICancelable<T> & T {\n if (this._isDisposed) {\n let noOpFunction = (() => {\n /** Do nothing */\n }) as ICancelable<T> & T;\n\n noOpFunction.cancel = () => {\n return;\n };\n noOpFunction.flush = (() => null) as unknown as () => ReturnType<T>;\n noOpFunction.pending = () => false;\n\n return noOpFunction;\n }\n\n let waitMS = wait || 0;\n let leading = false;\n let trailing = true;\n let maxWait: number | null = null;\n let lastCallTime = 0;\n let lastExecuteTime = Date.now();\n let lastResult: ReturnType<T>;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n let lastArgs: any[];\n let timeoutId: number | null = null;\n\n if (options && typeof options.leading === 'boolean') {\n leading = options.leading;\n }\n\n if (options && typeof options.trailing === 'boolean') {\n trailing = options.trailing;\n }\n\n if (options && typeof options.maxWait === 'number' && !isNaN(options.maxWait)) {\n maxWait = options.maxWait;\n }\n\n let markExecuted = (time: number) => {\n if (timeoutId) {\n this.clearTimeout(timeoutId);\n timeoutId = null;\n }\n lastExecuteTime = time;\n };\n\n let invokeFunction = (time: number) => {\n markExecuted(time);\n lastResult = func.apply(this._parent, lastArgs);\n };\n\n let callback = (userCall?: boolean) => {\n let now = Date.now();\n let executeImmediately = false;\n if (userCall) {\n if (leading && now - lastCallTime >= waitMS) {\n executeImmediately = true;\n }\n lastCallTime = now;\n }\n let delta = now - lastCallTime;\n let waitLength = waitMS - delta;\n let maxWaitDelta = now - lastExecuteTime;\n let maxWaitExpired = false;\n\n if (maxWait !== null) {\n // maxWait only matters when there is a pending callback\n if (maxWaitDelta >= maxWait && timeoutId) {\n maxWaitExpired = true;\n } else {\n waitLength = Math.min(waitLength, maxWait - maxWaitDelta);\n }\n }\n\n if (delta >= waitMS || maxWaitExpired || executeImmediately) {\n invokeFunction(now);\n } else if ((timeoutId === null || !userCall) && trailing) {\n timeoutId = this.setTimeout(callback, waitLength);\n }\n\n return lastResult;\n };\n\n let pending = (): boolean => {\n return !!timeoutId;\n };\n\n let cancel = (): void => {\n if (pending()) {\n // Mark the debounced function as having executed\n markExecuted(Date.now());\n }\n };\n\n let flush = () => {\n if (pending()) {\n invokeFunction(Date.now());\n }\n\n return lastResult;\n };\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n let resultFunction = ((...args: any[]) => {\n lastArgs = args;\n return callback(true);\n }) as ICancelable<T> & T;\n\n resultFunction.cancel = cancel;\n resultFunction.flush = flush;\n resultFunction.pending = pending;\n\n return resultFunction;\n }\n\n public requestAnimationFrame(callback: () => void, targetElement?: Element | null): number {\n let animationFrameId = 0;\n const win = getWindow(targetElement)!;\n\n if (!this._isDisposed) {\n if (!this._animationFrameIds) {\n this._animationFrameIds = {};\n }\n\n let animationFrameCallback = () => {\n try {\n // Now delete the record and call the callback.\n if (this._animationFrameIds) {\n delete this._animationFrameIds[animationFrameId];\n }\n\n callback.apply(this._parent);\n } catch (e) {\n this._logError(e);\n }\n };\n\n animationFrameId = win.requestAnimationFrame\n ? win.requestAnimationFrame(animationFrameCallback)\n : win.setTimeout(animationFrameCallback, 0);\n\n this._animationFrameIds[animationFrameId] = true;\n }\n\n return animationFrameId;\n }\n\n public cancelAnimationFrame(id: number, targetElement?: Element | null): void {\n const win = getWindow(targetElement)!;\n\n if (this._animationFrameIds && this._animationFrameIds[id]) {\n win.cancelAnimationFrame ? win.cancelAnimationFrame(id) : win.clearTimeout(id);\n delete this._animationFrameIds[id];\n }\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n protected _logError(e: any): void {\n if (this._onErrorHandler) {\n this._onErrorHandler(e);\n }\n }\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type ICancelable<T extends (...args: any[]) => any> = {\n flush: () => ReturnType<T>;\n cancel: () => void;\n pending: () => boolean;\n};\n"],"names":["getWindow","Async","dispose","id","_isDisposed","_parent","_timeoutIds","hasOwnProperty","clearTimeout","parseInt","_immediateIds","clearImmediate","_intervalIds","clearInterval","_animationFrameIds","cancelAnimationFrame","setTimeout","callback","duration","timeoutId","apply","e","_logError","setImmediate","targetElement","immediateId","win","setImmediateCallback","setInterval","intervalId","throttle","func","wait","options","_noop","waitMS","leading","trailing","lastExecuteTime","lastResult","lastArgs","userCall","now","Date","delta","waitLength","resultFunction","args","debounce","noOpFunction","cancel","flush","pending","maxWait","lastCallTime","isNaN","markExecuted","time","invokeFunction","executeImmediately","maxWaitDelta","maxWaitExpired","Math","min","requestAnimationFrame","animationFrameId","animationFrameCallback","_onErrorHandler","constructor","parent","onError"],"mappings":";;;;;;;eAcaC;;;;2BAda,cAAc;AAcjC;IAoBL;;GAEC,GACMC,UAAgB;QACrB,IAAIC;QAEJ,IAAI,CAACC,WAAW,GAAG;QACnB,IAAI,CAACC,OAAO,GAAG;QAEf,kBAAkB;QAClB,IAAI,IAAI,CAACC,WAAW,EAAE;YACpB,IAAKH,MAAM,IAAI,CAACG,WAAW,CAAE;gBAC3B,IA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AAI,CAAC8C,eAAe,EAAE;YACxB,IAAI,CAACA,eAAe,CAAC9C;QACvB;IACF;IAvcA,8DAA8D;IAC9D+C,YAAYC,MAAe,EAAEC,OAA0B,CAAE;YAVzD,kBAAA,EAAA,IAAA,EAAQhE,eAAgD;QACxD,sBAAA,EAAA,IAAA,EAAQI,iBAAkD;YAC1D,kBAAA,EAAA,IAAA,EAAQE,gBAAiD;YACzD,kBAAA,EAAA,IAAA,EAAQE,sBAAuD;YAC/D,kBAAA,EAAA,IAAA,EAAQV,eAAR,KAAA;QACA,sBAAA,EAAA,IAAA,EAAQC,WAAR,KAAA;QACA,8DAA8D;YAC9D,kBAAA,EAAA,IAAA,EAAQ8D,mBAAR,KAAA;YACA,kBAAA,EAAA,IAAA,EAAQjC,SAAR,KAAA;QAGE,IAAI,CAAC9B,WAAW,GAAG;QACnB,IAAI,CAACC,OAAO,GAAGgE,UAAU;QACzB,IAAI,CAACF,eAAe,GAAGG;QACvB,IAAI,CAACpC,KAAK,GAAG;QACX,cAAc,GAChB;IACF;AAgcF"}
1
+ {"version":3,"sources":["../src/utilities/async-utils.ts"],"sourcesContent":["import { getWindow } from './getWindow';\n\ndeclare function setTimeout(cb: Function, delay: number): number;\ndeclare function setInterval(cb: Function, delay: number): number;\n\n/**\n * Bugs often appear in async code when stuff gets disposed, but async operations don't get canceled.\n * This Async helper class solves these issues by tying async code to the lifetime of a disposable object.\n *\n * Usage: Anything class extending from BaseModel can access this helper via this.async. Otherwise create a\n * new instance of the class and remember to call dispose() during your code's dispose handler.\n *\n * @public\n */\nexport class Async {\n private _timeoutIds: { [id: number]: boolean } | null = null;\n private _immediateIds: { [id: number]: boolean } | null = null;\n private _intervalIds: { [id: number]: boolean } | null = null;\n private _animationFrameIds: { [id: number]: boolean } | null = null;\n private _isDisposed: boolean;\n private _parent: object | null;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private _onErrorHandler: ((e: any) => void) | undefined;\n private _noop: () => void;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n constructor(parent?: object, onError?: (e: any) => void) {\n this._isDisposed = false;\n this._parent = parent || null;\n this._onErrorHandler = onError;\n this._noop = () => {\n /* do nothing */\n };\n }\n\n /**\n * Dispose function, clears all async operations.\n */\n public dispose(): void {\n let id;\n\n this._isDisposed = true;\n this._parent = null;\n\n // Clear timeouts.\n if (this._timeoutIds) {\n for (id in this._timeoutIds) {\n if (this._timeoutIds.hasOwnProperty(id)) {\n this.clearTimeout(parseInt(id, 10));\n }\n }\n\n this._timeoutIds = null;\n }\n\n // Clear immediates.\n if (this._immediateIds) {\n for (id in this._immediateIds) {\n if (this._immediateIds.hasOwnProperty(id)) {\n this.clearImmediate(parseInt(id, 10));\n }\n }\n\n this._immediateIds = null;\n }\n\n // Clear intervals.\n if (this._intervalIds) {\n for (id in this._intervalIds) {\n if (this._intervalIds.hasOwnProperty(id)) {\n this.clearInterval(parseInt(id, 10));\n }\n }\n this._intervalIds = null;\n }\n\n // Clear animation frames.\n if (this._animationFrameIds) {\n for (id in this._animationFrameIds) {\n if (this._animationFrameIds.hasOwnProperty(id)) {\n this.cancelAnimationFrame(parseInt(id, 10));\n }\n }\n\n this._animationFrameIds = null;\n }\n }\n\n /**\n * SetTimeout override, which will auto cancel the timeout during dispose.\n * @param callback - Callback to execute.\n * @param duration - Duration in milliseconds.\n * @returns The setTimeout id.\n */\n public setTimeout(callback: () => void, duration: number): number {\n let timeoutId = 0;\n\n if (!this._isDisposed) {\n if (!this._timeoutIds) {\n this._timeoutIds = {};\n }\n\n timeoutId = setTimeout(() => {\n // Time to execute the timeout, enqueue it as a foreground task to be executed.\n\n try {\n // Now delete the record and call the callback.\n if (this._timeoutIds) {\n delete this._timeoutIds[timeoutId];\n }\n callback.apply(this._parent);\n } catch (e) {\n this._logError(e);\n }\n }, duration);\n\n this._timeoutIds[timeoutId] = true;\n }\n\n return timeoutId;\n }\n\n /**\n * Clears the timeout.\n * @param id - Id to cancel.\n */\n public clearTimeout(id: number): void {\n if (this._timeoutIds && this._timeoutIds[id]) {\n clearTimeout(id);\n delete this._timeoutIds[id];\n }\n }\n\n /**\n * SetImmediate override, which will auto cancel the immediate during dispose.\n * @param callback - Callback to execute.\n * @param targetElement - Optional target element to use for identifying the correct window.\n * @returns The setTimeout id.\n */\n public setImmediate(callback: () => void, targetElement?: Element | null): number {\n let immediateId = 0;\n const win = getWindow(targetElement)!;\n\n if (!this._isDisposed) {\n if (!this._immediateIds) {\n this._immediateIds = {};\n }\n\n const setImmediateCallback = () => {\n // Time to execute the timeout, enqueue it as a foreground task to be executed.\n\n try {\n // Now delete the record and call the callback.\n if (this._immediateIds) {\n delete this._immediateIds[immediateId];\n }\n callback.apply(this._parent);\n } catch (e) {\n this._logError(e);\n }\n };\n\n immediateId = win.setTimeout(setImmediateCallback, 0);\n\n this._immediateIds[immediateId] = true;\n }\n\n return immediateId;\n }\n\n /**\n * Clears the immediate.\n * @param id - Id to cancel.\n * @param targetElement - Optional target element to use for identifying the correct window.\n */\n public clearImmediate(id: number, targetElement?: Element | null): void {\n const win = getWindow(targetElement)!;\n\n if (this._immediateIds && this._immediateIds[id]) {\n win.clearTimeout(id);\n delete this._immediateIds[id];\n }\n }\n\n /**\n * SetInterval override, which will auto cancel the timeout during dispose.\n * @param callback - Callback to execute.\n * @param duration - Duration in milliseconds.\n * @returns The setTimeout id.\n */\n public setInterval(callback: () => void, duration: number): number {\n let intervalId = 0;\n\n if (!this._isDisposed) {\n if (!this._intervalIds) {\n this._intervalIds = {};\n }\n\n intervalId = setInterval(() => {\n // Time to execute the interval callback, enqueue it as a foreground task to be executed.\n try {\n callback.apply(this._parent);\n } catch (e) {\n this._logError(e);\n }\n }, duration);\n\n this._intervalIds[intervalId] = true;\n }\n\n return intervalId;\n }\n\n /**\n * Clears the interval.\n * @param id - Id to cancel.\n */\n public clearInterval(id: number): void {\n if (this._intervalIds && this._intervalIds[id]) {\n clearInterval(id);\n delete this._intervalIds[id];\n }\n }\n\n /**\n * Creates a function that, when executed, will only call the func function at most once per\n * every wait milliseconds. Provide an options object to indicate that func should be invoked\n * on the leading and/or trailing edge of the wait timeout. Subsequent calls to the throttled\n * function will return the result of the last func call.\n *\n * Note: If leading and trailing options are true func will be called on the trailing edge of\n * the timeout only if the throttled function is invoked more than once during the wait timeout.\n *\n * @param func - The function to throttle.\n * @param wait - The number of milliseconds to throttle executions to. Defaults to 0.\n * @param options - The options object.\n * @returns The new throttled function.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n public throttle<T extends (...args: any[]) => any>(\n func: T,\n wait?: number,\n options?: {\n leading?: boolean;\n trailing?: boolean;\n },\n ): T {\n if (this._isDisposed) {\n return this._noop as T;\n }\n\n const waitMS = wait || 0;\n let leading = true;\n let trailing = true;\n let lastExecuteTime = 0;\n let lastResult: T;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n let lastArgs: any[];\n let timeoutId: number | null = null;\n\n if (options && typeof options.leading === 'boolean') {\n leading = options.leading;\n }\n\n if (options && typeof options.trailing === 'boolean') {\n trailing = options.trailing;\n }\n\n const callback = (userCall?: boolean) => {\n const now = Date.now();\n const delta = now - lastExecuteTime;\n const waitLength = leading ? waitMS - delta : waitMS;\n if (delta >= waitMS && (!userCall || leading)) {\n lastExecuteTime = now;\n if (timeoutId) {\n this.clearTimeout(timeoutId);\n timeoutId = null;\n }\n lastResult = func.apply(this._parent, lastArgs);\n } else if (timeoutId === null && trailing) {\n timeoutId = this.setTimeout(callback, waitLength);\n }\n\n return lastResult;\n };\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const resultFunction = ((...args: any[]): any => {\n lastArgs = args;\n return callback(true);\n }) as T;\n\n return resultFunction;\n }\n\n /**\n * Creates a function that will delay the execution of func until after wait milliseconds have\n * elapsed since the last time it was invoked. Provide an options object to indicate that func\n * should be invoked on the leading and/or trailing edge of the wait timeout. Subsequent calls\n * to the debounced function will return the result of the last func call.\n *\n * Note: If leading and trailing options are true func will be called on the trailing edge of\n * the timeout only if the debounced function is invoked more than once during the wait\n * timeout.\n *\n * @param func - The function to debounce.\n * @param wait - The number of milliseconds to delay.\n * @param options - The options object.\n * @returns The new debounced function.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n public debounce<T extends (...args: any[]) => any>(\n func: T,\n wait?: number,\n options?: {\n leading?: boolean;\n maxWait?: number;\n trailing?: boolean;\n },\n ): ICancelable<T> & T {\n if (this._isDisposed) {\n const noOpFunction = (() => {\n /** Do nothing */\n }) as ICancelable<T> & T;\n\n noOpFunction.cancel = () => {\n return;\n };\n noOpFunction.flush = (() => null) as unknown as () => ReturnType<T>;\n noOpFunction.pending = () => false;\n\n return noOpFunction;\n }\n\n const waitMS = wait || 0;\n let leading = false;\n let trailing = true;\n let maxWait: number | null = null;\n let lastCallTime = 0;\n let lastExecuteTime = Date.now();\n let lastResult: ReturnType<T>;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n let lastArgs: any[];\n let timeoutId: number | null = null;\n\n if (options && typeof options.leading === 'boolean') {\n leading = options.leading;\n }\n\n if (options && typeof options.trailing === 'boolean') {\n trailing = options.trailing;\n }\n\n if (options && typeof options.maxWait === 'number' && !isNaN(options.maxWait)) {\n maxWait = options.maxWait;\n }\n\n const markExecuted = (time: number) => {\n if (timeoutId) {\n this.clearTimeout(timeoutId);\n timeoutId = null;\n }\n lastExecuteTime = time;\n };\n\n const invokeFunction = (time: number) => {\n markExecuted(time);\n lastResult = func.apply(this._parent, lastArgs);\n };\n\n const callback = (userCall?: boolean) => {\n const now = Date.now();\n let executeImmediately = false;\n if (userCall) {\n if (leading && now - lastCallTime >= waitMS) {\n executeImmediately = true;\n }\n lastCallTime = now;\n }\n const delta = now - lastCallTime;\n let waitLength = waitMS - delta;\n const maxWaitDelta = now - lastExecuteTime;\n let maxWaitExpired = false;\n\n if (maxWait !== null) {\n // maxWait only matters when there is a pending callback\n if (maxWaitDelta >= maxWait && timeoutId) {\n maxWaitExpired = true;\n } else {\n waitLength = Math.min(waitLength, maxWait - maxWaitDelta);\n }\n }\n\n if (delta >= waitMS || maxWaitExpired || executeImmediately) {\n invokeFunction(now);\n } else if ((timeoutId === null || !userCall) && trailing) {\n timeoutId = this.setTimeout(callback, waitLength);\n }\n\n return lastResult;\n };\n\n const pending = (): boolean => {\n return !!timeoutId;\n };\n\n const cancel = (): void => {\n if (pending()) {\n // Mark the debounced function as having executed\n markExecuted(Date.now());\n }\n };\n\n const flush = () => {\n if (pending()) {\n invokeFunction(Date.now());\n }\n\n return lastResult;\n };\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const resultFunction = ((...args: any[]) => {\n lastArgs = args;\n return callback(true);\n }) as ICancelable<T> & T;\n\n resultFunction.cancel = cancel;\n resultFunction.flush = flush;\n resultFunction.pending = pending;\n\n return resultFunction;\n }\n\n public requestAnimationFrame(callback: () => void, targetElement?: Element | null): number {\n let animationFrameId = 0;\n const win = getWindow(targetElement)!;\n\n if (!this._isDisposed) {\n if (!this._animationFrameIds) {\n this._animationFrameIds = {};\n }\n\n const animationFrameCallback = () => {\n try {\n // Now delete the record and call the callback.\n if (this._animationFrameIds) {\n delete this._animationFrameIds[animationFrameId];\n }\n\n callback.apply(this._parent);\n } catch (e) {\n this._logError(e);\n }\n };\n\n animationFrameId = win.requestAnimationFrame\n ? win.requestAnimationFrame(animationFrameCallback)\n : win.setTimeout(animationFrameCallback, 0);\n\n this._animationFrameIds[animationFrameId] = true;\n }\n\n return animationFrameId;\n }\n\n public cancelAnimationFrame(id: number, targetElement?: Element | null): void {\n const win = getWindow(targetElement)!;\n\n if (this._animationFrameIds && this._animationFrameIds[id]) {\n win.cancelAnimationFrame ? win.cancelAnimationFrame(id) : win.clearTimeout(id);\n delete this._animationFrameIds[id];\n }\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n protected _logError(e: any): void {\n if (this._onErrorHandler) {\n this._onErrorHandler(e);\n }\n }\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type ICancelable<T extends (...args: any[]) => any> = {\n flush: () => ReturnType<T>;\n cancel: () => void;\n pending: () => boolean;\n};\n"],"names":["getWindow","Async","dispose","id","_isDisposed","_parent","_timeoutIds","hasOwnProperty","clearTimeout","parseInt","_immediateIds","clearImmediate","_intervalIds","clearInterval","_animationFrameIds","cancelAnimationFrame","setTimeout","callback","duration","timeoutId","apply","e","_logError","setImmediate","targetElement","immediateId","win","setImmediateCallback","setInterval","intervalId","throttle","func","wait","options","_noop","waitMS","leading","trailing","lastExecuteTime","lastResult","lastArgs","userCall","now","Date","delta","waitLength","resultFunction","args","debounce","noOpFunction","cancel","flush","pending","maxWait","lastCallTime","isNaN","markExecuted","time","invokeFunction","executeImmediately","maxWaitDelta","maxWaitExpired","Math","min","requestAnimationFrame","animationFrameId","animationFrameCallback","_onErrorHandler","constructor","parent","onError"],"mappings":";;;;;;;eAcaC;;;;2BAda,cAAc;AAcjC;IAoBL;;GAEC,GACMC,UAAgB;QACrB,IAAIC;QAEJ,IAAI,CAACC,WAAW,GAAG;QACnB,IAAI,CAACC,OAAO,GAAG;QAEf,kBAAkB;QAClB,IAAI,IAAI,CAACC,WAAW,EAAE;YACpB,IAAKH,MAAM,IAAI,CAACG,WAAW,CAAE;gBAC3B,IAAI,IAAI,CAACA,WAAW,CAACC,cAAc,CAACJ,KAAK;oBACvC,IAAI,CAACK,YAAY,CAACC,SAASN,IAAI;gBACjC;YACF;YAEA,IAAI,CAACG,WAAW,GAAG;QACrB;QAEA,oBAAoB;QACpB,IAAI,IAAI,CAACI,aAAa,EAAE;YACtB,IAAKP,MAAM,IAAI,CAACO,aAAa,CAAE;gBAC7B,IAAI,IAAI,CAACA,aAAa,CAACH,cAAc,CAACJ,KAAK;oBACzC,IAAI,CAACQ,cAAc,CAACF,SAASN,IAAI;gBACnC;YACF;YAEA,IAAI,CAACO,aAAa,GAAG;QACvB;QAEA,mBAAmB;QACnB,IAAI,IAAI,CAACE,YAAY,EAAE;YACrB,IAAKT,MAAM,IAAI,CAACS,YAAY,CAAE;gBA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jC,SAAR,KAAA;QAGE,IAAI,CAAC9B,WAAW,GAAG;QACnB,IAAI,CAACC,OAAO,GAAGgE,UAAU;QACzB,IAAI,CAACF,eAAe,GAAGG;QACvB,IAAI,CAACpC,KAAK,GAAG;QACX,cAAc,GAChB;IACF;AAgcF"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/utilities/hooks.ts"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { Chart, ImageExportOptions } from '../types/index';\nimport { LegendContainer } from '../Legends';\nimport { exportChartsAsImage } from './image-export-utils';\nimport { useRtl } from './utilities';\n\nexport const useImageExport = (\n componentRef: React.Ref<Chart> | undefined,\n hideLegends: boolean | undefined,\n isChartCartesian: boolean = true,\n): {\n cartesianChartRef: React.RefObject<Chart | null>;\n chartContainerRef: React.RefObject<HTMLDivElement | null>;\n legendsRef: React.RefObject<LegendContainer | null>;\n} => {\n const cartesianChartRef = React.useRef<Chart>(null);\n const chartContainerRef = React.useRef<HTMLDivElement>(null);\n const legendsRef = React.useRef<LegendContainer>(null);\n const isRTL = useRtl();\n\n React.useImperativeHandle(\n componentRef,\n () => {\n const chartContainer = isChartCartesian ? cartesianChartRef.current?.chartContainer : chartContainerRef.current;\n\n return {\n chartContainer: chartContainer ?? null,\n toImage: (opts?: ImageExportOptions): Promise<string> => {\n return exportChartsAsImage(\n [{ container: chartContainer }],\n hideLegends ? undefined : legendsRef.current?.toSVG,\n isRTL,\n opts,\n );\n },\n };\n },\n [hideLegends, isChartCartesian, isRTL],\n );\n\n return {\n cartesianChartRef,\n chartContainerRef,\n legendsRef,\n };\n};\n"],"names":["React","exportChartsAsImage","useRtl","useImageExport","componentRef","hideLegends","isChartCartesian","cartesianChartRef","useRef","chartContainerRef","legendsRef","isRTL","useImperativeHandle","chartContainer","current","toImage","opts","container","undefined","toSVG"],"mappings":"AAAA;;;;;+BAQaG;;;;;;;iEANU,QAAQ;kCAGK,uBAAuB;2BACpC,cAAc;AAE9B,uBAAuB,CAC5BC,cACAC,aACAC,mBAA4B,IAAI;IAMhC,MAAMC,oBAAoBP,OAAMQ,MAAM,CAAQ;IAC9C,MAAMC,oBAAoBT,OAAMQ,MAAM,CAAiB;IACvD,MAAME,aAAaV,OAAMQ,MAAM,CAAkB;IACjD,MAAMG,YAAQT,iBAAAA;IAEdF,OAAMY,mBAAmB,CACvBR,cACA;YAC4CG;QAA1C,MAAMM,iBAAiBP,mBAAAA,CAAmBC,6BAAAA,kBAAkBO,OAAAA,AAAO,MAAA,QAAzBP,+BAAAA,KAAAA,IAAAA,KAAAA,IAAAA,2BAA2BM,cAAc,GAAGJ,kBAAkBK,OAAO;QAE/G,OAAO;YACLD,gBAAgBA,mBAAAA,QAAAA,mBAAAA,KAAAA,IAAAA,iBAAkB;YAClCE,SAAS,CAACC;oBAGoBN;gBAF5B,WAAOT,qCAAAA,EACL;oBAAC;wBAAEgB,WAAWJ;oBAAe;iBAAE,EAC/BR,cAAca,YAAAA,CAAYR,sBAAAA,WAAWI,OAAAA,AAAO,MAAA,QAAlBJ,wBAAAA,KAAAA,IAAAA,KAAAA,IAAAA,oBAAoBS,KAAK,EACnDR,OACAK;YAEJ;QACF;IACF,GACA;QAACX;QAAaC;QAAkBK;KAAM;IAGxC,OAAO;QACLJ;QACAE;QACAC;IACF;AACF,EAAE"}
1
+ {"version":3,"sources":["../src/utilities/hooks.ts"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport type { Chart, ImageExportOptions } from '../types/index';\nimport type { LegendContainer } from '../Legends';\nimport { exportChartsAsImage } from './image-export-utils';\nimport { useRtl } from './utilities';\n\nexport const useImageExport = (\n componentRef: React.Ref<Chart> | undefined,\n hideLegends: boolean | undefined,\n isChartCartesian: boolean = true,\n): {\n cartesianChartRef: React.RefObject<Chart | null>;\n chartContainerRef: React.RefObject<HTMLDivElement | null>;\n legendsRef: React.RefObject<LegendContainer | null>;\n} => {\n const cartesianChartRef = React.useRef<Chart>(null);\n const chartContainerRef = React.useRef<HTMLDivElement>(null);\n const legendsRef = React.useRef<LegendContainer>(null);\n const isRTL = useRtl();\n\n React.useImperativeHandle(\n componentRef,\n () => {\n const chartContainer = isChartCartesian ? cartesianChartRef.current?.chartContainer : chartContainerRef.current;\n\n return {\n chartContainer: chartContainer ?? null,\n toImage: (opts?: ImageExportOptions): Promise<string> => {\n return exportChartsAsImage(\n [{ container: chartContainer }],\n hideLegends ? undefined : legendsRef.current?.toSVG,\n isRTL,\n opts,\n );\n },\n };\n },\n [hideLegends, isChartCartesian, isRTL],\n );\n\n return {\n cartesianChartRef,\n chartContainerRef,\n legendsRef,\n };\n};\n"],"names":["React","exportChartsAsImage","useRtl","useImageExport","componentRef","hideLegends","isChartCartesian","cartesianChartRef","useRef","chartContainerRef","legendsRef","isRTL","useImperativeHandle","chartContainer","current","toImage","opts","container","undefined","toSVG"],"mappings":"AAAA;;;;;+BAQaG;;;;;;;iEANU,QAAQ;kCAGK,uBAAuB;2BACpC,cAAc;AAE9B,uBAAuB,CAC5BC,cACAC,aACAC,mBAA4B,IAAI;IAMhC,MAAMC,oBAAoBP,OAAMQ,MAAM,CAAQ;IAC9C,MAAMC,oBAAoBT,OAAMQ,MAAM,CAAiB;IACvD,MAAME,aAAaV,OAAMQ,MAAM,CAAkB;IACjD,MAAMG,YAAQT,iBAAAA;IAEdF,OAAMY,mBAAmB,CACvBR,cACA;YAC4CG;QAA1C,MAAMM,iBAAiBP,mBAAAA,CAAmBC,6BAAAA,kBAAkBO,OAAAA,AAAO,MAAA,QAAzBP,+BAAAA,KAAAA,IAAAA,KAAAA,IAAAA,2BAA2BM,cAAc,GAAGJ,kBAAkBK,OAAO;QAE/G,OAAO;YACLD,gBAAgBA,mBAAAA,QAAAA,mBAAAA,KAAAA,IAAAA,iBAAkB;YAClCE,SAAS,CAACC;oBAGoBN;gBAF5B,WAAOT,qCAAAA,EACL;oBAAC;wBAAEgB,WAAWJ;oBAAe;iBAAE,EAC/BR,cAAca,YAAAA,CAAYR,sBAAAA,WAAWI,OAAAA,AAAO,MAAA,QAAlBJ,wBAAAA,KAAAA,IAAAA,KAAAA,IAAAA,oBAAoBS,KAAK,EACnDR,OACAK;YAEJ;QACF;IACF,GACA;QAACX;QAAaC;QAAkBK;KAAM;IAGxC,OAAO;QACLJ;QACAE;QACAC;IACF;AACF,EAAE"}