@fluentui/react-charts 1.2.0 → 9.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (364) hide show
  1. package/CHANGELOG.md +177 -15
  2. package/LICENSE +11 -17
  3. package/README.md +174 -23
  4. package/dist/index.d.ts +2143 -0
  5. package/lib/CartesianChart.js +1 -0
  6. package/lib/CartesianChart.js.map +1 -0
  7. package/lib/DeclarativeChart.js +1 -0
  8. package/lib/DeclarativeChart.js.map +1 -0
  9. package/lib/DonutChart.js +1 -0
  10. package/lib/DonutChart.js.map +1 -0
  11. package/lib/HorizontalBarChart.js +1 -0
  12. package/lib/HorizontalBarChart.js.map +1 -0
  13. package/lib/Legends.js +1 -0
  14. package/lib/Legends.js.map +1 -0
  15. package/lib/LineChart.js +1 -0
  16. package/lib/LineChart.js.map +1 -0
  17. package/lib/Popover.js +1 -0
  18. package/lib/Popover.js.map +1 -0
  19. package/lib/ResponsiveContainer.js +1 -0
  20. package/lib/ResponsiveContainer.js.map +1 -0
  21. package/lib/Sparkline.js +1 -0
  22. package/lib/Sparkline.js.map +1 -0
  23. package/lib/VerticalBarChart.js +1 -0
  24. package/lib/VerticalBarChart.js.map +1 -0
  25. package/lib/components/CommonComponents/CartesianChart.js +462 -0
  26. package/lib/components/CommonComponents/CartesianChart.js.map +1 -0
  27. package/lib/components/CommonComponents/CartesianChart.types.js +1 -0
  28. package/lib/components/CommonComponents/CartesianChart.types.js.map +1 -0
  29. package/lib/components/CommonComponents/ChartPopover.js +187 -0
  30. package/lib/components/CommonComponents/ChartPopover.js.map +1 -0
  31. package/lib/components/CommonComponents/ChartPopover.types.js +1 -0
  32. package/lib/components/CommonComponents/ChartPopover.types.js.map +1 -0
  33. package/lib/components/CommonComponents/index.js +4 -0
  34. package/lib/components/CommonComponents/index.js.map +1 -0
  35. package/lib/components/CommonComponents/useCartesianChartStyles.styles.js +229 -0
  36. package/lib/components/CommonComponents/useCartesianChartStyles.styles.js.map +1 -0
  37. package/lib/components/CommonComponents/useChartPopoverStyles.styles.js +178 -0
  38. package/lib/components/CommonComponents/useChartPopoverStyles.styles.js.map +1 -0
  39. package/lib/components/DeclarativeChart/DeclarativeChart.js +150 -0
  40. package/lib/components/DeclarativeChart/DeclarativeChart.js.map +1 -0
  41. package/lib/components/DeclarativeChart/PlotlySchema.js +7 -0
  42. package/lib/components/DeclarativeChart/PlotlySchema.js.map +1 -0
  43. package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js +400 -0
  44. package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -0
  45. package/lib/components/DeclarativeChart/imageExporter.js +221 -0
  46. package/lib/components/DeclarativeChart/imageExporter.js.map +1 -0
  47. package/lib/components/DeclarativeChart/index.js +1 -0
  48. package/lib/components/DeclarativeChart/index.js.map +1 -0
  49. package/lib/components/DonutChart/Arc/Arc.js +110 -0
  50. package/lib/components/DonutChart/Arc/Arc.js.map +1 -0
  51. package/lib/components/DonutChart/Arc/Arc.types.js +1 -0
  52. package/lib/components/DonutChart/Arc/Arc.types.js.map +1 -0
  53. package/lib/components/DonutChart/Arc/index.js +2 -0
  54. package/lib/components/DonutChart/Arc/index.js.map +1 -0
  55. package/lib/components/DonutChart/Arc/useArcStyles.styles.js +54 -0
  56. package/lib/components/DonutChart/Arc/useArcStyles.styles.js.map +1 -0
  57. package/lib/components/DonutChart/DonutChart.js +291 -0
  58. package/lib/components/DonutChart/DonutChart.js.map +1 -0
  59. package/lib/components/DonutChart/DonutChart.types.js +1 -0
  60. package/lib/components/DonutChart/DonutChart.types.js.map +1 -0
  61. package/lib/components/DonutChart/Pie/Pie.js +72 -0
  62. package/lib/components/DonutChart/Pie/Pie.js.map +1 -0
  63. package/lib/components/DonutChart/Pie/Pie.types.js +1 -0
  64. package/lib/components/DonutChart/Pie/Pie.types.js.map +1 -0
  65. package/lib/components/DonutChart/Pie/index.js +2 -0
  66. package/lib/components/DonutChart/Pie/index.js.map +1 -0
  67. package/lib/components/DonutChart/Pie/usePieStyles.styles.js +44 -0
  68. package/lib/components/DonutChart/Pie/usePieStyles.styles.js.map +1 -0
  69. package/lib/components/DonutChart/index.js +3 -0
  70. package/lib/components/DonutChart/index.js.map +1 -0
  71. package/lib/components/DonutChart/useDonutChartStyles.styles.js +58 -0
  72. package/lib/components/DonutChart/useDonutChartStyles.styles.js.map +1 -0
  73. package/lib/components/HorizontalBarChart/HorizontalBarChart.js +402 -0
  74. package/lib/components/HorizontalBarChart/HorizontalBarChart.js.map +1 -0
  75. package/lib/components/HorizontalBarChart/HorizontalBarChart.types.js +6 -0
  76. package/lib/components/HorizontalBarChart/HorizontalBarChart.types.js.map +1 -0
  77. package/lib/components/HorizontalBarChart/index.js +3 -0
  78. package/lib/components/HorizontalBarChart/index.js.map +1 -0
  79. package/lib/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.js +163 -0
  80. package/lib/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.js.map +1 -0
  81. package/lib/components/Legends/Legends.js +302 -0
  82. package/lib/components/Legends/Legends.js.map +1 -0
  83. package/lib/components/Legends/Legends.types.js +1 -0
  84. package/lib/components/Legends/Legends.types.js.map +1 -0
  85. package/lib/components/Legends/OverflowMenu.js +25 -0
  86. package/lib/components/Legends/OverflowMenu.js.map +1 -0
  87. package/lib/components/Legends/index.js +3 -0
  88. package/lib/components/Legends/index.js.map +1 -0
  89. package/lib/components/Legends/shape.js +35 -0
  90. package/lib/components/Legends/shape.js.map +1 -0
  91. package/lib/components/Legends/useLegendsStyles.styles.js +147 -0
  92. package/lib/components/Legends/useLegendsStyles.styles.js.map +1 -0
  93. package/lib/components/LineChart/LineChart.js +1026 -0
  94. package/lib/components/LineChart/LineChart.js.map +1 -0
  95. package/lib/components/LineChart/LineChart.types.js +3 -0
  96. package/lib/components/LineChart/LineChart.types.js.map +1 -0
  97. package/lib/components/LineChart/eventAnnotation/EventAnnotation.js +119 -0
  98. package/lib/components/LineChart/eventAnnotation/EventAnnotation.js.map +1 -0
  99. package/lib/components/LineChart/eventAnnotation/LabelLink.js +57 -0
  100. package/lib/components/LineChart/eventAnnotation/LabelLink.js.map +1 -0
  101. package/lib/components/LineChart/eventAnnotation/Textbox.js +40 -0
  102. package/lib/components/LineChart/eventAnnotation/Textbox.js.map +1 -0
  103. package/lib/components/LineChart/index.js +4 -0
  104. package/lib/components/LineChart/index.js.map +1 -0
  105. package/lib/components/LineChart/useLineChartStyles.styles.js +65 -0
  106. package/lib/components/LineChart/useLineChartStyles.styles.js.map +1 -0
  107. package/lib/components/ResponsiveContainer/ResponsiveContainer.js +65 -0
  108. package/lib/components/ResponsiveContainer/ResponsiveContainer.js.map +1 -0
  109. package/lib/components/ResponsiveContainer/ResponsiveContainer.types.js +1 -0
  110. package/lib/components/ResponsiveContainer/ResponsiveContainer.types.js.map +1 -0
  111. package/lib/components/ResponsiveContainer/index.js +1 -0
  112. package/lib/components/ResponsiveContainer/index.js.map +1 -0
  113. package/lib/components/ResponsiveContainer/useResponsiveContainerStyles.styles.js +23 -0
  114. package/lib/components/ResponsiveContainer/useResponsiveContainerStyles.styles.js.map +1 -0
  115. package/lib/components/Sparkline/Sparkline.js +119 -0
  116. package/lib/components/Sparkline/Sparkline.js.map +1 -0
  117. package/lib/components/Sparkline/Sparkline.types.js +4 -0
  118. package/lib/components/Sparkline/Sparkline.types.js.map +1 -0
  119. package/lib/components/Sparkline/index.js +3 -0
  120. package/lib/components/Sparkline/index.js.map +1 -0
  121. package/lib/components/Sparkline/useSparklineStyles.styles.js +49 -0
  122. package/lib/components/Sparkline/useSparklineStyles.styles.js.map +1 -0
  123. package/lib/components/VerticalBarChart/VerticalBarChart.js +849 -0
  124. package/lib/components/VerticalBarChart/VerticalBarChart.js.map +1 -0
  125. package/lib/components/VerticalBarChart/VerticalBarChart.types.js +4 -0
  126. package/lib/components/VerticalBarChart/VerticalBarChart.types.js.map +1 -0
  127. package/lib/components/VerticalBarChart/index.js +3 -0
  128. package/lib/components/VerticalBarChart/index.js.map +1 -0
  129. package/lib/components/VerticalBarChart/useVerticalBarChartStyles.styles.js +74 -0
  130. package/lib/components/VerticalBarChart/useVerticalBarChartStyles.styles.js.map +1 -0
  131. package/lib/index.js +12 -8
  132. package/lib/index.js.map +1 -1
  133. package/lib/types/DataPoint.js +3 -0
  134. package/lib/types/DataPoint.js.map +1 -0
  135. package/lib/types/EventAnnotation.js +1 -0
  136. package/lib/types/EventAnnotation.js.map +1 -0
  137. package/lib/types/LegendDataItem.js +1 -0
  138. package/lib/types/LegendDataItem.js.map +1 -0
  139. package/lib/types/index.js +2 -2
  140. package/lib/types/index.js.map +1 -1
  141. package/lib/utilities/FocusableTooltipText.js +65 -0
  142. package/lib/utilities/FocusableTooltipText.js.map +1 -0
  143. package/lib/utilities/KeyCodes.js +8 -0
  144. package/lib/utilities/KeyCodes.js.map +1 -0
  145. package/lib/utilities/SVGTooltipText.js +138 -0
  146. package/lib/utilities/SVGTooltipText.js.map +1 -0
  147. package/lib/utilities/async-utils.js +380 -0
  148. package/lib/utilities/async-utils.js.map +1 -0
  149. package/lib/utilities/colors.js +249 -0
  150. package/lib/utilities/colors.js.map +1 -0
  151. package/lib/utilities/getWindow.js +25 -0
  152. package/lib/utilities/getWindow.js.map +1 -0
  153. package/lib/utilities/index.js +3 -0
  154. package/lib/utilities/index.js.map +1 -0
  155. package/lib/utilities/locale-util.js +15 -0
  156. package/lib/utilities/locale-util.js.map +1 -0
  157. package/lib/utilities/overflow-utils.js +27 -0
  158. package/lib/utilities/overflow-utils.js.map +1 -0
  159. package/lib/utilities/test-data.js +276 -0
  160. package/lib/utilities/test-data.js.map +1 -0
  161. package/lib/utilities/utilities.js +1215 -0
  162. package/lib/utilities/utilities.js.map +1 -0
  163. package/lib/utilities/vbc-utils.js +27 -0
  164. package/lib/utilities/vbc-utils.js.map +1 -0
  165. package/lib-commonjs/CartesianChart.js +6 -0
  166. package/lib-commonjs/CartesianChart.js.map +1 -0
  167. package/lib-commonjs/DeclarativeChart.js +6 -0
  168. package/lib-commonjs/DeclarativeChart.js.map +1 -0
  169. package/lib-commonjs/DonutChart.js +6 -0
  170. package/lib-commonjs/DonutChart.js.map +1 -0
  171. package/lib-commonjs/HorizontalBarChart.js +6 -0
  172. package/lib-commonjs/HorizontalBarChart.js.map +1 -0
  173. package/lib-commonjs/Legends.js +6 -0
  174. package/lib-commonjs/Legends.js.map +1 -0
  175. package/lib-commonjs/LineChart.js +6 -0
  176. package/lib-commonjs/LineChart.js.map +1 -0
  177. package/lib-commonjs/Popover.js +6 -0
  178. package/lib-commonjs/Popover.js.map +1 -0
  179. package/lib-commonjs/ResponsiveContainer.js +6 -0
  180. package/lib-commonjs/ResponsiveContainer.js.map +1 -0
  181. package/lib-commonjs/Sparkline.js +6 -0
  182. package/lib-commonjs/Sparkline.js.map +1 -0
  183. package/lib-commonjs/VerticalBarChart.js +6 -0
  184. package/lib-commonjs/VerticalBarChart.js.map +1 -0
  185. package/lib-commonjs/components/CommonComponents/CartesianChart.js +469 -0
  186. package/lib-commonjs/components/CommonComponents/CartesianChart.js.map +1 -0
  187. package/lib-commonjs/components/CommonComponents/CartesianChart.types.js +6 -0
  188. package/lib-commonjs/components/CommonComponents/CartesianChart.types.js.map +1 -0
  189. package/lib-commonjs/components/CommonComponents/ChartPopover.js +197 -0
  190. package/lib-commonjs/components/CommonComponents/ChartPopover.js.map +1 -0
  191. package/lib-commonjs/components/CommonComponents/ChartPopover.types.js +4 -0
  192. package/lib-commonjs/components/CommonComponents/ChartPopover.types.js.map +1 -0
  193. package/lib-commonjs/components/CommonComponents/index.js +9 -0
  194. package/lib-commonjs/components/CommonComponents/index.js.map +1 -0
  195. package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.js +356 -0
  196. package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.js.map +1 -0
  197. package/lib-commonjs/components/CommonComponents/useChartPopoverStyles.styles.js +261 -0
  198. package/lib-commonjs/components/CommonComponents/useChartPopoverStyles.styles.js.map +1 -0
  199. package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js +158 -0
  200. package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js.map +1 -0
  201. package/lib-commonjs/components/DeclarativeChart/PlotlySchema.js +10 -0
  202. package/lib-commonjs/components/DeclarativeChart/PlotlySchema.js.map +1 -0
  203. package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js +445 -0
  204. package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -0
  205. package/lib-commonjs/components/DeclarativeChart/imageExporter.js +231 -0
  206. package/lib-commonjs/components/DeclarativeChart/imageExporter.js.map +1 -0
  207. package/lib-commonjs/components/DeclarativeChart/index.js +6 -0
  208. package/lib-commonjs/components/DeclarativeChart/index.js.map +1 -0
  209. package/lib-commonjs/components/DonutChart/Arc/Arc.js +117 -0
  210. package/lib-commonjs/components/DonutChart/Arc/Arc.js.map +1 -0
  211. package/lib-commonjs/components/DonutChart/Arc/Arc.types.js +4 -0
  212. package/lib-commonjs/components/DonutChart/Arc/Arc.types.js.map +1 -0
  213. package/lib-commonjs/components/DonutChart/Arc/index.js +7 -0
  214. package/lib-commonjs/components/DonutChart/Arc/index.js.map +1 -0
  215. package/lib-commonjs/components/DonutChart/Arc/useArcStyles.styles.js +83 -0
  216. package/lib-commonjs/components/DonutChart/Arc/useArcStyles.styles.js.map +1 -0
  217. package/lib-commonjs/components/DonutChart/DonutChart.js +298 -0
  218. package/lib-commonjs/components/DonutChart/DonutChart.js.map +1 -0
  219. package/lib-commonjs/components/DonutChart/DonutChart.types.js +6 -0
  220. package/lib-commonjs/components/DonutChart/DonutChart.types.js.map +1 -0
  221. package/lib-commonjs/components/DonutChart/Pie/Pie.js +79 -0
  222. package/lib-commonjs/components/DonutChart/Pie/Pie.js.map +1 -0
  223. package/lib-commonjs/components/DonutChart/Pie/Pie.types.js +4 -0
  224. package/lib-commonjs/components/DonutChart/Pie/Pie.types.js.map +1 -0
  225. package/lib-commonjs/components/DonutChart/Pie/index.js +7 -0
  226. package/lib-commonjs/components/DonutChart/Pie/index.js.map +1 -0
  227. package/lib-commonjs/components/DonutChart/Pie/usePieStyles.styles.js +61 -0
  228. package/lib-commonjs/components/DonutChart/Pie/usePieStyles.styles.js.map +1 -0
  229. package/lib-commonjs/components/DonutChart/index.js +8 -0
  230. package/lib-commonjs/components/DonutChart/index.js.map +1 -0
  231. package/lib-commonjs/components/DonutChart/useDonutChartStyles.styles.js +82 -0
  232. package/lib-commonjs/components/DonutChart/useDonutChartStyles.styles.js.map +1 -0
  233. package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.js +408 -0
  234. package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.js.map +1 -0
  235. package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.types.js +17 -0
  236. package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.types.js.map +1 -0
  237. package/lib-commonjs/components/HorizontalBarChart/index.js +8 -0
  238. package/lib-commonjs/components/HorizontalBarChart/index.js.map +1 -0
  239. package/lib-commonjs/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.js +251 -0
  240. package/lib-commonjs/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.js.map +1 -0
  241. package/lib-commonjs/components/Legends/Legends.js +313 -0
  242. package/lib-commonjs/components/Legends/Legends.js.map +1 -0
  243. package/lib-commonjs/components/Legends/Legends.types.js +6 -0
  244. package/lib-commonjs/components/Legends/Legends.types.js.map +1 -0
  245. package/lib-commonjs/components/Legends/OverflowMenu.js +36 -0
  246. package/lib-commonjs/components/Legends/OverflowMenu.js.map +1 -0
  247. package/lib-commonjs/components/Legends/index.js +8 -0
  248. package/lib-commonjs/components/Legends/index.js.map +1 -0
  249. package/lib-commonjs/components/Legends/shape.js +46 -0
  250. package/lib-commonjs/components/Legends/shape.js.map +1 -0
  251. package/lib-commonjs/components/Legends/useLegendsStyles.styles.js +304 -0
  252. package/lib-commonjs/components/Legends/useLegendsStyles.styles.js.map +1 -0
  253. package/lib-commonjs/components/LineChart/LineChart.js +1032 -0
  254. package/lib-commonjs/components/LineChart/LineChart.js.map +1 -0
  255. package/lib-commonjs/components/LineChart/LineChart.types.js +6 -0
  256. package/lib-commonjs/components/LineChart/LineChart.types.js.map +1 -0
  257. package/lib-commonjs/components/LineChart/eventAnnotation/EventAnnotation.js +129 -0
  258. package/lib-commonjs/components/LineChart/eventAnnotation/EventAnnotation.js.map +1 -0
  259. package/lib-commonjs/components/LineChart/eventAnnotation/LabelLink.js +68 -0
  260. package/lib-commonjs/components/LineChart/eventAnnotation/LabelLink.js.map +1 -0
  261. package/lib-commonjs/components/LineChart/eventAnnotation/Textbox.js +51 -0
  262. package/lib-commonjs/components/LineChart/eventAnnotation/Textbox.js.map +1 -0
  263. package/lib-commonjs/components/LineChart/index.js +9 -0
  264. package/lib-commonjs/components/LineChart/index.js.map +1 -0
  265. package/lib-commonjs/components/LineChart/useLineChartStyles.styles.js +96 -0
  266. package/lib-commonjs/components/LineChart/useLineChartStyles.styles.js.map +1 -0
  267. package/lib-commonjs/components/ResponsiveContainer/ResponsiveContainer.js +76 -0
  268. package/lib-commonjs/components/ResponsiveContainer/ResponsiveContainer.js.map +1 -0
  269. package/lib-commonjs/components/ResponsiveContainer/ResponsiveContainer.types.js +6 -0
  270. package/lib-commonjs/components/ResponsiveContainer/ResponsiveContainer.types.js.map +1 -0
  271. package/lib-commonjs/components/ResponsiveContainer/index.js +6 -0
  272. package/lib-commonjs/components/ResponsiveContainer/index.js.map +1 -0
  273. package/lib-commonjs/components/ResponsiveContainer/useResponsiveContainerStyles.styles.js +47 -0
  274. package/lib-commonjs/components/ResponsiveContainer/useResponsiveContainerStyles.styles.js.map +1 -0
  275. package/lib-commonjs/components/Sparkline/Sparkline.js +125 -0
  276. package/lib-commonjs/components/Sparkline/Sparkline.js.map +1 -0
  277. package/lib-commonjs/components/Sparkline/Sparkline.types.js +7 -0
  278. package/lib-commonjs/components/Sparkline/Sparkline.types.js.map +1 -0
  279. package/lib-commonjs/components/Sparkline/index.js +8 -0
  280. package/lib-commonjs/components/Sparkline/index.js.map +1 -0
  281. package/lib-commonjs/components/Sparkline/useSparklineStyles.styles.js +77 -0
  282. package/lib-commonjs/components/Sparkline/useSparklineStyles.styles.js.map +1 -0
  283. package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.js +851 -0
  284. package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.js.map +1 -0
  285. package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.types.js +7 -0
  286. package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.types.js.map +1 -0
  287. package/lib-commonjs/components/VerticalBarChart/index.js +8 -0
  288. package/lib-commonjs/components/VerticalBarChart/index.js.map +1 -0
  289. package/lib-commonjs/components/VerticalBarChart/useVerticalBarChartStyles.styles.js +117 -0
  290. package/lib-commonjs/components/VerticalBarChart/useVerticalBarChartStyles.styles.js.map +1 -0
  291. package/lib-commonjs/index.js +17 -0
  292. package/lib-commonjs/index.js.map +1 -0
  293. package/lib-commonjs/types/DataPoint.js +6 -0
  294. package/lib-commonjs/types/DataPoint.js.map +1 -0
  295. package/lib-commonjs/types/EventAnnotation.js +6 -0
  296. package/lib-commonjs/types/EventAnnotation.js.map +1 -0
  297. package/lib-commonjs/types/LegendDataItem.js +4 -0
  298. package/lib-commonjs/types/LegendDataItem.js.map +1 -0
  299. package/lib-commonjs/types/index.js +7 -0
  300. package/lib-commonjs/types/index.js.map +1 -0
  301. package/lib-commonjs/utilities/FocusableTooltipText.js +75 -0
  302. package/lib-commonjs/utilities/FocusableTooltipText.js.map +1 -0
  303. package/lib-commonjs/utilities/KeyCodes.js +18 -0
  304. package/lib-commonjs/utilities/KeyCodes.js.map +1 -0
  305. package/lib-commonjs/utilities/SVGTooltipText.js +148 -0
  306. package/lib-commonjs/utilities/SVGTooltipText.js.map +1 -0
  307. package/lib-commonjs/utilities/async-utils.js +382 -0
  308. package/lib-commonjs/utilities/async-utils.js.map +1 -0
  309. package/lib-commonjs/utilities/colors.js +270 -0
  310. package/lib-commonjs/utilities/colors.js.map +1 -0
  311. package/lib-commonjs/utilities/getWindow.js +28 -0
  312. package/lib-commonjs/utilities/getWindow.js.map +1 -0
  313. package/lib-commonjs/utilities/index.js +8 -0
  314. package/lib-commonjs/utilities/index.js.map +1 -0
  315. package/lib-commonjs/utilities/locale-util.js +25 -0
  316. package/lib-commonjs/utilities/locale-util.js.map +1 -0
  317. package/lib-commonjs/utilities/overflow-utils.js +36 -0
  318. package/lib-commonjs/utilities/overflow-utils.js.map +1 -0
  319. package/lib-commonjs/utilities/test-data.js +324 -0
  320. package/lib-commonjs/utilities/test-data.js.map +1 -0
  321. package/lib-commonjs/utilities/utilities.js +1184 -0
  322. package/lib-commonjs/utilities/utilities.js.map +1 -0
  323. package/lib-commonjs/utilities/vbc-utils.js +45 -0
  324. package/lib-commonjs/utilities/vbc-utils.js.map +1 -0
  325. package/package.json +80 -72
  326. package/CHANGELOG.json +0 -65
  327. package/lib/chart/chart-legend.d.ts +0 -6
  328. package/lib/chart/chart-legend.js +0 -445
  329. package/lib/chart/chart-legend.js.map +0 -1
  330. package/lib/chart/chart-render.d.ts +0 -3
  331. package/lib/chart/chart-render.js +0 -50
  332. package/lib/chart/chart-render.js.map +0 -1
  333. package/lib/chart/chart.d.ts +0 -3
  334. package/lib/chart/chart.js +0 -10
  335. package/lib/chart/chart.js.map +0 -1
  336. package/lib/chart/index.d.ts +0 -1
  337. package/lib/chart/index.js +0 -2
  338. package/lib/chart/index.js.map +0 -1
  339. package/lib/index.d.ts +0 -7
  340. package/lib/lib/builder.d.ts +0 -89
  341. package/lib/lib/builder.js +0 -379
  342. package/lib/lib/builder.js.map +0 -1
  343. package/lib/lib/datasets.d.ts +0 -123
  344. package/lib/lib/datasets.js +0 -285
  345. package/lib/lib/datasets.js.map +0 -1
  346. package/lib/lib/patterns.d.ts +0 -43
  347. package/lib/lib/patterns.js +0 -433
  348. package/lib/lib/patterns.js.map +0 -1
  349. package/lib/lib/plugins.d.ts +0 -11
  350. package/lib/lib/plugins.js +0 -403
  351. package/lib/lib/plugins.js.map +0 -1
  352. package/lib/lib/settings.d.ts +0 -12
  353. package/lib/lib/settings.js +0 -368
  354. package/lib/lib/settings.js.map +0 -1
  355. package/lib/lib/storybook.d.ts +0 -11
  356. package/lib/lib/storybook.js +0 -13
  357. package/lib/lib/storybook.js.map +0 -1
  358. package/lib/lib/utils.d.ts +0 -34
  359. package/lib/lib/utils.js +0 -253
  360. package/lib/lib/utils.js.map +0 -1
  361. package/lib/types/index.d.ts +0 -1
  362. package/lib/types/types.d.ts +0 -101
  363. package/lib/types/types.js +0 -41
  364. package/lib/types/types.js.map +0 -1
