@fluentui/react-charting 5.16.24 → 5.16.25

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 (794) hide show
  1. package/CHANGELOG.json +42 -1
  2. package/CHANGELOG.md +14 -2
  3. package/config/setup-env.js +1 -0
  4. package/docs/TestPlans/BasicDonutChart.png +0 -0
  5. package/docs/TestPlans/DonutChart/ComponentTests.md +35 -0
  6. package/lib/AreaChart.d.ts +1 -0
  7. package/lib/AreaChart.js +2 -0
  8. package/lib/AreaChart.js.map +1 -0
  9. package/lib/CartesianChart.d.ts +1 -0
  10. package/lib/CartesianChart.js +2 -0
  11. package/lib/CartesianChart.js.map +1 -0
  12. package/lib/DonutChart.d.ts +1 -0
  13. package/lib/DonutChart.js +2 -0
  14. package/lib/DonutChart.js.map +1 -0
  15. package/lib/GroupedVerticalBarChart.d.ts +1 -0
  16. package/lib/GroupedVerticalBarChart.js +2 -0
  17. package/lib/GroupedVerticalBarChart.js.map +1 -0
  18. package/lib/HeatMapChart.d.ts +1 -0
  19. package/lib/HeatMapChart.js +2 -0
  20. package/lib/HeatMapChart.js.map +1 -0
  21. package/lib/HorizontalBarChart.d.ts +1 -0
  22. package/lib/HorizontalBarChart.js +2 -0
  23. package/lib/HorizontalBarChart.js.map +1 -0
  24. package/lib/Legends.d.ts +1 -0
  25. package/lib/Legends.js +2 -0
  26. package/lib/Legends.js.map +1 -0
  27. package/lib/LineChart.d.ts +1 -0
  28. package/lib/LineChart.js +2 -0
  29. package/lib/LineChart.js.map +1 -0
  30. package/lib/PieChart.d.ts +1 -0
  31. package/lib/PieChart.js +2 -0
  32. package/lib/PieChart.js.map +1 -0
  33. package/lib/SankeyChart.d.ts +1 -0
  34. package/lib/SankeyChart.js +2 -0
  35. package/lib/SankeyChart.js.map +1 -0
  36. package/lib/Sparkline.d.ts +1 -0
  37. package/lib/Sparkline.js +2 -0
  38. package/lib/Sparkline.js.map +1 -0
  39. package/lib/StackedBarChart.d.ts +1 -0
  40. package/lib/StackedBarChart.js +2 -0
  41. package/lib/StackedBarChart.js.map +1 -0
  42. package/lib/Styling.d.ts +2 -0
  43. package/lib/Styling.js +8 -0
  44. package/lib/Styling.js.map +1 -0
  45. package/lib/TreeChart.d.ts +1 -0
  46. package/lib/TreeChart.js +2 -0
  47. package/lib/TreeChart.js.map +1 -0
  48. package/lib/Utilities.d.ts +2 -0
  49. package/lib/Utilities.js +20 -0
  50. package/lib/Utilities.js.map +1 -0
  51. package/lib/VerticalBarChart.d.ts +1 -0
  52. package/lib/VerticalBarChart.js +2 -0
  53. package/lib/VerticalBarChart.js.map +1 -0
  54. package/lib/VerticalStackedBarChart.d.ts +1 -0
  55. package/lib/VerticalStackedBarChart.js +2 -0
  56. package/lib/VerticalStackedBarChart.js.map +1 -0
  57. package/lib/components/AreaChart/AreaChart.base.d.ts +92 -0
  58. package/lib/components/AreaChart/AreaChart.base.js +562 -0
  59. package/lib/components/AreaChart/AreaChart.base.js.map +1 -0
  60. package/lib/components/AreaChart/AreaChart.d.ts +3 -0
  61. package/lib/components/AreaChart/AreaChart.js +6 -0
  62. package/lib/components/AreaChart/AreaChart.js.map +1 -0
  63. package/lib/components/AreaChart/AreaChart.styles.d.ts +2 -0
  64. package/lib/components/AreaChart/AreaChart.styles.js +7 -0
  65. package/lib/components/AreaChart/AreaChart.styles.js.map +1 -0
  66. package/lib/components/AreaChart/AreaChart.types.d.ts +37 -0
  67. package/lib/components/AreaChart/AreaChart.types.js +2 -0
  68. package/lib/components/AreaChart/AreaChart.types.js.map +1 -0
  69. package/lib/components/AreaChart/index.d.ts +2 -0
  70. package/lib/components/AreaChart/index.js +3 -0
  71. package/lib/components/AreaChart/index.js.map +1 -0
  72. package/lib/components/CommonComponents/CartesianChart.base.d.ts +43 -0
  73. package/lib/components/CommonComponents/CartesianChart.base.js +331 -0
  74. package/lib/components/CommonComponents/CartesianChart.base.js.map +1 -0
  75. package/lib/components/CommonComponents/CartesianChart.d.ts +3 -0
  76. package/lib/components/CommonComponents/CartesianChart.js +5 -0
  77. package/lib/components/CommonComponents/CartesianChart.js.map +1 -0
  78. package/lib/components/CommonComponents/CartesianChart.styles.d.ts +2 -0
  79. package/lib/components/CommonComponents/CartesianChart.styles.js +163 -0
  80. package/lib/components/CommonComponents/CartesianChart.styles.js.map +1 -0
  81. package/lib/components/CommonComponents/CartesianChart.types.d.ts +428 -0
  82. package/lib/components/CommonComponents/CartesianChart.types.js +2 -0
  83. package/lib/components/CommonComponents/CartesianChart.types.js.map +1 -0
  84. package/lib/components/CommonComponents/index.d.ts +2 -0
  85. package/lib/components/CommonComponents/index.js +3 -0
  86. package/lib/components/CommonComponents/index.js.map +1 -0
  87. package/lib/components/DonutChart/Arc/Arc.d.ts +21 -0
  88. package/lib/components/DonutChart/Arc/Arc.js +86 -0
  89. package/lib/components/DonutChart/Arc/Arc.js.map +1 -0
  90. package/lib/components/DonutChart/Arc/Arc.styles.d.ts +2 -0
  91. package/lib/components/DonutChart/Arc/Arc.styles.js +28 -0
  92. package/lib/components/DonutChart/Arc/Arc.styles.js.map +1 -0
  93. package/lib/components/DonutChart/Arc/Arc.types.d.ts +124 -0
  94. package/lib/components/DonutChart/Arc/Arc.types.js +2 -0
  95. package/lib/components/DonutChart/Arc/Arc.types.js.map +1 -0
  96. package/lib/components/DonutChart/Arc/index.d.ts +2 -0
  97. package/lib/components/DonutChart/Arc/index.js +3 -0
  98. package/lib/components/DonutChart/Arc/index.js.map +1 -0
  99. package/lib/components/DonutChart/DonutChart.base.d.ts +50 -0
  100. package/lib/components/DonutChart/DonutChart.base.js +211 -0
  101. package/lib/components/DonutChart/DonutChart.base.js.map +1 -0
  102. package/lib/components/DonutChart/DonutChart.d.ts +3 -0
  103. package/lib/components/DonutChart/DonutChart.js +6 -0
  104. package/lib/components/DonutChart/DonutChart.js.map +1 -0
  105. package/lib/components/DonutChart/DonutChart.styles.d.ts +2 -0
  106. package/lib/components/DonutChart/DonutChart.styles.js +30 -0
  107. package/lib/components/DonutChart/DonutChart.styles.js.map +1 -0
  108. package/lib/components/DonutChart/DonutChart.types.d.ts +63 -0
  109. package/lib/components/DonutChart/DonutChart.types.js +2 -0
  110. package/lib/components/DonutChart/DonutChart.types.js.map +1 -0
  111. package/lib/components/DonutChart/Pie/Pie.d.ts +15 -0
  112. package/lib/components/DonutChart/Pie/Pie.js +71 -0
  113. package/lib/components/DonutChart/Pie/Pie.js.map +1 -0
  114. package/lib/components/DonutChart/Pie/Pie.styles.d.ts +2 -0
  115. package/lib/components/DonutChart/Pie/Pie.styles.js +19 -0
  116. package/lib/components/DonutChart/Pie/Pie.styles.js.map +1 -0
  117. package/lib/components/DonutChart/Pie/Pie.types.d.ts +96 -0
  118. package/lib/components/DonutChart/Pie/Pie.types.js +2 -0
  119. package/lib/components/DonutChart/Pie/Pie.types.js.map +1 -0
  120. package/lib/components/DonutChart/Pie/index.d.ts +2 -0
  121. package/lib/components/DonutChart/Pie/index.js +3 -0
  122. package/lib/components/DonutChart/Pie/index.js.map +1 -0
  123. package/lib/components/DonutChart/index.d.ts +3 -0
  124. package/lib/components/DonutChart/index.js +4 -0
  125. package/lib/components/DonutChart/index.js.map +1 -0
  126. package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.d.ts +62 -0
  127. package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js +381 -0
  128. package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js.map +1 -0
  129. package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.d.ts +3 -0
  130. package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js +6 -0
  131. package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js.map +1 -0
  132. package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.styles.d.ts +2 -0
  133. package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.styles.js +17 -0
  134. package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.styles.js.map +1 -0
  135. package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.types.d.ts +83 -0
  136. package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.types.js +2 -0
  137. package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.types.js.map +1 -0
  138. package/lib/components/GroupedVerticalBarChart/index.d.ts +2 -0
  139. package/lib/components/GroupedVerticalBarChart/index.js +3 -0
  140. package/lib/components/GroupedVerticalBarChart/index.js.map +1 -0
  141. package/lib/components/HeatMapChart/HeatMapChart.base.d.ts +147 -0
  142. package/lib/components/HeatMapChart/HeatMapChart.base.js +498 -0
  143. package/lib/components/HeatMapChart/HeatMapChart.base.js.map +1 -0
  144. package/lib/components/HeatMapChart/HeatMapChart.d.ts +3 -0
  145. package/lib/components/HeatMapChart/HeatMapChart.js +5 -0
  146. package/lib/components/HeatMapChart/HeatMapChart.js.map +1 -0
  147. package/lib/components/HeatMapChart/HeatMapChart.styles.d.ts +2 -0
  148. package/lib/components/HeatMapChart/HeatMapChart.styles.js +24 -0
  149. package/lib/components/HeatMapChart/HeatMapChart.styles.js.map +1 -0
  150. package/lib/components/HeatMapChart/HeatMapChart.types.d.ts +110 -0
  151. package/lib/components/HeatMapChart/HeatMapChart.types.js +2 -0
  152. package/lib/components/HeatMapChart/HeatMapChart.types.js.map +1 -0
  153. package/lib/components/HeatMapChart/index.d.ts +2 -0
  154. package/lib/components/HeatMapChart/index.js +3 -0
  155. package/lib/components/HeatMapChart/index.js.map +1 -0
  156. package/lib/components/HorizontalBarChart/HorizontalBarChart.base.d.ts +36 -0
  157. package/lib/components/HorizontalBarChart/HorizontalBarChart.base.js +237 -0
  158. package/lib/components/HorizontalBarChart/HorizontalBarChart.base.js.map +1 -0
  159. package/lib/components/HorizontalBarChart/HorizontalBarChart.d.ts +3 -0
  160. package/lib/components/HorizontalBarChart/HorizontalBarChart.js +6 -0
  161. package/lib/components/HorizontalBarChart/HorizontalBarChart.js.map +1 -0
  162. package/lib/components/HorizontalBarChart/HorizontalBarChart.styles.d.ts +2 -0
  163. package/lib/components/HorizontalBarChart/HorizontalBarChart.styles.js +69 -0
  164. package/lib/components/HorizontalBarChart/HorizontalBarChart.styles.js.map +1 -0
  165. package/lib/components/HorizontalBarChart/HorizontalBarChart.types.d.ts +172 -0
  166. package/lib/components/HorizontalBarChart/HorizontalBarChart.types.js +6 -0
  167. package/lib/components/HorizontalBarChart/HorizontalBarChart.types.js.map +1 -0
  168. package/lib/components/HorizontalBarChart/index.d.ts +3 -0
  169. package/lib/components/HorizontalBarChart/index.js +4 -0
  170. package/lib/components/HorizontalBarChart/index.js.map +1 -0
  171. package/lib/components/Legends/Legends.base.d.ts +44 -0
  172. package/lib/components/Legends/Legends.base.js +293 -0
  173. package/lib/components/Legends/Legends.base.js.map +1 -0
  174. package/lib/components/Legends/Legends.d.ts +3 -0
  175. package/lib/components/Legends/Legends.js +5 -0
  176. package/lib/components/Legends/Legends.js.map +1 -0
  177. package/lib/components/Legends/Legends.styles.d.ts +2 -0
  178. package/lib/components/Legends/Legends.styles.js +103 -0
  179. package/lib/components/Legends/Legends.styles.js.map +1 -0
  180. package/lib/components/Legends/Legends.types.d.ts +169 -0
  181. package/lib/components/Legends/Legends.types.js +2 -0
  182. package/lib/components/Legends/Legends.types.js.map +1 -0
  183. package/lib/components/Legends/index.d.ts +3 -0
  184. package/lib/components/Legends/index.js +4 -0
  185. package/lib/components/Legends/index.js.map +1 -0
  186. package/lib/components/Legends/shape.d.ts +9 -0
  187. package/lib/components/Legends/shape.js +24 -0
  188. package/lib/components/Legends/shape.js.map +1 -0
  189. package/lib/components/LineChart/LineChart.base.d.ts +84 -0
  190. package/lib/components/LineChart/LineChart.base.js +815 -0
  191. package/lib/components/LineChart/LineChart.base.js.map +1 -0
  192. package/lib/components/LineChart/LineChart.d.ts +3 -0
  193. package/lib/components/LineChart/LineChart.js +6 -0
  194. package/lib/components/LineChart/LineChart.js.map +1 -0
  195. package/lib/components/LineChart/LineChart.styles.d.ts +2 -0
  196. package/lib/components/LineChart/LineChart.styles.js +7 -0
  197. package/lib/components/LineChart/LineChart.styles.js.map +1 -0
  198. package/lib/components/LineChart/LineChart.types.d.ts +72 -0
  199. package/lib/components/LineChart/LineChart.types.js +2 -0
  200. package/lib/components/LineChart/LineChart.types.js.map +1 -0
  201. package/lib/components/LineChart/eventAnnotation/EventAnnotation.d.ts +10 -0
  202. package/lib/components/LineChart/eventAnnotation/EventAnnotation.js +93 -0
  203. package/lib/components/LineChart/eventAnnotation/EventAnnotation.js.map +1 -0
  204. package/lib/components/LineChart/eventAnnotation/LabelLink.d.ts +22 -0
  205. package/lib/components/LineChart/eventAnnotation/LabelLink.js +37 -0
  206. package/lib/components/LineChart/eventAnnotation/LabelLink.js.map +1 -0
  207. package/lib/components/LineChart/eventAnnotation/Textbox.d.ts +13 -0
  208. package/lib/components/LineChart/eventAnnotation/Textbox.js +37 -0
  209. package/lib/components/LineChart/eventAnnotation/Textbox.js.map +1 -0
  210. package/lib/components/LineChart/index.d.ts +3 -0
  211. package/lib/components/LineChart/index.js +4 -0
  212. package/lib/components/LineChart/index.js.map +1 -0
  213. package/lib/components/PieChart/Arc/Arc.d.ts +12 -0
  214. package/lib/components/PieChart/Arc/Arc.js +57 -0
  215. package/lib/components/PieChart/Arc/Arc.js.map +1 -0
  216. package/lib/components/PieChart/Arc/Arc.styles.d.ts +2 -0
  217. package/lib/components/PieChart/Arc/Arc.styles.js +8 -0
  218. package/lib/components/PieChart/Arc/Arc.styles.js.map +1 -0
  219. package/lib/components/PieChart/Arc/Arc.types.d.ts +60 -0
  220. package/lib/components/PieChart/Arc/Arc.types.js +2 -0
  221. package/lib/components/PieChart/Arc/Arc.types.js.map +1 -0
  222. package/lib/components/PieChart/Arc/index.d.ts +2 -0
  223. package/lib/components/PieChart/Arc/index.js +3 -0
  224. package/lib/components/PieChart/Arc/index.js.map +1 -0
  225. package/lib/components/PieChart/Pie/Pie.d.ts +10 -0
  226. package/lib/components/PieChart/Pie/Pie.js +35 -0
  227. package/lib/components/PieChart/Pie/Pie.js.map +1 -0
  228. package/lib/components/PieChart/Pie/Pie.styles.d.ts +2 -0
  229. package/lib/components/PieChart/Pie/Pie.styles.js +6 -0
  230. package/lib/components/PieChart/Pie/Pie.styles.js.map +1 -0
  231. package/lib/components/PieChart/Pie/Pie.types.d.ts +46 -0
  232. package/lib/components/PieChart/Pie/Pie.types.js +2 -0
  233. package/lib/components/PieChart/Pie/Pie.types.js.map +1 -0
  234. package/lib/components/PieChart/Pie/index.d.ts +2 -0
  235. package/lib/components/PieChart/Pie/index.js +3 -0
  236. package/lib/components/PieChart/Pie/index.js.map +1 -0
  237. package/lib/components/PieChart/PieChart.base.d.ts +7 -0
  238. package/lib/components/PieChart/PieChart.base.js +34 -0
  239. package/lib/components/PieChart/PieChart.base.js.map +1 -0
  240. package/lib/components/PieChart/PieChart.d.ts +3 -0
  241. package/lib/components/PieChart/PieChart.js +6 -0
  242. package/lib/components/PieChart/PieChart.js.map +1 -0
  243. package/lib/components/PieChart/PieChart.styles.d.ts +2 -0
  244. package/lib/components/PieChart/PieChart.styles.js +29 -0
  245. package/lib/components/PieChart/PieChart.styles.js.map +1 -0
  246. package/lib/components/PieChart/PieChart.types.d.ts +63 -0
  247. package/lib/components/PieChart/PieChart.types.js +2 -0
  248. package/lib/components/PieChart/PieChart.types.js.map +1 -0
  249. package/lib/components/PieChart/index.d.ts +2 -0
  250. package/lib/components/PieChart/index.js +3 -0
  251. package/lib/components/PieChart/index.js.map +1 -0
  252. package/lib/components/SankeyChart/SankeyChart.base.d.ts +95 -0
  253. package/lib/components/SankeyChart/SankeyChart.base.js +674 -0
  254. package/lib/components/SankeyChart/SankeyChart.base.js.map +1 -0
  255. package/lib/components/SankeyChart/SankeyChart.d.ts +3 -0
  256. package/lib/components/SankeyChart/SankeyChart.js +6 -0
  257. package/lib/components/SankeyChart/SankeyChart.js.map +1 -0
  258. package/lib/components/SankeyChart/SankeyChart.styles.d.ts +2 -0
  259. package/lib/components/SankeyChart/SankeyChart.styles.js +58 -0
  260. package/lib/components/SankeyChart/SankeyChart.styles.js.map +1 -0
  261. package/lib/components/SankeyChart/SankeyChart.types.d.ts +83 -0
  262. package/lib/components/SankeyChart/SankeyChart.types.js +2 -0
  263. package/lib/components/SankeyChart/SankeyChart.types.js.map +1 -0
  264. package/lib/components/SankeyChart/index.d.ts +2 -0
  265. package/lib/components/SankeyChart/index.js +3 -0
  266. package/lib/components/SankeyChart/index.js.map +1 -0
  267. package/lib/components/Sparkline/Sparkline.base.d.ts +20 -0
  268. package/lib/components/Sparkline/Sparkline.base.js +76 -0
  269. package/lib/components/Sparkline/Sparkline.base.js.map +1 -0
  270. package/lib/components/Sparkline/Sparkline.d.ts +3 -0
  271. package/lib/components/Sparkline/Sparkline.js +6 -0
  272. package/lib/components/Sparkline/Sparkline.js.map +1 -0
  273. package/lib/components/Sparkline/Sparkline.styles.d.ts +2 -0
  274. package/lib/components/Sparkline/Sparkline.styles.js +10 -0
  275. package/lib/components/Sparkline/Sparkline.styles.js.map +1 -0
  276. package/lib/components/Sparkline/Sparkline.types.d.ts +51 -0
  277. package/lib/components/Sparkline/Sparkline.types.js +2 -0
  278. package/lib/components/Sparkline/Sparkline.types.js.map +1 -0
  279. package/lib/components/Sparkline/index.d.ts +2 -0
  280. package/lib/components/Sparkline/index.js +3 -0
  281. package/lib/components/Sparkline/index.js.map +1 -0
  282. package/lib/components/StackedBarChart/MultiStackedBarChart.base.d.ts +56 -0
  283. package/lib/components/StackedBarChart/MultiStackedBarChart.base.js +356 -0
  284. package/lib/components/StackedBarChart/MultiStackedBarChart.base.js.map +1 -0
  285. package/lib/components/StackedBarChart/MultiStackedBarChart.d.ts +3 -0
  286. package/lib/components/StackedBarChart/MultiStackedBarChart.js +6 -0
  287. package/lib/components/StackedBarChart/MultiStackedBarChart.js.map +1 -0
  288. package/lib/components/StackedBarChart/MultiStackedBarChart.styles.d.ts +2 -0
  289. package/lib/components/StackedBarChart/MultiStackedBarChart.styles.js +90 -0
  290. package/lib/components/StackedBarChart/MultiStackedBarChart.styles.js.map +1 -0
  291. package/lib/components/StackedBarChart/MultiStackedBarChart.types.d.ts +198 -0
  292. package/lib/components/StackedBarChart/MultiStackedBarChart.types.js +6 -0
  293. package/lib/components/StackedBarChart/MultiStackedBarChart.types.js.map +1 -0
  294. package/lib/components/StackedBarChart/StackedBarChart.base.d.ts +51 -0
  295. package/lib/components/StackedBarChart/StackedBarChart.base.js +311 -0
  296. package/lib/components/StackedBarChart/StackedBarChart.base.js.map +1 -0
  297. package/lib/components/StackedBarChart/StackedBarChart.d.ts +3 -0
  298. package/lib/components/StackedBarChart/StackedBarChart.js +6 -0
  299. package/lib/components/StackedBarChart/StackedBarChart.js.map +1 -0
  300. package/lib/components/StackedBarChart/StackedBarChart.styles.d.ts +2 -0
  301. package/lib/components/StackedBarChart/StackedBarChart.styles.js +104 -0
  302. package/lib/components/StackedBarChart/StackedBarChart.styles.js.map +1 -0
  303. package/lib/components/StackedBarChart/StackedBarChart.types.d.ts +210 -0
  304. package/lib/components/StackedBarChart/StackedBarChart.types.js +2 -0
  305. package/lib/components/StackedBarChart/StackedBarChart.types.js.map +1 -0
  306. package/lib/components/StackedBarChart/index.d.ts +5 -0
  307. package/lib/components/StackedBarChart/index.js +6 -0
  308. package/lib/components/StackedBarChart/index.js.map +1 -0
  309. package/lib/components/TreeChart/TreeChart.base.d.ts +18 -0
  310. package/lib/components/TreeChart/TreeChart.base.js +316 -0
  311. package/lib/components/TreeChart/TreeChart.base.js.map +1 -0
  312. package/lib/components/TreeChart/TreeChart.d.ts +3 -0
  313. package/lib/components/TreeChart/TreeChart.js +5 -0
  314. package/lib/components/TreeChart/TreeChart.js.map +1 -0
  315. package/lib/components/TreeChart/TreeChart.styles.d.ts +2 -0
  316. package/lib/components/TreeChart/TreeChart.styles.js +29 -0
  317. package/lib/components/TreeChart/TreeChart.styles.js.map +1 -0
  318. package/lib/components/TreeChart/TreeChart.types.d.ts +197 -0
  319. package/lib/components/TreeChart/TreeChart.types.js +23 -0
  320. package/lib/components/TreeChart/TreeChart.types.js.map +1 -0
  321. package/lib/components/TreeChart/index.d.ts +2 -0
  322. package/lib/components/TreeChart/index.js +3 -0
  323. package/lib/components/TreeChart/index.js.map +1 -0
  324. package/lib/components/VerticalBarChart/VerticalBarChart.base.d.ts +74 -0
  325. package/lib/components/VerticalBarChart/VerticalBarChart.base.js +536 -0
  326. package/lib/components/VerticalBarChart/VerticalBarChart.base.js.map +1 -0
  327. package/lib/components/VerticalBarChart/VerticalBarChart.d.ts +3 -0
  328. package/lib/components/VerticalBarChart/VerticalBarChart.js +6 -0
  329. package/lib/components/VerticalBarChart/VerticalBarChart.js.map +1 -0
  330. package/lib/components/VerticalBarChart/VerticalBarChart.styles.d.ts +2 -0
  331. package/lib/components/VerticalBarChart/VerticalBarChart.styles.js +28 -0
  332. package/lib/components/VerticalBarChart/VerticalBarChart.styles.js.map +1 -0
  333. package/lib/components/VerticalBarChart/VerticalBarChart.types.d.ts +114 -0
  334. package/lib/components/VerticalBarChart/VerticalBarChart.types.js +2 -0
  335. package/lib/components/VerticalBarChart/VerticalBarChart.types.js.map +1 -0
  336. package/lib/components/VerticalBarChart/index.d.ts +2 -0
  337. package/lib/components/VerticalBarChart/index.js +3 -0
  338. package/lib/components/VerticalBarChart/index.js.map +1 -0
  339. package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.base.d.ts +85 -0
  340. package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js +666 -0
  341. package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js.map +1 -0
  342. package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.d.ts +3 -0
  343. package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.js +6 -0
  344. package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.js.map +1 -0
  345. package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.styles.d.ts +2 -0
  346. package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.styles.js +18 -0
  347. package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.styles.js.map +1 -0
  348. package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.types.d.ts +142 -0
  349. package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.types.js +2 -0
  350. package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.types.js.map +1 -0
  351. package/lib/components/VerticalStackedBarChart/index.d.ts +2 -0
  352. package/lib/components/VerticalStackedBarChart/index.js +3 -0
  353. package/lib/components/VerticalStackedBarChart/index.js.map +1 -0
  354. package/lib/index.d.ts +19 -0
  355. package/lib/index.js +20 -0
  356. package/lib/index.js.map +1 -0
  357. package/lib/types/IDataPoint.d.ts +545 -0
  358. package/lib/types/IDataPoint.js +2 -0
  359. package/lib/types/IDataPoint.js.map +1 -0
  360. package/lib/types/IEventAnnotation.d.ts +6 -0
  361. package/lib/types/IEventAnnotation.js +2 -0
  362. package/lib/types/IEventAnnotation.js.map +1 -0
  363. package/lib/types/ILegendDataItem.d.ts +10 -0
  364. package/lib/types/ILegendDataItem.js +2 -0
  365. package/lib/types/ILegendDataItem.js.map +1 -0
  366. package/lib/types/index.d.ts +2 -0
  367. package/lib/types/index.js +3 -0
  368. package/lib/types/index.js.map +1 -0
  369. package/lib/utilities/ChartHoverCard/ChartHoverCard.base.d.ts +6 -0
  370. package/lib/utilities/ChartHoverCard/ChartHoverCard.base.js +38 -0
  371. package/lib/utilities/ChartHoverCard/ChartHoverCard.base.js.map +1 -0
  372. package/lib/utilities/ChartHoverCard/ChartHoverCard.d.ts +3 -0
  373. package/lib/utilities/ChartHoverCard/ChartHoverCard.js +6 -0
  374. package/lib/utilities/ChartHoverCard/ChartHoverCard.js.map +1 -0
  375. package/lib/utilities/ChartHoverCard/ChartHoverCard.styles.d.ts +2 -0
  376. package/lib/utilities/ChartHoverCard/ChartHoverCard.styles.js +82 -0
  377. package/lib/utilities/ChartHoverCard/ChartHoverCard.styles.js.map +1 -0
  378. package/lib/utilities/ChartHoverCard/ChartHoverCard.types.d.ts +105 -0
  379. package/lib/utilities/ChartHoverCard/ChartHoverCard.types.js +2 -0
  380. package/lib/utilities/ChartHoverCard/ChartHoverCard.types.js.map +1 -0
  381. package/lib/utilities/ChartHoverCard/index.d.ts +3 -0
  382. package/lib/utilities/ChartHoverCard/index.js +4 -0
  383. package/lib/utilities/ChartHoverCard/index.js.map +1 -0
  384. package/lib/utilities/FocusableTooltipText.d.ts +27 -0
  385. package/lib/utilities/FocusableTooltipText.js +54 -0
  386. package/lib/utilities/FocusableTooltipText.js.map +1 -0
  387. package/lib/utilities/colors.d.ts +51 -0
  388. package/lib/utilities/colors.js +132 -0
  389. package/lib/utilities/colors.js.map +1 -0
  390. package/lib/utilities/index.d.ts +3 -0
  391. package/lib/utilities/index.js +4 -0
  392. package/lib/utilities/index.js.map +1 -0
  393. package/lib/utilities/utilities.d.ts +377 -0
  394. package/lib/utilities/utilities.js +864 -0
  395. package/lib/utilities/utilities.js.map +1 -0
  396. package/lib/version.d.ts +1 -0
  397. package/lib/version.js +5 -0
  398. package/lib/version.js.map +1 -0
  399. package/lib-amd/AreaChart.d.ts +1 -0
  400. package/lib-amd/AreaChart.js +6 -0
  401. package/lib-amd/AreaChart.js.map +1 -0
  402. package/lib-amd/CartesianChart.d.ts +1 -0
  403. package/lib-amd/CartesianChart.js +6 -0
  404. package/lib-amd/CartesianChart.js.map +1 -0
  405. package/lib-amd/DonutChart.d.ts +1 -0
  406. package/lib-amd/DonutChart.js +6 -0
  407. package/lib-amd/DonutChart.js.map +1 -0
  408. package/lib-amd/GroupedVerticalBarChart.d.ts +1 -0
  409. package/lib-amd/GroupedVerticalBarChart.js +6 -0
  410. package/lib-amd/GroupedVerticalBarChart.js.map +1 -0
  411. package/lib-amd/HeatMapChart.d.ts +1 -0
  412. package/lib-amd/HeatMapChart.js +6 -0
  413. package/lib-amd/HeatMapChart.js.map +1 -0
  414. package/lib-amd/HorizontalBarChart.d.ts +1 -0
  415. package/lib-amd/HorizontalBarChart.js +6 -0
  416. package/lib-amd/HorizontalBarChart.js.map +1 -0
  417. package/lib-amd/Legends.d.ts +1 -0
  418. package/lib-amd/Legends.js +6 -0
  419. package/lib-amd/Legends.js.map +1 -0
  420. package/lib-amd/LineChart.d.ts +1 -0
  421. package/lib-amd/LineChart.js +6 -0
  422. package/lib-amd/LineChart.js.map +1 -0
  423. package/lib-amd/PieChart.d.ts +1 -0
  424. package/lib-amd/PieChart.js +6 -0
  425. package/lib-amd/PieChart.js.map +1 -0
  426. package/lib-amd/SankeyChart.d.ts +1 -0
  427. package/lib-amd/SankeyChart.js +6 -0
  428. package/lib-amd/SankeyChart.js.map +1 -0
  429. package/lib-amd/Sparkline.d.ts +1 -0
  430. package/lib-amd/Sparkline.js +6 -0
  431. package/lib-amd/Sparkline.js.map +1 -0
  432. package/lib-amd/StackedBarChart.d.ts +1 -0
  433. package/lib-amd/StackedBarChart.js +6 -0
  434. package/lib-amd/StackedBarChart.js.map +1 -0
  435. package/lib-amd/Styling.d.ts +2 -0
  436. package/lib-amd/Styling.js +75 -0
  437. package/lib-amd/Styling.js.map +1 -0
  438. package/lib-amd/TreeChart.d.ts +1 -0
  439. package/lib-amd/TreeChart.js +6 -0
  440. package/lib-amd/TreeChart.js.map +1 -0
  441. package/lib-amd/Utilities.d.ts +2 -0
  442. package/lib-amd/Utilities.js +183 -0
  443. package/lib-amd/Utilities.js.map +1 -0
  444. package/lib-amd/VerticalBarChart.d.ts +1 -0
  445. package/lib-amd/VerticalBarChart.js +6 -0
  446. package/lib-amd/VerticalBarChart.js.map +1 -0
  447. package/lib-amd/VerticalStackedBarChart.d.ts +1 -0
  448. package/lib-amd/VerticalStackedBarChart.js +6 -0
  449. package/lib-amd/VerticalStackedBarChart.js.map +1 -0
  450. package/lib-amd/components/AreaChart/AreaChart.base.d.ts +92 -0
  451. package/lib-amd/components/AreaChart/AreaChart.base.js +555 -0
  452. package/lib-amd/components/AreaChart/AreaChart.base.js.map +1 -0
  453. package/lib-amd/components/AreaChart/AreaChart.d.ts +3 -0
  454. package/lib-amd/components/AreaChart/AreaChart.js +8 -0
  455. package/lib-amd/components/AreaChart/AreaChart.js.map +1 -0
  456. package/lib-amd/components/AreaChart/AreaChart.styles.d.ts +2 -0
  457. package/lib-amd/components/AreaChart/AreaChart.styles.js +12 -0
  458. package/lib-amd/components/AreaChart/AreaChart.styles.js.map +1 -0
  459. package/lib-amd/components/AreaChart/AreaChart.types.d.ts +37 -0
  460. package/lib-amd/components/AreaChart/AreaChart.types.js +5 -0
  461. package/lib-amd/components/AreaChart/AreaChart.types.js.map +1 -0
  462. package/lib-amd/components/AreaChart/index.d.ts +2 -0
  463. package/lib-amd/components/AreaChart/index.js +7 -0
  464. package/lib-amd/components/AreaChart/index.js.map +1 -0
  465. package/lib-amd/components/CommonComponents/CartesianChart.base.d.ts +43 -0
  466. package/lib-amd/components/CommonComponents/CartesianChart.base.js +329 -0
  467. package/lib-amd/components/CommonComponents/CartesianChart.base.js.map +1 -0
  468. package/lib-amd/components/CommonComponents/CartesianChart.d.ts +3 -0
  469. package/lib-amd/components/CommonComponents/CartesianChart.js +7 -0
  470. package/lib-amd/components/CommonComponents/CartesianChart.js.map +1 -0
  471. package/lib-amd/components/CommonComponents/CartesianChart.styles.d.ts +2 -0
  472. package/lib-amd/components/CommonComponents/CartesianChart.styles.js +166 -0
  473. package/lib-amd/components/CommonComponents/CartesianChart.styles.js.map +1 -0
  474. package/lib-amd/components/CommonComponents/CartesianChart.types.d.ts +428 -0
  475. package/lib-amd/components/CommonComponents/CartesianChart.types.js +5 -0
  476. package/lib-amd/components/CommonComponents/CartesianChart.types.js.map +1 -0
  477. package/lib-amd/components/CommonComponents/index.d.ts +2 -0
  478. package/lib-amd/components/CommonComponents/index.js +7 -0
  479. package/lib-amd/components/CommonComponents/index.js.map +1 -0
  480. package/lib-amd/components/DonutChart/Arc/Arc.d.ts +21 -0
  481. package/lib-amd/components/DonutChart/Arc/Arc.js +85 -0
  482. package/lib-amd/components/DonutChart/Arc/Arc.js.map +1 -0
  483. package/lib-amd/components/DonutChart/Arc/Arc.styles.d.ts +2 -0
  484. package/lib-amd/components/DonutChart/Arc/Arc.styles.js +33 -0
  485. package/lib-amd/components/DonutChart/Arc/Arc.styles.js.map +1 -0
  486. package/lib-amd/components/DonutChart/Arc/Arc.types.d.ts +124 -0
  487. package/lib-amd/components/DonutChart/Arc/Arc.types.js +5 -0
  488. package/lib-amd/components/DonutChart/Arc/Arc.types.js.map +1 -0
  489. package/lib-amd/components/DonutChart/Arc/index.d.ts +2 -0
  490. package/lib-amd/components/DonutChart/Arc/index.js +7 -0
  491. package/lib-amd/components/DonutChart/Arc/index.js.map +1 -0
  492. package/lib-amd/components/DonutChart/DonutChart.base.d.ts +50 -0
  493. package/lib-amd/components/DonutChart/DonutChart.base.js +208 -0
  494. package/lib-amd/components/DonutChart/DonutChart.base.js.map +1 -0
  495. package/lib-amd/components/DonutChart/DonutChart.d.ts +3 -0
  496. package/lib-amd/components/DonutChart/DonutChart.js +8 -0
  497. package/lib-amd/components/DonutChart/DonutChart.js.map +1 -0
  498. package/lib-amd/components/DonutChart/DonutChart.styles.d.ts +2 -0
  499. package/lib-amd/components/DonutChart/DonutChart.styles.js +36 -0
  500. package/lib-amd/components/DonutChart/DonutChart.styles.js.map +1 -0
  501. package/lib-amd/components/DonutChart/DonutChart.types.d.ts +63 -0
  502. package/lib-amd/components/DonutChart/DonutChart.types.js +5 -0
  503. package/lib-amd/components/DonutChart/DonutChart.types.js.map +1 -0
  504. package/lib-amd/components/DonutChart/Pie/Pie.d.ts +15 -0
  505. package/lib-amd/components/DonutChart/Pie/Pie.js +69 -0
  506. package/lib-amd/components/DonutChart/Pie/Pie.js.map +1 -0
  507. package/lib-amd/components/DonutChart/Pie/Pie.styles.d.ts +2 -0
  508. package/lib-amd/components/DonutChart/Pie/Pie.styles.js +24 -0
  509. package/lib-amd/components/DonutChart/Pie/Pie.styles.js.map +1 -0
  510. package/lib-amd/components/DonutChart/Pie/Pie.types.d.ts +96 -0
  511. package/lib-amd/components/DonutChart/Pie/Pie.types.js +5 -0
  512. package/lib-amd/components/DonutChart/Pie/Pie.types.js.map +1 -0
  513. package/lib-amd/components/DonutChart/Pie/index.d.ts +2 -0
  514. package/lib-amd/components/DonutChart/Pie/index.js +7 -0
  515. package/lib-amd/components/DonutChart/Pie/index.js.map +1 -0
  516. package/lib-amd/components/DonutChart/index.d.ts +3 -0
  517. package/lib-amd/components/DonutChart/index.js +8 -0
  518. package/lib-amd/components/DonutChart/index.js.map +1 -0
  519. package/lib-amd/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.d.ts +62 -0
  520. package/lib-amd/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js +375 -0
  521. package/lib-amd/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js.map +1 -0
  522. package/lib-amd/components/GroupedVerticalBarChart/GroupedVerticalBarChart.d.ts +3 -0
  523. package/lib-amd/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js +8 -0
  524. package/lib-amd/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js.map +1 -0
  525. package/lib-amd/components/GroupedVerticalBarChart/GroupedVerticalBarChart.styles.d.ts +2 -0
  526. package/lib-amd/components/GroupedVerticalBarChart/GroupedVerticalBarChart.styles.js +21 -0
  527. package/lib-amd/components/GroupedVerticalBarChart/GroupedVerticalBarChart.styles.js.map +1 -0
  528. package/lib-amd/components/GroupedVerticalBarChart/GroupedVerticalBarChart.types.d.ts +83 -0
  529. package/lib-amd/components/GroupedVerticalBarChart/GroupedVerticalBarChart.types.js +5 -0
  530. package/lib-amd/components/GroupedVerticalBarChart/GroupedVerticalBarChart.types.js.map +1 -0
  531. package/lib-amd/components/GroupedVerticalBarChart/index.d.ts +2 -0
  532. package/lib-amd/components/GroupedVerticalBarChart/index.js +7 -0
  533. package/lib-amd/components/GroupedVerticalBarChart/index.js.map +1 -0
  534. package/lib-amd/components/HeatMapChart/HeatMapChart.base.d.ts +147 -0
  535. package/lib-amd/components/HeatMapChart/HeatMapChart.base.js +492 -0
  536. package/lib-amd/components/HeatMapChart/HeatMapChart.base.js.map +1 -0
  537. package/lib-amd/components/HeatMapChart/HeatMapChart.d.ts +3 -0
  538. package/lib-amd/components/HeatMapChart/HeatMapChart.js +7 -0
  539. package/lib-amd/components/HeatMapChart/HeatMapChart.js.map +1 -0
  540. package/lib-amd/components/HeatMapChart/HeatMapChart.styles.d.ts +2 -0
  541. package/lib-amd/components/HeatMapChart/HeatMapChart.styles.js +29 -0
  542. package/lib-amd/components/HeatMapChart/HeatMapChart.styles.js.map +1 -0
  543. package/lib-amd/components/HeatMapChart/HeatMapChart.types.d.ts +110 -0
  544. package/lib-amd/components/HeatMapChart/HeatMapChart.types.js +5 -0
  545. package/lib-amd/components/HeatMapChart/HeatMapChart.types.js.map +1 -0
  546. package/lib-amd/components/HeatMapChart/index.d.ts +2 -0
  547. package/lib-amd/components/HeatMapChart/index.js +7 -0
  548. package/lib-amd/components/HeatMapChart/index.js.map +1 -0
  549. package/lib-amd/components/HorizontalBarChart/HorizontalBarChart.base.d.ts +36 -0
  550. package/lib-amd/components/HorizontalBarChart/HorizontalBarChart.base.js +233 -0
  551. package/lib-amd/components/HorizontalBarChart/HorizontalBarChart.base.js.map +1 -0
  552. package/lib-amd/components/HorizontalBarChart/HorizontalBarChart.d.ts +3 -0
  553. package/lib-amd/components/HorizontalBarChart/HorizontalBarChart.js +8 -0
  554. package/lib-amd/components/HorizontalBarChart/HorizontalBarChart.js.map +1 -0
  555. package/lib-amd/components/HorizontalBarChart/HorizontalBarChart.styles.d.ts +2 -0
  556. package/lib-amd/components/HorizontalBarChart/HorizontalBarChart.styles.js +72 -0
  557. package/lib-amd/components/HorizontalBarChart/HorizontalBarChart.styles.js.map +1 -0
  558. package/lib-amd/components/HorizontalBarChart/HorizontalBarChart.types.d.ts +172 -0
  559. package/lib-amd/components/HorizontalBarChart/HorizontalBarChart.types.js +11 -0
  560. package/lib-amd/components/HorizontalBarChart/HorizontalBarChart.types.js.map +1 -0
  561. package/lib-amd/components/HorizontalBarChart/index.d.ts +3 -0
  562. package/lib-amd/components/HorizontalBarChart/index.js +8 -0
  563. package/lib-amd/components/HorizontalBarChart/index.js.map +1 -0
  564. package/lib-amd/components/Legends/Legends.base.d.ts +44 -0
  565. package/lib-amd/components/Legends/Legends.base.js +290 -0
  566. package/lib-amd/components/Legends/Legends.base.js.map +1 -0
  567. package/lib-amd/components/Legends/Legends.d.ts +3 -0
  568. package/lib-amd/components/Legends/Legends.js +7 -0
  569. package/lib-amd/components/Legends/Legends.js.map +1 -0
  570. package/lib-amd/components/Legends/Legends.styles.d.ts +2 -0
  571. package/lib-amd/components/Legends/Legends.styles.js +107 -0
  572. package/lib-amd/components/Legends/Legends.styles.js.map +1 -0
  573. package/lib-amd/components/Legends/Legends.types.d.ts +169 -0
  574. package/lib-amd/components/Legends/Legends.types.js +5 -0
  575. package/lib-amd/components/Legends/Legends.types.js.map +1 -0
  576. package/lib-amd/components/Legends/index.d.ts +3 -0
  577. package/lib-amd/components/Legends/index.js +8 -0
  578. package/lib-amd/components/Legends/index.js.map +1 -0
  579. package/lib-amd/components/Legends/shape.d.ts +9 -0
  580. package/lib-amd/components/Legends/shape.js +27 -0
  581. package/lib-amd/components/Legends/shape.js.map +1 -0
  582. package/lib-amd/components/LineChart/LineChart.base.d.ts +84 -0
  583. package/lib-amd/components/LineChart/LineChart.base.js +809 -0
  584. package/lib-amd/components/LineChart/LineChart.base.js.map +1 -0
  585. package/lib-amd/components/LineChart/LineChart.d.ts +3 -0
  586. package/lib-amd/components/LineChart/LineChart.js +8 -0
  587. package/lib-amd/components/LineChart/LineChart.js.map +1 -0
  588. package/lib-amd/components/LineChart/LineChart.styles.d.ts +2 -0
  589. package/lib-amd/components/LineChart/LineChart.styles.js +12 -0
  590. package/lib-amd/components/LineChart/LineChart.styles.js.map +1 -0
  591. package/lib-amd/components/LineChart/LineChart.types.d.ts +72 -0
  592. package/lib-amd/components/LineChart/LineChart.types.js +5 -0
  593. package/lib-amd/components/LineChart/LineChart.types.js.map +1 -0
  594. package/lib-amd/components/LineChart/eventAnnotation/EventAnnotation.d.ts +10 -0
  595. package/lib-amd/components/LineChart/eventAnnotation/EventAnnotation.js +95 -0
  596. package/lib-amd/components/LineChart/eventAnnotation/EventAnnotation.js.map +1 -0
  597. package/lib-amd/components/LineChart/eventAnnotation/LabelLink.d.ts +22 -0
  598. package/lib-amd/components/LineChart/eventAnnotation/LabelLink.js +40 -0
  599. package/lib-amd/components/LineChart/eventAnnotation/LabelLink.js.map +1 -0
  600. package/lib-amd/components/LineChart/eventAnnotation/Textbox.d.ts +13 -0
  601. package/lib-amd/components/LineChart/eventAnnotation/Textbox.js +40 -0
  602. package/lib-amd/components/LineChart/eventAnnotation/Textbox.js.map +1 -0
  603. package/lib-amd/components/LineChart/index.d.ts +3 -0
  604. package/lib-amd/components/LineChart/index.js +8 -0
  605. package/lib-amd/components/LineChart/index.js.map +1 -0
  606. package/lib-amd/components/PieChart/Arc/Arc.d.ts +12 -0
  607. package/lib-amd/components/PieChart/Arc/Arc.js +56 -0
  608. package/lib-amd/components/PieChart/Arc/Arc.js.map +1 -0
  609. package/lib-amd/components/PieChart/Arc/Arc.styles.d.ts +2 -0
  610. package/lib-amd/components/PieChart/Arc/Arc.styles.js +13 -0
  611. package/lib-amd/components/PieChart/Arc/Arc.styles.js.map +1 -0
  612. package/lib-amd/components/PieChart/Arc/Arc.types.d.ts +60 -0
  613. package/lib-amd/components/PieChart/Arc/Arc.types.js +5 -0
  614. package/lib-amd/components/PieChart/Arc/Arc.types.js.map +1 -0
  615. package/lib-amd/components/PieChart/Arc/index.d.ts +2 -0
  616. package/lib-amd/components/PieChart/Arc/index.js +7 -0
  617. package/lib-amd/components/PieChart/Arc/index.js.map +1 -0
  618. package/lib-amd/components/PieChart/Pie/Pie.d.ts +10 -0
  619. package/lib-amd/components/PieChart/Pie/Pie.js +35 -0
  620. package/lib-amd/components/PieChart/Pie/Pie.js.map +1 -0
  621. package/lib-amd/components/PieChart/Pie/Pie.styles.d.ts +2 -0
  622. package/lib-amd/components/PieChart/Pie/Pie.styles.js +12 -0
  623. package/lib-amd/components/PieChart/Pie/Pie.styles.js.map +1 -0
  624. package/lib-amd/components/PieChart/Pie/Pie.types.d.ts +46 -0
  625. package/lib-amd/components/PieChart/Pie/Pie.types.js +5 -0
  626. package/lib-amd/components/PieChart/Pie/Pie.types.js.map +1 -0
  627. package/lib-amd/components/PieChart/Pie/index.d.ts +2 -0
  628. package/lib-amd/components/PieChart/Pie/index.js +7 -0
  629. package/lib-amd/components/PieChart/Pie/index.js.map +1 -0
  630. package/lib-amd/components/PieChart/PieChart.base.d.ts +7 -0
  631. package/lib-amd/components/PieChart/PieChart.base.js +35 -0
  632. package/lib-amd/components/PieChart/PieChart.base.js.map +1 -0
  633. package/lib-amd/components/PieChart/PieChart.d.ts +3 -0
  634. package/lib-amd/components/PieChart/PieChart.js +8 -0
  635. package/lib-amd/components/PieChart/PieChart.js.map +1 -0
  636. package/lib-amd/components/PieChart/PieChart.styles.d.ts +2 -0
  637. package/lib-amd/components/PieChart/PieChart.styles.js +34 -0
  638. package/lib-amd/components/PieChart/PieChart.styles.js.map +1 -0
  639. package/lib-amd/components/PieChart/PieChart.types.d.ts +63 -0
  640. package/lib-amd/components/PieChart/PieChart.types.js +5 -0
  641. package/lib-amd/components/PieChart/PieChart.types.js.map +1 -0
  642. package/lib-amd/components/PieChart/index.d.ts +2 -0
  643. package/lib-amd/components/PieChart/index.js +7 -0
  644. package/lib-amd/components/PieChart/index.js.map +1 -0
  645. package/lib-amd/components/SankeyChart/SankeyChart.base.d.ts +95 -0
  646. package/lib-amd/components/SankeyChart/SankeyChart.base.js +669 -0
  647. package/lib-amd/components/SankeyChart/SankeyChart.base.js.map +1 -0
  648. package/lib-amd/components/SankeyChart/SankeyChart.d.ts +3 -0
  649. package/lib-amd/components/SankeyChart/SankeyChart.js +8 -0
  650. package/lib-amd/components/SankeyChart/SankeyChart.js.map +1 -0
  651. package/lib-amd/components/SankeyChart/SankeyChart.styles.d.ts +2 -0
  652. package/lib-amd/components/SankeyChart/SankeyChart.styles.js +62 -0
  653. package/lib-amd/components/SankeyChart/SankeyChart.styles.js.map +1 -0
  654. package/lib-amd/components/SankeyChart/SankeyChart.types.d.ts +83 -0
  655. package/lib-amd/components/SankeyChart/SankeyChart.types.js +5 -0
  656. package/lib-amd/components/SankeyChart/SankeyChart.types.js.map +1 -0
  657. package/lib-amd/components/SankeyChart/index.d.ts +2 -0
  658. package/lib-amd/components/SankeyChart/index.js +7 -0
  659. package/lib-amd/components/SankeyChart/index.js.map +1 -0
  660. package/lib-amd/components/Sparkline/Sparkline.base.d.ts +20 -0
  661. package/lib-amd/components/Sparkline/Sparkline.base.js +74 -0
  662. package/lib-amd/components/Sparkline/Sparkline.base.js.map +1 -0
  663. package/lib-amd/components/Sparkline/Sparkline.d.ts +3 -0
  664. package/lib-amd/components/Sparkline/Sparkline.js +8 -0
  665. package/lib-amd/components/Sparkline/Sparkline.js.map +1 -0
  666. package/lib-amd/components/Sparkline/Sparkline.styles.d.ts +2 -0
  667. package/lib-amd/components/Sparkline/Sparkline.styles.js +15 -0
  668. package/lib-amd/components/Sparkline/Sparkline.styles.js.map +1 -0
  669. package/lib-amd/components/Sparkline/Sparkline.types.d.ts +51 -0
  670. package/lib-amd/components/Sparkline/Sparkline.types.js +5 -0
  671. package/lib-amd/components/Sparkline/Sparkline.types.js.map +1 -0
  672. package/lib-amd/components/Sparkline/index.d.ts +2 -0
  673. package/lib-amd/components/Sparkline/index.js +7 -0
  674. package/lib-amd/components/Sparkline/index.js.map +1 -0
  675. package/lib-amd/components/StackedBarChart/MultiStackedBarChart.base.d.ts +56 -0
  676. package/lib-amd/components/StackedBarChart/MultiStackedBarChart.base.js +351 -0
  677. package/lib-amd/components/StackedBarChart/MultiStackedBarChart.base.js.map +1 -0
  678. package/lib-amd/components/StackedBarChart/MultiStackedBarChart.d.ts +3 -0
  679. package/lib-amd/components/StackedBarChart/MultiStackedBarChart.js +8 -0
  680. package/lib-amd/components/StackedBarChart/MultiStackedBarChart.js.map +1 -0
  681. package/lib-amd/components/StackedBarChart/MultiStackedBarChart.styles.d.ts +2 -0
  682. package/lib-amd/components/StackedBarChart/MultiStackedBarChart.styles.js +93 -0
  683. package/lib-amd/components/StackedBarChart/MultiStackedBarChart.styles.js.map +1 -0
  684. package/lib-amd/components/StackedBarChart/MultiStackedBarChart.types.d.ts +198 -0
  685. package/lib-amd/components/StackedBarChart/MultiStackedBarChart.types.js +11 -0
  686. package/lib-amd/components/StackedBarChart/MultiStackedBarChart.types.js.map +1 -0
  687. package/lib-amd/components/StackedBarChart/StackedBarChart.base.d.ts +51 -0
  688. package/lib-amd/components/StackedBarChart/StackedBarChart.base.js +308 -0
  689. package/lib-amd/components/StackedBarChart/StackedBarChart.base.js.map +1 -0
  690. package/lib-amd/components/StackedBarChart/StackedBarChart.d.ts +3 -0
  691. package/lib-amd/components/StackedBarChart/StackedBarChart.js +8 -0
  692. package/lib-amd/components/StackedBarChart/StackedBarChart.js.map +1 -0
  693. package/lib-amd/components/StackedBarChart/StackedBarChart.styles.d.ts +2 -0
  694. package/lib-amd/components/StackedBarChart/StackedBarChart.styles.js +108 -0
  695. package/lib-amd/components/StackedBarChart/StackedBarChart.styles.js.map +1 -0
  696. package/lib-amd/components/StackedBarChart/StackedBarChart.types.d.ts +210 -0
  697. package/lib-amd/components/StackedBarChart/StackedBarChart.types.js +5 -0
  698. package/lib-amd/components/StackedBarChart/StackedBarChart.types.js.map +1 -0
  699. package/lib-amd/components/StackedBarChart/index.d.ts +5 -0
  700. package/lib-amd/components/StackedBarChart/index.js +10 -0
  701. package/lib-amd/components/StackedBarChart/index.js.map +1 -0
  702. package/lib-amd/components/TreeChart/TreeChart.base.d.ts +18 -0
  703. package/lib-amd/components/TreeChart/TreeChart.base.js +314 -0
  704. package/lib-amd/components/TreeChart/TreeChart.base.js.map +1 -0
  705. package/lib-amd/components/TreeChart/TreeChart.d.ts +3 -0
  706. package/lib-amd/components/TreeChart/TreeChart.js +7 -0
  707. package/lib-amd/components/TreeChart/TreeChart.js.map +1 -0
  708. package/lib-amd/components/TreeChart/TreeChart.styles.d.ts +2 -0
  709. package/lib-amd/components/TreeChart/TreeChart.styles.js +34 -0
  710. package/lib-amd/components/TreeChart/TreeChart.styles.js.map +1 -0
  711. package/lib-amd/components/TreeChart/TreeChart.types.d.ts +197 -0
  712. package/lib-amd/components/TreeChart/TreeChart.types.js +28 -0
  713. package/lib-amd/components/TreeChart/TreeChart.types.js.map +1 -0
  714. package/lib-amd/components/TreeChart/index.d.ts +2 -0
  715. package/lib-amd/components/TreeChart/index.js +7 -0
  716. package/lib-amd/components/TreeChart/index.js.map +1 -0
  717. package/lib-amd/components/VerticalBarChart/VerticalBarChart.base.d.ts +74 -0
  718. package/lib-amd/components/VerticalBarChart/VerticalBarChart.base.js +529 -0
  719. package/lib-amd/components/VerticalBarChart/VerticalBarChart.base.js.map +1 -0
  720. package/lib-amd/components/VerticalBarChart/VerticalBarChart.d.ts +3 -0
  721. package/lib-amd/components/VerticalBarChart/VerticalBarChart.js +8 -0
  722. package/lib-amd/components/VerticalBarChart/VerticalBarChart.js.map +1 -0
  723. package/lib-amd/components/VerticalBarChart/VerticalBarChart.styles.d.ts +2 -0
  724. package/lib-amd/components/VerticalBarChart/VerticalBarChart.styles.js +32 -0
  725. package/lib-amd/components/VerticalBarChart/VerticalBarChart.styles.js.map +1 -0
  726. package/lib-amd/components/VerticalBarChart/VerticalBarChart.types.d.ts +114 -0
  727. package/lib-amd/components/VerticalBarChart/VerticalBarChart.types.js +5 -0
  728. package/lib-amd/components/VerticalBarChart/VerticalBarChart.types.js.map +1 -0
  729. package/lib-amd/components/VerticalBarChart/index.d.ts +2 -0
  730. package/lib-amd/components/VerticalBarChart/index.js +7 -0
  731. package/lib-amd/components/VerticalBarChart/index.js.map +1 -0
  732. package/lib-amd/components/VerticalStackedBarChart/VerticalStackedBarChart.base.d.ts +85 -0
  733. package/lib-amd/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js +659 -0
  734. package/lib-amd/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js.map +1 -0
  735. package/lib-amd/components/VerticalStackedBarChart/VerticalStackedBarChart.d.ts +3 -0
  736. package/lib-amd/components/VerticalStackedBarChart/VerticalStackedBarChart.js +8 -0
  737. package/lib-amd/components/VerticalStackedBarChart/VerticalStackedBarChart.js.map +1 -0
  738. package/lib-amd/components/VerticalStackedBarChart/VerticalStackedBarChart.styles.d.ts +2 -0
  739. package/lib-amd/components/VerticalStackedBarChart/VerticalStackedBarChart.styles.js +22 -0
  740. package/lib-amd/components/VerticalStackedBarChart/VerticalStackedBarChart.styles.js.map +1 -0
  741. package/lib-amd/components/VerticalStackedBarChart/VerticalStackedBarChart.types.d.ts +142 -0
  742. package/lib-amd/components/VerticalStackedBarChart/VerticalStackedBarChart.types.js +5 -0
  743. package/lib-amd/components/VerticalStackedBarChart/VerticalStackedBarChart.types.js.map +1 -0
  744. package/lib-amd/components/VerticalStackedBarChart/index.d.ts +2 -0
  745. package/lib-amd/components/VerticalStackedBarChart/index.js +7 -0
  746. package/lib-amd/components/VerticalStackedBarChart/index.js.map +1 -0
  747. package/lib-amd/index.d.ts +19 -0
  748. package/lib-amd/index.js +23 -0
  749. package/lib-amd/index.js.map +1 -0
  750. package/lib-amd/types/IDataPoint.d.ts +545 -0
  751. package/lib-amd/types/IDataPoint.js +5 -0
  752. package/lib-amd/types/IDataPoint.js.map +1 -0
  753. package/lib-amd/types/IEventAnnotation.d.ts +6 -0
  754. package/lib-amd/types/IEventAnnotation.js +5 -0
  755. package/lib-amd/types/IEventAnnotation.js.map +1 -0
  756. package/lib-amd/types/ILegendDataItem.d.ts +10 -0
  757. package/lib-amd/types/ILegendDataItem.js +5 -0
  758. package/lib-amd/types/ILegendDataItem.js.map +1 -0
  759. package/lib-amd/types/index.d.ts +2 -0
  760. package/lib-amd/types/index.js +7 -0
  761. package/lib-amd/types/index.js.map +1 -0
  762. package/lib-amd/utilities/ChartHoverCard/ChartHoverCard.base.d.ts +6 -0
  763. package/lib-amd/utilities/ChartHoverCard/ChartHoverCard.base.js +39 -0
  764. package/lib-amd/utilities/ChartHoverCard/ChartHoverCard.base.js.map +1 -0
  765. package/lib-amd/utilities/ChartHoverCard/ChartHoverCard.d.ts +3 -0
  766. package/lib-amd/utilities/ChartHoverCard/ChartHoverCard.js +8 -0
  767. package/lib-amd/utilities/ChartHoverCard/ChartHoverCard.js.map +1 -0
  768. package/lib-amd/utilities/ChartHoverCard/ChartHoverCard.styles.d.ts +2 -0
  769. package/lib-amd/utilities/ChartHoverCard/ChartHoverCard.styles.js +87 -0
  770. package/lib-amd/utilities/ChartHoverCard/ChartHoverCard.styles.js.map +1 -0
  771. package/lib-amd/utilities/ChartHoverCard/ChartHoverCard.types.d.ts +105 -0
  772. package/lib-amd/utilities/ChartHoverCard/ChartHoverCard.types.js +5 -0
  773. package/lib-amd/utilities/ChartHoverCard/ChartHoverCard.types.js.map +1 -0
  774. package/lib-amd/utilities/ChartHoverCard/index.d.ts +3 -0
  775. package/lib-amd/utilities/ChartHoverCard/index.js +8 -0
  776. package/lib-amd/utilities/ChartHoverCard/index.js.map +1 -0
  777. package/lib-amd/utilities/FocusableTooltipText.d.ts +27 -0
  778. package/lib-amd/utilities/FocusableTooltipText.js +54 -0
  779. package/lib-amd/utilities/FocusableTooltipText.js.map +1 -0
  780. package/lib-amd/utilities/colors.d.ts +51 -0
  781. package/lib-amd/utilities/colors.js +139 -0
  782. package/lib-amd/utilities/colors.js.map +1 -0
  783. package/lib-amd/utilities/index.d.ts +3 -0
  784. package/lib-amd/utilities/index.js +8 -0
  785. package/lib-amd/utilities/index.js.map +1 -0
  786. package/lib-amd/utilities/utilities.d.ts +377 -0
  787. package/lib-amd/utilities/utilities.js +888 -0
  788. package/lib-amd/utilities/utilities.js.map +1 -0
  789. package/lib-amd/version.d.ts +1 -0
  790. package/lib-amd/version.js +6 -0
  791. package/lib-amd/version.js.map +1 -0
  792. package/lib-commonjs/version.js +1 -1
  793. package/lib-commonjs/version.js.map +1 -1
  794. package/package.json +5 -4
