@fluentui/react-charts 1.1.0 → 9.0.0

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 (364) hide show
  1. package/CHANGELOG.md +181 -11
  2. package/LICENSE +11 -17
  3. package/README.md +174 -23
  4. package/dist/index.d.ts +2143 -0
  5. package/lib/CartesianChart.js +1 -0
  6. package/lib/CartesianChart.js.map +1 -0
  7. package/lib/DeclarativeChart.js +1 -0
  8. package/lib/DeclarativeChart.js.map +1 -0
  9. package/lib/DonutChart.js +1 -0
  10. package/lib/DonutChart.js.map +1 -0
  11. package/lib/HorizontalBarChart.js +1 -0
  12. package/lib/HorizontalBarChart.js.map +1 -0
  13. package/lib/Legends.js +1 -0
  14. package/lib/Legends.js.map +1 -0
  15. package/lib/LineChart.js +1 -0
  16. package/lib/LineChart.js.map +1 -0
  17. package/lib/Popover.js +1 -0
  18. package/lib/Popover.js.map +1 -0
  19. package/lib/ResponsiveContainer.js +1 -0
  20. package/lib/ResponsiveContainer.js.map +1 -0
  21. package/lib/Sparkline.js +1 -0
  22. package/lib/Sparkline.js.map +1 -0
  23. package/lib/VerticalBarChart.js +1 -0
  24. package/lib/VerticalBarChart.js.map +1 -0
  25. package/lib/components/CommonComponents/CartesianChart.js +462 -0
  26. package/lib/components/CommonComponents/CartesianChart.js.map +1 -0
  27. package/lib/components/CommonComponents/CartesianChart.types.js +1 -0
  28. package/lib/components/CommonComponents/CartesianChart.types.js.map +1 -0
  29. package/lib/components/CommonComponents/ChartPopover.js +187 -0
  30. package/lib/components/CommonComponents/ChartPopover.js.map +1 -0
  31. package/lib/components/CommonComponents/ChartPopover.types.js +1 -0
  32. package/lib/components/CommonComponents/ChartPopover.types.js.map +1 -0
  33. package/lib/components/CommonComponents/index.js +4 -0
  34. package/lib/components/CommonComponents/index.js.map +1 -0
  35. package/lib/components/CommonComponents/useCartesianChartStyles.styles.js +229 -0
  36. package/lib/components/CommonComponents/useCartesianChartStyles.styles.js.map +1 -0
  37. package/lib/components/CommonComponents/useChartPopoverStyles.styles.js +178 -0
  38. package/lib/components/CommonComponents/useChartPopoverStyles.styles.js.map +1 -0
  39. package/lib/components/DeclarativeChart/DeclarativeChart.js +150 -0
  40. package/lib/components/DeclarativeChart/DeclarativeChart.js.map +1 -0
  41. package/lib/components/DeclarativeChart/PlotlySchema.js +7 -0
  42. package/lib/components/DeclarativeChart/PlotlySchema.js.map +1 -0
  43. package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js +400 -0
  44. package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -0
  45. package/lib/components/DeclarativeChart/imageExporter.js +221 -0
  46. package/lib/components/DeclarativeChart/imageExporter.js.map +1 -0
  47. package/lib/components/DeclarativeChart/index.js +1 -0
  48. package/lib/components/DeclarativeChart/index.js.map +1 -0
  49. package/lib/components/DonutChart/Arc/Arc.js +110 -0
  50. package/lib/components/DonutChart/Arc/Arc.js.map +1 -0
  51. package/lib/components/DonutChart/Arc/Arc.types.js +1 -0
  52. package/lib/components/DonutChart/Arc/Arc.types.js.map +1 -0
  53. package/lib/components/DonutChart/Arc/index.js +2 -0
  54. package/lib/components/DonutChart/Arc/index.js.map +1 -0
  55. package/lib/components/DonutChart/Arc/useArcStyles.styles.js +54 -0
  56. package/lib/components/DonutChart/Arc/useArcStyles.styles.js.map +1 -0
  57. package/lib/components/DonutChart/DonutChart.js +291 -0
  58. package/lib/components/DonutChart/DonutChart.js.map +1 -0
  59. package/lib/components/DonutChart/DonutChart.types.js +1 -0
  60. package/lib/components/DonutChart/DonutChart.types.js.map +1 -0
  61. package/lib/components/DonutChart/Pie/Pie.js +72 -0
  62. package/lib/components/DonutChart/Pie/Pie.js.map +1 -0
  63. package/lib/components/DonutChart/Pie/Pie.types.js +1 -0
  64. package/lib/components/DonutChart/Pie/Pie.types.js.map +1 -0
  65. package/lib/components/DonutChart/Pie/index.js +2 -0
  66. package/lib/components/DonutChart/Pie/index.js.map +1 -0
  67. package/lib/components/DonutChart/Pie/usePieStyles.styles.js +44 -0
  68. package/lib/components/DonutChart/Pie/usePieStyles.styles.js.map +1 -0
  69. package/lib/components/DonutChart/index.js +3 -0
  70. package/lib/components/DonutChart/index.js.map +1 -0
  71. package/lib/components/DonutChart/useDonutChartStyles.styles.js +58 -0
  72. package/lib/components/DonutChart/useDonutChartStyles.styles.js.map +1 -0
  73. package/lib/components/HorizontalBarChart/HorizontalBarChart.js +402 -0
  74. package/lib/components/HorizontalBarChart/HorizontalBarChart.js.map +1 -0
  75. package/lib/components/HorizontalBarChart/HorizontalBarChart.types.js +6 -0
  76. package/lib/components/HorizontalBarChart/HorizontalBarChart.types.js.map +1 -0
  77. package/lib/components/HorizontalBarChart/index.js +3 -0
  78. package/lib/components/HorizontalBarChart/index.js.map +1 -0
  79. package/lib/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.js +163 -0
  80. package/lib/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.js.map +1 -0
  81. package/lib/components/Legends/Legends.js +302 -0
  82. package/lib/components/Legends/Legends.js.map +1 -0
  83. package/lib/components/Legends/Legends.types.js +1 -0
  84. package/lib/components/Legends/Legends.types.js.map +1 -0
  85. package/lib/components/Legends/OverflowMenu.js +25 -0
  86. package/lib/components/Legends/OverflowMenu.js.map +1 -0
  87. package/lib/components/Legends/index.js +3 -0
  88. package/lib/components/Legends/index.js.map +1 -0
  89. package/lib/components/Legends/shape.js +35 -0
  90. package/lib/components/Legends/shape.js.map +1 -0
  91. package/lib/components/Legends/useLegendsStyles.styles.js +147 -0
  92. package/lib/components/Legends/useLegendsStyles.styles.js.map +1 -0
  93. package/lib/components/LineChart/LineChart.js +1026 -0
  94. package/lib/components/LineChart/LineChart.js.map +1 -0
  95. package/lib/components/LineChart/LineChart.types.js +3 -0
  96. package/lib/components/LineChart/LineChart.types.js.map +1 -0
  97. package/lib/components/LineChart/eventAnnotation/EventAnnotation.js +119 -0
  98. package/lib/components/LineChart/eventAnnotation/EventAnnotation.js.map +1 -0
  99. package/lib/components/LineChart/eventAnnotation/LabelLink.js +57 -0
  100. package/lib/components/LineChart/eventAnnotation/LabelLink.js.map +1 -0
  101. package/lib/components/LineChart/eventAnnotation/Textbox.js +40 -0
  102. package/lib/components/LineChart/eventAnnotation/Textbox.js.map +1 -0
  103. package/lib/components/LineChart/index.js +4 -0
  104. package/lib/components/LineChart/index.js.map +1 -0
  105. package/lib/components/LineChart/useLineChartStyles.styles.js +65 -0
  106. package/lib/components/LineChart/useLineChartStyles.styles.js.map +1 -0
  107. package/lib/components/ResponsiveContainer/ResponsiveContainer.js +65 -0
  108. package/lib/components/ResponsiveContainer/ResponsiveContainer.js.map +1 -0
  109. package/lib/components/ResponsiveContainer/ResponsiveContainer.types.js +1 -0
  110. package/lib/components/ResponsiveContainer/ResponsiveContainer.types.js.map +1 -0
  111. package/lib/components/ResponsiveContainer/index.js +1 -0
  112. package/lib/components/ResponsiveContainer/index.js.map +1 -0
  113. package/lib/components/ResponsiveContainer/useResponsiveContainerStyles.styles.js +23 -0
  114. package/lib/components/ResponsiveContainer/useResponsiveContainerStyles.styles.js.map +1 -0
  115. package/lib/components/Sparkline/Sparkline.js +119 -0
  116. package/lib/components/Sparkline/Sparkline.js.map +1 -0
  117. package/lib/components/Sparkline/Sparkline.types.js +4 -0
  118. package/lib/components/Sparkline/Sparkline.types.js.map +1 -0
  119. package/lib/components/Sparkline/index.js +3 -0
  120. package/lib/components/Sparkline/index.js.map +1 -0
  121. package/lib/components/Sparkline/useSparklineStyles.styles.js +49 -0
  122. package/lib/components/Sparkline/useSparklineStyles.styles.js.map +1 -0
  123. package/lib/components/VerticalBarChart/VerticalBarChart.js +849 -0
  124. package/lib/components/VerticalBarChart/VerticalBarChart.js.map +1 -0
  125. package/lib/components/VerticalBarChart/VerticalBarChart.types.js +4 -0
  126. package/lib/components/VerticalBarChart/VerticalBarChart.types.js.map +1 -0
  127. package/lib/components/VerticalBarChart/index.js +3 -0
  128. package/lib/components/VerticalBarChart/index.js.map +1 -0
  129. package/lib/components/VerticalBarChart/useVerticalBarChartStyles.styles.js +74 -0
  130. package/lib/components/VerticalBarChart/useVerticalBarChartStyles.styles.js.map +1 -0
  131. package/lib/index.js +12 -8
  132. package/lib/index.js.map +1 -1
  133. package/lib/types/DataPoint.js +3 -0
  134. package/lib/types/DataPoint.js.map +1 -0
  135. package/lib/types/EventAnnotation.js +1 -0
  136. package/lib/types/EventAnnotation.js.map +1 -0
  137. package/lib/types/LegendDataItem.js +1 -0
  138. package/lib/types/LegendDataItem.js.map +1 -0
  139. package/lib/types/index.js +2 -2
  140. package/lib/types/index.js.map +1 -1
  141. package/lib/utilities/FocusableTooltipText.js +65 -0
  142. package/lib/utilities/FocusableTooltipText.js.map +1 -0
  143. package/lib/utilities/KeyCodes.js +8 -0
  144. package/lib/utilities/KeyCodes.js.map +1 -0
  145. package/lib/utilities/SVGTooltipText.js +138 -0
  146. package/lib/utilities/SVGTooltipText.js.map +1 -0
  147. package/lib/utilities/async-utils.js +380 -0
  148. package/lib/utilities/async-utils.js.map +1 -0
  149. package/lib/utilities/colors.js +249 -0
  150. package/lib/utilities/colors.js.map +1 -0
  151. package/lib/utilities/getWindow.js +25 -0
  152. package/lib/utilities/getWindow.js.map +1 -0
  153. package/lib/utilities/index.js +3 -0
  154. package/lib/utilities/index.js.map +1 -0
  155. package/lib/utilities/locale-util.js +15 -0
  156. package/lib/utilities/locale-util.js.map +1 -0
  157. package/lib/utilities/overflow-utils.js +27 -0
  158. package/lib/utilities/overflow-utils.js.map +1 -0
  159. package/lib/utilities/test-data.js +276 -0
  160. package/lib/utilities/test-data.js.map +1 -0
  161. package/lib/utilities/utilities.js +1215 -0
  162. package/lib/utilities/utilities.js.map +1 -0
  163. package/lib/utilities/vbc-utils.js +27 -0
  164. package/lib/utilities/vbc-utils.js.map +1 -0
  165. package/lib-commonjs/CartesianChart.js +6 -0
  166. package/lib-commonjs/CartesianChart.js.map +1 -0
  167. package/lib-commonjs/DeclarativeChart.js +6 -0
  168. package/lib-commonjs/DeclarativeChart.js.map +1 -0
  169. package/lib-commonjs/DonutChart.js +6 -0
  170. package/lib-commonjs/DonutChart.js.map +1 -0
  171. package/lib-commonjs/HorizontalBarChart.js +6 -0
  172. package/lib-commonjs/HorizontalBarChart.js.map +1 -0
  173. package/lib-commonjs/Legends.js +6 -0
  174. package/lib-commonjs/Legends.js.map +1 -0
  175. package/lib-commonjs/LineChart.js +6 -0
  176. package/lib-commonjs/LineChart.js.map +1 -0
  177. package/lib-commonjs/Popover.js +6 -0
  178. package/lib-commonjs/Popover.js.map +1 -0
  179. package/lib-commonjs/ResponsiveContainer.js +6 -0
  180. package/lib-commonjs/ResponsiveContainer.js.map +1 -0
  181. package/lib-commonjs/Sparkline.js +6 -0
  182. package/lib-commonjs/Sparkline.js.map +1 -0
  183. package/lib-commonjs/VerticalBarChart.js +6 -0
  184. package/lib-commonjs/VerticalBarChart.js.map +1 -0
  185. package/lib-commonjs/components/CommonComponents/CartesianChart.js +469 -0
  186. package/lib-commonjs/components/CommonComponents/CartesianChart.js.map +1 -0
  187. package/lib-commonjs/components/CommonComponents/CartesianChart.types.js +6 -0
  188. package/lib-commonjs/components/CommonComponents/CartesianChart.types.js.map +1 -0
  189. package/lib-commonjs/components/CommonComponents/ChartPopover.js +197 -0
  190. package/lib-commonjs/components/CommonComponents/ChartPopover.js.map +1 -0
  191. package/lib-commonjs/components/CommonComponents/ChartPopover.types.js +4 -0
  192. package/lib-commonjs/components/CommonComponents/ChartPopover.types.js.map +1 -0
  193. package/lib-commonjs/components/CommonComponents/index.js +9 -0
  194. package/lib-commonjs/components/CommonComponents/index.js.map +1 -0
  195. package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.js +356 -0
  196. package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.js.map +1 -0
  197. package/lib-commonjs/components/CommonComponents/useChartPopoverStyles.styles.js +261 -0
  198. package/lib-commonjs/components/CommonComponents/useChartPopoverStyles.styles.js.map +1 -0
  199. package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js +158 -0
  200. package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js.map +1 -0
  201. package/lib-commonjs/components/DeclarativeChart/PlotlySchema.js +10 -0
  202. package/lib-commonjs/components/DeclarativeChart/PlotlySchema.js.map +1 -0
  203. package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js +445 -0
  204. package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -0
  205. package/lib-commonjs/components/DeclarativeChart/imageExporter.js +231 -0
  206. package/lib-commonjs/components/DeclarativeChart/imageExporter.js.map +1 -0
  207. package/lib-commonjs/components/DeclarativeChart/index.js +6 -0
  208. package/lib-commonjs/components/DeclarativeChart/index.js.map +1 -0
  209. package/lib-commonjs/components/DonutChart/Arc/Arc.js +117 -0
  210. package/lib-commonjs/components/DonutChart/Arc/Arc.js.map +1 -0
  211. package/lib-commonjs/components/DonutChart/Arc/Arc.types.js +4 -0
  212. package/lib-commonjs/components/DonutChart/Arc/Arc.types.js.map +1 -0
  213. package/lib-commonjs/components/DonutChart/Arc/index.js +7 -0
  214. package/lib-commonjs/components/DonutChart/Arc/index.js.map +1 -0
  215. package/lib-commonjs/components/DonutChart/Arc/useArcStyles.styles.js +83 -0
  216. package/lib-commonjs/components/DonutChart/Arc/useArcStyles.styles.js.map +1 -0
  217. package/lib-commonjs/components/DonutChart/DonutChart.js +298 -0
  218. package/lib-commonjs/components/DonutChart/DonutChart.js.map +1 -0
  219. package/lib-commonjs/components/DonutChart/DonutChart.types.js +6 -0
  220. package/lib-commonjs/components/DonutChart/DonutChart.types.js.map +1 -0
  221. package/lib-commonjs/components/DonutChart/Pie/Pie.js +79 -0
  222. package/lib-commonjs/components/DonutChart/Pie/Pie.js.map +1 -0
  223. package/lib-commonjs/components/DonutChart/Pie/Pie.types.js +4 -0
  224. package/lib-commonjs/components/DonutChart/Pie/Pie.types.js.map +1 -0
  225. package/lib-commonjs/components/DonutChart/Pie/index.js +7 -0
  226. package/lib-commonjs/components/DonutChart/Pie/index.js.map +1 -0
  227. package/lib-commonjs/components/DonutChart/Pie/usePieStyles.styles.js +61 -0
  228. package/lib-commonjs/components/DonutChart/Pie/usePieStyles.styles.js.map +1 -0
  229. package/lib-commonjs/components/DonutChart/index.js +8 -0
  230. package/lib-commonjs/components/DonutChart/index.js.map +1 -0
  231. package/lib-commonjs/components/DonutChart/useDonutChartStyles.styles.js +82 -0
  232. package/lib-commonjs/components/DonutChart/useDonutChartStyles.styles.js.map +1 -0
  233. package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.js +408 -0
  234. package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.js.map +1 -0
  235. package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.types.js +17 -0
  236. package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.types.js.map +1 -0
  237. package/lib-commonjs/components/HorizontalBarChart/index.js +8 -0
  238. package/lib-commonjs/components/HorizontalBarChart/index.js.map +1 -0
  239. package/lib-commonjs/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.js +251 -0
  240. package/lib-commonjs/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.js.map +1 -0
  241. package/lib-commonjs/components/Legends/Legends.js +313 -0
  242. package/lib-commonjs/components/Legends/Legends.js.map +1 -0
  243. package/lib-commonjs/components/Legends/Legends.types.js +6 -0
  244. package/lib-commonjs/components/Legends/Legends.types.js.map +1 -0
  245. package/lib-commonjs/components/Legends/OverflowMenu.js +36 -0
  246. package/lib-commonjs/components/Legends/OverflowMenu.js.map +1 -0
  247. package/lib-commonjs/components/Legends/index.js +8 -0
  248. package/lib-commonjs/components/Legends/index.js.map +1 -0
  249. package/lib-commonjs/components/Legends/shape.js +46 -0
  250. package/lib-commonjs/components/Legends/shape.js.map +1 -0
  251. package/lib-commonjs/components/Legends/useLegendsStyles.styles.js +304 -0
  252. package/lib-commonjs/components/Legends/useLegendsStyles.styles.js.map +1 -0
  253. package/lib-commonjs/components/LineChart/LineChart.js +1032 -0
  254. package/lib-commonjs/components/LineChart/LineChart.js.map +1 -0
  255. package/lib-commonjs/components/LineChart/LineChart.types.js +6 -0
  256. package/lib-commonjs/components/LineChart/LineChart.types.js.map +1 -0
  257. package/lib-commonjs/components/LineChart/eventAnnotation/EventAnnotation.js +129 -0
  258. package/lib-commonjs/components/LineChart/eventAnnotation/EventAnnotation.js.map +1 -0
  259. package/lib-commonjs/components/LineChart/eventAnnotation/LabelLink.js +68 -0
  260. package/lib-commonjs/components/LineChart/eventAnnotation/LabelLink.js.map +1 -0
  261. package/lib-commonjs/components/LineChart/eventAnnotation/Textbox.js +51 -0
  262. package/lib-commonjs/components/LineChart/eventAnnotation/Textbox.js.map +1 -0
  263. package/lib-commonjs/components/LineChart/index.js +9 -0
  264. package/lib-commonjs/components/LineChart/index.js.map +1 -0
  265. package/lib-commonjs/components/LineChart/useLineChartStyles.styles.js +96 -0
  266. package/lib-commonjs/components/LineChart/useLineChartStyles.styles.js.map +1 -0
  267. package/lib-commonjs/components/ResponsiveContainer/ResponsiveContainer.js +76 -0
  268. package/lib-commonjs/components/ResponsiveContainer/ResponsiveContainer.js.map +1 -0
  269. package/lib-commonjs/components/ResponsiveContainer/ResponsiveContainer.types.js +6 -0
  270. package/lib-commonjs/components/ResponsiveContainer/ResponsiveContainer.types.js.map +1 -0
  271. package/lib-commonjs/components/ResponsiveContainer/index.js +6 -0
  272. package/lib-commonjs/components/ResponsiveContainer/index.js.map +1 -0
  273. package/lib-commonjs/components/ResponsiveContainer/useResponsiveContainerStyles.styles.js +47 -0
  274. package/lib-commonjs/components/ResponsiveContainer/useResponsiveContainerStyles.styles.js.map +1 -0
  275. package/lib-commonjs/components/Sparkline/Sparkline.js +125 -0
  276. package/lib-commonjs/components/Sparkline/Sparkline.js.map +1 -0
  277. package/lib-commonjs/components/Sparkline/Sparkline.types.js +7 -0
  278. package/lib-commonjs/components/Sparkline/Sparkline.types.js.map +1 -0
  279. package/lib-commonjs/components/Sparkline/index.js +8 -0
  280. package/lib-commonjs/components/Sparkline/index.js.map +1 -0
  281. package/lib-commonjs/components/Sparkline/useSparklineStyles.styles.js +77 -0
  282. package/lib-commonjs/components/Sparkline/useSparklineStyles.styles.js.map +1 -0
  283. package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.js +851 -0
  284. package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.js.map +1 -0
  285. package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.types.js +7 -0
  286. package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.types.js.map +1 -0
  287. package/lib-commonjs/components/VerticalBarChart/index.js +8 -0
  288. package/lib-commonjs/components/VerticalBarChart/index.js.map +1 -0
  289. package/lib-commonjs/components/VerticalBarChart/useVerticalBarChartStyles.styles.js +117 -0
  290. package/lib-commonjs/components/VerticalBarChart/useVerticalBarChartStyles.styles.js.map +1 -0
  291. package/lib-commonjs/index.js +17 -0
  292. package/lib-commonjs/index.js.map +1 -0
  293. package/lib-commonjs/types/DataPoint.js +6 -0
  294. package/lib-commonjs/types/DataPoint.js.map +1 -0
  295. package/lib-commonjs/types/EventAnnotation.js +6 -0
  296. package/lib-commonjs/types/EventAnnotation.js.map +1 -0
  297. package/lib-commonjs/types/LegendDataItem.js +4 -0
  298. package/lib-commonjs/types/LegendDataItem.js.map +1 -0
  299. package/lib-commonjs/types/index.js +7 -0
  300. package/lib-commonjs/types/index.js.map +1 -0
  301. package/lib-commonjs/utilities/FocusableTooltipText.js +75 -0
  302. package/lib-commonjs/utilities/FocusableTooltipText.js.map +1 -0
  303. package/lib-commonjs/utilities/KeyCodes.js +18 -0
  304. package/lib-commonjs/utilities/KeyCodes.js.map +1 -0
  305. package/lib-commonjs/utilities/SVGTooltipText.js +148 -0
  306. package/lib-commonjs/utilities/SVGTooltipText.js.map +1 -0
  307. package/lib-commonjs/utilities/async-utils.js +382 -0
  308. package/lib-commonjs/utilities/async-utils.js.map +1 -0
  309. package/lib-commonjs/utilities/colors.js +270 -0
  310. package/lib-commonjs/utilities/colors.js.map +1 -0
  311. package/lib-commonjs/utilities/getWindow.js +28 -0
  312. package/lib-commonjs/utilities/getWindow.js.map +1 -0
  313. package/lib-commonjs/utilities/index.js +8 -0
  314. package/lib-commonjs/utilities/index.js.map +1 -0
  315. package/lib-commonjs/utilities/locale-util.js +25 -0
  316. package/lib-commonjs/utilities/locale-util.js.map +1 -0
  317. package/lib-commonjs/utilities/overflow-utils.js +36 -0
  318. package/lib-commonjs/utilities/overflow-utils.js.map +1 -0
  319. package/lib-commonjs/utilities/test-data.js +324 -0
  320. package/lib-commonjs/utilities/test-data.js.map +1 -0
  321. package/lib-commonjs/utilities/utilities.js +1184 -0
  322. package/lib-commonjs/utilities/utilities.js.map +1 -0
  323. package/lib-commonjs/utilities/vbc-utils.js +45 -0
  324. package/lib-commonjs/utilities/vbc-utils.js.map +1 -0
  325. package/package.json +80 -71
  326. package/CHANGELOG.json +0 -50
  327. package/lib/chart/chart-legend.d.ts +0 -6
  328. package/lib/chart/chart-legend.js +0 -446
  329. package/lib/chart/chart-legend.js.map +0 -1
  330. package/lib/chart/chart-render.d.ts +0 -3
  331. package/lib/chart/chart-render.js +0 -50
  332. package/lib/chart/chart-render.js.map +0 -1
  333. package/lib/chart/chart.d.ts +0 -3
  334. package/lib/chart/chart.js +0 -11
  335. package/lib/chart/chart.js.map +0 -1
  336. package/lib/chart/index.d.ts +0 -1
  337. package/lib/chart/index.js +0 -2
  338. package/lib/chart/index.js.map +0 -1
  339. package/lib/index.d.ts +0 -7
  340. package/lib/lib/builder.d.ts +0 -82
  341. package/lib/lib/builder.js +0 -341
  342. package/lib/lib/builder.js.map +0 -1
  343. package/lib/lib/datasets.d.ts +0 -99
  344. package/lib/lib/datasets.js +0 -240
  345. package/lib/lib/datasets.js.map +0 -1
  346. package/lib/lib/patterns.d.ts +0 -43
  347. package/lib/lib/patterns.js +0 -433
  348. package/lib/lib/patterns.js.map +0 -1
  349. package/lib/lib/plugins.d.ts +0 -11
  350. package/lib/lib/plugins.js +0 -403
  351. package/lib/lib/plugins.js.map +0 -1
  352. package/lib/lib/settings.d.ts +0 -11
  353. package/lib/lib/settings.js +0 -342
  354. package/lib/lib/settings.js.map +0 -1
  355. package/lib/lib/storybook.d.ts +0 -11
  356. package/lib/lib/storybook.js +0 -13
  357. package/lib/lib/storybook.js.map +0 -1
  358. package/lib/lib/utils.d.ts +0 -34
  359. package/lib/lib/utils.js +0 -253
  360. package/lib/lib/utils.js.map +0 -1
  361. package/lib/types/index.d.ts +0 -1
  362. package/lib/types/types.d.ts +0 -94
  363. package/lib/types/types.js +0 -41
  364. package/lib/types/types.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["PlotlySchemaAdapter.ts"],"sourcesContent":["/* eslint-disable one-var */\n/* eslint-disable vars-on-top */\n/* eslint-disable no-var */\n/* eslint-disable @typescript-eslint/no-explicit-any */\nimport * as React from 'react';\nimport { bin as d3Bin, extent as d3Extent, sum as d3Sum, min as d3Min, max as d3Max, merge as d3Merge } from 'd3-array';\nimport { scaleLinear as d3ScaleLinear } from 'd3-scale';\nimport { format as d3Format, precisionFixed as d3PrecisionFixed } from 'd3-format';\nimport { DonutChartProps } from '../DonutChart/index';\nimport { ChartDataPoint, ChartProps, LineChartPoints, VerticalBarChartDataPoint } from '../../types/DataPoint';\nimport { LineChartProps } from '../LineChart/index';\nimport { getNextColor } from '../../utilities/colors';\nimport { VerticalBarChartProps } from '../VerticalBarChart/index';\nimport { findNumericMinMaxOfY } from '../../utilities/utilities';\nimport { Layout, PlotlySchema, PieData, PlotData } from './PlotlySchema';\nimport type { Datum, TypedArray } from './PlotlySchema';\nimport { timeParse } from 'd3-time-format';\n\ninterface SecondaryYAxisValues {\n secondaryYAxistitle?: string;\n secondaryYScaleOptions?: { yMinValue?: number; yMaxValue?: number };\n}\n\nconst SUPPORTED_PLOT_TYPES = ['pie', 'bar', 'scatter', 'heatmap', 'sankey', 'indicator', 'histogram'];\nconst dashOptions = {\n dot: {\n strokeDasharray: '1, 5',\n strokeLinecap: 'round',\n strokeWidth: '2',\n lineBorderWidth: '4',\n },\n dash: {\n strokeDasharray: '5, 5',\n strokeLinecap: 'butt',\n strokeWidth: '2',\n lineBorderWidth: '4',\n },\n longdash: {\n strokeDasharray: '10, 5',\n strokeLinecap: 'butt',\n strokeWidth: '2',\n lineBorderWidth: '4',\n },\n dashdot: {\n strokeDasharray: '5, 5, 1, 5',\n strokeLinecap: 'butt',\n strokeWidth: '2',\n lineBorderWidth: '4',\n },\n longdashdot: {\n strokeDasharray: '10, 5, 1, 5',\n strokeLinecap: 'butt',\n strokeWidth: '2',\n lineBorderWidth: '4',\n },\n solid: {\n strokeDasharray: '0',\n strokeLinecap: 'butt',\n strokeWidth: '2',\n lineBorderWidth: '4',\n },\n} as const;\nconst isDate = (value: any): boolean => {\n const parsedDate = new Date(Date.parse(value));\n if (isNaN(parsedDate.getTime())) {\n return false;\n }\n const parsedYear = parsedDate.getFullYear();\n const yearInString = /\\b\\d{4}\\b/.test(value);\n if (!yearInString && (parsedYear === 2000 || parsedYear === 2001)) {\n return false;\n }\n return true;\n};\n\nconst isNumber = (value: any): boolean => !isNaN(parseFloat(value)) && isFinite(value);\n\nconst isMonth = (possiblyMonthValue: any): boolean => {\n const parseFullMonth = timeParse('%B');\n const parseShortMonth = timeParse('%b');\n return parseFullMonth(possiblyMonthValue) !== null || parseShortMonth(possiblyMonthValue) !== null;\n};\n\nconst isArrayOfType = (\n plotCoordinates: Datum[] | Datum[][] | TypedArray | undefined,\n typeCheck: (datum: any, ...args: any[]) => boolean,\n ...args: any[]\n): boolean => {\n if (!isArrayOrTypedArray(plotCoordinates)) {\n return false;\n }\n\n if (plotCoordinates!.length === 0) {\n return false;\n }\n\n if (Array.isArray(plotCoordinates![0])) {\n // Handle 2D array\n return (plotCoordinates as Datum[][]).every(innerArray => innerArray.every(datum => typeCheck(datum, ...args)));\n } else {\n // Handle 1D array\n return (plotCoordinates as Datum[]).every(datum => typeCheck(datum, ...args));\n }\n};\n\nexport const isDateArray = (data: Datum[] | Datum[][] | TypedArray): boolean => {\n return isArrayOfType(data, isDate);\n};\n\nexport const isNumberArray = (data: Datum[] | Datum[][] | TypedArray): boolean => {\n return isArrayOfType(data, isNumber);\n};\n\nexport const isMonthArray = (data: Datum[] | Datum[][] | TypedArray): boolean => {\n return isArrayOfType(data, isMonth);\n};\n\nexport const isLineData = (data: Partial<PlotData>): boolean => {\n return (\n !SUPPORTED_PLOT_TYPES.includes(`${data.type}`) &&\n Array.isArray(data.x) &&\n isArrayOfType(data.y, (value: any) => typeof value === 'number') &&\n data.x.length > 0 &&\n data.x.length === data.y!.length\n );\n};\n\nconst invalidate2Dseries = (series: PlotData, chartType: string): void => {\n if (series.x?.length > 0 && Array.isArray(series.x[0])) {\n throw new Error(`transform to ${chartType}:: 2D x array not supported`);\n }\n if (series.y?.length > 0 && Array.isArray(series.y[0])) {\n throw new Error(`transform to ${chartType}:: 2D y array not supported`);\n }\n};\n\nconst getLegend = (series: PlotData, index: number): string => {\n return series.name || `Series ${index + 1}`;\n};\n\nfunction getTitles(layout: Partial<Layout> | undefined) {\n const titles = {\n chartTitle: typeof layout?.title === 'string' ? layout.title : layout?.title?.text ?? '',\n xAxisTitle: typeof layout?.xaxis?.title === 'string' ? layout?.xaxis?.title : layout?.xaxis?.title?.text ?? '',\n yAxisTitle: typeof layout?.yaxis?.title === 'string' ? layout?.yaxis?.title : layout?.yaxis?.title?.text ?? '',\n };\n return titles;\n}\n\nexport const updateXValues = (xValues: Datum[] | Datum[][] | TypedArray): any[] => {\n const presentYear = new Date().getFullYear();\n if (xValues.length > 0 && Array.isArray(xValues[0])) {\n throw new Error('updateXValues:: 2D array not supported');\n }\n const dates = (xValues as Datum[]).map(possiblyMonthValue => {\n const parsedDate = `${possiblyMonthValue} 01, ${presentYear}`;\n return isDate(parsedDate) ? new Date(parsedDate) : null;\n });\n for (let i = dates.length - 1; i > 0; i--) {\n const currentMonth = dates[i]!.getMonth();\n const previousMonth = dates[i - 1]!.getMonth();\n const currentYear = dates[i]!.getFullYear();\n const previousYear = dates[i - 1]!.getFullYear();\n if (previousMonth >= currentMonth) {\n dates[i - 1]!.setFullYear(dates[i]!.getFullYear() - 1);\n } else if (previousYear > currentYear) {\n dates[i - 1]!.setFullYear(currentYear);\n }\n }\n xValues = (xValues as Datum[]).map((month, index) => {\n return `${month} 01, ${dates[index]!.getFullYear()}`;\n });\n return xValues;\n};\n\nexport const getColor = (\n legendLabel: string,\n colorMap: React.MutableRefObject<Map<string, string>>,\n isDarkTheme?: boolean,\n): string => {\n if (!colorMap.current.has(legendLabel)) {\n const nextColor = getNextColor(colorMap.current.size + 1, 0, isDarkTheme);\n colorMap.current.set(legendLabel, nextColor);\n return nextColor;\n }\n\n return colorMap.current.get(legendLabel) as string;\n};\n\nconst getSecondaryYAxisValues = (series: PlotData, layout: Partial<Layout> | undefined) => {\n const secondaryYAxisValues: SecondaryYAxisValues = {};\n if (layout && layout.yaxis2 && series.yaxis === 'y2') {\n secondaryYAxisValues.secondaryYAxistitle =\n typeof layout.yaxis2.title === 'string'\n ? layout.yaxis2.title\n : typeof layout.yaxis2.title?.text === 'string'\n ? layout.yaxis2.title.text\n : '';\n if (layout.yaxis2.range) {\n secondaryYAxisValues.secondaryYScaleOptions = {\n yMinValue: layout.yaxis2.range[0],\n yMaxValue: layout.yaxis2.range[1],\n };\n } else {\n const yValues = series.y as number[];\n if (yValues) {\n secondaryYAxisValues.secondaryYScaleOptions = {\n yMinValue: Math.min(...yValues),\n yMaxValue: Math.max(...yValues),\n };\n }\n }\n }\n secondaryYAxisValues.secondaryYAxistitle =\n secondaryYAxisValues.secondaryYAxistitle !== '' ? secondaryYAxisValues.secondaryYAxistitle : undefined;\n secondaryYAxisValues.secondaryYScaleOptions =\n secondaryYAxisValues.secondaryYScaleOptions && Object.keys(secondaryYAxisValues.secondaryYScaleOptions).length !== 0\n ? secondaryYAxisValues.secondaryYScaleOptions\n : undefined;\n return secondaryYAxisValues;\n};\n\nexport const transformPlotlyJsonToDonutProps = (\n input: PlotlySchema,\n colorMap: React.MutableRefObject<Map<string, string>>,\n isDarkTheme?: boolean,\n): DonutChartProps => {\n const firstData = input.data[0] as PieData;\n\n const donutData = firstData.labels?.map((label: string, index: number): ChartDataPoint => {\n const color = getColor(label, colorMap, isDarkTheme);\n return {\n legend: label,\n data: firstData.values?.[index] as number, //ToDo how to handle string data?\n color,\n };\n });\n\n const width: number = input.layout?.width ?? 440;\n const height: number = input.layout?.height ?? 220;\n const hideLabels: boolean = firstData.textinfo\n ? !['value', 'percent', 'label+percent'].includes(firstData.textinfo)\n : false;\n const donutMarginHorizontal: number = hideLabels ? 0 : 80;\n const donutMarginVertical: number = 40 + (hideLabels ? 0 : 40);\n const innerRadius: number = firstData.hole\n ? firstData.hole * (Math.min(width - donutMarginHorizontal, height - donutMarginVertical) / 2)\n : 0;\n const { chartTitle } = getTitles(input.layout);\n\n return {\n data: {\n chartTitle,\n chartData: donutData,\n },\n hideLegend: input.layout?.showlegend === false ? true : false,\n width,\n height,\n innerRadius,\n hideLabels,\n showLabelsInPercent: firstData.textinfo ? ['percent', 'label+percent'].includes(firstData.textinfo) : true,\n };\n};\n\nexport const transformPlotlyJsonToVBCProps = (\n input: PlotlySchema,\n colorMap: React.MutableRefObject<Map<string, string>>,\n isDarkTheme?: boolean,\n): VerticalBarChartProps => {\n const vbcData: VerticalBarChartDataPoint[] = [];\n\n input.data.forEach((series: PlotData, index: number) => {\n invalidate2Dseries(series, 'VBC');\n\n if (!series.x) {\n return;\n }\n\n const scale = d3ScaleLinear()\n .domain(d3Extent<number>(series.x as number[]) as [number, number])\n .nice();\n let [xMin, xMax] = scale.domain();\n\n xMin = typeof series.xbins?.start === 'number' ? series.xbins.start : xMin;\n xMax = typeof series.xbins?.end === 'number' ? series.xbins.end : xMax;\n\n const bin = d3Bin().domain([xMin, xMax]);\n\n if (typeof series.xbins?.size === 'number') {\n const thresholds: number[] = [];\n let th = xMin;\n const precision = d3PrecisionFixed(series.xbins.size);\n const format = d3Format(`.${precision}f`);\n\n while (th < xMax + series.xbins.size) {\n thresholds.push(parseFloat(format(th)));\n th += series.xbins.size;\n }\n\n xMin = thresholds[0];\n xMax = thresholds[thresholds.length - 1];\n bin.domain([xMin, xMax]).thresholds(thresholds);\n }\n\n const buckets = bin(series.x as number[]);\n // If the start or end of xbins is specified, then the number of datapoints may become less than x.length\n const totalDataPoints = d3Merge(buckets).length;\n\n buckets.forEach(bucket => {\n const legend: string = getLegend(series, index);\n const color: string = getColor(legend, colorMap, isDarkTheme);\n let y = bucket.length;\n\n if (series.histnorm === 'percent') {\n y = (bucket.length / totalDataPoints) * 100;\n } else if (series.histnorm === 'probability') {\n y = bucket.length / totalDataPoints;\n } else if (series.histnorm === 'density') {\n y = bucket.x0 === bucket.x1 ? 0 : bucket.length / (bucket.x1! - bucket.x0!);\n } else if (series.histnorm === 'probability density') {\n y = bucket.x0 === bucket.x1 ? 0 : bucket.length / (totalDataPoints * (bucket.x1! - bucket.x0!));\n } else if (series.histfunc === 'sum') {\n y = d3Sum(bucket);\n } else if (series.histfunc === 'avg') {\n y = bucket.length === 0 ? 0 : d3Sum(bucket) / bucket.length;\n } else if (series.histfunc === 'min') {\n y = d3Min(bucket)!;\n } else if (series.histfunc === 'max') {\n y = d3Max(bucket)!;\n }\n\n vbcData.push({\n x: (bucket.x1! + bucket.x0!) / 2,\n y,\n legend,\n color,\n xAxisCalloutData: `[${bucket.x0} - ${bucket.x1})`,\n });\n });\n });\n\n const { chartTitle, xAxisTitle, yAxisTitle } = getTitles(input.layout);\n\n return {\n data: vbcData,\n // width: layout?.width,\n // height: layout?.height,\n chartTitle,\n xAxisTitle,\n yAxisTitle,\n hideTickOverlap: true,\n };\n};\n\nexport const transformPlotlyJsonToScatterChartProps = (\n input: PlotlySchema,\n isAreaChart: boolean,\n colorMap: React.MutableRefObject<Map<string, string>>,\n isDarkTheme?: boolean,\n): LineChartProps => {\n let secondaryYAxisValues: SecondaryYAxisValues = {};\n const chartData: LineChartPoints[] = input.data.map((series: PlotData, index: number) => {\n invalidate2Dseries(series, 'Scatter');\n const xValues = series.x as Datum[];\n const isString = typeof xValues[0] === 'string';\n const isXDate = isDateArray(xValues);\n const isXNumber = isNumberArray(xValues);\n const legend: string = getLegend(series, index);\n const lineColor = getColor(legend, colorMap, isDarkTheme);\n secondaryYAxisValues = getSecondaryYAxisValues(series, input.layout);\n\n return {\n legend,\n ...(series.line?.dash && dashOptions[series.line.dash]\n ? { lineOptions: { ...dashOptions[series.line.dash] } }\n : {}),\n data: xValues.map((x, i: number) => ({\n x: isString ? (isXDate ? new Date(x as string) : isXNumber ? parseFloat(x as string) : x) : x,\n y: series.y[i],\n })),\n color: lineColor,\n } as LineChartPoints;\n });\n\n const yMinMaxValues = findNumericMinMaxOfY(chartData);\n const { chartTitle, xAxisTitle, yAxisTitle } = getTitles(input.layout);\n\n const chartProps: ChartProps = {\n chartTitle,\n lineChartData: chartData,\n };\n\n return {\n data: chartProps,\n supportNegativeData: true,\n xAxisTitle,\n yAxisTitle,\n secondaryYAxistitle: secondaryYAxisValues.secondaryYAxistitle,\n secondaryYScaleOptions: secondaryYAxisValues.secondaryYScaleOptions,\n roundedTicks: true,\n yMinValue: yMinMaxValues.startValue,\n yMaxValue: yMinMaxValues.endValue,\n hideTickOverlap: true,\n } as LineChartProps;\n};\n\nconst MAX_DEPTH = 15;\nexport const sanitizeJson = (jsonObject: any, depth: number = 0): any => {\n if (depth > MAX_DEPTH) {\n throw new Error('Maximum json depth exceeded');\n }\n\n if (typeof jsonObject === 'object' && jsonObject !== null) {\n for (const key in jsonObject) {\n if (jsonObject.hasOwnProperty(key)) {\n if (typeof jsonObject[key] === 'string') {\n jsonObject[key] = jsonObject[key].replace(/</g, '&lt;').replace(/>/g, '&gt;');\n } else {\n jsonObject[key] = sanitizeJson(jsonObject[key], depth + 1);\n }\n }\n }\n }\n\n return jsonObject;\n};\n\nfunction isTypedArray(a: any) {\n return ArrayBuffer.isView(a) && !(a instanceof DataView);\n}\n\nexport function isArrayOrTypedArray(a: any) {\n return Array.isArray(a) || isTypedArray(a);\n}\n\nfunction isPlainObject(obj: any) {\n return (\n Object.prototype.toString.call(obj) === '[object Object]' &&\n Object.getPrototypeOf(obj).hasOwnProperty('hasOwnProperty')\n );\n}\n\nvar arrayAttributes: any[] = [];\nvar stack: any[] = [];\nvar isArrayStack: any[] = [];\nvar baseContainer: any, baseAttrName: any;\n/**\n * Interate iteratively through the trace object and find all the array attributes.\n * 1 trace record = 1 series of data\n * @param trace\n */\nexport function findArrayAttributes(trace: any) {\n // Init basecontainer and baseAttrName\n crawlIntoTrace(baseContainer, 0, '');\n}\n\nfunction crawlIntoTrace(container: any, i: number, astrPartial: any) {\n var item = container[stack[i]];\n var newAstrPartial = astrPartial + stack[i];\n if (i === stack.length - 1) {\n if (isArrayOrTypedArray(item)) {\n arrayAttributes.push(baseAttrName + newAstrPartial);\n }\n } else {\n if (isArrayStack[i]) {\n if (Array.isArray(item)) {\n for (var j = 0; j < item.length; j++) {\n if (isPlainObject(item[j])) {\n crawlIntoTrace(item[j], i + 1, newAstrPartial + '[' + j + '].');\n }\n }\n }\n } else if (isPlainObject(item)) {\n crawlIntoTrace(item, i + 1, newAstrPartial + '.');\n }\n }\n}\n"],"names":["React","bin","d3Bin","extent","d3Extent","sum","d3Sum","min","d3Min","max","d3Max","merge","d3Merge","scaleLinear","d3ScaleLinear","format","d3Format","precisionFixed","d3PrecisionFixed","getNextColor","findNumericMinMaxOfY","timeParse","SUPPORTED_PLOT_TYPES","dashOptions","dot","strokeDasharray","strokeLinecap","strokeWidth","lineBorderWidth","dash","longdash","dashdot","longdashdot","solid","isDate","value","parsedDate","Date","parse","isNaN","getTime","parsedYear","getFullYear","yearInString","test","isNumber","parseFloat","isFinite","isMonth","possiblyMonthValue","parseFullMonth","parseShortMonth","isArrayOfType","plotCoordinates","typeCheck","args","isArrayOrTypedArray","length","Array","isArray","every","innerArray","datum","isDateArray","data","isNumberArray","isMonthArray","isLineData","includes","type","x","y","invalidate2Dseries","series","chartType","Error","getLegend","index","name","getTitles","layout","titles","chartTitle","title","text","xAxisTitle","xaxis","yAxisTitle","yaxis","updateXValues","xValues","presentYear","dates","map","i","currentMonth","getMonth","previousMonth","currentYear","previousYear","setFullYear","month","getColor","legendLabel","colorMap","isDarkTheme","current","has","nextColor","size","set","get","getSecondaryYAxisValues","secondaryYAxisValues","yaxis2","secondaryYAxistitle","range","secondaryYScaleOptions","yMinValue","yMaxValue","yValues","Math","undefined","Object","keys","transformPlotlyJsonToDonutProps","input","firstData","donutData","labels","label","color","legend","values","width","height","hideLabels","textinfo","donutMarginHorizontal","donutMarginVertical","innerRadius","hole","chartData","hideLegend","showlegend","showLabelsInPercent","transformPlotlyJsonToVBCProps","vbcData","forEach","scale","domain","nice","xMin","xMax","xbins","start","end","thresholds","th","precision","push","buckets","totalDataPoints","bucket","histnorm","x0","x1","histfunc","xAxisCalloutData","hideTickOverlap","transformPlotlyJsonToScatterChartProps","isAreaChart","isString","isXDate","isXNumber","lineColor","line","lineOptions","yMinMaxValues","chartProps","lineChartData","supportNegativeData","roundedTicks","startValue","endValue","MAX_DEPTH","sanitizeJson","jsonObject","depth","key","hasOwnProperty","replace","isTypedArray","a","ArrayBuffer","isView","DataView","isPlainObject","obj","prototype","toString","call","getPrototypeOf","arrayAttributes","stack","isArrayStack","baseContainer","baseAttrName","findArrayAttributes","trace","crawlIntoTrace","container","astrPartial","item","newAstrPartial","j"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AAiBF,cAAcR,KAAK,CAAC9G,EAAE;IAC3C,IAAIA,MAAM8G,MAAMnJ,MAAM,GAAG,GAAG;QAC1B,IAAID,oBAAoB6J,OAAO;YAC7BV,gBAAgB3C,IAAI,CAAC+C,eAAeO;QACtC;IACF,OAAO;QACL,IAAIT,YAAY,CAAC/G,EAAE,EAAE;YACnB,IAAIpC,MAAMC,OAAO,CAAC0J,OAAO;gBACvB,IAAK,IAAIE,IAAI,GAAGA,IAAIF,KAAK5J,MAAM,EAAE8J,IAAK;oBACpC,IAAIlB,cAAcgB,IAAI,CAACE,EAAE,GAAG;wBAC1BL,eAAeG,IAAI,CAACE,EAAE,EAAEzH,IAAI,GAAGwH,iBAAiB,MAAMC,IAAI;oBAC5D;gBACF;YACF;QACF,OAAO,IAAIlB,cAAcgB,OAAO;YAC9BH,eAAeG,MAAMvH,IAAI,GAAGwH,iBAAiB;QAC/C;IACF;AACF"}
@@ -0,0 +1,221 @@
1
+ import { create as d3Create, select as d3Select } from 'd3-selection';
2
+ import { resolveCSSVariables } from '../../utilities/index';
3
+ export function toImage(chartContainer, opts = {}) {
4
+ return new Promise((resolve, reject)=>{
5
+ if (!chartContainer) {
6
+ return reject(new Error('Chart container is not defined'));
7
+ }
8
+ try {
9
+ const background = typeof opts.background === 'string' ? resolveCSSVariables(chartContainer, opts.background) : 'transparent';
10
+ const svg = toSVG(chartContainer, background);
11
+ const svgData = new XMLSerializer().serializeToString(svg.node);
12
+ const svgDataUrl = 'data:image/svg+xml;base64,' + btoa(unescapePonyfill(encodeURIComponent(svgData)));
13
+ svgToPng(svgDataUrl, {
14
+ width: opts.width || svg.width,
15
+ height: opts.height || svg.height,
16
+ scale: opts.scale
17
+ }).then(resolve).catch(reject);
18
+ } catch (err) {
19
+ return reject(err);
20
+ }
21
+ });
22
+ }
23
+ const SVG_STYLE_PROPERTIES = [
24
+ 'display',
25
+ 'fill',
26
+ 'fill-opacity',
27
+ 'opacity',
28
+ 'stroke',
29
+ 'stroke-width',
30
+ 'transform'
31
+ ];
32
+ const SVG_TEXT_STYLE_PROPERTIES = [
33
+ 'font-family',
34
+ 'font-size',
35
+ 'font-weight',
36
+ 'text-anchor'
37
+ ];
38
+ function toSVG(chartContainer, background) {
39
+ const svg = chartContainer.querySelector('svg');
40
+ if (!svg) {
41
+ throw new Error('SVG not found');
42
+ }
43
+ const clonedSvg = d3Select(svg.cloneNode(true)).attr('width', null).attr('height', null).attr('viewBox', null);
44
+ const svgElements = svg.getElementsByTagName('*');
45
+ const clonedSvgElements = clonedSvg.node().getElementsByTagName('*');
46
+ for(let i = 0; i < svgElements.length; i++){
47
+ if (svgElements[i].tagName.toLowerCase() === 'text') {
48
+ copyStyle([
49
+ ...SVG_STYLE_PROPERTIES,
50
+ ...SVG_TEXT_STYLE_PROPERTIES
51
+ ], svgElements[i], clonedSvgElements[i]);
52
+ } else {
53
+ copyStyle(SVG_STYLE_PROPERTIES, svgElements[i], clonedSvgElements[i]);
54
+ }
55
+ }
56
+ const { width: svgWidth, height: svgHeight } = svg.getBoundingClientRect();
57
+ const legendGroup = cloneLegendsToSVG(chartContainer, svgWidth, svgHeight);
58
+ const w1 = Math.max(svgWidth, legendGroup.width);
59
+ const h1 = svgHeight + legendGroup.height;
60
+ if (legendGroup.node) {
61
+ clonedSvg.append(()=>legendGroup.node);
62
+ }
63
+ clonedSvg.insert('rect', ':first-child').attr('x', 0).attr('y', 0).attr('width', w1).attr('height', h1).attr('fill', background);
64
+ clonedSvg.attr('width', w1).attr('height', h1).attr('viewBox', `0 0 ${w1} ${h1}`);
65
+ return {
66
+ node: clonedSvg.node(),
67
+ width: w1,
68
+ height: h1
69
+ };
70
+ }
71
+ const LEGEND_RECT_STYLE_PROPERTIES_MAP = {
72
+ 'background-color': 'fill',
73
+ 'border-color': 'stroke'
74
+ };
75
+ const LEGEND_TEXT_STYLE_PROPERTIES_MAP = {
76
+ color: 'fill',
77
+ 'font-family': 'font-family',
78
+ 'font-size': 'font-size',
79
+ 'font-weight': 'font-weight',
80
+ opacity: 'opacity'
81
+ };
82
+ function cloneLegendsToSVG(chartContainer, svgWidth, svgHeight) {
83
+ const legendButtons = chartContainer.querySelectorAll(`
84
+ button.fui-legend__legend:not([data-overflowing]),
85
+ .fui-donut__legendContainer button.fui-MenuButton,
86
+ .fui-cart__legendContainer button.fui-MenuButton
87
+ `);
88
+ if (legendButtons.length === 0) {
89
+ return {
90
+ node: null,
91
+ width: 0,
92
+ height: 0
93
+ };
94
+ }
95
+ const legendGroup = d3Create('svg:g');
96
+ let legendX = 0;
97
+ let legendY = 8;
98
+ let legendLine = [];
99
+ const legendLines = [];
100
+ const legendLineWidths = [];
101
+ for(let i = 0; i < legendButtons.length; i++){
102
+ const { width: legendWidth } = legendButtons[i].getBoundingClientRect();
103
+ const legendItem = legendGroup.append('g');
104
+ legendLine.push(legendItem);
105
+ if (legendX + legendWidth > svgWidth && legendLine.length > 1) {
106
+ legendLine.pop();
107
+ legendLines.push(legendLine);
108
+ legendLineWidths.push(legendX);
109
+ legendLine = [
110
+ legendItem
111
+ ];
112
+ legendX = 0;
113
+ legendY += 32;
114
+ }
115
+ let legendText;
116
+ let textOffset = 0;
117
+ if (!legendButtons[i].hasAttribute('data-overflow-menu')) {
118
+ const legendRect = legendButtons[i].querySelector('.fui-legend__rect');
119
+ legendText = legendButtons[i].querySelector('.fui-legend__text');
120
+ legendItem.append('rect').attr('x', legendX + 8).attr('y', svgHeight + legendY + 8).attr('width', 12).attr('height', 12).attr('stroke-width', 1).call((selection)=>copyStyle(LEGEND_RECT_STYLE_PROPERTIES_MAP, legendRect, selection.node()));
121
+ textOffset = 28;
122
+ } else {
123
+ legendText = legendButtons[i];
124
+ console.log(legendText.textContent);
125
+ textOffset = 8;
126
+ }
127
+ legendItem.append('text').attr('x', legendX + textOffset).attr('y', svgHeight + legendY + 8).attr('dominant-baseline', 'hanging').text(legendText.textContent).call((selection)=>copyStyle(LEGEND_TEXT_STYLE_PROPERTIES_MAP, legendText, selection.node()));
128
+ legendX += legendWidth;
129
+ }
130
+ legendLines.push(legendLine);
131
+ legendLineWidths.push(legendX);
132
+ legendY += 32;
133
+ const centerLegends = true;
134
+ if (centerLegends) {
135
+ legendLines.forEach((ln, idx)=>{
136
+ const offsetX = Math.max((svgWidth - legendLineWidths[idx]) / 2, 0);
137
+ ln.forEach((item)=>{
138
+ item.attr('transform', `translate(${offsetX}, 0)`);
139
+ });
140
+ });
141
+ }
142
+ return {
143
+ node: legendGroup.node(),
144
+ width: Math.max(...legendLineWidths),
145
+ height: legendY
146
+ };
147
+ }
148
+ function svgToPng(svgDataUrl, opts = {}) {
149
+ return new Promise((resolve, reject)=>{
150
+ const scale = opts.scale || 1;
151
+ const w0 = opts.width || 300;
152
+ const h0 = opts.height || 150;
153
+ const w1 = scale * w0;
154
+ const h1 = scale * h0;
155
+ const canvas = document.createElement('canvas');
156
+ const img = new Image();
157
+ canvas.width = w1;
158
+ canvas.height = h1;
159
+ img.onload = function() {
160
+ const ctx = canvas.getContext('2d');
161
+ if (!ctx) {
162
+ return reject(new Error('Canvas context is null'));
163
+ }
164
+ ctx.clearRect(0, 0, w1, h1);
165
+ ctx.drawImage(img, 0, 0, w1, h1);
166
+ const imgData = canvas.toDataURL('image/png');
167
+ resolve(imgData);
168
+ };
169
+ img.onerror = function(err) {
170
+ reject(err);
171
+ };
172
+ img.src = svgDataUrl;
173
+ });
174
+ }
175
+ const hex2 = /^[\da-f]{2}$/i;
176
+ const hex4 = /^[\da-f]{4}$/i;
177
+ /**
178
+ * A ponyfill for the deprecated `unescape` method, taken from the `core-js` library.
179
+ *
180
+ * Source: {@link https://github.com/zloirock/core-js/blob/167136f479d3b8519953f2e4c534ecdd1031d3cf/packages/core-js/modules/es.unescape.js core-js/packages/core-js/modules/es.unescape.js}
181
+ */ function unescapePonyfill(str) {
182
+ let result = '';
183
+ const length = str.length;
184
+ let index = 0;
185
+ let chr;
186
+ let part;
187
+ while(index < length){
188
+ chr = str.charAt(index++);
189
+ if (chr === '%') {
190
+ if (str.charAt(index) === 'u') {
191
+ part = str.slice(index + 1, index + 5);
192
+ if (hex4.exec(part)) {
193
+ result += String.fromCharCode(parseInt(part, 16));
194
+ index += 5;
195
+ continue;
196
+ }
197
+ } else {
198
+ part = str.slice(index, index + 2);
199
+ if (hex2.exec(part)) {
200
+ result += String.fromCharCode(parseInt(part, 16));
201
+ index += 2;
202
+ continue;
203
+ }
204
+ }
205
+ }
206
+ result += chr;
207
+ }
208
+ return result;
209
+ }
210
+ function copyStyle(properties, fromEl, toEl) {
211
+ const styles = getComputedStyle(fromEl);
212
+ if (Array.isArray(properties)) {
213
+ properties.forEach((prop)=>{
214
+ d3Select(toEl).style(prop, styles.getPropertyValue(prop));
215
+ });
216
+ } else {
217
+ Object.entries(properties).forEach(([fromProp, toProp])=>{
218
+ d3Select(toEl).style(toProp, styles.getPropertyValue(fromProp));
219
+ });
220
+ }
221
+ }
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["imageExporter.ts"],"sourcesContent":["import { create as d3Create, select as d3Select, Selection } from 'd3-selection';\nimport { resolveCSSVariables } from '../../utilities/index';\n\n/**\n * {@docCategory DeclarativeChart}\n */\nexport interface ImageExportOptions {\n width?: number;\n height?: number;\n scale?: number;\n background?: string;\n}\n\nexport function toImage(chartContainer?: HTMLElement | null, opts: ImageExportOptions = {}): Promise<string> {\n return new Promise((resolve, reject) => {\n if (!chartContainer) {\n return reject(new Error('Chart container is not defined'));\n }\n\n try {\n const background =\n typeof opts.background === 'string' ? resolveCSSVariables(chartContainer, opts.background) : 'transparent';\n const svg = toSVG(chartContainer, background);\n\n const svgData = new XMLSerializer().serializeToString(svg.node);\n const svgDataUrl = 'data:image/svg+xml;base64,' + btoa(unescapePonyfill(encodeURIComponent(svgData)));\n\n svgToPng(svgDataUrl, {\n width: opts.width || svg.width,\n height: opts.height || svg.height,\n scale: opts.scale,\n })\n .then(resolve)\n .catch(reject);\n } catch (err) {\n return reject(err);\n }\n });\n}\n\nconst SVG_STYLE_PROPERTIES = ['display', 'fill', 'fill-opacity', 'opacity', 'stroke', 'stroke-width', 'transform'];\nconst SVG_TEXT_STYLE_PROPERTIES = ['font-family', 'font-size', 'font-weight', 'text-anchor'];\n\nfunction toSVG(chartContainer: HTMLElement, background: string) {\n const svg = chartContainer.querySelector<SVGSVGElement>('svg');\n if (!svg) {\n throw new Error('SVG not found');\n }\n\n const clonedSvg = d3Select(svg.cloneNode(true) as SVGSVGElement)\n .attr('width', null)\n .attr('height', null)\n .attr('viewBox', null);\n const svgElements = svg.getElementsByTagName('*');\n const clonedSvgElements = clonedSvg.node()!.getElementsByTagName('*');\n\n for (let i = 0; i < svgElements.length; i++) {\n if (svgElements[i].tagName.toLowerCase() === 'text') {\n copyStyle([...SVG_STYLE_PROPERTIES, ...SVG_TEXT_STYLE_PROPERTIES], svgElements[i], clonedSvgElements[i]);\n } else {\n copyStyle(SVG_STYLE_PROPERTIES, svgElements[i], clonedSvgElements[i]);\n }\n }\n\n const { width: svgWidth, height: svgHeight } = svg.getBoundingClientRect();\n const legendGroup = cloneLegendsToSVG(chartContainer, svgWidth, svgHeight);\n const w1 = Math.max(svgWidth, legendGroup.width);\n const h1 = svgHeight + legendGroup.height;\n\n if (legendGroup.node) {\n clonedSvg.append(() => legendGroup.node);\n }\n clonedSvg\n .insert('rect', ':first-child')\n .attr('x', 0)\n .attr('y', 0)\n .attr('width', w1)\n .attr('height', h1)\n .attr('fill', background);\n clonedSvg.attr('width', w1).attr('height', h1).attr('viewBox', `0 0 ${w1} ${h1}`);\n\n return {\n node: clonedSvg.node()!,\n width: w1,\n height: h1,\n };\n}\n\nconst LEGEND_RECT_STYLE_PROPERTIES_MAP = {\n 'background-color': 'fill',\n 'border-color': 'stroke',\n};\nconst LEGEND_TEXT_STYLE_PROPERTIES_MAP = {\n color: 'fill',\n 'font-family': 'font-family',\n 'font-size': 'font-size',\n 'font-weight': 'font-weight',\n opacity: 'opacity',\n};\n\nfunction cloneLegendsToSVG(chartContainer: HTMLElement, svgWidth: number, svgHeight: number) {\n const legendButtons = chartContainer.querySelectorAll<HTMLElement>(`\n button.fui-legend__legend:not([data-overflowing]),\n .fui-donut__legendContainer button.fui-MenuButton,\n .fui-cart__legendContainer button.fui-MenuButton\n `);\n if (legendButtons.length === 0) {\n return {\n node: null,\n width: 0,\n height: 0,\n };\n }\n\n const legendGroup = d3Create<SVGGElement>('svg:g');\n let legendX = 0;\n let legendY = 8;\n let legendLine: Selection<SVGGElement, unknown, null, undefined>[] = [];\n const legendLines: (typeof legendLine)[] = [];\n const legendLineWidths: number[] = [];\n\n for (let i = 0; i < legendButtons.length; i++) {\n const { width: legendWidth } = legendButtons[i].getBoundingClientRect();\n const legendItem = legendGroup.append('g');\n\n legendLine.push(legendItem);\n if (legendX + legendWidth > svgWidth && legendLine.length > 1) {\n legendLine.pop();\n legendLines.push(legendLine);\n legendLineWidths.push(legendX);\n\n legendLine = [legendItem];\n legendX = 0;\n legendY += 32;\n }\n\n let legendText: HTMLDivElement | HTMLButtonElement | null;\n let textOffset = 0;\n\n if (!legendButtons[i].hasAttribute('data-overflow-menu')) {\n const legendRect = legendButtons[i].querySelector<HTMLDivElement>('.fui-legend__rect');\n\n legendText = legendButtons[i].querySelector<HTMLDivElement>('.fui-legend__text');\n legendItem\n .append('rect')\n .attr('x', legendX + 8)\n .attr('y', svgHeight + legendY + 8)\n .attr('width', 12)\n .attr('height', 12)\n .attr('stroke-width', 1)\n .call(selection => copyStyle(LEGEND_RECT_STYLE_PROPERTIES_MAP, legendRect!, selection.node()!));\n textOffset = 28;\n } else {\n legendText = legendButtons[i] as HTMLButtonElement;\n console.log(legendText!.textContent);\n textOffset = 8;\n }\n\n legendItem\n .append('text')\n .attr('x', legendX + textOffset)\n .attr('y', svgHeight + legendY + 8)\n .attr('dominant-baseline', 'hanging')\n .text(legendText!.textContent)\n .call(selection => copyStyle(LEGEND_TEXT_STYLE_PROPERTIES_MAP, legendText!, selection.node()!));\n legendX += legendWidth;\n }\n\n legendLines.push(legendLine);\n legendLineWidths.push(legendX);\n legendY += 32;\n\n const centerLegends = true;\n if (centerLegends) {\n legendLines.forEach((ln, idx) => {\n const offsetX = Math.max((svgWidth - legendLineWidths[idx]) / 2, 0);\n ln.forEach(item => {\n item.attr('transform', `translate(${offsetX}, 0)`);\n });\n });\n }\n\n return {\n node: legendGroup.node(),\n width: Math.max(...legendLineWidths),\n height: legendY,\n };\n}\n\nfunction svgToPng(svgDataUrl: string, opts: ImageExportOptions = {}): Promise<string> {\n return new Promise((resolve, reject) => {\n const scale = opts.scale || 1;\n const w0 = opts.width || 300;\n const h0 = opts.height || 150;\n const w1 = scale * w0;\n const h1 = scale * h0;\n\n const canvas = document.createElement('canvas');\n const img = new Image();\n\n canvas.width = w1;\n canvas.height = h1;\n\n img.onload = function () {\n const ctx = canvas.getContext('2d');\n if (!ctx) {\n return reject(new Error('Canvas context is null'));\n }\n\n ctx.clearRect(0, 0, w1, h1);\n ctx.drawImage(img, 0, 0, w1, h1);\n\n const imgData = canvas.toDataURL('image/png');\n resolve(imgData);\n };\n\n img.onerror = function (err) {\n reject(err);\n };\n\n img.src = svgDataUrl;\n });\n}\n\nconst hex2 = /^[\\da-f]{2}$/i;\nconst hex4 = /^[\\da-f]{4}$/i;\n\n/**\n * A ponyfill for the deprecated `unescape` method, taken from the `core-js` library.\n *\n * Source: {@link https://github.com/zloirock/core-js/blob/167136f479d3b8519953f2e4c534ecdd1031d3cf/packages/core-js/modules/es.unescape.js core-js/packages/core-js/modules/es.unescape.js}\n */\nfunction unescapePonyfill(str: string) {\n let result = '';\n const length = str.length;\n let index = 0;\n let chr;\n let part;\n while (index < length) {\n chr = str.charAt(index++);\n if (chr === '%') {\n if (str.charAt(index) === 'u') {\n part = str.slice(index + 1, index + 5);\n if (hex4.exec(part)) {\n result += String.fromCharCode(parseInt(part, 16));\n index += 5;\n continue;\n }\n } else {\n part = str.slice(index, index + 2);\n if (hex2.exec(part)) {\n result += String.fromCharCode(parseInt(part, 16));\n index += 2;\n continue;\n }\n }\n }\n result += chr;\n }\n return result;\n}\n\nfunction copyStyle(properties: string[] | Record<string, string>, fromEl: Element, toEl: Element) {\n const styles = getComputedStyle(fromEl);\n if (Array.isArray(properties)) {\n properties.forEach(prop => {\n d3Select(toEl).style(prop, styles.getPropertyValue(prop));\n });\n } else {\n Object.entries(properties).forEach(([fromProp, toProp]) => {\n d3Select(toEl).style(toProp, styles.getPropertyValue(fromProp));\n });\n }\n}\n"],"names":["create","d3Create","select","d3Select","resolveCSSVariables","toImage","chartContainer","opts","Promise","resolve","reject","Error","background","svg","toSVG","svgData","XMLSerializer","serializeToString","node","svgDataUrl","btoa","unescapePonyfill","encodeURIComponent","svgToPng","width","height","scale","then","catch","err","SVG_STYLE_PROPERTIES","SVG_TEXT_STYLE_PROPERTIES","querySelector","clonedSvg","cloneNode","attr","svgElements","getElementsByTagName","clonedSvgElements","i","length","tagName","toLowerCase","copyStyle","svgWidth","svgHeight","getBoundingClientRect","legendGroup","cloneLegendsToSVG","w1","Math","max","h1","append","insert","LEGEND_RECT_STYLE_PROPERTIES_MAP","LEGEND_TEXT_STYLE_PROPERTIES_MAP","color","opacity","legendButtons","querySelectorAll","legendX","legendY","legendLine","legendLines","legendLineWidths","legendWidth","legendItem","push","pop","legendText","textOffset","hasAttribute","legendRect","call","selection","console","log","textContent","text","centerLegends","forEach","ln","idx","offsetX","item","w0","h0","canvas","document","createElement","img","Image","onload","ctx","getContext","clearRect","drawImage","imgData","toDataURL","onerror","src","hex2","hex4","str","result","index","chr","part","charAt","slice","exec","String","fromCharCode","parseInt","properties","fromEl","toEl","styles","getComputedStyle","Array","isArray","prop","style","getPropertyValue","Object","entries","fromProp","toProp"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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F;QACF;QACAD,UAAUE;IACZ;IACA,OAAOF;AACT;AAEA,SAAS9D,UAAUwE,UAA6C,EAAEC,MAAe,EAAEC,IAAa;IAC9F,MAAMC,SAASC,iBAAiBH;IAChC,IAAII,MAAMC,OAAO,CAACN,aAAa;QAC7BA,WAAWlC,OAAO,CAACyC,CAAAA;YACjBvH,SAASkH,MAAMM,KAAK,CAACD,MAAMJ,OAAOM,gBAAgB,CAACF;QACrD;IACF,OAAO;QACLG,OAAOC,OAAO,CAACX,YAAYlC,OAAO,CAAC,CAAC,CAAC8C,UAAUC,OAAO;YACpD7H,SAASkH,MAAMM,KAAK,CAACK,QAAQV,OAAOM,gBAAgB,CAACG;QACvD;IACF;AACF"}
@@ -0,0 +1 @@
1
+ export * from './DeclarativeChart';
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["index.ts"],"sourcesContent":["export * from './DeclarativeChart';\nexport type { ImageExportOptions } from './imageExporter';\n"],"names":[],"rangeMappings":"","mappings":"AAAA,cAAc,qBAAqB"}
@@ -0,0 +1,110 @@
1
+ import * as React from 'react';
2
+ import { arc as d3Arc } from 'd3-shape';
3
+ import { useArcStyles } from './useArcStyles.styles';
4
+ import { format as d3Format } from 'd3-format';
5
+ import { formatValueWithSIPrefix, useRtl } from '../../../utilities/index';
6
+ // Create a Arc within Donut Chart variant which uses these default styles and this styled subcomponent.
7
+ /**
8
+ * Arc component within Donut Chart.
9
+ * {@docCategory ArcDonutChart}
10
+ */ export const Arc = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
11
+ var _props_data;
12
+ const arc = d3Arc();
13
+ const currentRef = /*#__PURE__*/ React.createRef();
14
+ const _isRTL = useRtl();
15
+ const classes = useArcStyles(props);
16
+ React.useEffect(()=>{
17
+ _updateChart(props);
18
+ }, [
19
+ props
20
+ ]);
21
+ function _onFocus(data, id) {
22
+ props.onFocusCallback(data, id, currentRef.current);
23
+ }
24
+ function _hoverOn(data, mouseEvent) {
25
+ mouseEvent.persist();
26
+ props.hoverOnCallback(data, mouseEvent);
27
+ }
28
+ function _hoverOff() {
29
+ props.hoverLeaveCallback();
30
+ }
31
+ function _onBlur() {
32
+ props.onBlurCallback();
33
+ }
34
+ function _getAriaLabel() {
35
+ var _point_callOutAccessibilityData;
36
+ const point = props.data.data;
37
+ const legend = point.xAxisCalloutData || point.legend;
38
+ const yValue = point.yAxisCalloutData || point.data || 0;
39
+ return ((_point_callOutAccessibilityData = point.callOutAccessibilityData) === null || _point_callOutAccessibilityData === void 0 ? void 0 : _point_callOutAccessibilityData.ariaLabel) || (legend ? `${legend}, ` : '') + `${yValue}.`;
40
+ }
41
+ function _renderArcLabel(className) {
42
+ const { data, innerRadius, outerRadius, showLabelsInPercent, totalValue, hideLabels, activeArc } = props;
43
+ if (hideLabels || Math.abs(data.endAngle - data.startAngle) < Math.PI / 12 || activeArc !== data.data.legend && activeArc !== '') {
44
+ return null;
45
+ }
46
+ const [base, perp] = arc.centroid({
47
+ ...data,
48
+ innerRadius,
49
+ outerRadius
50
+ });
51
+ const hyp = Math.sqrt(base * base + perp * perp);
52
+ const labelRadius = Math.max(innerRadius, outerRadius) + 2;
53
+ const angle = (data.startAngle + data.endAngle) / 2;
54
+ const arcValue = data.value;
55
+ return /*#__PURE__*/ React.createElement("text", {
56
+ x: (hyp === 0 ? 0 : base / hyp) * labelRadius,
57
+ y: (hyp === 0 ? 0 : perp / hyp) * labelRadius,
58
+ textAnchor: angle > Math.PI !== _isRTL ? 'end' : 'start',
59
+ dominantBaseline: angle > Math.PI / 2 && angle < 3 * Math.PI / 2 ? 'hanging' : 'auto',
60
+ className: className,
61
+ "aria-hidden": true
62
+ }, showLabelsInPercent ? d3Format('.0%')(totalValue === 0 ? 0 : arcValue / totalValue) : formatValueWithSIPrefix(arcValue));
63
+ }
64
+ function _updateChart(newProps) {
65
+ if (newProps.arc && newProps.innerRadius && newProps.outerRadius) {
66
+ newProps.arc.innerRadius(newProps.innerRadius);
67
+ newProps.arc.outerRadius(newProps.outerRadius);
68
+ }
69
+ }
70
+ const { href, focusedArcId } = props;
71
+ //TO DO 'replace' is throwing error
72
+ const id = props.uniqText + props.data.data.legend.replace(/\s+/, '') + props.data.data.data;
73
+ const opacity = props.activeArc === props.data.data.legend || props.activeArc === '' ? 1 : 0.1;
74
+ return /*#__PURE__*/ React.createElement("g", {
75
+ ref: currentRef
76
+ }, !!focusedArcId && focusedArcId === id && // TODO innerradius and outerradius were absent
77
+ /*#__PURE__*/ React.createElement("path", {
78
+ id: id + 'focusRing',
79
+ d: arc({
80
+ ...props.focusData,
81
+ innerRadius: props.innerRadius,
82
+ outerRadius: props.outerRadius
83
+ }),
84
+ className: classes.focusRing
85
+ }), /*#__PURE__*/ React.createElement("path", {
86
+ // TODO innerradius and outerradius were absent
87
+ id: id,
88
+ d: arc({
89
+ ...props.data,
90
+ innerRadius: props.innerRadius,
91
+ outerRadius: props.outerRadius
92
+ }),
93
+ className: classes.root,
94
+ style: {
95
+ fill: props.color,
96
+ cursor: href ? 'pointer' : 'default'
97
+ },
98
+ onFocus: _onFocus.bind(this, props.data.data, id),
99
+ "data-is-focusable": props.activeArc === props.data.data.legend || props.activeArc === '',
100
+ onMouseOver: _hoverOn.bind(this, props.data.data),
101
+ onMouseMove: _hoverOn.bind(this, props.data.data),
102
+ onMouseLeave: _hoverOff,
103
+ onBlur: _onBlur,
104
+ opacity: opacity,
105
+ onClick: (_props_data = props.data) === null || _props_data === void 0 ? void 0 : _props_data.data.onClick,
106
+ "aria-label": _getAriaLabel(),
107
+ role: "img"
108
+ }), _renderArcLabel(classes.arcLabel));
109
+ });
110
+ Arc.displayName = 'Arc';
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["Arc.tsx"],"sourcesContent":["import * as React from 'react';\nimport { arc as d3Arc } from 'd3-shape';\nimport { useArcStyles } from './useArcStyles.styles';\nimport { ChartDataPoint } from '../index';\nimport { ArcProps } from './index';\nimport { format as d3Format } from 'd3-format';\nimport { formatValueWithSIPrefix, useRtl } from '../../../utilities/index';\n\n// Create a Arc within Donut Chart variant which uses these default styles and this styled subcomponent.\n/**\n * Arc component within Donut Chart.\n * {@docCategory ArcDonutChart}\n */\nexport const Arc: React.FunctionComponent<ArcProps> = React.forwardRef<HTMLDivElement, ArcProps>(\n (props, forwardedRef) => {\n const arc = d3Arc();\n const currentRef = React.createRef<SVGPathElement>();\n const _isRTL: boolean = useRtl();\n const classes = useArcStyles(props);\n\n React.useEffect(() => {\n _updateChart(props);\n }, [props]);\n\n function _onFocus(data: ChartDataPoint, id: string): void {\n props.onFocusCallback!(data, id, currentRef.current);\n }\n\n function _hoverOn(data: ChartDataPoint, mouseEvent: React.MouseEvent<SVGPathElement>): void {\n mouseEvent.persist();\n props.hoverOnCallback!(data, mouseEvent);\n }\n\n function _hoverOff(): void {\n props.hoverLeaveCallback!();\n }\n\n function _onBlur(): void {\n props.onBlurCallback!();\n }\n\n function _getAriaLabel(): string {\n const point = props.data!.data;\n const legend = point.xAxisCalloutData || point.legend;\n const yValue = point.yAxisCalloutData || point.data || 0;\n return point.callOutAccessibilityData?.ariaLabel || (legend ? `${legend}, ` : '') + `${yValue}.`;\n }\n\n function _renderArcLabel(className: string) {\n const { data, innerRadius, outerRadius, showLabelsInPercent, totalValue, hideLabels, activeArc } = props;\n\n if (\n hideLabels ||\n Math.abs(data!.endAngle - data!.startAngle) < Math.PI / 12 ||\n (activeArc !== data!.data.legend && activeArc !== '')\n ) {\n return null;\n }\n\n const [base, perp] = arc.centroid({ ...data!, innerRadius, outerRadius });\n const hyp = Math.sqrt(base * base + perp * perp);\n const labelRadius = Math.max(innerRadius!, outerRadius!) + 2;\n const angle = (data!.startAngle + data!.endAngle) / 2;\n const arcValue = data!.value;\n\n return (\n <text\n x={(hyp === 0 ? 0 : base / hyp) * labelRadius}\n y={(hyp === 0 ? 0 : perp / hyp) * labelRadius}\n textAnchor={angle > Math.PI !== _isRTL ? 'end' : 'start'}\n dominantBaseline={angle > Math.PI / 2 && angle < (3 * Math.PI) / 2 ? 'hanging' : 'auto'}\n className={className}\n aria-hidden={true}\n >\n {showLabelsInPercent\n ? d3Format('.0%')(totalValue! === 0 ? 0 : arcValue / totalValue!)\n : formatValueWithSIPrefix(arcValue)}\n </text>\n );\n }\n\n function _updateChart(newProps: ArcProps): void {\n if (newProps.arc && newProps.innerRadius && newProps.outerRadius) {\n newProps.arc.innerRadius(newProps.innerRadius);\n newProps.arc.outerRadius(newProps.outerRadius);\n }\n }\n\n const { href, focusedArcId } = props;\n //TO DO 'replace' is throwing error\n const id = props.uniqText! + props.data!.data.legend!.replace(/\\s+/, '') + props.data!.data.data;\n const opacity: number = props.activeArc === props.data!.data.legend || props.activeArc === '' ? 1 : 0.1;\n return (\n <g ref={currentRef}>\n {!!focusedArcId && focusedArcId === id && (\n // TODO innerradius and outerradius were absent\n <path\n id={id + 'focusRing'}\n d={arc({ ...props.focusData!, innerRadius: props.innerRadius, outerRadius: props.outerRadius })!}\n className={classes.focusRing}\n />\n )}\n <path\n // TODO innerradius and outerradius were absent\n id={id}\n d={arc({ ...props.data!, innerRadius: props.innerRadius, outerRadius: props.outerRadius })!}\n className={classes.root}\n style={{ fill: props.color, cursor: href ? 'pointer' : 'default' }}\n onFocus={_onFocus.bind(this, props.data!.data, id)}\n data-is-focusable={props.activeArc === props.data!.data.legend || props.activeArc === ''}\n onMouseOver={_hoverOn.bind(this, props.data!.data)}\n onMouseMove={_hoverOn.bind(this, props.data!.data)}\n onMouseLeave={_hoverOff}\n onBlur={_onBlur}\n opacity={opacity}\n onClick={props.data?.data.onClick}\n aria-label={_getAriaLabel()}\n role=\"img\"\n />\n {_renderArcLabel(classes.arcLabel)}\n </g>\n );\n },\n);\nArc.displayName = 'Arc';\n"],"names":["React","arc","d3Arc","useArcStyles","format","d3Format","formatValueWithSIPrefix","useRtl","Arc","forwardRef","props","forwardedRef","currentRef","createRef","_isRTL","classes","useEffect","_updateChart","_onFocus","data","id","onFocusCallback","current","_hoverOn","mouseEvent","persist","hoverOnCallback","_hoverOff","hoverLeaveCallback","_onBlur","onBlurCallback","_getAriaLabel","point","legend","xAxisCalloutData","yValue","yAxisCalloutData","callOutAccessibilityData","ariaLabel","_renderArcLabel","className","innerRadius","outerRadius","showLabelsInPercent","totalValue","hideLabels","activeArc","Math","abs","endAngle","startAngle","PI","base","perp","centroid","hyp","sqrt","labelRadius","max","angle","arcValue","value","text","x","y","textAnchor","dominantBaseline","aria-hidden","newProps","href","focusedArcId","uniqText","replace","opacity","g","ref","path","d","focusData","focusRing","root","style","fill","color","cursor","onFocus","bind","data-is-focusable","onMouseOver","onMouseMove","onMouseLeave","onBlur","onClick","aria-label","role","arcLabel","displayName"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,OAAOC,KAAK,QAAQ,WAAW;AACxC,SAASC,YAAY,QAAQ,wBAAwB;AAGrD,SAASC,UAAUC,QAAQ,QAAQ,YAAY;AAC/C,SAASC,uBAAuB,EAAEC,MAAM,QAAQ,2BAA2B;AAE3E,wGAAwG;AACxG;;;CAGC,GACD,OAAO,MAAMC,oBAAyCR,MAAMS,UAAU,CACpE,CAACC,OAAOC;QAqGSD;IApGf,MAAMT,MAAMC;IACZ,MAAMU,2BAAaZ,MAAMa,SAAS;IAClC,MAAMC,SAAkBP;IACxB,MAAMQ,UAAUZ,aAAaO;IAE7BV,MAAMgB,SAAS,CAAC;QACdC,aAAaP;IACf,GAAG;QAACA;KAAM;IAEV,SAASQ,SAASC,IAAoB,EAAEC,EAAU;QAChDV,MAAMW,eAAe,CAAEF,MAAMC,IAAIR,WAAWU,OAAO;IACrD;IAEA,SAASC,SAASJ,IAAoB,EAAEK,UAA4C;QAClFA,WAAWC,OAAO;QAClBf,MAAMgB,eAAe,CAAEP,MAAMK;IAC/B;IAEA,SAASG;QACPjB,MAAMkB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AG5E,IAAI;YAAE,GAAGS,MAAMS,IAAI;YAAGsB,aAAa/B,MAAM+B,WAAW;YAAEC,aAAahC,MAAMgC,WAAW;QAAC;QACxFF,WAAWzB,QAAQiE,IAAI;QACvBC,OAAO;YAAEC,MAAMxE,MAAMyE,KAAK;YAAEC,QAAQf,OAAO,YAAY;QAAU;QACjEgB,SAASnE,SAASoE,IAAI,CAAC,IAAI,EAAE5E,MAAMS,IAAI,CAAEA,IAAI,EAAEC;QAC/CmE,qBAAmB7E,MAAMoC,SAAS,KAAKpC,MAAMS,IAAI,CAAEA,IAAI,CAACc,MAAM,IAAIvB,MAAMoC,SAAS,KAAK;QACtF0C,aAAajE,SAAS+D,IAAI,CAAC,IAAI,EAAE5E,MAAMS,IAAI,CAAEA,IAAI;QACjDsE,aAAalE,SAAS+D,IAAI,CAAC,IAAI,EAAE5E,MAAMS,IAAI,CAAEA,IAAI;QACjDuE,cAAc/D;QACdgE,QAAQ9D;QACR4C,SAASA;QACTmB,OAAO,GAAElF,cAAAA,MAAMS,IAAI,cAAVT,kCAAAA,YAAYS,IAAI,CAACyE,OAAO;QACjCC,cAAY9D;QACZ+D,MAAK;QAENvD,gBAAgBxB,QAAQgF,QAAQ;AAGvC,GACA;AACFvF,IAAIwF,WAAW,GAAG"}
@@ -0,0 +1 @@
1
+ export { };
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["Arc.types.ts"],"sourcesContent":["import { ChartDataPoint } from '../index';\nexport interface ArcProps {\n /**\n * Data to render in the Arc.\n */\n data?: ArcData;\n\n /**\n * Data to render focused Arc\n */\n focusData?: ArcData;\n\n /**\n * id of the focused arc\n */\n focusedArcId?: string;\n /**\n * shape for Arc.\n */\n /* eslint-disable @typescript-eslint/no-explicit-any */\n arc?: any;\n\n /**\n * innerRadius of the Arc.\n */\n innerRadius: number;\n\n /**\n * outerRadius of the Arc.\n */\n outerRadius: number;\n\n /**\n * Color for the Arc.\n */\n color: string;\n\n /**\n * Defines the function that is executed upon hovering over the legend\n */\n hoverOnCallback?: Function;\n\n /**\n * Defines the function that is executed upon hovering over the legend\n */\n onFocusCallback?: Function;\n\n /**\n * Defines the function that is executed upon hovering Leave the legend\n */\n onBlurCallback?: Function;\n\n /**\n * Defines the function that is executed upon hovering Leave the legend\n */\n hoverLeaveCallback?: Function;\n\n /**\n * Uniq string for chart\n */\n uniqText?: string;\n\n /**\n * string for callout id\n */\n calloutId?: string;\n\n /**\n * Active Arc for chart\n */\n activeArc?: string;\n\n /**\n * internal prop for href\n */\n href?: string;\n\n /**\n * props for inside donut value\n */\n valueInsideDonut?: string | number;\n\n /**\n * Prop to show the arc labels in percentage format\n */\n showLabelsInPercent?: boolean;\n\n /**\n * Prop used to define the sum of all arc values\n */\n totalValue?: number;\n\n /**\n * Prop to hide the arc labels\n */\n hideLabels?: boolean;\n\n /**\n * Call to provide customized styling that will layer on top of the variant rules.\n */\n styles?: ArcStyles;\n\n /**\n * Additional CSS class(es) to apply to the Chart.\n */\n className?: string;\n}\n\nexport interface ArcData {\n /**\n * Data to render in the chart for individual arc.\n */\n data: ChartDataPoint;\n /**\n * endAngle of the Arc\n */\n endAngle: number;\n /**\n * index of the Arc\n */\n index: number;\n /**\n * padAngle of the Arc\n */\n padAngle: number;\n /**\n * startAngle of the Arc\n */\n startAngle: number;\n /**\n * value of the Arc\n */\n value: number;\n}\n\nexport interface ArcStyles {\n /**\n * Style set for the card header component root\n */\n root: string;\n\n /**\n * styles for the focus\n */\n focusRing: string;\n\n /**\n * Style for the arc labels\n */\n arcLabel: string;\n}\n"],"names":[],"rangeMappings":"","mappings":"AAuIA,WAeC"}
@@ -0,0 +1,2 @@
1
+ export * from './Arc';
2
+ export * from './Arc.types';
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["index.ts"],"sourcesContent":["export * from './Arc';\nexport * from './Arc.types';\n"],"names":[],"rangeMappings":";","mappings":"AAAA,cAAc,QAAQ;AACtB,cAAc,cAAc"}
@@ -0,0 +1,54 @@
1
+ import { __styles, mergeClasses, shorthands } from '@griffel/react';
2
+ import { tokens, typographyStyles } from '@fluentui/react-theme';
3
+ /**
4
+ * @internal
5
+ */
6
+ export const donutArcClassNames = {
7
+ root: 'fui-donut-arc__root',
8
+ focusRing: 'fui-donut-arc__focusRing',
9
+ arcLabel: 'fui-donut-arc__arcLabel'
10
+ };
11
+ /**
12
+ * Base Styles
13
+ */
14
+ const useStyles = /*#__PURE__*/__styles({
15
+ root: {
16
+ Bceei9c: "f158kwzp",
17
+ Bpd4iqm: "f2cu5sd",
18
+ ojy3ng: "f1yuyku4",
19
+ B4ncu3z: "f138xzbb",
20
+ zxy5zd: ["fny96iz", "fi0bkha"],
21
+ bkw2yb: "f1jv8gm3",
22
+ Bjksbd0: ["fi0bkha", "fny96iz"]
23
+ },
24
+ focusRing: {
25
+ ojy3ng: "frcfrt5",
26
+ Be5yapy: "f9nnx8l",
27
+ Bkfmm31: "f1au8mb3"
28
+ },
29
+ arcLabel: {
30
+ Bahqtrf: "fk6fouc",
31
+ Be2twd7: "fy9rknc",
32
+ Bhrd7zp: "fl43uef",
33
+ Bg96gwp: "fwrc4pm",
34
+ Bkfmm31: "fhuob2q"
35
+ }
36
+ }, {
37
+ d: [".f158kwzp{cursor:default;}", ".f2cu5sd{outline-width:transparent;}", ".f1yuyku4{stroke:var(--colorNeutralBackground1);}", ".f138xzbb selectors::-moz-focus-inner{border-top-width:0;}", ".fny96iz selectors::-moz-focus-inner{border-right-width:0;}", ".fi0bkha selectors::-moz-focus-inner{border-left-width:0;}", ".f1jv8gm3 selectors::-moz-focus-inner{border-bottom-width:0;}", ".frcfrt5{stroke:var(--colorStrokeFocus2);}", ".f9nnx8l{stroke-width:var(--strokeWidthThickest);}", ".f1au8mb3{fill:transparent;}", ".fk6fouc{font-family:var(--fontFamilyBase);}", ".fy9rknc{font-size:var(--fontSizeBase200);}", ".fl43uef{font-weight:var(--fontWeightSemibold);}", ".fwrc4pm{line-height:var(--lineHeightBase200);}", ".fhuob2q{fill:var(--colorNeutralForeground1);}"]
38
+ });
39
+ /**
40
+ * Apply styling to the Arc components
41
+ */
42
+ export const useArcStyles = props => {
43
+ var _props_styles, _props_styles1, _props_styles2;
44
+ const {
45
+ className
46
+ } = props;
47
+ const baseStyles = useStyles();
48
+ return {
49
+ root: mergeClasses(donutArcClassNames.root, baseStyles.root, className, (_props_styles = props.styles) === null || _props_styles === void 0 ? void 0 : _props_styles.root),
50
+ focusRing: mergeClasses(donutArcClassNames.focusRing, baseStyles.focusRing, (_props_styles1 = props.styles) === null || _props_styles1 === void 0 ? void 0 : _props_styles1.focusRing),
51
+ arcLabel: mergeClasses(donutArcClassNames.arcLabel, baseStyles.arcLabel, (_props_styles2 = props.styles) === null || _props_styles2 === void 0 ? void 0 : _props_styles2.arcLabel)
52
+ };
53
+ };
54
+ //# sourceMappingURL=useArcStyles.styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["__styles","mergeClasses","shorthands","tokens","typographyStyles","donutArcClassNames","root","focusRing","arcLabel","useStyles","Bceei9c","Bpd4iqm","ojy3ng","B4ncu3z","zxy5zd","bkw2yb","Bjksbd0","Be5yapy","Bkfmm31","Bahqtrf","Be2twd7","Bhrd7zp","Bg96gwp","d","useArcStyles","props","_props_styles","_props_styles1","_props_styles2","className","baseStyles","styles"],"sources":["useArcStyles.styles.js"],"sourcesContent":["import { makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport { tokens, typographyStyles } from '@fluentui/react-theme';\n/**\n * @internal\n */ export const donutArcClassNames = {\n root: 'fui-donut-arc__root',\n focusRing: 'fui-donut-arc__focusRing',\n arcLabel: 'fui-donut-arc__arcLabel'\n};\n/**\n * Base Styles\n */ const useStyles = makeStyles({\n root: {\n cursor: 'default',\n ...shorthands.outline('transparent'),\n stroke: tokens.colorNeutralBackground1,\n '& selectors': {\n '::-moz-focus-inner': {\n ...shorthands.border('0')\n }\n }\n },\n focusRing: {\n stroke: tokens.colorStrokeFocus2,\n strokeWidth: tokens.strokeWidthThickest,\n fill: 'transparent'\n },\n arcLabel: {\n ...typographyStyles.caption1Strong,\n fill: tokens.colorNeutralForeground1\n }\n});\n/**\n * Apply styling to the Arc components\n */ export const useArcStyles = (props)=>{\n var _props_styles, _props_styles1, _props_styles2;\n const { className } = props;\n const baseStyles = useStyles();\n return {\n root: mergeClasses(donutArcClassNames.root, baseStyles.root, className, (_props_styles = props.styles) === null || _props_styles === void 0 ? void 0 : _props_styles.root),\n focusRing: mergeClasses(donutArcClassNames.focusRing, baseStyles.focusRing, (_props_styles1 = props.styles) === null || _props_styles1 === void 0 ? void 0 : _props_styles1.focusRing),\n arcLabel: mergeClasses(donutArcClassNames.arcLabel, baseStyles.arcLabel, (_props_styles2 = props.styles) === null || _props_styles2 === void 0 ? void 0 : _props_styles2.arcLabel)\n };\n};\n"],"mappings":"AAAA,SAAAA,QAAA,EAAqBC,YAAY,EAAEC,UAAU,QAAQ,gBAAgB;AACrE,SAASC,MAAM,EAAEC,gBAAgB,QAAQ,uBAAuB;AAChE;AACA;AACA;AAAI,OAAO,MAAMC,kBAAkB,GAAG;EAClCC,IAAI,EAAE,qBAAqB;EAC3BC,SAAS,EAAE,0BAA0B;EACrCC,QAAQ,EAAE;AACd,CAAC;AACD;AACA;AACA;AAAI,MAAMC,SAAS,gBAAGT,QAAA;EAAAM,IAAA;IAAAI,OAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,OAAA;EAAA;EAAAT,SAAA;IAAAK,MAAA;IAAAK,OAAA;IAAAC,OAAA;EAAA;EAAAV,QAAA;IAAAW,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAJ,OAAA;EAAA;AAAA;EAAAK,CAAA;AAAA,CAoBrB,CAAC;AACF;AACA;AACA;AAAI,OAAO,MAAMC,YAAY,GAAIC,KAAK,IAAG;EACrC,IAAIC,aAAa,EAAEC,cAAc,EAAEC,cAAc;EACjD,MAAM;IAAEC;EAAU,CAAC,GAAGJ,K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