@fluentui/react-charts 1.2.0 → 9.0.1

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 +193 -15
  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 -72
  326. package/CHANGELOG.json +0 -65
  327. package/lib/chart/chart-legend.d.ts +0 -6
  328. package/lib/chart/chart-legend.js +0 -445
  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 -10
  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 -89
  341. package/lib/lib/builder.js +0 -379
  342. package/lib/lib/builder.js.map +0 -1
  343. package/lib/lib/datasets.d.ts +0 -123
  344. package/lib/lib/datasets.js +0 -285
  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 -12
  353. package/lib/lib/settings.js +0 -368
  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 -101
  363. package/lib/types/types.js +0 -41
  364. package/lib/types/types.js.map +0 -1
@@ -0,0 +1,65 @@
1
+ import * as React from 'react';
2
+ import { useFluent_unstable } from '@fluentui/react-shared-contexts';
3
+ import { useResponsiveContainerStyles } from './useResponsiveContainerStyles.styles';
4
+ export const ResponsiveContainer = (props)=>{
5
+ const containerRef = React.useRef(null);
6
+ const onResizeRef = React.useRef();
7
+ const { targetDocument } = useFluent_unstable();
8
+ const classes = useResponsiveContainerStyles(props);
9
+ const [size, setSize] = React.useState({});
10
+ onResizeRef.current = props.onResize;
11
+ const _window = targetDocument === null || targetDocument === void 0 ? void 0 : targetDocument.defaultView;
12
+ React.useEffect(()=>{
13
+ let animationFrameId;
14
+ // eslint-disable-next-line no-restricted-globals
15
+ let resizeObserver;
16
+ const resizeCallback = (entries)=>{
17
+ var _onResizeRef_current;
18
+ const { width: containerWidth, height: containerHeight } = entries[0].contentRect;
19
+ // rAF is an alternative to the throttle function. For more info, see:
20
+ // https://css-tricks.com/debouncing-throttling-explained-examples/#aa-requestanimationframe-raf
21
+ animationFrameId = _window === null || _window === void 0 ? void 0 : _window.requestAnimationFrame(()=>{
22
+ setSize((prevSize)=>{
23
+ const roundedWidth = Math.floor(containerWidth);
24
+ const roundedHeight = Math.floor(containerHeight);
25
+ if (prevSize.containerWidth === roundedWidth && prevSize.containerHeight === roundedHeight) {
26
+ return prevSize;
27
+ }
28
+ return {
29
+ containerWidth: roundedWidth,
30
+ containerHeight: roundedHeight
31
+ };
32
+ });
33
+ });
34
+ (_onResizeRef_current = onResizeRef.current) === null || _onResizeRef_current === void 0 ? void 0 : _onResizeRef_current.call(onResizeRef, containerWidth, containerHeight);
35
+ };
36
+ if (_window === null || _window === void 0 ? void 0 : _window.ResizeObserver) {
37
+ resizeObserver = new _window.ResizeObserver(resizeCallback);
38
+ if (containerRef.current) {
39
+ resizeObserver.observe(containerRef.current);
40
+ }
41
+ }
42
+ return ()=>{
43
+ if (animationFrameId) {
44
+ _window === null || _window === void 0 ? void 0 : _window.cancelAnimationFrame(animationFrameId);
45
+ }
46
+ resizeObserver === null || resizeObserver === void 0 ? void 0 : resizeObserver.disconnect();
47
+ };
48
+ }, [
49
+ _window
50
+ ]);
51
+ return /*#__PURE__*/ React.createElement("div", {
52
+ ref: containerRef,
53
+ className: classes.root,
54
+ style: {
55
+ width: props.width,
56
+ height: props.height
57
+ }
58
+ }, React.Children.map(props.children, (child)=>{
59
+ return /*#__PURE__*/ React.cloneElement(child, {
60
+ width: size.containerWidth,
61
+ height: size.containerHeight
62
+ });
63
+ }));
64
+ };
65
+ ResponsiveContainer.displayName = 'ResponsiveContainer';
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["ResponsiveContainer.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useFluent_unstable } from '@fluentui/react-shared-contexts';\nimport { ResponsiveContainerProps } from './ResponsiveContainer.types';\nimport { useResponsiveContainerStyles } from './useResponsiveContainerStyles.styles';\n\nexport const ResponsiveContainer: React.FC<ResponsiveContainerProps> = props => {\n const containerRef = React.useRef<HTMLDivElement>(null);\n const onResizeRef = React.useRef<ResponsiveContainerProps['onResize']>();\n const { targetDocument } = useFluent_unstable();\n const classes = useResponsiveContainerStyles(props);\n\n const [size, setSize] = React.useState<{ containerWidth?: number; containerHeight?: number }>({});\n\n onResizeRef.current = props.onResize;\n const _window = targetDocument?.defaultView;\n\n React.useEffect(() => {\n let animationFrameId: number | undefined;\n // eslint-disable-next-line no-restricted-globals\n let resizeObserver: ResizeObserver | undefined;\n\n const resizeCallback = (entries: ResizeObserverEntry[]) => {\n const { width: containerWidth, height: containerHeight } = entries[0].contentRect;\n // rAF is an alternative to the throttle function. For more info, see:\n // https://css-tricks.com/debouncing-throttling-explained-examples/#aa-requestanimationframe-raf\n animationFrameId = _window?.requestAnimationFrame(() => {\n setSize(prevSize => {\n const roundedWidth = Math.floor(containerWidth);\n const roundedHeight = Math.floor(containerHeight);\n if (prevSize.containerWidth === roundedWidth && prevSize.containerHeight === roundedHeight) {\n return prevSize;\n }\n\n return { containerWidth: roundedWidth, containerHeight: roundedHeight };\n });\n });\n onResizeRef.current?.(containerWidth, containerHeight);\n };\n\n if (_window?.ResizeObserver) {\n resizeObserver = new _window.ResizeObserver(resizeCallback);\n if (containerRef.current) {\n resizeObserver.observe(containerRef.current);\n }\n }\n\n return () => {\n if (animationFrameId) {\n _window?.cancelAnimationFrame(animationFrameId);\n }\n\n resizeObserver?.disconnect();\n };\n }, [_window]);\n\n return (\n <div ref={containerRef} className={classes.root} style={{ width: props.width, height: props.height }}>\n {React.Children.map(props.children, child => {\n return React.cloneElement(child, {\n width: size.containerWidth,\n height: size.containerHeight,\n });\n })}\n </div>\n );\n};\nResponsiveContainer.displayName = 'ResponsiveContainer';\n"],"names":["React","useFluent_unstable","useResponsiveContainerStyles","ResponsiveContainer","props","containerRef","useRef","onResizeRef","targetDocument","classes","size","setSize","useState","current","onResize","_window","defaultView","useEffect","animationFrameId","resizeObserver","resizeCallback","entries","width","containerWidth","height","containerHeight","contentRect","requestAnimationFrame","prevSize","roundedWidth","Math","floor","roundedHeight","ResizeObserver","observe","cancelAnimationFrame","disconnect","div","ref","className","root","style","Children","map","children","child","cloneElement","displayName"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,kB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,OAAO;YACL,IAAIK,kBAAkB;gBACpBH,oBAAAA,8BAAAA,QAASoB,oBAAoB,CAACjB;YAChC;YAEAC,2BAAAA,qCAAAA,eAAgBiB,UAAU;QAC5B;IACF,GAAG;QAACrB;KAAQ;IAEZ,qBACE,oBAACsB;QAAIC,KAAKjC;QAAckC,WAAW9B,QAAQ+B,IAAI;QAAEC,OAAO;YAAEnB,OAAOlB,MAAMkB,KAAK;YAAEE,QAAQpB,MAAMoB,MAAM;QAAC;OAChGxB,MAAM0C,QAAQ,CAACC,GAAG,CAACvC,MAAMwC,QAAQ,EAAEC,CAAAA;QAClC,qBAAO7C,MAAM8C,YAAY,CAACD,OAAO;YAC/BvB,OAAOZ,KAAKa,cAAc;YAC1BC,QAAQd,KAAKe,eAAe;QAC9B;IACF;AAGN,EAAE;AACFtB,oBAAoB4C,WAAW,GAAG"}
@@ -0,0 +1 @@
1
+ import * as React from 'react';
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["ResponsiveContainer.types.ts"],"sourcesContent":["import * as React from 'react';\n\nexport interface ResponsiveContainerProps {\n children: React.ReactElement;\n onResize?: (width: number, height: number) => void;\n width?: number | string;\n height?: number | string;\n}\n\nexport interface ResponsiveContainerStyles {\n root: string;\n}\n"],"names":["React"],"rangeMappings":"","mappings":"AAAA,YAAYA,WAAW,QAAQ"}
@@ -0,0 +1 @@
1
+ export * from './ResponsiveContainer';
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["index.ts"],"sourcesContent":["export * from './ResponsiveContainer';\n"],"names":[],"rangeMappings":"","mappings":"AAAA,cAAc,wBAAwB"}
@@ -0,0 +1,23 @@
1
+ import { __styles, mergeClasses } from '@griffel/react';
2
+ export const responsiveContainerClassNames = {
3
+ root: 'fui-charts-resp__root'
4
+ };
5
+ const useStyles = /*#__PURE__*/__styles({
6
+ root: {
7
+ a9b677: "fly5x3f",
8
+ Bqenvij: "f1l02sjl",
9
+ Bvcz5cu: "fx80qsw",
10
+ Bjw6159: "f4wz6dc",
11
+ B5pe6w7: "f17klwcu",
12
+ p4uzdd: "ffmg4tr"
13
+ }
14
+ }, {
15
+ d: [".fly5x3f{width:100%;}", ".f1l02sjl{height:100%;}", ".fx80qsw [class*=\"chartWrapper\"]{width:100%;}", ".f4wz6dc [class*=\"chartWrapper\"]{height:100%;}", ".f17klwcu svg{width:100%;}", ".ffmg4tr svg{height:100%;}"]
16
+ });
17
+ export const useResponsiveContainerStyles = props => {
18
+ const baseStyles = useStyles();
19
+ return {
20
+ root: mergeClasses(responsiveContainerClassNames.root, baseStyles.root)
21
+ };
22
+ };
23
+ //# sourceMappingURL=useResponsiveContainerStyles.styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["__styles","mergeClasses","responsiveContainerClassNames","root","useStyles","a9b677","Bqenvij","Bvcz5cu","Bjw6159","B5pe6w7","p4uzdd","d","useResponsiveContainerStyles","props","baseStyles"],"sources":["useResponsiveContainerStyles.styles.js"],"sourcesContent":["import { makeStyles, mergeClasses } from '@griffel/react';\nexport const responsiveContainerClassNames = {\n root: 'fui-charts-resp__root'\n};\nconst useStyles = makeStyles({\n root: {\n width: '100%',\n height: '100%',\n '& [class*=\"chartWrapper\"]': {\n width: '100%',\n // To prevent chart height from collapsing while resizing\n height: '100%'\n },\n '& svg': {\n // This overrides the pixel width and height of svg allowing it to resize properly within flexbox\n width: '100%',\n height: '100%'\n }\n }\n});\nexport const useResponsiveContainerStyles = (props)=>{\n const baseStyles = useStyles();\n return {\n root: mergeClasses(responsiveContainerClassNames.root, baseStyles.root)\n };\n};\n"],"mappings":"AAAA,SAAAA,QAAA,EAAqBC,YAAY,QAAQ,gBAAgB;AACzD,OAAO,MAAMC,6BAA6B,GAAG;EACzCC,IAAI,EAAE;AACV,CAAC;AACD,MAAMC,SAAS,gBAAGJ,QAAA;EAAAG,IAAA;IAAAE,MAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,MAAA;EAAA;AAAA;EAAAC,CAAA;AAAA,CAejB,CAAC;AACF,OAAO,MAAMC,4BAA4B,GAAIC,KAAK,IAAG;EACjD,MAAMC,UAAU,GAAGV,SAAS,CAAC,CAAC;EAC9B,OAAO;IACHD,IAAI,EAAEF,YAAY,CAACC,6BAA6B,CAACC,IAAI,EAAEW,UAAU,CAACX,IAAI;EAC1E,CAAC;AACL,CAAC","ignoreList":[]}
@@ -0,0 +1,119 @@
1
+ import * as React from 'react';
2
+ import { useSparklineStyles } from './useSparklineStyles.styles';
3
+ import { scaleLinear as d3ScaleLinear } from 'd3-scale';
4
+ import { area as d3Area, line as d3Line, curveLinear as d3curveLinear } from 'd3-shape';
5
+ import { max as d3Max, extent as d3Extent } from 'd3-array';
6
+ import { useFocusableGroup } from '@fluentui/react-tabster';
7
+ import { useRtl } from '../../utilities/index';
8
+ /**
9
+ * Sparkline is the context wrapper and container for all Sparkline content/controls,
10
+ * It has no direct style or slot opinions.
11
+ *
12
+ * Sparkline also provides API interfaces for callbacks that will occur on navigation events.
13
+ */ export const Sparkline = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
14
+ let margin = {
15
+ top: 2,
16
+ right: 0,
17
+ bottom: 0,
18
+ left: 0
19
+ };
20
+ let x;
21
+ let y;
22
+ let _emptyChartId = '_SparklineChart_empty';
23
+ let _isRTL = useRtl();
24
+ const [points, setPoints] = React.useState([]);
25
+ const width = 80;
26
+ const height = 20;
27
+ const valueTextWidth = 80;
28
+ const line = React.useMemo(()=>{
29
+ return d3Line().x((d)=>x(d.x)).y((d)=>y(d.y)).curve(d3curveLinear);
30
+ }, [
31
+ x,
32
+ y
33
+ ]);
34
+ const area = React.useMemo(()=>{
35
+ return d3Area().x((d)=>x(d.x)).y0(height).y1((d)=>y(d.y)).curve(d3curveLinear);
36
+ }, [
37
+ height,
38
+ x,
39
+ y
40
+ ]);
41
+ React.useEffect(()=>{
42
+ if (!_isChartEmpty()) {
43
+ // eslint-disable-next-line @typescript-eslint/no-shadow
44
+ const _points = props.data.lineChartData[0].data;
45
+ /* eslint-disable @typescript-eslint/no-explicit-any */ const [xMin, xMax] = d3Extent(_points, (d)=>d.x);
46
+ // eslint-disable-next-line react-hooks/exhaustive-deps
47
+ x = d3ScaleLinear().domain([
48
+ xMin,
49
+ xMax
50
+ ]).range([
51
+ margin.left,
52
+ width - margin.right
53
+ ]);
54
+ // eslint-disable-next-line react-hooks/exhaustive-deps
55
+ y = d3ScaleLinear()/* eslint-disable @typescript-eslint/no-explicit-any */ .domain([
56
+ 0,
57
+ d3Max(_points, (d)=>d.y)
58
+ ]).range([
59
+ height - margin.bottom,
60
+ margin.top
61
+ ]);
62
+ setPoints(_points);
63
+ }
64
+ }, []);
65
+ const { data } = props;
66
+ function _isChartEmpty() {
67
+ return !(data && data.lineChartData && data.lineChartData.length > 0 && data.lineChartData.filter((item)=>item.data.length === 0).length === 0);
68
+ }
69
+ function drawSparkline() {
70
+ if (!line || !area) {
71
+ return null;
72
+ }
73
+ return /*#__PURE__*/ React.createElement(React.Fragment, null, /*#__PURE__*/ React.createElement("path", {
74
+ className: "line",
75
+ d: line(points),
76
+ fill: 'transparent',
77
+ opacity: 1,
78
+ strokeWidth: 2,
79
+ stroke: data.lineChartData[0].color
80
+ }), /*#__PURE__*/ React.createElement("path", {
81
+ className: "area",
82
+ d: area(points),
83
+ opacity: 1,
84
+ fillOpacity: 0.2,
85
+ fill: data.lineChartData[0].color,
86
+ role: "img",
87
+ "aria-hidden": true
88
+ }));
89
+ }
90
+ const classes = useSparklineStyles(props);
91
+ const focusAttributes = useFocusableGroup();
92
+ return !_isChartEmpty() ? /*#__PURE__*/ React.createElement("div", {
93
+ className: classes.inlineBlock,
94
+ ...focusAttributes
95
+ }, width >= 50 && height >= 16 ? /*#__PURE__*/ React.createElement("svg", {
96
+ width: width,
97
+ height: height,
98
+ "aria-label": `Sparkline with label ${data.lineChartData[0].legend}`,
99
+ tabIndex: 0
100
+ }, points ? drawSparkline() : null) : /*#__PURE__*/ React.createElement(React.Fragment, null), props.showLegend && props.data.lineChartData[0].legend ? /*#__PURE__*/ React.createElement("svg", {
101
+ width: valueTextWidth,
102
+ height: height
103
+ }, /*#__PURE__*/ React.createElement("text", {
104
+ x: "0%",
105
+ textAnchor: _isRTL ? 'end' : 'start',
106
+ dx: 8,
107
+ y: "100%",
108
+ dy: -5,
109
+ className: classes.valueText
110
+ }, props.data.lineChartData[0].legend)) : /*#__PURE__*/ React.createElement(React.Fragment, null)) : /*#__PURE__*/ React.createElement("div", {
111
+ id: _emptyChartId,
112
+ role: 'alert',
113
+ style: {
114
+ opacity: '0'
115
+ },
116
+ "aria-label": 'Graph has no data to display'
117
+ });
118
+ });
119
+ Sparkline.displayName = 'Sparkline';
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["Sparkline.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useSparklineStyles } from './useSparklineStyles.styles';\nimport { scaleLinear as d3ScaleLinear } from 'd3-scale';\nimport { area as d3Area, line as d3Line, curveLinear as d3curveLinear } from 'd3-shape';\nimport { max as d3Max, extent as d3Extent } from 'd3-array';\nimport { useFocusableGroup } from '@fluentui/react-tabster';\nimport { LineChartDataPoint } from '../../types/DataPoint';\nimport { useRtl } from '../../utilities/index';\nimport { SparklineProps } from '../../index';\n\n/**\n * Sparkline is the context wrapper and container for all Sparkline content/controls,\n * It has no direct style or slot opinions.\n *\n * Sparkline also provides API interfaces for callbacks that will occur on navigation events.\n */\nexport const Sparkline: React.FunctionComponent<SparklineProps> = React.forwardRef<HTMLDivElement, SparklineProps>(\n (props, forwardedRef) => {\n let margin = {\n top: 2,\n right: 0,\n bottom: 0,\n left: 0,\n };\n let x: any;\n let y: any;\n let _emptyChartId: string = '_SparklineChart_empty';\n let _isRTL: boolean = useRtl();\n const [points, setPoints] = React.useState<LineChartDataPoint[]>([]);\n const width = 80;\n const height = 20;\n const valueTextWidth = 80;\n\n const line = React.useMemo(() => {\n return d3Line<LineChartDataPoint>()\n .x((d: LineChartDataPoint) => x(d.x))\n .y((d: LineChartDataPoint) => y(d.y))\n .curve(d3curveLinear);\n }, [x, y]);\n\n const area = React.useMemo(() => {\n return d3Area<LineChartDataPoint>()\n .x((d: LineChartDataPoint) => x(d.x))\n .y0(height)\n .y1((d: LineChartDataPoint) => y(d.y))\n .curve(d3curveLinear);\n }, [height, x, y]);\n\n React.useEffect(() => {\n if (!_isChartEmpty()) {\n // eslint-disable-next-line @typescript-eslint/no-shadow\n const _points = props.data!.lineChartData![0].data;\n\n /* eslint-disable @typescript-eslint/no-explicit-any */\n const [xMin, xMax] = d3Extent(_points, (d: any) => d.x);\n\n // eslint-disable-next-line react-hooks/exhaustive-deps\n x = d3ScaleLinear()\n .domain([xMin, xMax])\n .range([margin.left!, width - margin.right!]);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n y = d3ScaleLinear()\n /* eslint-disable @typescript-eslint/no-explicit-any */\n .domain([0, d3Max(_points, (d: any) => d.y)])\n .range([height - margin.bottom!, margin.top!]);\n\n setPoints(_points);\n }\n }, []);\n\n const { data } = props;\n function _isChartEmpty(): boolean {\n return !(\n data &&\n data.lineChartData &&\n data.lineChartData.length > 0 &&\n data.lineChartData.filter(item => item.data.length === 0).length === 0\n );\n }\n function drawSparkline() {\n if (!line || !area) {\n return null;\n }\n return (\n <>\n <path\n className=\"line\"\n d={line(points)!}\n fill={'transparent'}\n opacity={1}\n strokeWidth={2}\n stroke={data!.lineChartData![0].color!}\n />\n <path\n className=\"area\"\n d={area(points)!}\n opacity={1}\n fillOpacity={0.2}\n fill={data!.lineChartData![0].color!}\n role=\"img\"\n aria-hidden\n />\n </>\n );\n }\n\n const classes = useSparklineStyles(props);\n const focusAttributes = useFocusableGroup();\n return !_isChartEmpty() ? (\n <div className={classes.inlineBlock} {...focusAttributes}>\n {width >= 50 && height >= 16 ? (\n <svg\n width={width}\n height={height}\n aria-label={`Sparkline with label ${data!.lineChartData![0].legend!}`}\n tabIndex={0}\n >\n {points ? drawSparkline() : null}\n </svg>\n ) : (\n <></>\n )}\n {props.showLegend && props.data!.lineChartData![0].legend ? (\n <svg width={valueTextWidth} height={height}>\n <text x=\"0%\" textAnchor={_isRTL ? 'end' : 'start'} dx={8} y=\"100%\" dy={-5} className={classes.valueText}>\n {props.data!.lineChartData![0].legend!}\n </text>\n </svg>\n ) : (\n <></>\n )}\n </div>\n ) : (\n <div id={_emptyChartId} role={'alert'} style={{ opacity: '0' }} aria-label={'Graph has no data to display'} />\n );\n },\n);\nSparkline.displayName = 'Sparkline';\n"],"names":["React","useSparklineStyles","scaleLinear","d3ScaleLinear","area","d3Area","line","d3Line","curveLinear","d3curveLinear","max","d3Max","extent","d3Extent","useFocusableGroup","useRtl","Sparkline","forwardRef","props","forwardedRef","margin","top","right","bottom","left","x","y","_emptyChartId","_isRTL","points","setPoints","useState","width","height","valueTextWidth","useMemo","d","curve","y0","y1","useEffect","_isChartEmpty","_points","data","lineChartData","xMin","xMax","domain","range","length","filter","item","drawSparkline","path","className","fill","opacity","strokeWidth","stroke","color","fillOpacity","role","aria-hidden","classes","focusAttributes","div","inlineBlock","svg","aria-label","legend","tabIndex","showLegend","text","textAnchor","dx","dy","valueText","id","style","displayName"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,kBAAkB,QAAQ,8BAA8B;AACjE,SAASC,eAAeC,aAAa,QAAQ,WAAW;AACxD,SAASC,QAAQC,MAAM,EAAEC,QAAQC,MAAM,EAAEC,eAAeC,aAAa,QAAQ,WAAW;AACxF,SAASC,OAAOC,KAAK,EAAEC,UAAUC,QAAQ,QAAQ,WAAW;AAC5D,SAASC,iBAAiB,QAAQ,0BAA0B;AAE5D,SAASC,MAAM,QAAQ,wBAAwB;AAG/C;;;;;CAKC,GACD,OAAO,MAAMC,0BAAqDhB,MAAMiB,U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ACyB,MAAM,iBACvD,oBAACF;QAAInC,OAAOE;QAAgBD,QAAQA;qBAClC,oBAACuC;QAAK/C,GAAE;QAAKgD,YAAY7C,SAAS,QAAQ;QAAS8C,IAAI;QAAGhD,GAAE;QAAOiD,IAAI,CAAC;QAAGrB,WAAWS,QAAQa,SAAS;OACpG1D,MAAMyB,IAAI,CAAEC,aAAa,AAAC,CAAC,EAAE,CAACyB,MAAM,mBAIzC,2DAIJ,oBAACJ;QAAIY,IAAIlD;QAAekC,MAAM;QAASiB,OAAO;YAAEtB,SAAS;QAAI;QAAGY,cAAY;;AAEhF,GACA;AACFpD,UAAU+D,WAAW,GAAG"}
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Sparkline styles
3
+ * {@docCategory SparklineChart}
4
+ */ export { };
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["Sparkline.types.ts"],"sourcesContent":["import { ChartProps } from './index';\nimport { CartesianChartStyleProps } from '../CommonComponents/index';\n\nexport interface SparklineStyleProps extends CartesianChartStyleProps {}\n\n/**\n * Sparkline properties\n * {@docCategory SparklineChart}\n */\nexport interface SparklineProps extends React.RefAttributes<HTMLDivElement> {\n /**\n * An array of chart data points for the Sparkline chart\n */\n data?: ChartProps;\n\n /**\n * Width of chart\n * * @default 80\n */\n width?: number;\n\n /**\n * Height of chart\n * @default 20\n */\n height?: number;\n\n /**\n * Width of value text\n * * @default 80\n */\n valueTextWidth?: number;\n\n /**\n * Additional CSS class(es) to apply to the SparklineChart.\n */\n className?: string;\n\n /**\n * The prop used to define the culture to localized the numbers\n */\n culture?: string;\n\n /**\n * Prop used to determine whether to show the legend or not\n */\n showLegend?: boolean;\n\n /**\n * Call to provide customized styling that will layer on top of the variant rules.\n */\n styles?: SparklineStyles;\n}\n\n/**\n * Sparkline styles\n * {@docCategory SparklineChart}\n */\nexport interface SparklineStyles {\n inlineBlock?: string;\n valueText?: string;\n}\n"],"names":[],"rangeMappings":";;;","mappings":"AAsDA;;;CAGC,GACD,WAGC"}
@@ -0,0 +1,3 @@
1
+ export * from './Sparkline';
2
+ export * from './Sparkline.types';
3
+ export * from '../../types/index';
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["index.ts"],"sourcesContent":["export * from './Sparkline';\nexport * from './Sparkline.types';\nexport * from '../../types/index';\n"],"names":[],"rangeMappings":";;","mappings":"AAAA,cAAc,cAAc;AAC5B,cAAc,oBAAoB;AAClC,cAAc,oBAAoB"}
@@ -0,0 +1,49 @@
1
+ import { __styles, mergeClasses } from '@griffel/react';
2
+ import { tokens, typographyStyles } from '@fluentui/react-theme';
3
+ import { HighContrastSelector } from '../../utilities/index';
4
+ /**
5
+ * @internal
6
+ */
7
+ export const sparklineClassNames = {
8
+ inlineBlock: 'fui-sprk__inlineBlock',
9
+ valueText: 'fui-sprk__valueText'
10
+ };
11
+ /**
12
+ * Base Styles
13
+ */
14
+ const useStyles = /*#__PURE__*/__styles({
15
+ inlineBlock: {
16
+ mc9l5x: "f1w7gpdv"
17
+ },
18
+ valueText: {
19
+ Bahqtrf: "fk6fouc",
20
+ Be2twd7: "fy9rknc",
21
+ Bhrd7zp: "figsok6",
22
+ Bg96gwp: "fwrc4pm",
23
+ Bkfmm31: "fhuob2q",
24
+ Bcwlslt: "fase104",
25
+ Bpvj6i6: "fzgeahw",
26
+ B93v9kj: "f15mrrko"
27
+ }
28
+ }, {
29
+ d: [".f1w7gpdv{display:inline;}", ".fk6fouc{font-family:var(--fontFamilyBase);}", ".fy9rknc{font-size:var(--fontSizeBase200);}", ".figsok6{font-weight:var(--fontWeightRegular);}", ".fwrc4pm{line-height:var(--lineHeightBase200);}", ".fhuob2q{fill:var(--colorNeutralForeground1);}"],
30
+ m: [["@media screen and (-ms-high-contrast: active),screen and (forced-colors: active){.fase104{opacity:0.1;}}", {
31
+ m: "screen and (-ms-high-contrast: active), screen and (forced-colors: active)"
32
+ }], ["@media screen and (-ms-high-contrast: active),screen and (forced-colors: active){.fzgeahw{stroke:rgb(179, 179, 179);}}", {
33
+ m: "screen and (-ms-high-contrast: active), screen and (forced-colors: active)"
34
+ }], ["@media screen and (-ms-high-contrast: active),screen and (forced-colors: active){.f15mrrko{forced-color-adjust:none;}}", {
35
+ m: "screen and (-ms-high-contrast: active), screen and (forced-colors: active)"
36
+ }]]
37
+ });
38
+ /**
39
+ * Apply styling to the Carousel slots based on the state
40
+ */
41
+ export const useSparklineStyles = props => {
42
+ var _props_styles, _props_styles1;
43
+ const baseStyles = useStyles();
44
+ return {
45
+ inlineBlock: mergeClasses(sparklineClassNames.inlineBlock, baseStyles.inlineBlock, (_props_styles = props.styles) === null || _props_styles === void 0 ? void 0 : _props_styles.inlineBlock),
46
+ valueText: mergeClasses(sparklineClassNames.valueText, baseStyles.valueText, (_props_styles1 = props.styles) === null || _props_styles1 === void 0 ? void 0 : _props_styles1.valueText)
47
+ };
48
+ };
49
+ //# sourceMappingURL=useSparklineStyles.styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["__styles","mergeClasses","tokens","typographyStyles","HighContrastSelector","sparklineClassNames","inlineBlock","valueText","useStyles","mc9l5x","Bahqtrf","Be2twd7","Bhrd7zp","Bg96gwp","Bkfmm31","Bcwlslt","Bpvj6i6","B93v9kj","d","m","useSparklineStyles","props","_props_styles","_props_styles1","baseStyles","styles"],"sources":["useSparklineStyles.styles.js"],"sourcesContent":["import { makeStyles, mergeClasses } from '@griffel/react';\nimport { tokens, typographyStyles } from '@fluentui/react-theme';\nimport { HighContrastSelector } from '../../utilities/index';\n/**\n * @internal\n */ export const sparklineClassNames = {\n inlineBlock: 'fui-sprk__inlineBlock',\n valueText: 'fui-sprk__valueText'\n};\n/**\n * Base Styles\n */ const useStyles = makeStyles({\n inlineBlock: {\n display: 'inline'\n },\n valueText: {\n ...typographyStyles.caption1,\n fill: tokens.colorNeutralForeground1,\n [HighContrastSelector]: {\n opacity: 0.1,\n stroke: 'rgb(179, 179, 179)',\n forcedColorAdjust: 'none'\n }\n }\n});\n/**\n * Apply styling to the Carousel slots based on the state\n */ export const useSparklineStyles = (props)=>{\n var _props_styles, _props_styles1;\n const baseStyles = useStyles();\n return {\n inlineBlock: mergeClasses(sparklineClassNames.inlineBlock, baseStyles.inlineBlock, (_props_styles = props.styles) === null || _props_styles === void 0 ? void 0 : _props_styles.inlineBlock),\n valueText: mergeClasses(sparklineClassNames.valueText, baseStyles.valueText, (_props_styles1 = props.styles) === null || _props_styles1 === void 0 ? void 0 : _props_styles1.valueText)\n };\n};\n"],"mappings":"AAAA,SAAAA,QAAA,EAAqBC,YAAY,QAAQ,gBAAgB;AACzD,SAASC,MAAM,EAAEC,gBAAgB,QAAQ,uBAAuB;AAChE,SAASC,oBAAoB,QAAQ,uBAAuB;AAC5D;AACA;AACA;AAAI,OAAO,MAAMC,mBAAmB,GAAG;EACnCC,WAAW,EAAE,uBAAuB;EACpCC,SAAS,EAAE;AACf,CAAC;AACD;AACA;AACA;AAAI,MAAMC,SAAS,gBAAGR,QAAA;EAAAM,WAAA;IAAAG,MAAA;EAAA;EAAAF,SAAA;IAAAG,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;EAAA;AAAA;EAAAC,CAAA;EAAAC,CAAA;IAAAA,CAAA;EAAA;IAAAA,CAAA;EAAA;IAAAA,CAAA;EAAA;AAAA,CAarB,CAAC;AACF;AACA;AACA;AAAI,OAAO,MAAMC,kBAAkB,GAAIC,KAAK,IAAG;EAC3C,IAAIC,aAAa,EAAEC,cAAc;EACjC,MAAMC,UAAU,GAAGhB,SAAS,CAAC,CAAC;EAC9B,OAAO;IACHF,WAAW,EAAEL,YAAY,CAACI,mBAAmB,CAACC,WAAW,EAAEkB,UAAU,CAAClB,WAAW,EAAE,CAACgB,aAAa,GAAGD,KAAK,CAACI,MAAM,MAAM,IAAI,IAAIH,aAAa,KAAK,KAAK,CAAC,GAAG,KAAK,CAAC,GAAGA,aAAa,CAAChB,WAAW,CAAC;IAC5LC,SAAS,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