@@ -1,368 +0,0 @@
1
- import { __assign } from "tslib";
2
- import { HighContrastColors } from "../types";
3
- import { usNumberFormat, shortTicks } from "./utils";
4
- import "chartjs-plugin-deferred";
5
- var stackedTooltipTitle = function (item, data) {
6
- var total = 0;
7
- if (!item)
8
- return "";
9
- if (!data)
10
- return "";
11
- if (!data.datasets)
12
- return "";
13
- data.datasets.map(function (dataset) {
14
- var value = dataset.data[item[0].index];
15
- if (typeof value === "number") {
16
- return (total += value);
17
- }
18
- });
19
- return ((Number(item[0].yLabel) / total) * 100).toPrecision(2) + "% (" + usNumberFormat(Number(item[0].yLabel)) + ")";
20
- };
21
- export var defaultOptions = {
22
- responsive: true,
23
- maintainAspectRatio: false,
24
- defaultColor: "#C8C6C4",
25
- legend: {
26
- display: false,
27
- custom: true,
28
- },
29
- animation: {
30
- duration: 1000,
31
- },
32
- layout: {
33
- padding: {
34
- left: 0,
35
- right: 16,
36
- top: 0,
37
- bottom: 0,
38
- },
39
- },
40
- elements: {
41
- line: {
42
- tension: 0.4,
43
- },
44
- },
45
- hover: {
46
- mode: "dataset",
47
- intersect: false,
48
- },
49
- tooltips: {
50
- yPadding: 12,
51
- xPadding: 20,
52
- caretPadding: 10,
53
- // Tooltip Title
54
- titleFontStyle: "200",
55
- titleFontSize: 20,
56
- // Tooltip Body
57
- bodySpacing: 4,
58
- bodyFontSize: 11.5,
59
- bodyFontStyle: "400",
60
- // Tooltip Footer
61
- footerFontStyle: "300",
62
- footerFontSize: 10,
63
- backgroundColor: "rgba(0, 0, 0, 0.88)",
64
- callbacks: {
65
- title: function (tooltipItems) {
66
- var value = tooltipItems[0].yLabel;
67
- return typeof value === "number" && value > 999
68
- ? usNumberFormat(value)
69
- : value;
70
- },
71
- label: function (tooltipItem, data) {
72
- return data.datasets[tooltipItem.datasetIndex].label;
73
- },
74
- footer: function (tooltipItems) {
75
- var value = tooltipItems[0].xLabel;
76
- return typeof value === "number" && value > 999
77
- ? usNumberFormat(value)
78
- : value;
79
- },
80
- },
81
- },
82
- scales: {
83
- xAxes: [
84
- {
85
- ticks: {
86
- fontSize: 10,
87
- padding: 0,
88
- maxRotation: 0,
89
- minRotation: 0,
90
- callback: shortTicks,
91
- fontColor: "#605E5C",
92
- },
93
- gridLines: {
94
- borderDash: [5, 9999],
95
- zeroLineBorderDash: [5, 9999],
96
- color: "#E1DFDD",
97
- },
98
- },
99
- ],
100
- yAxes: [
101
- {
102
- ticks: {
103
- callback: shortTicks,
104
- fontSize: 10,
105
- padding: -16,
106
- labelOffset: 10,
107
- maxTicksLimit: 5,
108
- fontColor: "#605E5C",
109
- },
110
- gridLines: {
111
- lineWidth: 1,
112
- drawBorder: false,
113
- drawTicks: true,
114
- tickMarkLength: 44,
115
- zeroLineColor: "#E1DFDD",
116
- color: "#E1DFDD",
117
- },
118
- },
119
- ],
120
- },
121
- plugins: {
122
- deferred: {
123
- delay: 150,
124
- },
125
- },
126
- };
127
- export var highContrastOptions = {
128
- highContrastMode: true,
129
- defaultColor: HighContrastColors.Foreground,
130
- tooltips: {
131
- backgroundColor: HighContrastColors.Background,
132
- borderColor: HighContrastColors.Active,
133
- multiKeyBackground: "transparent",
134
- titleFontColor: HighContrastColors.Foreground,
135
- bodyFontColor: HighContrastColors.Foreground,
136
- footerFontColor: HighContrastColors.Foreground,
137
- borderWidth: 2,
138
- displayColors: false,
139
- },
140
- hover: {
141
- mode: "dataset",
142
- intersect: false,
143
- },
144
- scales: {
145
- xAxes: [
146
- {
147
- ticks: {
148
- fontColor: HighContrastColors.Foreground,
149
- },
150
- },
151
- ],
152
- yAxes: [
153
- {
154
- ticks: {
155
- fontColor: HighContrastColors.Foreground,
156
- },
157
- gridLines: {
158
- zeroLineColor: "rgba(255,255,255, .3)",
159
- color: "rgba(255,255,255, .3)",
160
- },
161
- },
162
- ],
163
- },
164
- };
165
- export var stackedLineOptions = {
166
- scales: {
167
- yAxes: [
168
- {
169
- stacked: true,
170
- },
171
- ],
172
- },
173
- tooltips: {
174
- callbacks: {
175
- title: stackedTooltipTitle,
176
- labelColor: function (tooltipItem, chart) {
177
- return {
178
- borderColor: "transparent",
179
- backgroundColor: chart.config.data.datasets[tooltipItem.datasetIndex]
180
- .backgroundColor,
181
- };
182
- },
183
- },
184
- },
185
- };
186
- export var trendLineOptions = {
187
- hover: {
188
- mode: "nearest",
189
- intersect: false,
190
- },
191
- legend: {
192
- display: false,
193
- custom: false,
194
- },
195
- layout: {
196
- padding: {
197
- left: -40,
198
- right: 0,
199
- top: 0,
200
- bottom: 0,
201
- },
202
- },
203
- scales: {
204
- xAxes: [
205
- {
206
- ticks: {
207
- display: false,
208
- },
209
- gridLines: {
210
- display: false,
211
- },
212
- },
213
- ],
214
- yAxes: [
215
- {
216
- ticks: {
217
- display: false,
218
- },
219
- gridLines: {
220
- display: false,
221
- },
222
- },
223
- ],
224
- },
225
- plugins: {
226
- deferred: {
227
- xOffset: 150,
228
- yOffset: "100%",
229
- delay: 150,
230
- },
231
- },
232
- };
233
- export var barOptions = {
234
- hover: {
235
- mode: "nearest",
236
- intersect: false,
237
- },
238
- scales: {
239
- xAxes: [
240
- {
241
- gridLines: {
242
- offsetGridLines: false,
243
- },
244
- },
245
- ],
246
- },
247
- };
248
- export var pieOptions = {
249
- layout: {
250
- padding: {
251
- top: 32,
252
- right: 32,
253
- bottom: 32,
254
- left: -16,
255
- },
256
- },
257
- hover: {
258
- mode: "point",
259
- intersect: false,
260
- },
261
- scales: {
262
- xAxes: [
263
- {
264
- ticks: {
265
- display: false,
266
- },
267
- gridLines: {
268
- display: false,
269
- },
270
- },
271
- ],
272
- yAxes: [
273
- {
274
- ticks: {
275
- display: false,
276
- },
277
- gridLines: {
278
- display: false,
279
- },
280
- },
281
- ],
282
- },
283
- tooltips: {
284
- callbacks: {
285
- title: function (tooltipItems, data) {
286
- return ((Number(data.datasets[0].data[tooltipItems[0].index]) /
287
- data.datasets[0].data.reduce(function (a, b) { return a + b; })) *
288
- 100).toPrecision(2) + "% (" + usNumberFormat(Number(data.datasets[0].data[tooltipItems[0].index])) + ")";
289
- },
290
- label: function (tooltipItem, data) { return data.labels[tooltipItem.index]; },
291
- },
292
- },
293
- };
294
- export var doughnutOptions = __assign({ cutoutPercentage: 70 }, pieOptions);
295
- export var groupedBarOptions = {
296
- scales: {
297
- xAxes: [
298
- {
299
- gridLines: {
300
- offsetGridLines: true,
301
- },
302
- },
303
- ],
304
- },
305
- };
306
- export var stackedBarOptions = {
307
- hover: {
308
- mode: "nearest",
309
- intersect: false,
310
- },
311
- scales: {
312
- xAxes: [
313
- {
314
- stacked: true,
315
- gridLines: {
316
- offsetGridLines: false,
317
- },
318
- },
319
- ],
320
- yAxes: [{ stacked: true }],
321
- },
322
- tooltips: {
323
- callbacks: {
324
- title: stackedTooltipTitle,
325
- },
326
- },
327
- };
328
- export var horizontalBarOptions = {
329
- layout: {
330
- padding: {
331
- top: -6,
332
- left: -32,
333
- },
334
- },
335
- hover: {
336
- mode: "index",
337
- intersect: false,
338
- },
339
- scales: {
340
- xAxes: [
341
- {
342
- ticks: {
343
- display: false,
344
- },
345
- gridLines: {
346
- display: false,
347
- },
348
- },
349
- ],
350
- yAxes: [
351
- {
352
- ticks: {
353
- mirror: true,
354
- padding: 0,
355
- callback: function (v) { return v; },
356
- labelOffset: 26,
357
- },
358
- gridLines: {
359
- display: false,
360
- },
361
- },
362
- ],
363
- },
364
- tooltips: {
365
- position: "nearest",
366
- },
367
- };
368
- //# sourceMappingURL=settings.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"settings.js","sourceRoot":"","sources":["../../src/lib/settings.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,kBAAkB,EAAiB,MAAM,UAAU,CAAC;AAC7D,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrD,OAAO,yBAAyB,CAAC;AAEjC,IAAM,mBAAmB,GAAG,UAC1B,IAA8B,EAC9B,IAAqB;IAErB,IAAI,KAAK,GAAG,CAAC,CAAC;IACd,IAAI,CAAC,IAAI;QAAE,OAAO,EAAE,CAAC;IACrB,IAAI,CAAC,IAAI;QAAE,OAAO,EAAE,CAAC;IACrB,IAAI,CAAC,IAAI,CAAC,QAAQ;QAAE,OAAO,EAAE,CAAC;IAC9B,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,UAAC,OAAsB;QACvC,IAAM,KAAK,GAAG,OAAQ,CAAC,IAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,KAAM,CAAC,CAAC;QAC7C,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;YAC7B,OAAO,CAAC,KAAK,IAAI,KAAK,CAAC,CAAC;SACzB;IACH,CAAC,CAAC,CAAC;IACH,OAAU,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,KAAK,CAAC,GAAG,GAAG,CAAC,CAAC,WAAW,CAC5D,CAAC,CACF,WAAM,cAAc,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,MAAG,CAAC;AACnD,CAAC,CAAC;AAEF,MAAM,CAAC,IAAM,cAAc,GAAkB;IAC3C,UAAU,EAAE,IAAI;IAChB,mBAAmB,EAAE,KAAK;IAC1B,YAAY,EAAE,SAAS;IACvB,MAAM,EAAE;QACN,OAAO,EAAE,KAAK;QACd,MAAM,EAAE,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C,IAAM,oBAAoB,GAAkB;IACjD,MAAM,EAAE;QACN,OAAO,EAAE;YACP,GAAG,EAAE,CAAC,CAAC;YACP,IAAI,EAAE,CAAC,EAAE;SACV;KACF;IACD,KAAK,EAAE;QACL,IAAI,EAAE,OAAO;QACb,SAAS,EAAE,KAAK;KACjB;IACD,MAAM,EAAE;QACN,KAAK,EAAE;YACL;gBACE,KAAK,EAAE;oBACL,OAAO,EAAE,KAAK;iBACf;gBACD,SAAS,EAAE;oBACT,OAAO,EAAE,KAAK;iBACf;aACF;SACF;QACD,KAAK,EAAE;YACL;gBACE,KAAK,EAAE;oBACL,MAAM,EAAE,IAAI;oBACZ,OAAO,EAAE,CAAC;oBACV,QAAQ,EAAE,UAAC,CAAS,IAAK,OAAA,CAAC,EAAD,CAAC;oBAC1B,WAAW,EAAE,EAAE;iBAChB;gBACD,SAAS,EAAE;oBACT,OAAO,EAAE,KAAK;iBACf;aACF;SACF;KACF;IACD,QAAQ,EAAE;QACR,QAAQ,EAAE,SAAS;KACpB;CACF,CAAC"}
@@ -1,11 +0,0 @@
1
- import { StoryFn } from "@storybook/addons";
2
- import { ReactNode } from "react";
3
- export interface IChartsProvider {
4
- children: ReactNode;
5
- }
6
- export declare const ChartsProvider: ({ children }: IChartsProvider) => JSX.Element;
7
- export interface IStorybookThemeProviderProps {
8
- children: ReactNode;
9
- }
10
- export declare const StorybookThemeProvider: ({ children, }: IStorybookThemeProviderProps) => JSX.Element;
11
- export declare const withStorybookTheme: (storyFn: StoryFn<any>) => JSX.Element;
@@ -1,13 +0,0 @@
1
- import React from "react";
2
- export var ChartsProvider = function (_a) {
3
- var children = _a.children;
4
- return (React.createElement(React.Fragment, null,
5
- React.createElement("style", null, "\n canvas {\n border-radius: 3px;\n transition: box-shadow .05s .1s ease-out;\n }\n canvas:focus {\n outline: none;\n box-shadow: inset 0 0 0 2px #232323;\n }\n "),
6
- children));
7
- };
8
- export var StorybookThemeProvider = function (_a) {
9
- var children = _a.children;
10
- return React.createElement(ChartsProvider, null, children);
11
- };
12
- export var withStorybookTheme = function (storyFn) { return (React.createElement(StorybookThemeProvider, null, storyFn())); };
13
- //# sourceMappingURL=storybook.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"storybook.js","sourceRoot":"","sources":["../../src/lib/storybook.tsx"],"names":[],"mappings":"AACA,OAAO,KAAoB,MAAM,OAAO,CAAC;AAMzC,MAAM,CAAC,IAAM,cAAc,GAAG,UAAC,EAA6B;QAA3B,QAAQ,cAAA;IACvC,OAAO,CACL;QACE,mCACG,0PASA,CACK;QACP,QAAQ,CACR,CACJ,CAAC;AACJ,CAAC,CAAC;AAMF,MAAM,CAAC,IAAM,sBAAsB,GAAG,UAAC,EAER;QAD7B,QAAQ,cAAA;IAC0B,OAAA,oBAAC,cAAc,QAAE,QAAQ,CAAkB;AAA3C,CAA2C,CAAC;AAEhF,MAAM,CAAC,IAAM,kBAAkB,GAAG,UAAC,OAAqB,IAAK,OAAA,CAC3D,oBAAC,sBAAsB,QAAE,OAAO,EAAE,CAA0B,CAC7D,EAF4D,CAE5D,CAAC"}
@@ -1,34 +0,0 @@
1
- /// <reference types="chart.js" />
2
- export declare const PI: number;
3
- export declare const HALF_PI: number;
4
- export declare const QUARTER_PI: number;
5
- export declare const TWO_THIRDS_PI: number;
6
- export declare const random: (min: number, max: number) => number;
7
- export declare const shortTicks: (value: number | string) => string;
8
- export declare const hexToRgb: (hex: string) => string | null;
9
- export declare const getRgbValues: (color: string) => string | string[] | null | undefined;
10
- export declare const usNumberFormat: (value: number | string) => string;
11
- export declare function isHCThemeApplied(chart: any): boolean;
12
- export declare function showTooltipOnKayboard({ chart, setIndex, selectedPointIndex, }: {
13
- chart: Chart;
14
- setIndex: number;
15
- selectedPointIndex: number;
16
- }): void;
17
- export declare const tooltipConfig: () => {
18
- yPadding: number;
19
- xPadding: number;
20
- caretPadding: number;
21
- titleFontStyle: string;
22
- titleFontSize: number;
23
- bodySpacing: number;
24
- bodyFontSize: number;
25
- bodyFontStyle: string;
26
- footerFontStyle: string;
27
- footerFontSize: number;
28
- callbacks: {
29
- title: (tooltipItems: any) => any;
30
- label: (tooltipItem: any, data: any) => any;
31
- footer: (tooltipItems: any) => any;
32
- };
33
- };
34
- export declare const deepMerge: (target: any, source: any, isMergingArrays?: boolean) => any;
package/lib/lib/utils.js DELETED
@@ -1,253 +0,0 @@
1
- import { __assign } from "tslib";
2
- import { ChartTypes, HighContrastColors } from "../types";
3
- import { buildPattern } from "./patterns";
4
- import { LineDataSetHCStyle, LineStackedDataSetHCStyle } from "./datasets";
5
- export var PI = Math.PI;
6
- export var HALF_PI = PI / 2;
7
- export var QUARTER_PI = PI / 4;
8
- export var TWO_THIRDS_PI = (PI * 2) / 3;
9
- export var random = function (min, max) {
10
- return Math.round(Math.random() * (max - min) + min);
11
- };
12
- // TODO: Localization
13
- var suffixes = ["K", "M", "G", "T", "P", "E"];
14
- export var shortTicks = function (value) {
15
- if (typeof value === "number") {
16
- if (value < 1000) {
17
- return String(value);
18
- }
19
- var exp = Math.floor(Math.log(Number(value)) / Math.log(1000));
20
- value = "" + Number(value) / Math.pow(1000, exp) + suffixes[exp - 1];
21
- // There is no support for label aligment in Chart.js,
22
- // to be able align axis labels by left (right is by default)
23
- // add an additional spaces depends on label length
24
- switch (value.length) {
25
- case 2:
26
- return value + " ";
27
- case 1:
28
- return value + " ";
29
- case 3:
30
- default:
31
- return value;
32
- }
33
- }
34
- else {
35
- return value;
36
- }
37
- };
38
- export var hexToRgb = function (hex) {
39
- if (hex.length < 6) {
40
- hex = "#" + hex[1] + hex[1] + hex[2] + hex[2] + hex[3] + hex[3];
41
- }
42
- var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
43
- return result
44
- ? parseInt(result[1], 16) + ", " + parseInt(result[2], 16) + ", " + parseInt(result[3], 16)
45
- : null;
46
- };
47
- export var getRgbValues = function (color) {
48
- if (color.indexOf("#")) {
49
- return hexToRgb(color);
50
- }
51
- if (color.indexOf("rgba")) {
52
- return color
53
- .substring(5, color.length - 1)
54
- .replace(/ /g, "")
55
- .split(",");
56
- }
57
- if (color.indexOf("rgb")) {
58
- return color
59
- .substring(4, color.length - 1)
60
- .replace(/ /g, "")
61
- .split(",");
62
- }
63
- };
64
- export var usNumberFormat = function (value) {
65
- return String(value)
66
- .split("")
67
- .reverse()
68
- .join("")
69
- .replace(/(\d{3})/g, "$1,")
70
- .replace(/\,$/, "")
71
- .split("")
72
- .reverse()
73
- .join("");
74
- };
75
- export function isHCThemeApplied(chart) {
76
- return (typeof chart.data.datasets[0].backgroundColor !== "string" ||
77
- chart.data.datasets[0].borderDash);
78
- }
79
- export function showTooltipOnKayboard(_a) {
80
- var _b;
81
- var chart = _a.chart, setIndex = _a.setIndex, selectedPointIndex = _a.selectedPointIndex;
82
- var _c = chart.config, type = _c.type, data = _c.data, options = _c.options;
83
- var datasets = data.datasets;
84
- if (type === ChartTypes.Line ||
85
- !((_b = chart.config.options) === null || _b === void 0 ? void 0 : _b.scales).yAxes[0].stacked) {
86
- var duplicates_1 = [];
87
- var segments_1 = [];
88
- var fakeSet_1 = new LineDataSetHCStyle({});
89
- datasets.filter(function (dataset, i) {
90
- if (dataset.data[selectedPointIndex] ===
91
- data.datasets[setIndex].data[selectedPointIndex]) {
92
- duplicates_1.push(i);
93
- }
94
- if (options.highContrastMode) {
95
- datasets[i].borderColor = fakeSet_1.borderColor;
96
- datasets[i].borderWidth = fakeSet_1.borderWidth;
97
- if (typeof datasets[i].backgroundColor !== "string") {
98
- datasets[i].backgroundColor = buildPattern(__assign({ backgroundColor: HighContrastColors.Background, patternColor: fakeSet_1.borderColor }, datasets[i].pattern));
99
- }
100
- }
101
- });
102
- duplicates_1.forEach(function (segmentId) {
103
- segments_1.push(chart.getDatasetMeta(segmentId).data[selectedPointIndex]);
104
- if (options.highContrastMode) {
105
- datasets[segmentId].borderColor = fakeSet_1.hoverBorderColor;
106
- datasets[segmentId].borderWidth = fakeSet_1.hoverBorderWidth;
107
- if (typeof datasets[segmentId].backgroundColor !== "string") {
108
- datasets[segmentId].backgroundColor = buildPattern(__assign({ backgroundColor: HighContrastColors.Background, patternColor: fakeSet_1.hoverBorderColor }, datasets[segmentId].pattern));
109
- }
110
- }
111
- });
112
- if (options.highContrastMode) {
113
- chart.update();
114
- }
115
- chart.tooltip._active = segments_1;
116
- }
117
- else {
118
- var fakeSet_2 = new LineStackedDataSetHCStyle({});
119
- var segment = chart.getDatasetMeta(setIndex).data[selectedPointIndex];
120
- chart.tooltip._active = [segment];
121
- if (options.highContrastMode) {
122
- datasets.map(function (dataset, i) {
123
- if (dataset.pattern) {
124
- dataset.borderColor = fakeSet_2.borderColor;
125
- dataset.borderWidth = fakeSet_2.borderWidth;
126
- dataset.backgroundColor = buildPattern(__assign({ backgroundColor: HighContrastColors.Background, patternColor: fakeSet_2.borderColor }, dataset.pattern));
127
- }
128
- });
129
- datasets[setIndex].borderColor = fakeSet_2.hoverBorderColor;
130
- datasets[setIndex].borderWidth = fakeSet_2.hoverBorderWidth;
131
- datasets[setIndex].backgroundColor = datasets[setIndex].backgroundColor = buildPattern(__assign({ backgroundColor: HighContrastColors.Background, patternColor: fakeSet_2.hoverBorderColor }, datasets[setIndex].pattern));
132
- }
133
- }
134
- chart.update();
135
- chart.tooltip.update();
136
- chart.draw();
137
- }
138
- // export const setTooltipColorScheme = ({
139
- // chart,
140
- // siteVariables,
141
- // chartDataPointColors,
142
- // patterns,
143
- // verticalDataAlignment,
144
- // }: {
145
- // chart: Chart;
146
- // siteVariables: SiteVariablesPrepared;
147
- // chartDataPointColors: string[];
148
- // patterns?: IChartPatterns;
149
- // verticalDataAlignment?: boolean;
150
- // }) => {
151
- // const { colorScheme } = siteVariables;
152
- // chart.options.tooltips = {
153
- // ...chart.options.tooltips,
154
- // borderColor: colorScheme.default.borderHover,
155
- // multiKeyBackground: colorScheme.white.foreground,
156
- // titleFontColor: colorScheme.default.foreground3,
157
- // bodyFontColor: colorScheme.default.foreground3,
158
- // footerFontColor: colorScheme.default.foreground3,
159
- // // callbacks: {
160
- // // ...chart.options.tooltips?.callbacks,
161
- // // labelColor:
162
- // // patterns && theme === ChartTheme.HighContrast
163
- // // ? (tooltipItem: any) => ({
164
- // // borderColor: "transparent",
165
- // // backgroundColor: buildPattern({
166
- // // ...patterns(colorScheme)[
167
- // // verticalDataAlignment
168
- // // ? tooltipItem.index
169
- // // : tooltipItem.datasetIndex
170
- // // ],
171
- // // backgroundColor: colorScheme.default.background,
172
- // // patternColor: colorScheme.default.borderHover,
173
- // // }) as any,
174
- // // })
175
- // // : (tooltipItem: any) => ({
176
- // // borderColor: "transparent",
177
- // // backgroundColor:
178
- // // chartDataPointColors[
179
- // // verticalDataAlignment
180
- // // ? tooltipItem.index
181
- // // : tooltipItem.datasetIndex
182
- // // ],
183
- // // }),
184
- // // },
185
- // };
186
- // // if (siteVariables.theme === ChartTheme.HighContrast) {
187
- // // (chart as any).options.scales.yAxes[0].gridLines.lineWidth = 0.25;
188
- // // } else {
189
- // // (chart as any).options.scales.yAxes[0].gridLines.lineWidth = 1;
190
- // // }
191
- // };
192
- export var tooltipConfig = function () { return ({
193
- yPadding: 12,
194
- xPadding: 20,
195
- caretPadding: 10,
196
- // Tooltip Title
197
- titleFontStyle: "200",
198
- titleFontSize: 20,
199
- // Tooltip Body
200
- bodySpacing: 4,
201
- bodyFontSize: 11.5,
202
- bodyFontStyle: "400",
203
- // Tooltip Footer
204
- footerFontStyle: "300",
205
- footerFontSize: 10,
206
- callbacks: {
207
- title: function (tooltipItems) {
208
- var value = tooltipItems[0].yLabel;
209
- return typeof value === "number" && value > 999
210
- ? usNumberFormat(value)
211
- : value;
212
- },
213
- label: function (tooltipItem, data) {
214
- return data.datasets[tooltipItem.datasetIndex].label;
215
- },
216
- footer: function (tooltipItems) {
217
- var value = tooltipItems[0].xLabel;
218
- return typeof value === "number" && value > 999
219
- ? usNumberFormat(value)
220
- : value;
221
- },
222
- },
223
- }); };
224
- export var deepMerge = function (target, source, isMergingArrays) {
225
- if (isMergingArrays === void 0) { isMergingArrays = true; }
226
- target = (function (obj) { return Object.assign({}, obj); })(target);
227
- var isObject = function (obj) { return obj && typeof obj === "object"; };
228
- if (!isObject(target) || !isObject(source))
229
- return source;
230
- Object.keys(source).forEach(function (key) {
231
- var targetValue = target[key];
232
- var sourceValue = source[key];
233
- if (Array.isArray(targetValue) && Array.isArray(sourceValue))
234
- if (isMergingArrays) {
235
- target[key] = targetValue.map(function (x, i) {
236
- return sourceValue.length <= i
237
- ? x
238
- : deepMerge(x, sourceValue[i], isMergingArrays);
239
- });
240
- if (sourceValue.length > targetValue.length)
241
- target[key] = target[key].concat(sourceValue.slice(targetValue.length));
242
- }
243
- else {
244
- target[key] = targetValue.concat(sourceValue);
245
- }
246
- else if (isObject(targetValue) && isObject(sourceValue))
247
- target[key] = deepMerge(Object.assign({}, targetValue), sourceValue, isMergingArrays);
248
- else
249
- target[key] = sourceValue;
250
- });
251
- return target;
252
- };
253
- //# sourceMappingURL=utils.js.map