@@ -0,0 +1,314 @@
1
+ define(["require", "exports", "tslib", "react", "d3-hierarchy", "@fluentui/react/lib/Utilities", "d3-selection", "@fluentui/react-focus", "d3-array"], function (require, exports, tslib_1, React, d3_hierarchy_1, Utilities_1, d3_selection_1, react_focus_1, d3_array_1) {
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.TreeChartBase = void 0;
5
+ var getClassNames = Utilities_1.classNamesFunction();
6
+ // Create a parent class for common tree components
7
+ var StandardTree = /** @class */ (function () {
8
+ function StandardTree(treeData, styleClassNames, _nodeElements, _linkElements) {
9
+ if (_nodeElements === void 0) { _nodeElements = []; }
10
+ if (_linkElements === void 0) { _linkElements = []; }
11
+ this._nodeElements = [];
12
+ this._linkElements = [];
13
+ this.treeData = treeData;
14
+ this.styleClassNames = styleClassNames;
15
+ this._nodeElements = _nodeElements;
16
+ this._linkElements = _linkElements;
17
+ }
18
+ StandardTree.prototype.truncateText = function (text, rectangleWidth, padding, styleClass) {
19
+ var truncatedText = '';
20
+ var words = text.split(/\s+/).reverse();
21
+ var word = '';
22
+ var tspan = d3_selection_1.select('.svgTree').append('text').attr('class', 'tempText').append('tspan').text(null);
23
+ if (styleClass) {
24
+ tspan.attr('class', styleClass);
25
+ }
26
+ var line = [];
27
+ while ((word = words.pop())) {
28
+ line.push(word);
29
+ tspan.text(line.join(' ') + ' ');
30
+ if (tspan.node() !== null) {
31
+ var w = tspan.node().getComputedTextLength();
32
+ if (w > rectangleWidth - padding) {
33
+ line.pop();
34
+ line.push('...');
35
+ break;
36
+ }
37
+ }
38
+ }
39
+ truncatedText = line.join(' ') + ' ';
40
+ tspan.text(null);
41
+ d3_selection_1.selectAll('.tempText').remove();
42
+ return truncatedText;
43
+ };
44
+ // Append node elements
45
+ // nodeId to create unique key
46
+ StandardTree.prototype.addNodeShapetoSVG = function (name, subname, bodytext, metricName, xCenterCoordinate, yCoordinate, fillColor, rectangleWidth, rectangleHeight, nodeId, parentInfo) {
47
+ var ariaLabel = "nodeId: " + nodeId + " \nnodeMainText: " + name + "\nsubText " + subname + " " + parentInfo;
48
+ var xCoordinate = xCenterCoordinate - rectangleWidth / 2;
49
+ if (metricName || nodeId !== 0 || !bodytext) {
50
+ this._nodeElements.push(React.createElement("rect", { width: rectangleWidth, height: rectangleHeight, x: xCoordinate, y: yCoordinate, tabIndex: 0, role: 'text', "data-is-focusable": true, "aria-label": ariaLabel, className: this.styleClassNames.rectNode, stroke: fillColor, key: "" + nodeId + this.styleClassNames.rectNode }));
51
+ }
52
+ if (subname) {
53
+ subname = this.truncateText(subname, rectangleWidth, rectangleWidth / 4, this.styleClassNames.rectSubText);
54
+ }
55
+ if (bodytext) {
56
+ bodytext = this.truncateText(bodytext, rectangleWidth, rectangleWidth / 4, this.styleClassNames.rectBodyText);
57
+ }
58
+ if (metricName) {
59
+ metricName = this.truncateText(metricName, rectangleWidth, rectangleWidth / 4, this.styleClassNames.rectMetricText);
60
+ }
61
+ name = this.truncateText(name, rectangleWidth, rectangleWidth / 4, this.styleClassNames.rectText);
62
+ // Text position y = y + rectHeight/2, 2 is ratio for depth
63
+ // Text position x = x + rectWidth/2, 2 is ratio for length
64
+ // Sub-text position x = x + rectWidth/2, 2 is ratio for length
65
+ var subValue = metricName ? (React.createElement("tspan", { className: this.styleClassNames.rectMetricText, dy: "1.4em", x: xCoordinate + rectangleWidth / 2 }, metricName)) : bodytext ? (React.createElement(React.Fragment, null,
66
+ React.createElement("tspan", { className: this.styleClassNames.rectSubText, dy: "1.4em", x: xCoordinate + rectangleWidth / 2 }, subname),
67
+ React.createElement("tspan", { className: this.styleClassNames.rectBodyText, dy: "1.4em", x: xCoordinate + rectangleWidth / 2 }, bodytext))) : (React.createElement("tspan", { className: this.styleClassNames.rectSubText, dy: "1.4em", x: xCoordinate + rectangleWidth / 2 }, subname));
68
+ if (!subname && !metricName && !bodytext) {
69
+ this._nodeElements.push(React.createElement("text", { textAnchor: "middle", className: this.styleClassNames.rectMetricText, dy: yCoordinate + rectangleHeight / 1.6, x: xCoordinate + rectangleWidth / 2, key: "" + nodeId + this.styleClassNames.rectText }, name));
70
+ }
71
+ else {
72
+ this._nodeElements.push(React.createElement("text", { textAnchor: "middle", className: metricName ? this.styleClassNames.rectSubText : this.styleClassNames.rectText, dy: metricName ? yCoordinate + rectangleHeight / 2.5 : yCoordinate + rectangleHeight / 2, x: xCoordinate + rectangleWidth / 2, key: "" + nodeId + this.styleClassNames.rectText },
73
+ name,
74
+ subValue));
75
+ }
76
+ };
77
+ // Create a rectangular path from parent to the child nodes
78
+ StandardTree.prototype.createPathLink = function (parentX, parentY, childX, childY, leaf, rectWidth, rectHeight, gap, childXMax) {
79
+ // gap adds ratio for parent.y to child.y
80
+ /*Below code is used to draw lines(___|) to show the parent child relation i.e a vertical line
81
+ emerging from the parent and
82
+ then a horzontal line encompassing all the its children which are
83
+ shown below it .so it gives a visual representation of tree branches.
84
+
85
+ So for making this path firstly we are moving to the childX which is the mid point of the node and then
86
+ we are subtracting the half of rectwidth to move the complete width of the rectangle and
87
+ we are subtracting gap from y cordinate as we are making this line at a little gap from node.
88
+ Then we are building that line horizonatlly till childXmax, again adding half rectwidth to complete
89
+ the line till end as childXmax will be midpoint.
90
+ Then last part is for making line vertical for that we move to the parentx position and
91
+ then draw the vertical till parenty + rectHeight + gap/2
92
+ We have seperate path for leaf node as we are using different composition like compact, long etc.*/
93
+ var path = "M" + (childX - rectWidth / 2) + "," + (childY - gap) + " H" + (childXMax + rectWidth / 2) + " M" + parentX + "," + (childY - gap) + "\n V" + (parentY + rectHeight + gap / 2);
94
+ var leafpath = "M" + parentX + "," + (parentY + rectHeight + gap / 2) + " V" + (parentY + gap * 5) + "\n H" + (parentX - rectWidth / 2) + " H" + (parentX + rectWidth / 2);
95
+ // based on the type of node return leafpath or path element
96
+ return leaf ? leafpath : path;
97
+ };
98
+ // Append path link element
99
+ StandardTree.prototype.addLinktoSVG = function (nodeId, parentX, parentY, childX, childY, leaf, rectWidth, rectHeight, gap, childXMax) {
100
+ if (childXMax === void 0) { childXMax = 0; }
101
+ this._linkElements.push(React.createElement("path", { className: this.styleClassNames.link, d: this.createPathLink(parentX, parentY, childX, childY, leaf, rectWidth, rectHeight, gap, childXMax), key: "" + nodeId + this.styleClassNames.link }));
102
+ };
103
+ return StandardTree;
104
+ }());
105
+ // Create child class to Add Tree component based on treeHeight
106
+ var LayeredTree = /** @class */ (function (_super) {
107
+ tslib_1.__extends(LayeredTree, _super);
108
+ function LayeredTree(treeData, composition, styleClassNames, _nodeElements, _linkElements, _treeTraversal) {
109
+ if (_nodeElements === void 0) { _nodeElements = []; }
110
+ if (_linkElements === void 0) { _linkElements = []; }
111
+ var _this = _super.call(this, treeData, styleClassNames, _nodeElements, _linkElements) || this;
112
+ _this.composition = composition;
113
+ _this._treeTraversal = _treeTraversal;
114
+ return _this;
115
+ }
116
+ LayeredTree.prototype.createTree = function (givenLayoutWidth, screenWidth) {
117
+ var _a, _b, _c, _d, _e, _f;
118
+ givenLayoutWidth = givenLayoutWidth < 65 ? 65 : givenLayoutWidth > 90 ? 90 : givenLayoutWidth;
119
+ var layoutWidth = givenLayoutWidth || 75;
120
+ var root = d3_hierarchy_1.hierarchy(this.treeData, function (d) {
121
+ return d.children;
122
+ });
123
+ // Find tree Height
124
+ var treeHeight = (root === null || root === void 0 ? void 0 : root.height) + 1;
125
+ // Create tree layout, width: layoutWidth, height: layoutWidth/1.5 and add node separation
126
+ var treeChart = d3_hierarchy_1.tree()
127
+ .nodeSize([layoutWidth, layoutWidth / 1.5])
128
+ .separation(function (a, b) {
129
+ return a.parent === root && b.parent === root ? 3.5 : 1;
130
+ });
131
+ // Assigns the x and y position for the nodes
132
+ var treeData = treeChart(root);
133
+ // Compute the new tree layout.
134
+ var nodes = treeData.descendants();
135
+ // Normalize for fixed-depth and width
136
+ // Normalise y coordinate by depth of each node by a factor of 130
137
+ // Normalise x coordinate by start coordinate 0 with screenSize/3
138
+ nodes.forEach(function (d) {
139
+ d.y = d.depth === 0 ? 10 : d.depth * 130;
140
+ d.x += screenWidth / 2;
141
+ });
142
+ // <------------------ Traversal section ------------------>
143
+ // Create tree data structure
144
+ var treeDataStructure = [];
145
+ var TreeID = 0;
146
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
147
+ var createTreeDataStructure = function (d) {
148
+ var _a, _b;
149
+ d.id = TreeID;
150
+ treeDataStructure.push({
151
+ id: TreeID,
152
+ children: d.children,
153
+ dataName: d.data.name,
154
+ subName: d.data.subname,
155
+ bodyText: d.data.bodytext,
156
+ metricName: (_a = d.data) === null || _a === void 0 ? void 0 : _a.metric,
157
+ fill: d.data.fill,
158
+ x: d.x,
159
+ y: d.y,
160
+ parentID: (_b = d.parent) === null || _b === void 0 ? void 0 : _b.id,
161
+ });
162
+ TreeID++;
163
+ };
164
+ this._treeTraversal === 0
165
+ ? root.each(function (d) {
166
+ createTreeDataStructure(d);
167
+ })
168
+ : root.eachBefore(function (d) {
169
+ createTreeDataStructure(d);
170
+ });
171
+ var rectWidth = layoutWidth * 3;
172
+ var rectHeight = rectWidth / 3.45;
173
+ var gap = 20;
174
+ var parentSet = new Set();
175
+ for (var _i = 0, treeDataStructure_1 = treeDataStructure; _i < treeDataStructure_1.length; _i++) {
176
+ var d = treeDataStructure_1[_i];
177
+ var parentInfo = d.id === 0
178
+ ? 'Root Node'
179
+ : "Parent info parentId: " + d.parentID + "\n " + treeDataStructure[d.parentID].dataName + "\n " + treeDataStructure[d.parentID].subName;
180
+ // check for leaf nodes
181
+ if (!d.children && !parentSet.has(d.parentID) && treeHeight === 3) {
182
+ var compactNodeWidth = (rectWidth - gap) / 2;
183
+ var compactNodeHeight = rectHeight;
184
+ parentSet.add(d.parentID);
185
+ // <------------------ Links section ------------------>
186
+ this.addLinktoSVG(d.id, treeDataStructure[d.parentID].x, treeDataStructure[d.parentID].y, treeDataStructure[d.id].x, treeDataStructure[d.id].y, true, rectWidth, rectHeight, gap);
187
+ // <------------------ Nodes section ------------------>
188
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
189
+ var children = (_a = treeDataStructure[d.parentID]) === null || _a === void 0 ? void 0 : _a.children;
190
+ var compactNodeCenterX1 = ((_b = treeDataStructure[d.parentID]) === null || _b === void 0 ? void 0 : _b.x) - compactNodeWidth / 2 - gap / 2;
191
+ var compactNodeCenterX2 = ((_c = treeDataStructure[d.parentID]) === null || _c === void 0 ? void 0 : _c.x) + compactNodeWidth / 2 + gap / 2;
192
+ var longNodeCenterX = (_d = treeDataStructure[d.parentID]) === null || _d === void 0 ? void 0 : _d.x;
193
+ var dy = (_e = children[0]) === null || _e === void 0 ? void 0 : _e.y;
194
+ for (var itr = 0; itr < children.length; ++itr) {
195
+ var child = children[itr];
196
+ // Given Composition
197
+ if (this.composition !== undefined) {
198
+ // For compact compostion
199
+ if (this.composition === 0) {
200
+ this.addNodeShapetoSVG(child.data.name, child.data.subname, child.data.bodytext, child.data.metricName,
201
+ // If the leaf node count is 1 ,
202
+ //irrespective of provided composition we should always use long composition
203
+ itr % 2 === 0 ? (children.length === 1 ? longNodeCenterX : compactNodeCenterX1) : compactNodeCenterX2, dy, child.data.fill, children.length === 1 ? rectWidth : compactNodeWidth, rectHeight, child.id, parentInfo);
204
+ if (itr % 2 === 1) {
205
+ dy += compactNodeHeight + gap;
206
+ }
207
+ }
208
+ // For long compostion
209
+ else {
210
+ this.addNodeShapetoSVG(child.data.name, child.data.subname, child.data.bodytext, child.data.metricName, longNodeCenterX, dy, child.data.fill, rectWidth, rectHeight, child.id, parentInfo);
211
+ dy += compactNodeHeight + gap;
212
+ }
213
+ }
214
+ // Automatic Node Composition
215
+ else {
216
+ if (children.length > 2) {
217
+ this.addNodeShapetoSVG(child.data.name, child.data.subname, child.data.bodytext, child.data.metricName, itr % 2 === 0 ? compactNodeCenterX1 : compactNodeCenterX2, dy, child.data.fill, children.length === 1 ? rectWidth : compactNodeWidth, rectHeight, child.id, parentInfo);
218
+ if (itr % 2 === 1) {
219
+ dy += compactNodeHeight + gap;
220
+ }
221
+ }
222
+ else {
223
+ this.addNodeShapetoSVG(child.data.name, child.data.subname, child.data.bodytext, child.data.metricName, longNodeCenterX, dy, child.data.fill, rectWidth, rectHeight, child.id, parentInfo);
224
+ dy += compactNodeHeight + gap;
225
+ }
226
+ }
227
+ }
228
+ }
229
+ if (d.children || treeHeight <= 2) {
230
+ // <------------------ Nodes section ------------------>
231
+ // Since the height <=2 we will be using long compositon.
232
+ this.addNodeShapetoSVG(d.dataName, d.subName, d.bodyText, d.metricName, d.x, d.y, d.fill, rectWidth, rectHeight, d.id, parentInfo);
233
+ // <------------------ Links section ------------------>
234
+ if (d.id === 0 && d.children) {
235
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
236
+ var children = (_f = treeDataStructure[d.id]) === null || _f === void 0 ? void 0 : _f.children;
237
+ var childXMin = d3_array_1.min(children, function (child) { return child.x; });
238
+ var childXMax = d3_array_1.max(children, function (child) { return child.x; });
239
+ this.addLinktoSVG(d.id, d.x, d.y, childXMin, d.children[0].y, false, rectWidth, rectHeight, gap, childXMax);
240
+ }
241
+ }
242
+ }
243
+ };
244
+ return LayeredTree;
245
+ }(StandardTree));
246
+ var TreeChartBase = /** @class */ (function (_super) {
247
+ tslib_1.__extends(TreeChartBase, _super);
248
+ function TreeChartBase(props) {
249
+ var _a;
250
+ var _this = _super.call(this, props) || this;
251
+ _this._nodeElements = [];
252
+ _this._linkElements = [];
253
+ _this._margin = { top: 30, right: 20, bottom: 30, left: 50 };
254
+ _this._width = _this.props.width || 1500;
255
+ _this._height = _this.props.height || 700;
256
+ _this._treeData = _this.props.treeData;
257
+ _this._composition = (_a = _this.props) === null || _a === void 0 ? void 0 : _a.composition;
258
+ _this._treeTraversal = _this.props.treeTraversal;
259
+ _this.state = {
260
+ _width: _this._width,
261
+ _height: _this._height,
262
+ };
263
+ return _this;
264
+ }
265
+ TreeChartBase.prototype.componentDidMount = function () {
266
+ var _a = this.props, theme = _a.theme, className = _a.className, styles = _a.styles;
267
+ // Get classNames to create component styling
268
+ this._classNames = getClassNames(styles, {
269
+ theme: theme,
270
+ className: className,
271
+ });
272
+ // Call createTreeChart function in componentDidMount
273
+ this.createTreeChart();
274
+ this.setState({
275
+ _width: this.props.width || 1500,
276
+ _height: this.props.height || 700,
277
+ });
278
+ };
279
+ TreeChartBase.prototype.componentDidUpdate = function (prevProps) {
280
+ if (prevProps.layoutWidth !== this.props.layoutWidth) {
281
+ var svgText = d3_selection_1.selectAll('text');
282
+ var svgRect = d3_selection_1.selectAll('rect');
283
+ var svgLink = d3_selection_1.selectAll('path');
284
+ if (this._nodeElements.length === 0 && this._linkElements.length === 0) {
285
+ svgText.remove();
286
+ svgRect.remove();
287
+ svgLink.remove();
288
+ }
289
+ this.createTreeChart();
290
+ }
291
+ };
292
+ TreeChartBase.prototype.createTreeChart = function () {
293
+ var nodeElements = [];
294
+ var linkElements = [];
295
+ // Instantiate inherited class and call createTree function for the object
296
+ var treeObject = new LayeredTree(this._treeData, this._composition, this._classNames, nodeElements, linkElements, this._treeTraversal);
297
+ var width = this.state._width - this._margin.left - this._margin.right;
298
+ treeObject.createTree(this.props.layoutWidth, width);
299
+ this._nodeElements = nodeElements;
300
+ this._linkElements = linkElements;
301
+ };
302
+ TreeChartBase.prototype.render = function () {
303
+ var _a;
304
+ return (React.createElement(react_focus_1.FocusZone, null,
305
+ React.createElement("div", { className: (_a = this._classNames) === null || _a === void 0 ? void 0 : _a.root },
306
+ React.createElement("svg", { className: "svgTree", width: this.state._width - this._margin.left - this._margin.right, height: this.state._height - this._margin.top - this._margin.bottom },
307
+ React.createElement("g", { className: "svgNode" }, this._nodeElements.map(function (element) { return element; })),
308
+ React.createElement("g", { className: "svgLink" }, this._linkElements.map(function (element) { return element; }))))));
309
+ };
310
+ return TreeChartBase;
311
+ }(React.Component));
312
+ exports.TreeChartBase = TreeChartBase;
313
+ });
314
+ //# sourceMappingURL=TreeChart.base.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TreeChart.base.js","sourceRoot":"../src/","sources":["components/TreeChart/TreeChart.base.tsx"],"names":[],"mappings":";;;;IAiBA,IAAM,aAAa,GAAG,8BAAkB,EAAgC,CAAC;IAEzE,mDAAmD;IACnD;QAOE,sBACE,QAA6B,EAC7B,eAAgD,EAChD,aAAiC,EACjC,aAAiC;YADjC,8BAAA,EAAA,kBAAiC;YACjC,8BAAA,EAAA,kBAAiC;YAP3B,kBAAa,GAAkB,EAAE,CAAC;YAClC,kBAAa,GAAkB,EAAE,CAAC;YAQxC,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;YACzB,IAAI,CAAC,eAAe,GAAG,eAAe,CAAC;YACvC,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;YACnC,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;QACrC,CAAC;QAEM,mCAAY,GAAnB,UAAoB,IAAY,EAAE,cAAsB,EAAE,OAAe,EAAE,UAA8B;YACvG,IAAI,aAAa,GAAG,EAAE,CAAC;YACvB,IAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,OAAO,EAAE,CAAC;YAC1C,IAAI,IAAI,GAAW,EAAE,CAAC;YACtB,IAAM,KAAK,GAAG,qBAAM,CAAC,UAAU,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YAErG,IAAI,UAAU,EAAE;gBACd,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;aACjC;YAED,IAAM,IAAI,GAAa,EAAE,CAAC;YAC1B,OAAO,CAAC,IAAI,GAAG,KAAK,CAAC,GAAG,EAAG,CAAC,EAAE;gBAC5B,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;gBAChB,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hierarchy, tree } from 'd3-hierarchy';\nimport { classNamesFunction } from '@fluentui/react/lib/Utilities';\nimport { IProcessedStyleSet } from '@fluentui/react/lib/Styling';\nimport { select, selectAll } from 'd3-selection';\nimport { FocusZone } from '@fluentui/react-focus';\nimport { max as d3Max, min as d3Min } from 'd3-array';\n\nimport {\n ITreeProps,\n ITreeState,\n ITreeDataStructure,\n ITreeChartDataPoint,\n ITreeStyleProps,\n ITreeStyles,\n} from '../../index';\n\nconst getClassNames = classNamesFunction<ITreeStyleProps, ITreeStyles>();\n\n// Create a parent class for common tree components\nclass StandardTree {\n public treeData: ITreeChartDataPoint;\n public styleClassNames: IProcessedStyleSet<ITreeStyles>;\n\n private _nodeElements: JSX.Element[] = [];\n private _linkElements: JSX.Element[] = [];\n\n constructor(\n treeData: ITreeChartDataPoint,\n styleClassNames: IProcessedStyleSet<ITreeStyles>,\n _nodeElements: JSX.Element[] = [],\n _linkElements: JSX.Element[] = [],\n ) {\n this.treeData = treeData;\n this.styleClassNames = styleClassNames;\n this._nodeElements = _nodeElements;\n this._linkElements = _linkElements;\n }\n\n public truncateText(text: string, rectangleWidth: number, padding: number, styleClass: string | undefined) {\n let truncatedText = '';\n const words = text.split(/\\s+/).reverse();\n let word: string = '';\n const tspan = select('.svgTree').append('text').attr('class', 'tempText').append('tspan').text(null);\n\n if (styleClass) {\n tspan.attr('class', styleClass);\n }\n\n const line: string[] = [];\n while ((word = words.pop()!)) {\n line.push(word);\n tspan.text(line.join(' ') + ' ');\n if (tspan.node() !== null) {\n const w = tspan.node()!.getComputedTextLength();\n if (w > rectangleWidth - padding) {\n line.pop();\n line.push('...');\n break;\n }\n }\n }\n\n truncatedText = line.join(' ') + ' ';\n tspan.text(null);\n selectAll('.tempText').remove();\n return truncatedText;\n }\n\n // Append node elements\n // nodeId to create unique key\n public addNodeShapetoSVG(\n name: string,\n subname: string | undefined,\n bodytext: string | undefined,\n metricName: string | undefined,\n xCenterCoordinate: number,\n yCoordinate: number,\n fillColor: string,\n rectangleWidth: number,\n rectangleHeight: number,\n nodeId: number,\n parentInfo: string,\n ) {\n const ariaLabel = `nodeId: ${nodeId} \\nnodeMainText: ${name}\\nsubText ${subname} ${parentInfo}`;\n const xCoordinate = xCenterCoordinate - rectangleWidth / 2;\n if (metricName || nodeId !== 0 || !bodytext) {\n this._nodeElements.push(\n <rect\n width={rectangleWidth}\n height={rectangleHeight}\n x={xCoordinate}\n y={yCoordinate}\n tabIndex={0}\n role={'text'}\n data-is-focusable={true}\n aria-label={ariaLabel}\n className={this.styleClassNames.rectNode}\n stroke={fillColor}\n key={`${nodeId}${this.styleClassNames.rectNode}`}\n />,\n );\n }\n\n if (subname) {\n subname = this.truncateText(subname, rectangleWidth, rectangleWidth / 4, this.styleClassNames.rectSubText);\n }\n if (bodytext) {\n bodytext = this.truncateText(bodytext, rectangleWidth, rectangleWidth / 4, this.styleClassNames.rectBodyText);\n }\n if (metricName) {\n metricName = this.truncateText(\n metricName,\n rectangleWidth,\n rectangleWidth / 4,\n this.styleClassNames.rectMetricText,\n );\n }\n name = this.truncateText(name, rectangleWidth, rectangleWidth / 4, this.styleClassNames.rectText);\n\n // Text position y = y + rectHeight/2, 2 is ratio for depth\n // Text position x = x + rectWidth/2, 2 is ratio for length\n // Sub-text position x = x + rectWidth/2, 2 is ratio for length\n\n const subValue = metricName ? (\n <tspan className={this.styleClassNames.rectMetricText} dy=\"1.4em\" x={xCoordinate + rectangleWidth / 2}>\n {metricName}\n </tspan>\n ) : bodytext ? (\n <>\n <tspan className={this.styleClassNames.rectSubText} dy=\"1.4em\" x={xCoordinate + rectangleWidth / 2}>\n {subname}\n </tspan>\n <tspan className={this.styleClassNames.rectBodyText} dy=\"1.4em\" x={xCoordinate + rectangleWidth / 2}>\n {bodytext}\n </tspan>\n </>\n ) : (\n <tspan className={this.styleClassNames.rectSubText} dy=\"1.4em\" x={xCoordinate + rectangleWidth / 2}>\n {subname}\n </tspan>\n );\n\n if (!subname && !metricName && !bodytext) {\n this._nodeElements.push(\n <text\n textAnchor=\"middle\"\n className={this.styleClassNames.rectMetricText}\n dy={yCoordinate + rectangleHeight / 1.6}\n x={xCoordinate + rectangleWidth / 2}\n key={`${nodeId}${this.styleClassNames.rectText}`}\n >\n {name}\n </text>,\n );\n } else {\n this._nodeElements.push(\n <text\n textAnchor=\"middle\"\n className={metricName ? this.styleClassNames.rectSubText : this.styleClassNames.rectText}\n dy={metricName ? yCoordinate + rectangleHeight / 2.5 : yCoordinate + rectangleHeight / 2}\n x={xCoordinate + rectangleWidth / 2}\n key={`${nodeId}${this.styleClassNames.rectText}`}\n >\n {name}\n {subValue}\n </text>,\n );\n }\n }\n // Create a rectangular path from parent to the child nodes\n public createPathLink(\n parentX: number,\n parentY: number,\n childX: number,\n childY: number,\n leaf: boolean,\n rectWidth: number,\n rectHeight: number,\n gap: number,\n childXMax: number,\n ): string {\n // gap adds ratio for parent.y to child.y\n\n /*Below code is used to draw lines(___|) to show the parent child relation i.e a vertical line\n emerging from the parent and\n then a horzontal line encompassing all the its children which are\n shown below it .so it gives a visual representation of tree branches.\n\n So for making this path firstly we are moving to the childX which is the mid point of the node and then\n we are subtracting the half of rectwidth to move the complete width of the rectangle and\n we are subtracting gap from y cordinate as we are making this line at a little gap from node.\n Then we are building that line horizonatlly till childXmax, again adding half rectwidth to complete\n the line till end as childXmax will be midpoint.\n Then last part is for making line vertical for that we move to the parentx position and\n then draw the vertical till parenty + rectHeight + gap/2\n We have seperate path for leaf node as we are using different composition like compact, long etc.*/\n\n const path = `M${childX - rectWidth / 2},${childY - gap} H${childXMax + rectWidth / 2} M${parentX},${childY - gap}\n V${parentY + rectHeight + gap / 2}`;\n\n const leafpath = `M${parentX},${parentY + rectHeight + gap / 2} V${parentY + gap * 5}\n H${parentX - rectWidth / 2} H${parentX + rectWidth / 2}`;\n\n // based on the type of node return leafpath or path element\n return leaf ? leafpath : path;\n }\n\n // Append path link element\n public addLinktoSVG(\n nodeId: number,\n parentX: number,\n parentY: number,\n childX: number,\n childY: number,\n leaf: boolean,\n rectWidth: number,\n rectHeight: number,\n gap: number,\n childXMax: number = 0,\n ) {\n this._linkElements.push(\n <path\n className={this.styleClassNames.link}\n d={this.createPathLink(parentX, parentY, childX, childY, leaf, rectWidth, rectHeight, gap, childXMax)}\n key={`${nodeId}${this.styleClassNames.link}`}\n />,\n );\n }\n}\n\n// Create child class to Add Tree component based on treeHeight\nclass LayeredTree extends StandardTree {\n public composition: number | undefined;\n private _treeTraversal: number | undefined;\n constructor(\n treeData: ITreeChartDataPoint,\n composition: number | undefined,\n styleClassNames: IProcessedStyleSet<ITreeStyles>,\n _nodeElements: JSX.Element[] = [],\n _linkElements: JSX.Element[] = [],\n _treeTraversal: number | undefined,\n ) {\n super(treeData, styleClassNames, _nodeElements, _linkElements);\n this.composition = composition;\n this._treeTraversal = _treeTraversal;\n }\n public createTree(givenLayoutWidth: number | undefined, screenWidth: number) {\n givenLayoutWidth = givenLayoutWidth! < 65 ? 65 : givenLayoutWidth! > 90 ? 90 : givenLayoutWidth;\n const layoutWidth = givenLayoutWidth || 75;\n const root = hierarchy(this.treeData, d => {\n return d.children;\n });\n\n // Find tree Height\n const treeHeight = root?.height + 1;\n\n // Create tree layout, width: layoutWidth, height: layoutWidth/1.5 and add node separation\n const treeChart = tree()\n .nodeSize([layoutWidth, layoutWidth / 1.5])\n .separation((a, b) => {\n return a.parent === root && b.parent === root ? 3.5 : 1;\n });\n\n // Assigns the x and y position for the nodes\n const treeData = treeChart(root);\n\n // Compute the new tree layout.\n const nodes = treeData.descendants();\n\n // Normalize for fixed-depth and width\n // Normalise y coordinate by depth of each node by a factor of 130\n // Normalise x coordinate by start coordinate 0 with screenSize/3\n nodes.forEach(d => {\n d.y = d.depth === 0 ? 10 : d.depth * 130;\n d.x += screenWidth / 2;\n });\n\n // <------------------ Traversal section ------------------>\n\n // Create tree data structure\n const treeDataStructure: Array<ITreeDataStructure> = [];\n let TreeID: number = 0;\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const createTreeDataStructure = (d: any) => {\n d.id = TreeID;\n treeDataStructure.push({\n id: TreeID,\n children: d.children,\n dataName: d.data.name,\n subName: d.data.subname,\n bodyText: d.data.bodytext,\n metricName: d.data?.metric,\n fill: d.data.fill,\n x: d.x,\n y: d.y,\n parentID: d.parent?.id,\n });\n TreeID++;\n };\n\n this._treeTraversal === 0\n ? root.each(d => {\n createTreeDataStructure(d);\n })\n : root.eachBefore(d => {\n createTreeDataStructure(d);\n });\n\n const rectWidth = layoutWidth * 3;\n const rectHeight = rectWidth / 3.45;\n const gap: number = 20;\n const parentSet = new Set();\n\n for (const d of treeDataStructure) {\n const parentInfo =\n d.id === 0\n ? 'Root Node'\n : `Parent info parentId: ${d.parentID}\n ${treeDataStructure[d.parentID].dataName}\n ${treeDataStructure[d.parentID].subName}`;\n\n // check for leaf nodes\n if (!d.children && !parentSet.has(d.parentID) && treeHeight === 3) {\n const compactNodeWidth = (rectWidth - gap) / 2;\n const compactNodeHeight = rectHeight;\n parentSet.add(d.parentID);\n\n // <------------------ Links section ------------------>\n this.addLinktoSVG(\n d.id,\n treeDataStructure[d.parentID].x,\n treeDataStructure[d.parentID].y,\n treeDataStructure[d.id].x,\n treeDataStructure[d.id].y,\n true,\n rectWidth,\n rectHeight,\n gap,\n );\n\n // <------------------ Nodes section ------------------>\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const children: any = treeDataStructure[d.parentID]?.children;\n\n const compactNodeCenterX1: number = treeDataStructure[d.parentID]?.x - compactNodeWidth / 2 - gap / 2;\n const compactNodeCenterX2: number = treeDataStructure[d.parentID]?.x + compactNodeWidth / 2 + gap / 2;\n const longNodeCenterX: number = treeDataStructure[d.parentID]?.x;\n let dy: number = children[0]?.y;\n\n for (let itr = 0; itr < children.length; ++itr) {\n const child = children[itr];\n\n // Given Composition\n if (this.composition !== undefined) {\n // For compact compostion\n if (this.composition === 0) {\n this.addNodeShapetoSVG(\n child.data.name,\n child.data.subname,\n child.data.bodytext,\n child.data.metricName,\n // If the leaf node count is 1 ,\n //irrespective of provided composition we should always use long composition\n itr % 2 === 0 ? (children.length === 1 ? longNodeCenterX : compactNodeCenterX1) : compactNodeCenterX2,\n dy,\n child.data.fill,\n children.length === 1 ? rectWidth : compactNodeWidth,\n rectHeight,\n child.id,\n parentInfo,\n );\n if (itr % 2 === 1) {\n dy += compactNodeHeight + gap;\n }\n }\n // For long compostion\n else {\n this.addNodeShapetoSVG(\n child.data.name,\n child.data.subname,\n child.data.bodytext,\n child.data.metricName,\n longNodeCenterX,\n dy,\n child.data.fill,\n rectWidth,\n rectHeight,\n child.id,\n parentInfo,\n );\n dy += compactNodeHeight + gap;\n }\n }\n\n // Automatic Node Composition\n else {\n if (children.length > 2) {\n this.addNodeShapetoSVG(\n child.data.name,\n child.data.subname,\n child.data.bodytext,\n child.data.metricName,\n itr % 2 === 0 ? compactNodeCenterX1 : compactNodeCenterX2,\n dy,\n child.data.fill,\n children.length === 1 ? rectWidth : compactNodeWidth,\n rectHeight,\n child.id,\n parentInfo,\n );\n if (itr % 2 === 1) {\n dy += compactNodeHeight + gap;\n }\n } else {\n this.addNodeShapetoSVG(\n child.data.name,\n child.data.subname,\n child.data.bodytext,\n child.data.metricName,\n longNodeCenterX,\n dy,\n child.data.fill,\n rectWidth,\n rectHeight,\n child.id,\n parentInfo,\n );\n dy += compactNodeHeight + gap;\n }\n }\n }\n }\n\n if (d.children || treeHeight <= 2) {\n // <------------------ Nodes section ------------------>\n // Since the height <=2 we will be using long compositon.\n this.addNodeShapetoSVG(\n d.dataName,\n d.subName,\n d.bodyText,\n d.metricName,\n d.x,\n d.y,\n d.fill,\n rectWidth,\n rectHeight,\n d.id,\n parentInfo,\n );\n\n // <------------------ Links section ------------------>\n if (d.id === 0 && d.children) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const children: any = treeDataStructure[d.id]?.children;\n const childXMin = d3Min(children, (child: ITreeDataStructure) => child.x as number)!;\n const childXMax = d3Max(children, (child: ITreeDataStructure) => child.x as number)!;\n this.addLinktoSVG(d.id, d.x, d.y, childXMin, d.children[0].y, false, rectWidth, rectHeight, gap, childXMax);\n }\n }\n }\n }\n}\n\nexport class TreeChartBase extends React.Component<ITreeProps, ITreeState> {\n private _treeData: ITreeChartDataPoint;\n private _width: number;\n private _height: number;\n private _composition: number | undefined;\n private _classNames: IProcessedStyleSet<ITreeStyles>;\n private _margin: { left: number; right: number; top: number; bottom: number };\n private _nodeElements: JSX.Element[] = [];\n private _linkElements: JSX.Element[] = [];\n private _treeTraversal: number | undefined;\n\n constructor(props: ITreeProps) {\n super(props);\n this._margin = { top: 30, right: 20, bottom: 30, left: 50 };\n this._width = this.props.width || 1500;\n this._height = this.props.height || 700;\n this._treeData = this.props.treeData;\n this._composition = this.props?.composition;\n this._treeTraversal = this.props.treeTraversal;\n\n this.state = {\n _width: this._width,\n _height: this._height,\n };\n }\n\n public componentDidMount() {\n const { theme, className, styles } = this.props;\n\n // Get classNames to create component styling\n this._classNames = getClassNames(styles!, {\n theme: theme!,\n className,\n });\n\n // Call createTreeChart function in componentDidMount\n this.createTreeChart();\n\n this.setState({\n _width: this.props.width || 1500,\n _height: this.props.height || 700,\n });\n }\n\n public componentDidUpdate(prevProps: ITreeProps): void {\n if (prevProps.layoutWidth !== this.props.layoutWidth) {\n const svgText = selectAll('text');\n const svgRect = selectAll('rect');\n const svgLink = selectAll('path');\n\n if (this._nodeElements.length === 0 && this._linkElements.length === 0) {\n svgText.remove();\n svgRect.remove();\n svgLink.remove();\n }\n\n this.createTreeChart();\n }\n }\n public createTreeChart() {\n const nodeElements: JSX.Element[] = [];\n const linkElements: JSX.Element[] = [];\n\n // Instantiate inherited class and call createTree function for the object\n const treeObject = new LayeredTree(\n this._treeData,\n this._composition,\n this._classNames,\n nodeElements,\n linkElements,\n this._treeTraversal,\n );\n const width = this.state._width - this._margin.left - this._margin.right;\n treeObject.createTree(this.props.layoutWidth, width);\n this._nodeElements = nodeElements;\n this._linkElements = linkElements;\n }\n\n public render(): JSX.Element {\n return (\n <FocusZone>\n <div className={this._classNames?.root}>\n <svg\n className=\"svgTree\"\n width={this.state._width - this._margin.left - this._margin.right}\n height={this.state._height - this._margin.top - this._margin.bottom}\n >\n <g className=\"svgNode\">{this._nodeElements.map(element => element)}</g>\n <g className=\"svgLink\">{this._linkElements.map(element => element)}</g>\n </svg>\n </div>\n </FocusZone>\n );\n }\n}\n"]}
@@ -0,0 +1,3 @@
1
+ import * as React from 'react';
2
+ import { ITreeProps } from './TreeChart.types';
3
+ export declare const TreeChart: React.FunctionComponent<ITreeProps>;
@@ -0,0 +1,7 @@
1
+ define(["require", "exports", "@fluentui/react/lib/Utilities", "./TreeChart.base", "./TreeChart.styles"], function (require, exports, Utilities_1, TreeChart_base_1, TreeChart_styles_1) {
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.TreeChart = void 0;
5
+ exports.TreeChart = Utilities_1.styled(TreeChart_base_1.TreeChartBase, TreeChart_styles_1.getStyles);
6
+ });
7
+ //# sourceMappingURL=TreeChart.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TreeChart.js","sourceRoot":"../src/","sources":["components/TreeChart/TreeChart.tsx"],"names":[],"mappings":";;;;IAMa,QAAA,SAAS,GAAwC,kBAAM,CAClE,8BAAa,EACb,4BAAS,CACV,CAAC","sourcesContent":["import * as React from 'react';\nimport { styled } from '@fluentui/react/lib/Utilities';\nimport { ITreeStyles, ITreeProps, ITreeStyleProps } from './TreeChart.types';\nimport { TreeChartBase } from './TreeChart.base';\nimport { getStyles } from './TreeChart.styles';\n\nexport const TreeChart: React.FunctionComponent<ITreeProps> = styled<ITreeProps, ITreeStyleProps, ITreeStyles>(\n TreeChartBase,\n getStyles,\n);\n"]}
@@ -0,0 +1,2 @@
1
+ import { ITreeStyleProps, ITreeStyles } from './TreeChart.types';
2
+ export declare const getStyles: (props: ITreeStyleProps) => ITreeStyles;
@@ -0,0 +1,34 @@
1
+ define(["require", "exports", "tslib"], function (require, exports, tslib_1) {
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.getStyles = void 0;
5
+ var getStyles = function (props) {
6
+ return {
7
+ root: [
8
+ props.theme.spacing,
9
+ 'ms-TreeChart',
10
+ props.className,
11
+ {
12
+ overflow: 'scroll',
13
+ },
14
+ ],
15
+ link: {
16
+ fill: 'none',
17
+ stroke: '#A1A1A1',
18
+ strokeWidth: '2px',
19
+ },
20
+ rectNode: {
21
+ strokeWidth: '2px',
22
+ fill: 'white',
23
+ padding: '10px',
24
+ rx: '2px',
25
+ },
26
+ rectText: tslib_1.__assign({ fill: 'black' }, props.theme.fonts.large),
27
+ rectSubText: tslib_1.__assign({ fill: '#484644' }, props.theme.fonts.medium),
28
+ rectBodyText: tslib_1.__assign({ fill: '#808080' }, props.theme.fonts.xSmall),
29
+ rectMetricText: tslib_1.__assign({ fill: '#000000' }, props.theme.fonts.xLarge),
30
+ };
31
+ };
32
+ exports.getStyles = getStyles;
33
+ });
34
+ //# sourceMappingURL=TreeChart.styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TreeChart.styles.js","sourceRoot":"../src/","sources":["components/TreeChart/TreeChart.styles.ts"],"names":[],"mappings":";;;;IAEO,IAAM,SAAS,GAAG,UAAC,KAAsB;QAC9C,OAAO;YACL,IAAI,EAAE;gBACJ,KAAK,CAAC,KAAK,CAAC,OAAO;gBACnB,cAAc;gBACd,KAAK,CAAC,SAAS;gBACf;oBACE,QAAQ,EAAE,QAAQ;iBACnB;aACF;YACD,IAAI,EAAE;gBACJ,IAAI,EAAE,MAAM;gBACZ,MAAM,EAAE,SAAS;gBACjB,WAAW,EAAE,KAAK;aACnB;YACD,QAAQ,EAAE;gBACR,WAAW,EAAE,KAAK;gBAClB,IAAI,EAAE,OAAO;gBACb,OAAO,EAAE,MAAM;gBACf,EAAE,EAAE,KAAK;aACV;YACD,QAAQ,qBACN,IAAI,EAAE,OAAO,IACV,KAAK,CAAC,KAAM,CAAC,KAAK,CAAC,KAAK,CAC5B;YACD,WAAW,qBACT,IAAI,EAAE,SAAS,IACZ,KAAK,CAAC,KAAM,CAAC,KAAK,CAAC,MAAM,CAC7B;YACD,YAAY,qBACV,IAAI,EAAE,SAAS,IACZ,KAAK,CAAC,KAAM,CAAC,KAAK,CAAC,MAAM,CAC7B;YACD,cAAc,qBACZ,IAAI,EAAE,SAAS,IACZ,KAAK,CAAC,KAAM,CAAC,KAAK,CAAC,MAAM,CAC7B;SACF,CAAC;IACJ,CAAC,CAAC;IAtCW,QAAA,SAAS,aAsCpB","sourcesContent":["import { ITreeStyleProps, ITreeStyles } from './TreeChart.types';\n\nexport const getStyles = (props: ITreeStyleProps): ITreeStyles => {\n return {\n root: [\n props.theme.spacing,\n 'ms-TreeChart',\n props.className,\n {\n overflow: 'scroll',\n },\n ],\n link: {\n fill: 'none',\n stroke: '#A1A1A1',\n strokeWidth: '2px',\n },\n rectNode: {\n strokeWidth: '2px',\n fill: 'white',\n padding: '10px',\n rx: '2px',\n },\n rectText: {\n fill: 'black',\n ...props.theme!.fonts.large,\n },\n rectSubText: {\n fill: '#484644',\n ...props.theme!.fonts.medium,\n },\n rectBodyText: {\n fill: '#808080',\n ...props.theme!.fonts.xSmall,\n },\n rectMetricText: {\n fill: '#000000',\n ...props.theme!.fonts.xLarge,\n },\n };\n};\n"]}
@@ -0,0 +1,197 @@
1
+ import { IStyle, ITheme } from '@fluentui/react/lib/Styling';
2
+ import { IStyleFunctionOrObject } from '@fluentui/react/lib/Utilities';
3
+ export interface ITreeChartDataPoint {
4
+ /**
5
+ * Node main text
6
+ */
7
+ name: string;
8
+ /**
9
+ * Subtext value (optional)
10
+ */
11
+ subname?: string;
12
+ /**
13
+ * Bodytext value (optional)
14
+ */
15
+ bodytext?: string;
16
+ /**
17
+ * Metric text value (optional)
18
+ */
19
+ metric?: string;
20
+ /**
21
+ * Color of the rectangular box
22
+ */
23
+ fill: string;
24
+ /**
25
+ * Recursive datastructure for child node object
26
+ */
27
+ children?: Array<ITreeChartDataPoint>;
28
+ }
29
+ export declare enum NodesComposition {
30
+ /**
31
+ * NodeComposition enum val for long: number = 1
32
+ */
33
+ long = 1,
34
+ /**
35
+ * NodeComposition enum val for compact: number = 0
36
+ */
37
+ compact = 0
38
+ }
39
+ export declare enum TreeTraverse {
40
+ /**
41
+ * TreeTraverse enum val for preOrder: number = 1
42
+ */
43
+ preOrder = 1,
44
+ /**
45
+ * TreeTraverse enum val for levelOrder: number = 0
46
+ */
47
+ levelOrder = 0
48
+ }
49
+ export interface ITreeProps {
50
+ /**
51
+ * An object of chart data points for the Tree chart
52
+ */
53
+ treeData: ITreeChartDataPoint;
54
+ /**
55
+ * compostion for three layer chart, long: composition = 1; compact: composition = 0
56
+ */
57
+ composition?: NodesComposition.long | NodesComposition.compact;
58
+ /**
59
+ * Node Width Size for the Tree Layout
60
+ * * @default 75
61
+ */
62
+ layoutWidth?: number;
63
+ /**
64
+ * traversal order for tree chart, preOrder = 1, levelOrder = 0
65
+ */
66
+ treeTraversal?: TreeTraverse.preOrder | TreeTraverse.levelOrder;
67
+ /**
68
+ * Width of SVG tree chart
69
+ * * @default 1500
70
+ */
71
+ width?: number;
72
+ /**
73
+ * Height of SVG tree chart
74
+ * * @default 700
75
+ */
76
+ height?: number;
77
+ /**
78
+ * Margin for the SVG tree chart
79
+ */
80
+ marign?: {
81
+ left: number;
82
+ right: number;
83
+ top: number;
84
+ bottom: number;
85
+ };
86
+ /**
87
+ * Call to provide customized styling that will layer on top of the variant rules.
88
+ */
89
+ styles?: IStyleFunctionOrObject<ITreeStyleProps, ITreeStyles>;
90
+ /**
91
+ * Additional CSS class(es) to apply to the TreeChart.
92
+ */
93
+ className?: string;
94
+ /**
95
+ * Theme (provided through customization.)
96
+ */
97
+ theme?: ITheme;
98
+ }
99
+ export interface ITreeState {
100
+ /**
101
+ * Width of SVG tree chart
102
+ * * @default 1500
103
+ */
104
+ _width: number;
105
+ /**
106
+ * Height of SVG tree chart
107
+ * * @default 700
108
+ */
109
+ _height: number;
110
+ /**
111
+ * Layout Width of SVG tree chart
112
+ * * @default 75
113
+ */
114
+ _layoutWidth?: number;
115
+ }
116
+ export interface ITreeDataStructure {
117
+ /**
118
+ * Node id of each node
119
+ */
120
+ id: number;
121
+ /**
122
+ * Children node object
123
+ */
124
+ children: Array<ITreeDataStructure>;
125
+ /**
126
+ * Node main text
127
+ */
128
+ dataName: string;
129
+ /**
130
+ * Subtext value (optional)
131
+ */
132
+ subName?: string;
133
+ /**
134
+ * Bodytext value (optional)
135
+ */
136
+ bodyText?: string;
137
+ /**
138
+ * Metric text value (optional)
139
+ */
140
+ metricName?: string;
141
+ /**
142
+ * Color of the rectangular box
143
+ */
144
+ fill: string;
145
+ /**
146
+ * X-coordindate of node
147
+ */
148
+ x: number;
149
+ /**
150
+ * Y-coordindate of node
151
+ */
152
+ y: number;
153
+ /**
154
+ * Node id of each node's parent
155
+ */
156
+ parentID: number;
157
+ }
158
+ export interface ITreeStyleProps {
159
+ /**
160
+ * Theme (provided through customization.)
161
+ */
162
+ theme: ITheme;
163
+ /**
164
+ * Additional CSS class(es) to apply to the TreeChart.
165
+ */
166
+ className?: string;
167
+ }
168
+ export interface ITreeStyles {
169
+ /**
170
+ * Style for the root element.
171
+ */
172
+ root: IStyle;
173
+ /**
174
+ * Style for the Link/Path element.
175
+ */
176
+ link: IStyle;
177
+ /**
178
+ * Style for rectangular Node
179
+ */
180
+ rectNode: IStyle;
181
+ /**
182
+ * Style for the node main Text
183
+ */
184
+ rectText: IStyle;
185
+ /**
186
+ * Style for the node sub Text
187
+ */
188
+ rectSubText: IStyle;
189
+ /**
190
+ * Style for the node body Text
191
+ */
192
+ rectBodyText: IStyle;
193
+ /**
194
+ * Style for the node metric value Text
195
+ */
196
+ rectMetricText: IStyle;
197
+ }