@fluentui/react-charts 9.1.10 → 9.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (405) hide show
  1. package/CHANGELOG.md +41 -2
  2. package/dist/index.d.ts +44 -3
  3. package/lib/AreaChart.js.map +1 -1
  4. package/lib/CartesianChart.js.map +1 -1
  5. package/lib/DeclarativeChart.js.map +1 -1
  6. package/lib/DonutChart.js.map +1 -1
  7. package/lib/FunnelChart.js.map +1 -1
  8. package/lib/GanttChart.js.map +1 -1
  9. package/lib/GaugeChart.js.map +1 -1
  10. package/lib/GroupedVerticalBarChart.js.map +1 -1
  11. package/lib/HeatMapChart.js.map +1 -1
  12. package/lib/HorizontalBarChart.js.map +1 -1
  13. package/lib/HorizontalBarChartWithAxis.js.map +1 -1
  14. package/lib/Legends.js.map +1 -1
  15. package/lib/LineChart.js.map +1 -1
  16. package/lib/Popover.js.map +1 -1
  17. package/lib/ResponsiveContainer.js.map +1 -1
  18. package/lib/SankeyChart.js.map +1 -1
  19. package/lib/ScatterChart.js.map +1 -1
  20. package/lib/Sparkline.js.map +1 -1
  21. package/lib/VerticalBarChart.js.map +1 -1
  22. package/lib/VerticalStackedBarChart.js.map +1 -1
  23. package/lib/components/AreaChart/AreaChart.js +11 -3
  24. package/lib/components/AreaChart/AreaChart.js.map +1 -1
  25. package/lib/components/AreaChart/AreaChart.types.js.map +1 -1
  26. package/lib/components/AreaChart/index.js.map +1 -1
  27. package/lib/components/AreaChart/useAreaChartStyles.styles.js +1 -2
  28. package/lib/components/AreaChart/useAreaChartStyles.styles.raw.js +41 -0
  29. package/lib/components/AreaChart/useAreaChartStyles.styles.raw.js.map +1 -0
  30. package/lib/components/CommonComponents/CartesianChart.js +2 -1
  31. package/lib/components/CommonComponents/CartesianChart.js.map +1 -1
  32. package/lib/components/CommonComponents/CartesianChart.types.js.map +1 -1
  33. package/lib/components/CommonComponents/ChartPopover.js.map +1 -1
  34. package/lib/components/CommonComponents/ChartPopover.types.js.map +1 -1
  35. package/lib/components/CommonComponents/index.js.map +1 -1
  36. package/lib/components/CommonComponents/useCartesianChartStyles.styles.js +1 -2
  37. package/lib/components/CommonComponents/useCartesianChartStyles.styles.raw.js +128 -0
  38. package/lib/components/CommonComponents/useCartesianChartStyles.styles.raw.js.map +1 -0
  39. package/lib/components/CommonComponents/useChartPopoverStyles.styles.js +1 -2
  40. package/lib/components/CommonComponents/useChartPopoverStyles.styles.raw.js +126 -0
  41. package/lib/components/CommonComponents/useChartPopoverStyles.styles.raw.js.map +1 -0
  42. package/lib/components/DeclarativeChart/DeclarativeChart.js +15 -7
  43. package/lib/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
  44. package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js +90 -29
  45. package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
  46. package/lib/components/DeclarativeChart/imageExporter.js +1 -0
  47. package/lib/components/DeclarativeChart/imageExporter.js.map +1 -1
  48. package/lib/components/DeclarativeChart/index.js.map +1 -1
  49. package/lib/components/DonutChart/Arc/Arc.js.map +1 -1
  50. package/lib/components/DonutChart/Arc/Arc.types.js.map +1 -1
  51. package/lib/components/DonutChart/Arc/index.js.map +1 -1
  52. package/lib/components/DonutChart/Arc/useArcStyles.styles.js +1 -2
  53. package/lib/components/DonutChart/Arc/useArcStyles.styles.raw.js +44 -0
  54. package/lib/components/DonutChart/Arc/useArcStyles.styles.raw.js.map +1 -0
  55. package/lib/components/DonutChart/DonutChart.js +11 -3
  56. package/lib/components/DonutChart/DonutChart.js.map +1 -1
  57. package/lib/components/DonutChart/DonutChart.types.js.map +1 -1
  58. package/lib/components/DonutChart/Pie/Pie.js.map +1 -1
  59. package/lib/components/DonutChart/Pie/Pie.types.js.map +1 -1
  60. package/lib/components/DonutChart/Pie/index.js.map +1 -1
  61. package/lib/components/DonutChart/Pie/usePieStyles.styles.js +1 -2
  62. package/lib/components/DonutChart/Pie/usePieStyles.styles.raw.js +29 -0
  63. package/lib/components/DonutChart/Pie/usePieStyles.styles.raw.js.map +1 -0
  64. package/lib/components/DonutChart/index.js.map +1 -1
  65. package/lib/components/DonutChart/useDonutChartStyles.styles.js +1 -2
  66. package/lib/components/DonutChart/useDonutChartStyles.styles.raw.js +45 -0
  67. package/lib/components/DonutChart/useDonutChartStyles.styles.raw.js.map +1 -0
  68. package/lib/components/FunnelChart/FunnelChart.js +10 -1
  69. package/lib/components/FunnelChart/FunnelChart.js.map +1 -1
  70. package/lib/components/FunnelChart/FunnelChart.types.js.map +1 -1
  71. package/lib/components/FunnelChart/funnelGeometry.js.map +1 -1
  72. package/lib/components/FunnelChart/index.js.map +1 -1
  73. package/lib/components/FunnelChart/useFunnelChartStyles.styles.js +1 -2
  74. package/lib/components/FunnelChart/useFunnelChartStyles.styles.raw.js +51 -0
  75. package/lib/components/FunnelChart/useFunnelChartStyles.styles.raw.js.map +1 -0
  76. package/lib/components/GanttChart/GanttChart.js +19 -2
  77. package/lib/components/GanttChart/GanttChart.js.map +1 -1
  78. package/lib/components/GanttChart/GanttChart.types.js.map +1 -1
  79. package/lib/components/GanttChart/index.js.map +1 -1
  80. package/lib/components/GanttChart/useGanttChartStyles.styles.js +1 -2
  81. package/lib/components/GanttChart/useGanttChartStyles.styles.raw.js +23 -0
  82. package/lib/components/GanttChart/useGanttChartStyles.styles.raw.js.map +1 -0
  83. package/lib/components/GaugeChart/GaugeChart.js +9 -2
  84. package/lib/components/GaugeChart/GaugeChart.js.map +1 -1
  85. package/lib/components/GaugeChart/GaugeChart.types.js.map +1 -1
  86. package/lib/components/GaugeChart/index.js.map +1 -1
  87. package/lib/components/GaugeChart/useGaugeChartStyles.styles.js +1 -2
  88. package/lib/components/GaugeChart/useGaugeChartStyles.styles.raw.js +142 -0
  89. package/lib/components/GaugeChart/useGaugeChartStyles.styles.raw.js.map +1 -0
  90. package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js +70 -58
  91. package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js.map +1 -1
  92. package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.types.js.map +1 -1
  93. package/lib/components/GroupedVerticalBarChart/index.js.map +1 -1
  94. package/lib/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.js +1 -2
  95. package/lib/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.raw.js +53 -0
  96. package/lib/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.raw.js.map +1 -0
  97. package/lib/components/HeatMapChart/HeatMapChart.js +11 -3
  98. package/lib/components/HeatMapChart/HeatMapChart.js.map +1 -1
  99. package/lib/components/HeatMapChart/HeatMapChart.types.js.map +1 -1
  100. package/lib/components/HeatMapChart/index.js.map +1 -1
  101. package/lib/components/HeatMapChart/useHeatMapChartStyles.styles.js +1 -2
  102. package/lib/components/HeatMapChart/useHeatMapChartStyles.styles.raw.js +38 -0
  103. package/lib/components/HeatMapChart/useHeatMapChartStyles.styles.raw.js.map +1 -0
  104. package/lib/components/HorizontalBarChart/HorizontalBarChart.js +23 -26
  105. package/lib/components/HorizontalBarChart/HorizontalBarChart.js.map +1 -1
  106. package/lib/components/HorizontalBarChart/HorizontalBarChart.types.js.map +1 -1
  107. package/lib/components/HorizontalBarChart/index.js.map +1 -1
  108. package/lib/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.js +1 -2
  109. package/lib/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.raw.js +120 -0
  110. package/lib/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.raw.js.map +1 -0
  111. package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js +9 -2
  112. package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js.map +1 -1
  113. package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.types.js.map +1 -1
  114. package/lib/components/HorizontalBarChartWithAxis/index.js.map +1 -1
  115. package/lib/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.js +1 -2
  116. package/lib/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.raw.js +39 -0
  117. package/lib/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.raw.js.map +1 -0
  118. package/lib/components/Legends/Legends.js +28 -10
  119. package/lib/components/Legends/Legends.js.map +1 -1
  120. package/lib/components/Legends/Legends.types.js.map +1 -1
  121. package/lib/components/Legends/OverflowMenu.js.map +1 -1
  122. package/lib/components/Legends/index.js.map +1 -1
  123. package/lib/components/Legends/shape.js.map +1 -1
  124. package/lib/components/Legends/useLegendsStyles.styles.js +57 -14
  125. package/lib/components/Legends/useLegendsStyles.styles.js.map +1 -1
  126. package/lib/components/Legends/useLegendsStyles.styles.raw.js +138 -0
  127. package/lib/components/Legends/useLegendsStyles.styles.raw.js.map +1 -0
  128. package/lib/components/LineChart/LineChart.js +9 -2
  129. package/lib/components/LineChart/LineChart.js.map +1 -1
  130. package/lib/components/LineChart/LineChart.types.js.map +1 -1
  131. package/lib/components/LineChart/eventAnnotation/EventAnnotation.js.map +1 -1
  132. package/lib/components/LineChart/eventAnnotation/LabelLink.js.map +1 -1
  133. package/lib/components/LineChart/eventAnnotation/Textbox.js.map +1 -1
  134. package/lib/components/LineChart/index.js.map +1 -1
  135. package/lib/components/LineChart/useLineChartStyles.styles.js +1 -2
  136. package/lib/components/LineChart/useLineChartStyles.styles.raw.js +52 -0
  137. package/lib/components/LineChart/useLineChartStyles.styles.raw.js.map +1 -0
  138. package/lib/components/ResponsiveContainer/ResponsiveContainer.js.map +1 -1
  139. package/lib/components/ResponsiveContainer/ResponsiveContainer.types.js.map +1 -1
  140. package/lib/components/ResponsiveContainer/index.js.map +1 -1
  141. package/lib/components/ResponsiveContainer/useResponsiveChildStyles.styles.js +1 -2
  142. package/lib/components/ResponsiveContainer/useResponsiveChildStyles.styles.raw.js +28 -0
  143. package/lib/components/ResponsiveContainer/useResponsiveChildStyles.styles.raw.js.map +1 -0
  144. package/lib/components/ResponsiveContainer/withResponsiveContainer.js.map +1 -1
  145. package/lib/components/SankeyChart/SankeyChart.js +5 -1
  146. package/lib/components/SankeyChart/SankeyChart.js.map +1 -1
  147. package/lib/components/SankeyChart/SankeyChart.types.js.map +1 -1
  148. package/lib/components/SankeyChart/index.js.map +1 -1
  149. package/lib/components/SankeyChart/useSankeyChartStyles.styles.js +1 -2
  150. package/lib/components/SankeyChart/useSankeyChartStyles.styles.raw.js +77 -0
  151. package/lib/components/SankeyChart/useSankeyChartStyles.styles.raw.js.map +1 -0
  152. package/lib/components/ScatterChart/ScatterChart.js +11 -3
  153. package/lib/components/ScatterChart/ScatterChart.js.map +1 -1
  154. package/lib/components/ScatterChart/ScatterChart.types.js.map +1 -1
  155. package/lib/components/ScatterChart/index.js.map +1 -1
  156. package/lib/components/ScatterChart/useScatterChartStyles.styles.js +1 -2
  157. package/lib/components/ScatterChart/useScatterChartStyles.styles.raw.js +43 -0
  158. package/lib/components/ScatterChart/useScatterChartStyles.styles.raw.js.map +1 -0
  159. package/lib/components/Sparkline/Sparkline.js.map +1 -1
  160. package/lib/components/Sparkline/Sparkline.types.js.map +1 -1
  161. package/lib/components/Sparkline/index.js.map +1 -1
  162. package/lib/components/Sparkline/useSparklineStyles.styles.js +1 -2
  163. package/lib/components/Sparkline/useSparklineStyles.styles.raw.js +30 -0
  164. package/lib/components/Sparkline/useSparklineStyles.styles.raw.js.map +1 -0
  165. package/lib/components/VerticalBarChart/VerticalBarChart.js +62 -28
  166. package/lib/components/VerticalBarChart/VerticalBarChart.js.map +1 -1
  167. package/lib/components/VerticalBarChart/VerticalBarChart.types.js.map +1 -1
  168. package/lib/components/VerticalBarChart/index.js.map +1 -1
  169. package/lib/components/VerticalBarChart/useVerticalBarChartStyles.styles.js +1 -2
  170. package/lib/components/VerticalBarChart/useVerticalBarChartStyles.styles.raw.js +58 -0
  171. package/lib/components/VerticalBarChart/useVerticalBarChartStyles.styles.raw.js.map +1 -0
  172. package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.js +22 -8
  173. package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.js.map +1 -1
  174. package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.types.js.map +1 -1
  175. package/lib/components/VerticalStackedBarChart/index.js.map +1 -1
  176. package/lib/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.js +1 -2
  177. package/lib/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.raw.js +49 -0
  178. package/lib/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.raw.js.map +1 -0
  179. package/lib/index.js.map +1 -1
  180. package/lib/types/DataPoint.js.map +1 -1
  181. package/lib/types/EventAnnotation.js.map +1 -1
  182. package/lib/types/LegendDataItem.js.map +1 -1
  183. package/lib/types/index.js.map +1 -1
  184. package/lib/utilities/FocusableTooltipText.js.map +1 -1
  185. package/lib/utilities/KeyCodes.js.map +1 -1
  186. package/lib/utilities/SVGTooltipText.js +2 -0
  187. package/lib/utilities/SVGTooltipText.js.map +1 -1
  188. package/lib/utilities/async-utils.js.map +1 -1
  189. package/lib/utilities/colors.js.map +1 -1
  190. package/lib/utilities/getWindow.js.map +1 -1
  191. package/lib/utilities/image-export-utils.js +256 -0
  192. package/lib/utilities/image-export-utils.js.map +1 -0
  193. package/lib/utilities/index.js.map +1 -1
  194. package/lib/utilities/overflow-utils.js.map +1 -1
  195. package/lib/utilities/string.js.map +1 -1
  196. package/lib/utilities/test-data.js.map +1 -1
  197. package/lib/utilities/utilities.js +50 -5
  198. package/lib/utilities/utilities.js.map +1 -1
  199. package/lib/utilities/vbc-utils.js.map +1 -1
  200. package/lib-commonjs/AreaChart.js.map +1 -1
  201. package/lib-commonjs/CartesianChart.js.map +1 -1
  202. package/lib-commonjs/DeclarativeChart.js.map +1 -1
  203. package/lib-commonjs/DonutChart.js.map +1 -1
  204. package/lib-commonjs/FunnelChart.js.map +1 -1
  205. package/lib-commonjs/GanttChart.js.map +1 -1
  206. package/lib-commonjs/GaugeChart.js.map +1 -1
  207. package/lib-commonjs/GroupedVerticalBarChart.js.map +1 -1
  208. package/lib-commonjs/HeatMapChart.js.map +1 -1
  209. package/lib-commonjs/HorizontalBarChart.js.map +1 -1
  210. package/lib-commonjs/HorizontalBarChartWithAxis.js.map +1 -1
  211. package/lib-commonjs/Legends.js.map +1 -1
  212. package/lib-commonjs/LineChart.js.map +1 -1
  213. package/lib-commonjs/Popover.js.map +1 -1
  214. package/lib-commonjs/ResponsiveContainer.js.map +1 -1
  215. package/lib-commonjs/SankeyChart.js.map +1 -1
  216. package/lib-commonjs/ScatterChart.js.map +1 -1
  217. package/lib-commonjs/Sparkline.js.map +1 -1
  218. package/lib-commonjs/VerticalBarChart.js.map +1 -1
  219. package/lib-commonjs/VerticalStackedBarChart.js.map +1 -1
  220. package/lib-commonjs/components/AreaChart/AreaChart.js +10 -2
  221. package/lib-commonjs/components/AreaChart/AreaChart.js.map +1 -1
  222. package/lib-commonjs/components/AreaChart/AreaChart.types.js.map +1 -1
  223. package/lib-commonjs/components/AreaChart/index.js.map +1 -1
  224. package/lib-commonjs/components/AreaChart/useAreaChartStyles.styles.js +1 -1
  225. package/lib-commonjs/components/AreaChart/useAreaChartStyles.styles.js.map +1 -1
  226. package/lib-commonjs/components/AreaChart/useAreaChartStyles.styles.raw.js +57 -0
  227. package/lib-commonjs/components/AreaChart/useAreaChartStyles.styles.raw.js.map +1 -0
  228. package/lib-commonjs/components/CommonComponents/CartesianChart.js +2 -1
  229. package/lib-commonjs/components/CommonComponents/CartesianChart.js.map +1 -1
  230. package/lib-commonjs/components/CommonComponents/CartesianChart.types.js.map +1 -1
  231. package/lib-commonjs/components/CommonComponents/ChartPopover.js.map +1 -1
  232. package/lib-commonjs/components/CommonComponents/ChartPopover.types.js.map +1 -1
  233. package/lib-commonjs/components/CommonComponents/index.js.map +1 -1
  234. package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.js +1 -1
  235. package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.js.map +1 -1
  236. package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.raw.js +142 -0
  237. package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.raw.js.map +1 -0
  238. package/lib-commonjs/components/CommonComponents/useChartPopoverStyles.styles.js +1 -1
  239. package/lib-commonjs/components/CommonComponents/useChartPopoverStyles.styles.js.map +1 -1
  240. package/lib-commonjs/components/CommonComponents/useChartPopoverStyles.styles.raw.js +140 -0
  241. package/lib-commonjs/components/CommonComponents/useChartPopoverStyles.styles.raw.js.map +1 -0
  242. package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js +14 -6
  243. package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
  244. package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js +93 -29
  245. package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
  246. package/lib-commonjs/components/DeclarativeChart/imageExporter.js +1 -0
  247. package/lib-commonjs/components/DeclarativeChart/imageExporter.js.map +1 -1
  248. package/lib-commonjs/components/DeclarativeChart/index.js.map +1 -1
  249. package/lib-commonjs/components/DonutChart/Arc/Arc.js.map +1 -1
  250. package/lib-commonjs/components/DonutChart/Arc/Arc.types.js.map +1 -1
  251. package/lib-commonjs/components/DonutChart/Arc/index.js.map +1 -1
  252. package/lib-commonjs/components/DonutChart/Arc/useArcStyles.styles.js +1 -1
  253. package/lib-commonjs/components/DonutChart/Arc/useArcStyles.styles.js.map +1 -1
  254. package/lib-commonjs/components/DonutChart/Arc/useArcStyles.styles.raw.js +58 -0
  255. package/lib-commonjs/components/DonutChart/Arc/useArcStyles.styles.raw.js.map +1 -0
  256. package/lib-commonjs/components/DonutChart/DonutChart.js +10 -2
  257. package/lib-commonjs/components/DonutChart/DonutChart.js.map +1 -1
  258. package/lib-commonjs/components/DonutChart/DonutChart.types.js.map +1 -1
  259. package/lib-commonjs/components/DonutChart/Pie/Pie.js.map +1 -1
  260. package/lib-commonjs/components/DonutChart/Pie/Pie.types.js.map +1 -1
  261. package/lib-commonjs/components/DonutChart/Pie/index.js.map +1 -1
  262. package/lib-commonjs/components/DonutChart/Pie/usePieStyles.styles.js +1 -1
  263. package/lib-commonjs/components/DonutChart/Pie/usePieStyles.styles.raw.js +43 -0
  264. package/lib-commonjs/components/DonutChart/Pie/usePieStyles.styles.raw.js.map +1 -0
  265. package/lib-commonjs/components/DonutChart/index.js.map +1 -1
  266. package/lib-commonjs/components/DonutChart/useDonutChartStyles.styles.js +1 -1
  267. package/lib-commonjs/components/DonutChart/useDonutChartStyles.styles.raw.js +59 -0
  268. package/lib-commonjs/components/DonutChart/useDonutChartStyles.styles.raw.js.map +1 -0
  269. package/lib-commonjs/components/FunnelChart/FunnelChart.js +10 -1
  270. package/lib-commonjs/components/FunnelChart/FunnelChart.js.map +1 -1
  271. package/lib-commonjs/components/FunnelChart/FunnelChart.types.js.map +1 -1
  272. package/lib-commonjs/components/FunnelChart/funnelGeometry.js.map +1 -1
  273. package/lib-commonjs/components/FunnelChart/index.js.map +1 -1
  274. package/lib-commonjs/components/FunnelChart/useFunnelChartStyles.styles.js +1 -1
  275. package/lib-commonjs/components/FunnelChart/useFunnelChartStyles.styles.js.map +1 -1
  276. package/lib-commonjs/components/FunnelChart/useFunnelChartStyles.styles.raw.js +65 -0
  277. package/lib-commonjs/components/FunnelChart/useFunnelChartStyles.styles.raw.js.map +1 -0
  278. package/lib-commonjs/components/GanttChart/GanttChart.js +18 -1
  279. package/lib-commonjs/components/GanttChart/GanttChart.js.map +1 -1
  280. package/lib-commonjs/components/GanttChart/GanttChart.types.js.map +1 -1
  281. package/lib-commonjs/components/GanttChart/index.js.map +1 -1
  282. package/lib-commonjs/components/GanttChart/useGanttChartStyles.styles.js +1 -1
  283. package/lib-commonjs/components/GanttChart/useGanttChartStyles.styles.raw.js +39 -0
  284. package/lib-commonjs/components/GanttChart/useGanttChartStyles.styles.raw.js.map +1 -0
  285. package/lib-commonjs/components/GaugeChart/GaugeChart.js +9 -2
  286. package/lib-commonjs/components/GaugeChart/GaugeChart.js.map +1 -1
  287. package/lib-commonjs/components/GaugeChart/GaugeChart.types.js.map +1 -1
  288. package/lib-commonjs/components/GaugeChart/index.js.map +1 -1
  289. package/lib-commonjs/components/GaugeChart/useGaugeChartStyles.styles.js +1 -1
  290. package/lib-commonjs/components/GaugeChart/useGaugeChartStyles.styles.js.map +1 -1
  291. package/lib-commonjs/components/GaugeChart/useGaugeChartStyles.styles.raw.js +160 -0
  292. package/lib-commonjs/components/GaugeChart/useGaugeChartStyles.styles.raw.js.map +1 -0
  293. package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js +70 -58
  294. package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js.map +1 -1
  295. package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.types.js.map +1 -1
  296. package/lib-commonjs/components/GroupedVerticalBarChart/index.js.map +1 -1
  297. package/lib-commonjs/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.js +1 -1
  298. package/lib-commonjs/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.raw.js +69 -0
  299. package/lib-commonjs/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.raw.js.map +1 -0
  300. package/lib-commonjs/components/HeatMapChart/HeatMapChart.js +10 -2
  301. package/lib-commonjs/components/HeatMapChart/HeatMapChart.js.map +1 -1
  302. package/lib-commonjs/components/HeatMapChart/HeatMapChart.types.js.map +1 -1
  303. package/lib-commonjs/components/HeatMapChart/index.js.map +1 -1
  304. package/lib-commonjs/components/HeatMapChart/useHeatMapChartStyles.styles.js +1 -1
  305. package/lib-commonjs/components/HeatMapChart/useHeatMapChartStyles.styles.raw.js +56 -0
  306. package/lib-commonjs/components/HeatMapChart/useHeatMapChartStyles.styles.raw.js.map +1 -0
  307. package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.js +23 -26
  308. package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.js.map +1 -1
  309. package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.types.js.map +1 -1
  310. package/lib-commonjs/components/HorizontalBarChart/index.js.map +1 -1
  311. package/lib-commonjs/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.js +1 -1
  312. package/lib-commonjs/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.raw.js +134 -0
  313. package/lib-commonjs/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.raw.js.map +1 -0
  314. package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js +9 -2
  315. package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js.map +1 -1
  316. package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.types.js.map +1 -1
  317. package/lib-commonjs/components/HorizontalBarChartWithAxis/index.js.map +1 -1
  318. package/lib-commonjs/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.js +1 -1
  319. package/lib-commonjs/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.raw.js +55 -0
  320. package/lib-commonjs/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.raw.js.map +1 -0
  321. package/lib-commonjs/components/Legends/Legends.js +28 -10
  322. package/lib-commonjs/components/Legends/Legends.js.map +1 -1
  323. package/lib-commonjs/components/Legends/Legends.types.js.map +1 -1
  324. package/lib-commonjs/components/Legends/OverflowMenu.js.map +1 -1
  325. package/lib-commonjs/components/Legends/index.js.map +1 -1
  326. package/lib-commonjs/components/Legends/shape.js.map +1 -1
  327. package/lib-commonjs/components/Legends/useLegendsStyles.styles.js +101 -28
  328. package/lib-commonjs/components/Legends/useLegendsStyles.styles.js.map +1 -1
  329. package/lib-commonjs/components/Legends/useLegendsStyles.styles.raw.js +174 -0
  330. package/lib-commonjs/components/Legends/useLegendsStyles.styles.raw.js.map +1 -0
  331. package/lib-commonjs/components/LineChart/LineChart.js +9 -2
  332. package/lib-commonjs/components/LineChart/LineChart.js.map +1 -1
  333. package/lib-commonjs/components/LineChart/LineChart.types.js.map +1 -1
  334. package/lib-commonjs/components/LineChart/eventAnnotation/EventAnnotation.js.map +1 -1
  335. package/lib-commonjs/components/LineChart/eventAnnotation/LabelLink.js.map +1 -1
  336. package/lib-commonjs/components/LineChart/eventAnnotation/Textbox.js.map +1 -1
  337. package/lib-commonjs/components/LineChart/index.js.map +1 -1
  338. package/lib-commonjs/components/LineChart/useLineChartStyles.styles.js +1 -1
  339. package/lib-commonjs/components/LineChart/useLineChartStyles.styles.raw.js +66 -0
  340. package/lib-commonjs/components/LineChart/useLineChartStyles.styles.raw.js.map +1 -0
  341. package/lib-commonjs/components/ResponsiveContainer/ResponsiveContainer.js.map +1 -1
  342. package/lib-commonjs/components/ResponsiveContainer/ResponsiveContainer.types.js.map +1 -1
  343. package/lib-commonjs/components/ResponsiveContainer/index.js.map +1 -1
  344. package/lib-commonjs/components/ResponsiveContainer/useResponsiveChildStyles.styles.js +1 -1
  345. package/lib-commonjs/components/ResponsiveContainer/useResponsiveChildStyles.styles.raw.js +46 -0
  346. package/lib-commonjs/components/ResponsiveContainer/useResponsiveChildStyles.styles.raw.js.map +1 -0
  347. package/lib-commonjs/components/ResponsiveContainer/withResponsiveContainer.js.map +1 -1
  348. package/lib-commonjs/components/SankeyChart/SankeyChart.js +5 -1
  349. package/lib-commonjs/components/SankeyChart/SankeyChart.js.map +1 -1
  350. package/lib-commonjs/components/SankeyChart/SankeyChart.types.js.map +1 -1
  351. package/lib-commonjs/components/SankeyChart/index.js.map +1 -1
  352. package/lib-commonjs/components/SankeyChart/useSankeyChartStyles.styles.js +1 -1
  353. package/lib-commonjs/components/SankeyChart/useSankeyChartStyles.styles.js.map +1 -1
  354. package/lib-commonjs/components/SankeyChart/useSankeyChartStyles.styles.raw.js +95 -0
  355. package/lib-commonjs/components/SankeyChart/useSankeyChartStyles.styles.raw.js.map +1 -0
  356. package/lib-commonjs/components/ScatterChart/ScatterChart.js +10 -2
  357. package/lib-commonjs/components/ScatterChart/ScatterChart.js.map +1 -1
  358. package/lib-commonjs/components/ScatterChart/ScatterChart.types.js.map +1 -1
  359. package/lib-commonjs/components/ScatterChart/index.js.map +1 -1
  360. package/lib-commonjs/components/ScatterChart/useScatterChartStyles.styles.js +1 -1
  361. package/lib-commonjs/components/ScatterChart/useScatterChartStyles.styles.raw.js +57 -0
  362. package/lib-commonjs/components/ScatterChart/useScatterChartStyles.styles.raw.js.map +1 -0
  363. package/lib-commonjs/components/Sparkline/Sparkline.js.map +1 -1
  364. package/lib-commonjs/components/Sparkline/Sparkline.types.js.map +1 -1
  365. package/lib-commonjs/components/Sparkline/index.js.map +1 -1
  366. package/lib-commonjs/components/Sparkline/useSparklineStyles.styles.js +1 -1
  367. package/lib-commonjs/components/Sparkline/useSparklineStyles.styles.raw.js +44 -0
  368. package/lib-commonjs/components/Sparkline/useSparklineStyles.styles.raw.js.map +1 -0
  369. package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.js +62 -28
  370. package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.js.map +1 -1
  371. package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.types.js.map +1 -1
  372. package/lib-commonjs/components/VerticalBarChart/index.js.map +1 -1
  373. package/lib-commonjs/components/VerticalBarChart/useVerticalBarChartStyles.styles.js +1 -1
  374. package/lib-commonjs/components/VerticalBarChart/useVerticalBarChartStyles.styles.raw.js +74 -0
  375. package/lib-commonjs/components/VerticalBarChart/useVerticalBarChartStyles.styles.raw.js.map +1 -0
  376. package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.js +22 -8
  377. package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.js.map +1 -1
  378. package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.types.js.map +1 -1
  379. package/lib-commonjs/components/VerticalStackedBarChart/index.js.map +1 -1
  380. package/lib-commonjs/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.js +1 -1
  381. package/lib-commonjs/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.js.map +1 -1
  382. package/lib-commonjs/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.raw.js +67 -0
  383. package/lib-commonjs/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.raw.js.map +1 -0
  384. package/lib-commonjs/index.js.map +1 -1
  385. package/lib-commonjs/types/DataPoint.js.map +1 -1
  386. package/lib-commonjs/types/EventAnnotation.js.map +1 -1
  387. package/lib-commonjs/types/LegendDataItem.js.map +1 -1
  388. package/lib-commonjs/types/index.js.map +1 -1
  389. package/lib-commonjs/utilities/FocusableTooltipText.js.map +1 -1
  390. package/lib-commonjs/utilities/KeyCodes.js.map +1 -1
  391. package/lib-commonjs/utilities/SVGTooltipText.js +2 -0
  392. package/lib-commonjs/utilities/SVGTooltipText.js.map +1 -1
  393. package/lib-commonjs/utilities/async-utils.js.map +1 -1
  394. package/lib-commonjs/utilities/colors.js.map +1 -1
  395. package/lib-commonjs/utilities/getWindow.js.map +1 -1
  396. package/lib-commonjs/utilities/image-export-utils.js +274 -0
  397. package/lib-commonjs/utilities/image-export-utils.js.map +1 -0
  398. package/lib-commonjs/utilities/index.js.map +1 -1
  399. package/lib-commonjs/utilities/overflow-utils.js.map +1 -1
  400. package/lib-commonjs/utilities/string.js.map +1 -1
  401. package/lib-commonjs/utilities/test-data.js.map +1 -1
  402. package/lib-commonjs/utilities/utilities.js +56 -5
  403. package/lib-commonjs/utilities/utilities.js.map +1 -1
  404. package/lib-commonjs/utilities/vbc-utils.js.map +1 -1
  405. package/package.json +12 -22
@@ -0,0 +1,274 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ function _export(target, all) {
6
+ for(var name in all)Object.defineProperty(target, name, {
7
+ enumerable: true,
8
+ get: all[name]
9
+ });
10
+ }
11
+ _export(exports, {
12
+ cloneLegendsToSVG: function() {
13
+ return cloneLegendsToSVG;
14
+ },
15
+ toImage: function() {
16
+ return toImage;
17
+ }
18
+ });
19
+ const _d3selection = require("d3-selection");
20
+ const _index = require("./index");
21
+ const _useLegendsStylesstyles = require("../components/Legends/useLegendsStyles.styles");
22
+ function toImage(chartContainer, legendsToSvgCallback, isRTL = false, opts = {}) {
23
+ return new Promise((resolve, reject)=>{
24
+ if (!chartContainer) {
25
+ return reject(new Error('Chart container is not defined'));
26
+ }
27
+ try {
28
+ const background = typeof opts.background === 'string' ? (0, _index.resolveCSSVariables)(chartContainer, opts.background) : 'transparent';
29
+ const svg = toSVG(chartContainer, legendsToSvgCallback, isRTL, background);
30
+ if (!svg.node) {
31
+ return reject(new Error('SVG node is null'));
32
+ }
33
+ let svgData = new XMLSerializer().serializeToString(svg.node);
34
+ // This node is already detached from the DOM, so there's no need to call remove() on it.
35
+ // Just clear the reference.
36
+ svg.node = null;
37
+ let svgDataUrl = 'data:image/svg+xml;base64,' + btoa(unescapePonyfill(encodeURIComponent(svgData)));
38
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
39
+ svgData = null;
40
+ svgToPng(svgDataUrl, {
41
+ width: opts.width || svg.width,
42
+ height: opts.height || svg.height,
43
+ scale: opts.scale
44
+ }).then(resolve).catch(reject);
45
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
46
+ svgDataUrl = null;
47
+ } catch (err) {
48
+ return reject(err);
49
+ }
50
+ });
51
+ }
52
+ const SVG_STYLE_PROPERTIES = [
53
+ 'display',
54
+ 'fill',
55
+ 'fill-opacity',
56
+ 'opacity',
57
+ 'stroke',
58
+ 'stroke-width',
59
+ 'transform',
60
+ 'border-collapse'
61
+ ];
62
+ const SVG_TEXT_STYLE_PROPERTIES = [
63
+ 'font-family',
64
+ 'font-size',
65
+ 'font-weight',
66
+ 'text-anchor',
67
+ 'background-color',
68
+ 'color',
69
+ 'padding',
70
+ 'text-align',
71
+ 'border'
72
+ ];
73
+ function toSVG(chartContainer, legendsToSvgCallback, isRTL, background) {
74
+ const svg = chartContainer.querySelector('svg');
75
+ if (!svg) {
76
+ throw new Error('SVG not found');
77
+ }
78
+ let clonedSvg = (0, _d3selection.select)(svg.cloneNode(true)).attr('width', null).attr('height', null).attr('viewBox', null);
79
+ let svgElements = svg.getElementsByTagName('*');
80
+ let clonedSvgElements = clonedSvg.node().getElementsByTagName('*');
81
+ const TEXT_ELEMENTS = [
82
+ 'text'
83
+ ];
84
+ const TABLE_ELEMENTS = [
85
+ 'table',
86
+ 'thead',
87
+ 'tbody',
88
+ 'tr',
89
+ 'th',
90
+ 'td'
91
+ ];
92
+ for(let i = 0; i < svgElements.length; i++){
93
+ const tag = svgElements[i].tagName.toLowerCase();
94
+ if (TEXT_ELEMENTS.includes(tag) || TABLE_ELEMENTS.includes(tag)) {
95
+ (0, _index.copyStyle)([
96
+ ...SVG_STYLE_PROPERTIES,
97
+ ...SVG_TEXT_STYLE_PROPERTIES
98
+ ], svgElements[i], clonedSvgElements[i]);
99
+ } else {
100
+ (0, _index.copyStyle)(SVG_STYLE_PROPERTIES, svgElements[i], clonedSvgElements[i]);
101
+ }
102
+ }
103
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
104
+ svgElements = null;
105
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
106
+ clonedSvgElements = null;
107
+ const { width: svgWidth, height: svgHeight } = svg.getBoundingClientRect();
108
+ const legendGroup = typeof legendsToSvgCallback === 'function' ? legendsToSvgCallback(svgWidth, isRTL) : {
109
+ node: null,
110
+ width: 0,
111
+ height: 0
112
+ };
113
+ const w1 = Math.max(svgWidth, legendGroup.width);
114
+ const h1 = svgHeight + legendGroup.height;
115
+ if (legendGroup.node) {
116
+ (0, _d3selection.select)(legendGroup.node).attr('transform', `translate(0, ${svgHeight})`);
117
+ clonedSvg.append(()=>legendGroup.node);
118
+ }
119
+ clonedSvg.insert('rect', ':first-child').attr('x', 0).attr('y', 0).attr('width', w1).attr('height', h1).attr('fill', background);
120
+ clonedSvg.attr('width', w1).attr('height', h1).attr('viewBox', `0 0 ${w1} ${h1}`).attr('direction', isRTL ? 'rtl' : 'ltr');
121
+ const result = {
122
+ node: clonedSvg.node(),
123
+ width: w1,
124
+ height: h1
125
+ };
126
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
127
+ clonedSvg = null;
128
+ return result;
129
+ }
130
+ const LEGEND_TEXT_STYLE_PROPERTIES_MAP = {
131
+ color: 'fill',
132
+ 'font-family': 'font-family',
133
+ 'font-size': 'font-size',
134
+ 'font-weight': 'font-weight'
135
+ };
136
+ function cloneLegendsToSVG(legends, svgWidth, config, legendContainer) {
137
+ if (legends.length === 0) {
138
+ return {
139
+ node: null,
140
+ width: 0,
141
+ height: 0
142
+ };
143
+ }
144
+ const { selectedLegends, centerLegends, textClassName, isRTL } = config;
145
+ const legendGroup = (0, _d3selection.create)('svg:g');
146
+ let legendX = centerLegends ? 0 : _useLegendsStylesstyles.LEGEND_CONTAINER_MARGIN_START;
147
+ let legendY = _useLegendsStylesstyles.LEGEND_CONTAINER_MARGIN_TOP;
148
+ let legendLine = [];
149
+ const legendLines = [];
150
+ const legendLineWidths = [];
151
+ const noLegendsSelected = Object.keys(selectedLegends).length === 0;
152
+ for(let i = 0; i < legends.length; i++){
153
+ const textOffset = _useLegendsStylesstyles.LEGEND_PADDING + _useLegendsStylesstyles.LEGEND_SHAPE_SIZE + _useLegendsStylesstyles.LEGEND_SHAPE_MARGIN_END;
154
+ const legendText = (0, _index.createMeasurementSpan)(legends[i].title, textClassName, legendContainer);
155
+ const legendWidth = textOffset + legendText.getBoundingClientRect().width + _useLegendsStylesstyles.LEGEND_PADDING;
156
+ const legendItem = legendGroup.append('g');
157
+ legendLine.push({
158
+ elem: legendItem,
159
+ width: legendWidth
160
+ });
161
+ if (legendX + legendWidth > svgWidth && legendLine.length > 1) {
162
+ legendLine.pop();
163
+ legendLines.push(legendLine);
164
+ legendLineWidths.push(legendX);
165
+ legendLine = [
166
+ {
167
+ elem: legendItem,
168
+ width: legendWidth
169
+ }
170
+ ];
171
+ legendX = centerLegends ? 0 : _useLegendsStylesstyles.LEGEND_CONTAINER_MARGIN_START;
172
+ legendY += _useLegendsStylesstyles.LEGEND_HEIGHT;
173
+ }
174
+ const isLegendActive = selectedLegends[legends[i].title] || noLegendsSelected;
175
+ legendItem.append('rect').attr('x', legendX + (isRTL ? legendWidth - _useLegendsStylesstyles.LEGEND_PADDING - _useLegendsStylesstyles.LEGEND_SHAPE_SIZE : _useLegendsStylesstyles.LEGEND_PADDING)).attr('y', legendY + _useLegendsStylesstyles.LEGEND_PADDING).attr('width', _useLegendsStylesstyles.LEGEND_SHAPE_SIZE).attr('height', _useLegendsStylesstyles.LEGEND_SHAPE_SIZE).style('fill', isLegendActive ? legends[i].color : 'transparent').style('stroke-width', _useLegendsStylesstyles.LEGEND_SHAPE_BORDER).style('stroke', legends[i].color);
176
+ legendItem.append('text').attr('x', legendX + (isRTL ? legendWidth - textOffset : textOffset)).attr('y', legendY + _useLegendsStylesstyles.LEGEND_PADDING).attr('dominant-baseline', 'hanging').style('opacity', isLegendActive ? 1 : _useLegendsStylesstyles.INACTIVE_LEGEND_TEXT_OPACITY).text(legends[i].title).call((selection)=>(0, _index.copyStyle)(LEGEND_TEXT_STYLE_PROPERTIES_MAP, legendText, selection.node()));
177
+ legendX += legendWidth;
178
+ }
179
+ legendLines.push(legendLine);
180
+ legendLineWidths.push(legendX);
181
+ legendY += _useLegendsStylesstyles.LEGEND_HEIGHT;
182
+ if (centerLegends) {
183
+ legendLines.forEach((ln, idx)=>{
184
+ const lineOffsetX = Math.max((svgWidth - legendLineWidths[idx]) / 2, 0);
185
+ let remLineWidth = legendLineWidths[idx];
186
+ let itemOffsetX = 0;
187
+ ln.forEach((item)=>{
188
+ const newOffsetX = lineOffsetX + (isRTL ? remLineWidth - item.width - itemOffsetX : 0);
189
+ item.elem.attr('transform', `translate(${newOffsetX}, 0)`);
190
+ remLineWidth -= item.width;
191
+ itemOffsetX += item.width;
192
+ });
193
+ });
194
+ } else if (isRTL) {
195
+ const w1 = Math.max(svgWidth, ...legendLineWidths);
196
+ legendLines.forEach((ln)=>{
197
+ let remLineWidth = w1 - _useLegendsStylesstyles.LEGEND_CONTAINER_MARGIN_START;
198
+ let itemOffsetX = _useLegendsStylesstyles.LEGEND_CONTAINER_MARGIN_START;
199
+ ln.forEach((item)=>{
200
+ const newOffsetX = remLineWidth - item.width - itemOffsetX;
201
+ item.elem.attr('transform', `translate(${newOffsetX}, 0)`);
202
+ remLineWidth -= item.width;
203
+ itemOffsetX += item.width;
204
+ });
205
+ });
206
+ }
207
+ return {
208
+ node: legendGroup.node(),
209
+ width: Math.max(...legendLineWidths),
210
+ height: legendY
211
+ };
212
+ }
213
+ function svgToPng(svgDataUrl, opts = {}) {
214
+ return new Promise((resolve, reject)=>{
215
+ const scale = opts.scale || 1;
216
+ const w0 = opts.width || 300;
217
+ const h0 = opts.height || 150;
218
+ const w1 = scale * w0;
219
+ const h1 = scale * h0;
220
+ const canvas = document.createElement('canvas');
221
+ const img = new Image();
222
+ canvas.width = w1;
223
+ canvas.height = h1;
224
+ img.onload = function() {
225
+ const ctx = canvas.getContext('2d');
226
+ if (!ctx) {
227
+ return reject(new Error('Canvas context is null'));
228
+ }
229
+ ctx.clearRect(0, 0, w1, h1);
230
+ ctx.drawImage(img, 0, 0, w1, h1);
231
+ const imgData = canvas.toDataURL('image/png');
232
+ resolve(imgData);
233
+ };
234
+ img.onerror = function(err) {
235
+ reject(err);
236
+ };
237
+ img.src = svgDataUrl;
238
+ });
239
+ }
240
+ const hex2 = /^[\da-f]{2}$/i;
241
+ const hex4 = /^[\da-f]{4}$/i;
242
+ /**
243
+ * A ponyfill for the deprecated `unescape` method, taken from the `core-js` library.
244
+ *
245
+ * Source: {@link https://github.com/zloirock/core-js/blob/167136f479d3b8519953f2e4c534ecdd1031d3cf/packages/core-js/modules/es.unescape.js core-js/packages/core-js/modules/es.unescape.js}
246
+ */ function unescapePonyfill(str) {
247
+ let result = '';
248
+ const length = str.length;
249
+ let index = 0;
250
+ let chr;
251
+ let part;
252
+ while(index < length){
253
+ chr = str.charAt(index++);
254
+ if (chr === '%') {
255
+ if (str.charAt(index) === 'u') {
256
+ part = str.slice(index + 1, index + 5);
257
+ if (hex4.exec(part)) {
258
+ result += String.fromCharCode(parseInt(part, 16));
259
+ index += 5;
260
+ continue;
261
+ }
262
+ } else {
263
+ part = str.slice(index, index + 2);
264
+ if (hex2.exec(part)) {
265
+ result += String.fromCharCode(parseInt(part, 16));
266
+ index += 2;
267
+ continue;
268
+ }
269
+ }
270
+ }
271
+ result += chr;
272
+ }
273
+ return result;
274
+ }
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/utilities/image-export-utils.ts"],"sourcesContent":["import { create as d3Create, select as d3Select, Selection } from 'd3-selection';\nimport { copyStyle, createMeasurementSpan, resolveCSSVariables } from './index';\nimport { ImageExportOptions } from '../types/index';\nimport { Legend, LegendContainer } from '../Legends';\nimport {\n LEGEND_CONTAINER_MARGIN_TOP,\n LEGEND_CONTAINER_MARGIN_START,\n LEGEND_PADDING,\n LEGEND_HEIGHT,\n LEGEND_SHAPE_BORDER,\n LEGEND_SHAPE_SIZE,\n LEGEND_SHAPE_MARGIN_END,\n INACTIVE_LEGEND_TEXT_OPACITY,\n} from '../components/Legends/useLegendsStyles.styles';\n\nexport function toImage(\n chartContainer: HTMLElement | null | undefined,\n legendsToSvgCallback?: LegendContainer['toSVG'],\n isRTL: boolean = false,\n opts: ImageExportOptions = {},\n): Promise<string> {\n return new Promise((resolve, reject) => {\n if (!chartContainer) {\n return reject(new Error('Chart container is not defined'));\n }\n\n try {\n const background =\n typeof opts.background === 'string' ? resolveCSSVariables(chartContainer, opts.background) : 'transparent';\n\n const svg = toSVG(chartContainer, legendsToSvgCallback, isRTL, background);\n if (!svg.node) {\n return reject(new Error('SVG node is null'));\n }\n\n let svgData = new XMLSerializer().serializeToString(svg.node);\n // This node is already detached from the DOM, so there's no need to call remove() on it.\n // Just clear the reference.\n svg.node = null;\n\n let svgDataUrl = 'data:image/svg+xml;base64,' + btoa(unescapePonyfill(encodeURIComponent(svgData)));\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n svgData = null as any;\n\n svgToPng(svgDataUrl, {\n width: opts.width || svg.width,\n height: opts.height || svg.height,\n scale: opts.scale,\n })\n .then(resolve)\n .catch(reject);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n svgDataUrl = null as any;\n } catch (err) {\n return reject(err);\n }\n });\n}\n\nconst SVG_STYLE_PROPERTIES = [\n 'display',\n 'fill',\n 'fill-opacity',\n 'opacity',\n 'stroke',\n 'stroke-width',\n 'transform',\n 'border-collapse',\n];\nconst SVG_TEXT_STYLE_PROPERTIES = [\n 'font-family',\n 'font-size',\n 'font-weight',\n 'text-anchor',\n 'background-color',\n 'color',\n 'padding',\n 'text-align',\n 'border',\n];\n\nfunction toSVG(\n chartContainer: HTMLElement,\n legendsToSvgCallback: LegendContainer['toSVG'] | undefined,\n isRTL: boolean,\n background: string,\n) {\n const svg = chartContainer.querySelector<SVGSVGElement>('svg');\n if (!svg) {\n throw new Error('SVG not found');\n }\n\n let clonedSvg = d3Select(svg.cloneNode(true) as SVGSVGElement)\n .attr('width', null)\n .attr('height', null)\n .attr('viewBox', null);\n let svgElements = svg.getElementsByTagName('*');\n let clonedSvgElements = clonedSvg.node()!.getElementsByTagName('*');\n\n const TEXT_ELEMENTS = ['text'];\n const TABLE_ELEMENTS = ['table', 'thead', 'tbody', 'tr', 'th', 'td'];\n\n for (let i = 0; i < svgElements.length; i++) {\n const tag = svgElements[i].tagName.toLowerCase();\n\n if (TEXT_ELEMENTS.includes(tag) || TABLE_ELEMENTS.includes(tag)) {\n copyStyle([...SVG_STYLE_PROPERTIES, ...SVG_TEXT_STYLE_PROPERTIES], svgElements[i], clonedSvgElements[i]);\n } else {\n copyStyle(SVG_STYLE_PROPERTIES, svgElements[i], clonedSvgElements[i]);\n }\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n svgElements = null as any;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n clonedSvgElements = null as any;\n\n const { width: svgWidth, height: svgHeight } = svg.getBoundingClientRect();\n const legendGroup =\n typeof legendsToSvgCallback === 'function'\n ? legendsToSvgCallback(svgWidth, isRTL)\n : { node: null, width: 0, height: 0 };\n const w1 = Math.max(svgWidth, legendGroup.width);\n const h1 = svgHeight + legendGroup.height;\n\n if (legendGroup.node) {\n d3Select(legendGroup.node).attr('transform', `translate(0, ${svgHeight})`);\n clonedSvg.append(() => legendGroup.node);\n }\n clonedSvg\n .insert('rect', ':first-child')\n .attr('x', 0)\n .attr('y', 0)\n .attr('width', w1)\n .attr('height', h1)\n .attr('fill', background);\n clonedSvg\n .attr('width', w1)\n .attr('height', h1)\n .attr('viewBox', `0 0 ${w1} ${h1}`)\n .attr('direction', isRTL ? 'rtl' : 'ltr');\n\n const result = {\n node: clonedSvg.node(),\n width: w1,\n height: h1,\n };\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n clonedSvg = null as any;\n\n return result;\n}\n\nconst LEGEND_TEXT_STYLE_PROPERTIES_MAP = {\n color: 'fill',\n 'font-family': 'font-family',\n 'font-size': 'font-size',\n 'font-weight': 'font-weight',\n};\n\nexport function cloneLegendsToSVG(\n legends: Legend[],\n svgWidth: number,\n config: {\n selectedLegends: Record<string, boolean>;\n centerLegends: boolean;\n textClassName: string;\n isRTL: boolean;\n },\n legendContainer?: HTMLElement | null,\n) {\n if (legends.length === 0) {\n return {\n node: null,\n width: 0,\n height: 0,\n };\n }\n\n const { selectedLegends, centerLegends, textClassName, isRTL } = config;\n const legendGroup = d3Create<SVGGElement>('svg:g');\n let legendX = centerLegends ? 0 : LEGEND_CONTAINER_MARGIN_START;\n let legendY = LEGEND_CONTAINER_MARGIN_TOP;\n let legendLine: { elem: Selection<SVGGElement, unknown, null, undefined>; width: number }[] = [];\n const legendLines: (typeof legendLine)[] = [];\n const legendLineWidths: number[] = [];\n const noLegendsSelected = Object.keys(selectedLegends).length === 0;\n\n for (let i = 0; i < legends.length; i++) {\n const textOffset = LEGEND_PADDING + LEGEND_SHAPE_SIZE + LEGEND_SHAPE_MARGIN_END;\n const legendText = createMeasurementSpan(legends[i].title, textClassName, legendContainer);\n const legendWidth = textOffset + legendText.getBoundingClientRect().width + LEGEND_PADDING;\n const legendItem = legendGroup.append('g');\n\n legendLine.push({ elem: legendItem, width: legendWidth });\n if (legendX + legendWidth > svgWidth && legendLine.length > 1) {\n legendLine.pop();\n legendLines.push(legendLine);\n legendLineWidths.push(legendX);\n\n legendLine = [{ elem: legendItem, width: legendWidth }];\n legendX = centerLegends ? 0 : LEGEND_CONTAINER_MARGIN_START;\n legendY += LEGEND_HEIGHT;\n }\n\n const isLegendActive = selectedLegends[legends[i].title] || noLegendsSelected;\n\n legendItem\n .append('rect')\n .attr('x', legendX + (isRTL ? legendWidth - LEGEND_PADDING - LEGEND_SHAPE_SIZE : LEGEND_PADDING))\n .attr('y', legendY + LEGEND_PADDING)\n .attr('width', LEGEND_SHAPE_SIZE)\n .attr('height', LEGEND_SHAPE_SIZE)\n .style('fill', isLegendActive ? legends[i].color : 'transparent')\n .style('stroke-width', LEGEND_SHAPE_BORDER)\n .style('stroke', legends[i].color);\n\n legendItem\n .append('text')\n .attr('x', legendX + (isRTL ? legendWidth - textOffset : textOffset))\n .attr('y', legendY + LEGEND_PADDING)\n .attr('dominant-baseline', 'hanging')\n .style('opacity', isLegendActive ? 1 : INACTIVE_LEGEND_TEXT_OPACITY)\n .text(legends[i].title)\n .call(selection => copyStyle(LEGEND_TEXT_STYLE_PROPERTIES_MAP, legendText, selection.node()!));\n\n legendX += legendWidth;\n }\n\n legendLines.push(legendLine);\n legendLineWidths.push(legendX);\n legendY += LEGEND_HEIGHT;\n\n if (centerLegends) {\n legendLines.forEach((ln, idx) => {\n const lineOffsetX = Math.max((svgWidth - legendLineWidths[idx]) / 2, 0);\n let remLineWidth = legendLineWidths[idx];\n let itemOffsetX = 0;\n ln.forEach(item => {\n const newOffsetX = lineOffsetX + (isRTL ? remLineWidth - item.width - itemOffsetX : 0);\n item.elem.attr('transform', `translate(${newOffsetX}, 0)`);\n remLineWidth -= item.width;\n itemOffsetX += item.width;\n });\n });\n } else if (isRTL) {\n const w1 = Math.max(svgWidth, ...legendLineWidths);\n legendLines.forEach(ln => {\n let remLineWidth = w1 - LEGEND_CONTAINER_MARGIN_START;\n let itemOffsetX = LEGEND_CONTAINER_MARGIN_START;\n ln.forEach(item => {\n const newOffsetX = remLineWidth - item.width - itemOffsetX;\n item.elem.attr('transform', `translate(${newOffsetX}, 0)`);\n remLineWidth -= item.width;\n itemOffsetX += item.width;\n });\n });\n }\n\n return {\n node: legendGroup.node(),\n width: Math.max(...legendLineWidths),\n height: legendY,\n };\n}\n\nfunction svgToPng(svgDataUrl: string, opts: ImageExportOptions = {}): Promise<string> {\n return new Promise((resolve, reject) => {\n const scale = opts.scale || 1;\n const w0 = opts.width || 300;\n const h0 = opts.height || 150;\n const w1 = scale * w0;\n const h1 = scale * h0;\n\n const canvas = document.createElement('canvas');\n const img = new Image();\n\n canvas.width = w1;\n canvas.height = h1;\n\n img.onload = function () {\n const ctx = canvas.getContext('2d');\n if (!ctx) {\n return reject(new Error('Canvas context is null'));\n }\n\n ctx.clearRect(0, 0, w1, h1);\n ctx.drawImage(img, 0, 0, w1, h1);\n\n const imgData = canvas.toDataURL('image/png');\n resolve(imgData);\n };\n\n img.onerror = function (err) {\n reject(err);\n };\n\n img.src = svgDataUrl;\n });\n}\n\nconst hex2 = /^[\\da-f]{2}$/i;\nconst hex4 = /^[\\da-f]{4}$/i;\n\n/**\n * A ponyfill for the deprecated `unescape` method, taken from the `core-js` library.\n *\n * Source: {@link https://github.com/zloirock/core-js/blob/167136f479d3b8519953f2e4c534ecdd1031d3cf/packages/core-js/modules/es.unescape.js core-js/packages/core-js/modules/es.unescape.js}\n */\nfunction unescapePonyfill(str: string) {\n let result = '';\n const length = str.length;\n let index = 0;\n let chr;\n let part;\n while (index < length) {\n chr = str.charAt(index++);\n if (chr === '%') {\n if (str.charAt(index) === 'u') {\n part = str.slice(index + 1, index + 5);\n if (hex4.exec(part)) {\n result += String.fromCharCode(parseInt(part, 16));\n index += 5;\n continue;\n }\n } else {\n part = str.slice(index, index + 2);\n if (hex2.exec(part)) {\n result += String.fromCharCode(parseInt(part, 16));\n index += 2;\n continue;\n }\n }\n }\n result += chr;\n }\n return result;\n}\n"],"names":["create","d3Create","select","d3Select","copyStyle","createMeasurementSpan","resolveCSSVariables","LEGEND_CONTAINER_MARGIN_TOP","LEGEND_CONTAINER_MARGIN_START","LEGEND_PADDING","LEGEND_HEIGHT","LEGEND_SHAPE_BORDER","LEGEND_SHAPE_SIZE","LEGEND_SHAPE_MARGIN_END","INACTIVE_LEGEND_TEXT_OPACITY","toImage","chartContainer","legendsToSvgCallback","isRTL","opts","Promise","resolve","reject","Error","background","svg","toSVG","node","svgData","XMLSerializer","serializeToString","svgDataUrl","btoa","unescapePonyfill","encodeURIComponent","svgToPng","width","height","scale","then","catch","err","SVG_STYLE_PROPERTIES","SVG_TEXT_STYLE_PROPERTIES","querySelector","clonedSvg","cloneNode","attr","svgElements","getElementsByTagName","clonedSvgElements","TEXT_ELEMENTS","TABLE_ELEMENTS","i","length","tag","tagName","toLowerCase","includes","svgWidth","svgHeight","getBoundingClientRect","legendGroup","w1","Math","max","h1","append","insert","result","LEGEND_TEXT_STYLE_PROPERTIES_MAP","color","cloneLegendsToSVG","legends","config","legendContainer","selectedLegends","centerLegends","textClassName","legendX","legendY","legendLine","legendLines","legendLineWidths","noLegendsSelected","Object","keys","textOffset","legendText","title","legendWidth","legendItem","push","elem","pop","isLegendActive","style","text","call","selection","forEach","ln","idx","lineOffsetX","remLineWidth","itemOffsetX","item","newOffsetX","w0","h0","canvas","document","createElement","img","Image","onload","ctx","getContext","clearRect","drawImage","imgData","toDataURL","onerror","src","hex2","hex4","str","index","chr","part","charAt","slice","exec","String","fromCharC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,MAAM;IACzB,IAAIyE,QAAQ;IACZ,IAAIC;IACJ,IAAIC;IACJ,MAAOF,QAAQzE,OAAQ;QACrB0E,MAAMF,IAAII,MAAM,CAACH;QACjB,IAAIC,QAAQ,KAAK;YACf,IAAIF,IAAII,MAAM,CAACH,WAAW,KAAK;gBAC7BE,OAAOH,IAAIK,KAAK,CAACJ,QAAQ,GAAGA,QAAQ;gBACpC,IAAIF,KAAKO,IAAI,CAACH,OAAO;oBACnB5D,UAAUgE,OAAOC,YAAY,CAACC,SAASN,MAAM;oBAC7CF,SAAS;oBACT;gBACF;YACF,OAAO;gBACLE,OAAOH,IAAIK,KAAK,CAACJ,OAAOA,QAAQ;gBAChC,IAAIH,KAAKQ,IAAI,CAACH,OAAO;oBACnB5D,UAAUgE,OAAOC,YAAY,CAACC,SAASN,MAAM;oBAC7CF,SAAS;oBACT;gBACF;YACF;QACF;QACA1D,UAAU2D;IACZ;IACA,OAAO3D;AACT"}
@@ -1 +1 @@
1
- {"version":3,"sources":["index.ts"],"sourcesContent":["export * from './utilities';\nexport * from './colors';\nexport * from './vbc-utils';\n"],"names":[],"mappings":";;;;;uBAAc,cAAc;uBACd,WAAW;uBACX,cAAc"}
1
+ {"version":3,"sources":["../src/utilities/index.ts"],"sourcesContent":["export * from './utilities';\nexport * from './colors';\nexport * from './vbc-utils';\n"],"names":[],"mappings":";;;;;uBAAc,cAAc;uBACd,WAAW;uBACX,cAAc"}
@@ -1 +1 @@
1
- {"version":3,"sources":["overflow-utils.ts"],"sourcesContent":["/**\n * Detects whether an element's content has horizontal overflow\n *\n * @public\n * @param element - Element to check for overflow\n * @returns True if element's content overflows\n */\nexport function hasHorizontalOverflow(element: HTMLElement): boolean {\n return element.clientWidth < element.scrollWidth;\n}\n\n/**\n * Detects whether an element's content has vertical overflow\n *\n * @public\n * @param element - Element to check for overflow\n * @returns True if element's content overflows\n */\nexport function hasVerticalOverflow(element: HTMLElement): boolean {\n return element.clientHeight < element.scrollHeight;\n}\n\n/**\n * Detects whether an element's content has overflow in any direction\n *\n * @public\n * @param element - Element to check for overflow\n * @returns True if element's content overflows\n */\nexport function hasOverflow(element: HTMLElement): boolean {\n return hasHorizontalOverflow(element) || hasVerticalOverflow(element);\n}\n"],"names":["hasHorizontalOverflow","element","clientWidth","scrollWidth","hasVerticalOverflow","clientHeight","scrollHeight","hasOverflow"],"mappings":"AAAA;;;;;;CAMC,GACD;;;;;;;;;;;yBAAgBA;;;eAsBAO;;;uBAXAH;;;;AAXT,SAASJ,sBAAsBC,OAAoB;IACxD,OAAOA,QAAQC,WAAW,GAAGD,QAAQE,WAAW;AAClD;AASO,SAASC,oBAAoBH,OAAoB;IACtD,OAAOA,QAAQI,YAAY,GAAGJ,QAAQK,YAAY;AACpD;AASO,SAASC,YAAYN,OAAoB;IAC9C,OAAOD,sBAAsBC,YAAYG,oBAAoBH;AAC/D"}
1
+ {"version":3,"sources":["../src/utilities/overflow-utils.ts"],"sourcesContent":["/**\n * Detects whether an element's content has horizontal overflow\n *\n * @public\n * @param element - Element to check for overflow\n * @returns True if element's content overflows\n */\nexport function hasHorizontalOverflow(element: HTMLElement): boolean {\n return element.clientWidth < element.scrollWidth;\n}\n\n/**\n * Detects whether an element's content has vertical overflow\n *\n * @public\n * @param element - Element to check for overflow\n * @returns True if element's content overflows\n */\nexport function hasVerticalOverflow(element: HTMLElement): boolean {\n return element.clientHeight < element.scrollHeight;\n}\n\n/**\n * Detects whether an element's content has overflow in any direction\n *\n * @public\n * @param element - Element to check for overflow\n * @returns True if element's content overflows\n */\nexport function hasOverflow(element: HTMLElement): boolean {\n return hasHorizontalOverflow(element) || hasVerticalOverflow(element);\n}\n"],"names":["hasHorizontalOverflow","element","clientWidth","scrollWidth","hasVerticalOverflow","clientHeight","scrollHeight","hasOverflow"],"mappings":"AAAA;;;;;;CAMC,GACD;;;;;;;;;;;yBAAgBA;;;eAsBAO;;;uBAXAH;;;;AAXT,SAASJ,sBAAsBC,OAAoB;IACxD,OAAOA,QAAQC,WAAW,GAAGD,QAAQE,WAAW;AAClD;AASO,SAASC,oBAAoBH,OAAoB;IACtD,OAAOA,QAAQI,YAAY,GAAGJ,QAAQK,YAAY;AACpD;AASO,SAASC,YAAYN,OAAoB;IAC9C,OAAOD,sBAAsBC,YAAYG,oBAAoBH;AAC/D"}
@@ -1 +1 @@
1
- {"version":3,"sources":["string.ts"],"sourcesContent":["// Regex that finds { and } so they can be removed on a lookup for string format\nconst FORMAT_ARGS_REGEX = /[\\{\\}]/g;\n\n// Regex that finds {#} so it can be replaced by the arguments in string format\nconst FORMAT_REGEX = /\\{\\d+\\}/g;\n\n/**\n * String format method, used for scenarios where at runtime you\n * need to evaluate a formatted string given a tokenized string. This\n * usually only is needed in localization scenarios.\n\n * @example\n * ```tsx\n * \"I love {0} every {1}\".format(\"CXP\")\n * ```\n * will result in a Debug Exception.\n *\n * @public\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function format(s: string, ...values: any[]): string {\n const args = values;\n // Callback match function\n function replaceFunc(match: string): string {\n // looks up in the args\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n let replacement = args[match.replace(FORMAT_ARGS_REGEX, '') as any];\n\n // catches undefined in nondebug and null in debug and nondebug\n if (replacement === null || replacement === undefined) {\n replacement = '';\n }\n\n return replacement;\n }\n return s.replace(FORMAT_REGEX, replaceFunc);\n}\n"],"names":["FORMAT_ARGS_REGEX","FORMAT_REGEX","format","s","values","args","replaceFunc","match","replacement","replace","undefined"],"mappings":"AAAA,gFAAgF;;;;;;;;;;;AAChF,MAAMA,oBAAoB;AAE1B,+EAA+E;AAC/E,MAAMC,eAAe;AAgBd,SAASC,OAAOC,CAAS,EAAE,GAAGC,MAAa;IAChD,MAAMC,OAAOD;IACb,0BAA0B;IAC1B,SAASE,YAAYC,KAAa;QAChC,uBAAuB;QACvB,8DAA8D;QAC9D,IAAIC,cAAcH,IAAI,CAACE,MAAME,OAAO,CAACT,mBAAmB,IAAW;QAEnE,+DAA+D;QAC/D,IAAIQ,gBAAgB,QAAQA,gBAAgBE,WAAW;YACrDF,cAAc;QAChB;QAEA,OAAOA;IACT;IACA,OAAOL,EAAEM,OAAO,CAACR,cAAcK;AACjC"}
1
+ {"version":3,"sources":["../src/utilities/string.ts"],"sourcesContent":["// Regex that finds { and } so they can be removed on a lookup for string format\nconst FORMAT_ARGS_REGEX = /[\\{\\}]/g;\n\n// Regex that finds {#} so it can be replaced by the arguments in string format\nconst FORMAT_REGEX = /\\{\\d+\\}/g;\n\n/**\n * String format method, used for scenarios where at runtime you\n * need to evaluate a formatted string given a tokenized string. This\n * usually only is needed in localization scenarios.\n\n * @example\n * ```tsx\n * \"I love {0} every {1}\".format(\"CXP\")\n * ```\n * will result in a Debug Exception.\n *\n * @public\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function format(s: string, ...values: any[]): string {\n const args = values;\n // Callback match function\n function replaceFunc(match: string): string {\n // looks up in the args\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n let replacement = args[match.replace(FORMAT_ARGS_REGEX, '') as any];\n\n // catches undefined in nondebug and null in debug and nondebug\n if (replacement === null || replacement === undefined) {\n replacement = '';\n }\n\n return replacement;\n }\n return s.replace(FORMAT_REGEX, replaceFunc);\n}\n"],"names":["FORMAT_ARGS_REGEX","FORMAT_REGEX","format","s","values","args","replaceFunc","match","replacement","replace","undefined"],"mappings":"AAAA,gFAAgF;;;;;;;;;;;AAChF,MAAMA,oBAAoB;AAE1B,+EAA+E;AAC/E,MAAMC,eAAe;AAgBd,SAASC,OAAOC,CAAS,EAAE,GAAGC,MAAa;IAChD,MAAMC,OAAOD;IACb,0BAA0B;IAC1B,SAASE,YAAYC,KAAa;QAChC,uBAAuB;QACvB,8DAA8D;QAC9D,IAAIC,cAAcH,IAAI,CAACE,MAAME,OAAO,CAACT,mBAAmB,IAAW;QAEnE,+DAA+D;QAC/D,IAAIQ,gBAAgB,QAAQA,gBAAgBE,WAAW;YACrDF,cAAc;QAChB;QAEA,OAAOA;IACT;IACA,OAAOL,EAAEM,OAAO,CAACR,cAAcK;AACjC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["test-data.ts"],"sourcesContent":["import {\n ChartDataPoint,\n ChartProps,\n HorizontalBarChartWithAxisDataPoint,\n VSChartDataPoint,\n GanttChartDataPoint,\n VerticalStackedChartProps,\n VerticalBarChartDataPoint,\n DataVizPalette,\n} from '../index';\n\nexport const chartPointsVBC = [\n {\n x: 0,\n y: 10000,\n legend: 'First',\n color: 'aqua',\n xAxisCalloutData: '2020/04/30',\n yAxisCalloutData: '10%',\n },\n {\n x: 10000,\n y: 50000,\n legend: 'Second',\n color: 'blue',\n xAxisCalloutData: '2020/04/30',\n yAxisCalloutData: '20%',\n },\n {\n x: 25000,\n y: 30000,\n legend: 'Third',\n color: 'navy',\n xAxisCalloutData: '2020/04/30',\n yAxisCalloutData: '37%',\n },\n];\n\nconst firstChartPointsVSBC: VSChartDataPoint[] = [\n {\n legend: 'Metadata1',\n data: 40,\n color: 'aqua',\n xAxisCalloutData: '2020/04/30',\n yAxisCalloutData: '40%',\n },\n {\n legend: 'Metadata2',\n data: 5,\n color: 'navy',\n xAxisCalloutData: '2020/04/30',\n yAxisCalloutData: '5%',\n },\n];\n\nconst secondChartPointsVSBC: VSChartDataPoint[] = [\n {\n legend: 'Metadata1',\n data: 30,\n color: 'aqua',\n xAxisCalloutData: '2020/04/30',\n yAxisCalloutData: '30%',\n },\n {\n legend: 'Metadata2',\n data: 20,\n color: 'navy',\n xAxisCalloutData: '2020/04/30',\n yAxisCalloutData: '20%',\n },\n];\n\nexport const chartPointsVSBC: VerticalStackedChartProps[] = [\n { chartData: firstChartPointsVSBC, xAxisPoint: 0 },\n { chartData: secondChartPointsVSBC, xAxisPoint: 20 },\n];\n\nexport const chartPoints2VSBC: VerticalStackedChartProps[] = [\n {\n chartData: firstChartPointsVSBC,\n xAxisPoint: 0,\n lineData: [{ y: 15, legend: 'Line1', color: 'yellow' }],\n },\n {\n chartData: secondChartPointsVSBC,\n xAxisPoint: 20,\n lineData: [{ y: 30, legend: 'Line1', color: 'yellow' }],\n },\n];\n\nexport const emptychartPointsVSBC: VerticalStackedChartProps[] = [{ chartData: [], xAxisPoint: 0 }];\n\nexport const pointsHBCWA = [\n {\n x: 10000,\n y: 5000,\n legend: 'Oranges',\n color: 'aqua',\n xAxisCalloutData: '2020/04/30',\n yAxisCalloutData: '10%',\n },\n {\n x: 20000,\n y: 50000,\n legend: 'Dogs',\n color: 'blue',\n xAxisCalloutData: '2020/04/30',\n yAxisCalloutData: '20%',\n },\n {\n x: 25000,\n y: 30000,\n legend: 'Apples',\n color: 'navy',\n xAxisCalloutData: '2020/04/30',\n yAxisCalloutData: '37%',\n },\n\n {\n x: 40000,\n y: 13000,\n legend: 'Bananas',\n color: 'teal',\n xAxisCalloutData: '2020/04/30',\n yAxisCalloutData: '88%',\n },\n];\n\nexport const pointsDC: ChartDataPoint[] = [\n { legend: 'first', data: 20000, color: '#E5E5E5', xAxisCalloutData: '2020/04/30' },\n { legend: 'second', data: 39000, color: '#0078D4', xAxisCalloutData: '2020/04/20' },\n { legend: 'third', data: 45000, color: '#DADADA', xAxisCalloutData: '2020/04/25' },\n];\n\nexport const pointsDCElevateMinimumsExample: ChartDataPoint[] = [\n { legend: 'first', data: 39000, color: '#E5E5E5', xAxisCalloutData: '2020/04/30' },\n { legend: 'second', data: 20, color: '#0078D4', xAxisCalloutData: '2020/04/20' },\n { legend: 'third', data: 20, color: '#DADADA', xAxisCalloutData: '2020/04/25' },\n { legend: 'fourth', data: 20, color: '#DADADA', xAxisCalloutData: '2020/04/25' },\n { legend: 'fifth', data: 20, color: '#DADADA', xAxisCalloutData: '2020/04/25' },\n { legend: 'sixth', data: 20, color: '#DADADA', xAxisCalloutData: '2020/04/25' },\n];\n\nexport const chartPointsDC: ChartProps = {\n chartTitle: 'Donut chart example',\n chartData: pointsDC,\n};\n\nexport const chartPointsDCElevateMinimums: ChartProps = {\n chartTitle: 'Donut chart example',\n chartData: pointsDC,\n};\n\nexport const chartPointsHBCWA: HorizontalBarChartWithAxisDataPoint[] = [\n {\n x: 10000,\n y: 5000,\n legend: 'Oranges',\n color: 'aqua',\n yAxisCalloutData: '2020/04/30',\n xAxisCalloutData: '10%',\n },\n {\n x: 20000,\n y: 50000,\n legend: 'Grapes',\n color: 'blue',\n yAxisCalloutData: '2020/04/30',\n xAxisCalloutData: '20%',\n },\n {\n x: 25000,\n y: 30000,\n legend: 'Apples',\n color: 'navy',\n yAxisCalloutData: '2020/04/30',\n xAxisCalloutData: '37%',\n },\n\n {\n x: 40000,\n y: 13000,\n legend: 'Bananas',\n color: 'teal',\n yAxisCalloutData: '2020/04/30',\n xAxisCalloutData: '88%',\n },\n];\n\nexport const chartPointsWithStringYAxisHBCWA: HorizontalBarChartWithAxisDataPoint[] = [\n {\n y: 'String One',\n x: 1000,\n color: 'aqua',\n },\n {\n y: 'String Two',\n x: 5000,\n color: 'blue',\n },\n {\n y: 'String Three',\n x: 3000,\n color: 'navy',\n },\n {\n y: 'String Four',\n x: 2000,\n color: 'blue',\n },\n];\n\nexport const chartPointsWithAxisToolTipHBCWA: HorizontalBarChartWithAxisDataPoint[] = [\n {\n x: 1000,\n y: 1000,\n color: 'aqua',\n },\n {\n x: 2000,\n y: 5000,\n color: 'blue',\n },\n {\n x: 3000,\n y: 3000,\n color: 'navy',\n },\n {\n x: 4000,\n y: 2000,\n color: 'blue',\n },\n];\n\nexport const allNegativeChartPointsVBC: VerticalBarChartDataPoint[] = [\n {\n x: 0,\n y: -10000,\n legend: 'First',\n color: DataVizPalette.color1,\n xAxisCalloutData: '2020/04/30',\n yAxisCalloutData: '10%',\n },\n {\n x: 10000,\n y: -50000,\n legend: 'Second',\n color: DataVizPalette.color2,\n xAxisCalloutData: '2020/04/30',\n yAxisCalloutData: '20%',\n },\n {\n x: 25000,\n y: -30000,\n legend: 'Third',\n color: DataVizPalette.color3,\n xAxisCalloutData: '2020/04/30',\n yAxisCalloutData: '37%',\n },\n];\n\nexport const negativeChartPointsVBC: VerticalBarChartDataPoint[] = [\n {\n x: 0,\n y: 10000,\n legend: 'First',\n color: DataVizPalette.color1,\n xAxisCalloutData: '2020/04/30',\n yAxisCalloutData: '10%',\n },\n {\n x: 10000,\n y: -50000,\n legend: 'Second',\n color: DataVizPalette.color2,\n xAxisCalloutData: '2020/04/30',\n yAxisCalloutData: '20%',\n },\n {\n x: 25000,\n y: 30000,\n legend: 'Third',\n color: DataVizPalette.color3,\n xAxisCalloutData: '2020/04/30',\n yAxisCalloutData: '37%',\n },\n];\n\nexport const ganttData: GanttChartDataPoint[] = [\n {\n x: {\n start: new Date('2017-01-01'),\n end: new Date('2017-02-02'),\n },\n y: 'Job-1',\n legend: 'Complete',\n color: DataVizPalette.success,\n gradient: ['#0C5E0C', '#107C10'],\n },\n {\n x: {\n start: new Date('2017-01-17'),\n end: new Date('2017-02-17'),\n },\n y: 'Job-2',\n legend: 'Complete',\n color: DataVizPalette.success,\n gradient: ['#0C5E0C', '#107C10'],\n },\n {\n x: {\n start: new Date('2017-01-14'),\n end: new Date('2017-03-14'),\n },\n y: 'Job-4',\n legend: 'Complete',\n color: DataVizPalette.success,\n gradient: ['#0C5E0C', '#107C10'],\n },\n {\n x: {\n start: new Date('2017-02-15'),\n end: new Date('2017-03-15'),\n },\n y: 'Job-1',\n legend: 'Incomplete',\n color: DataVizPalette.warning,\n gradient: ['#DE590B', '#F7630C'],\n },\n {\n x: {\n start: new Date('2017-01-17'),\n end: new Date('2017-02-17'),\n },\n y: 'Job-2',\n legend: 'Not Started',\n color: DataVizPalette.error,\n gradient: ['#B10E1C', '#CC2635'],\n },\n {\n x: {\n start: new Date('2017-03-10'),\n end: new Date('2017-03-20'),\n },\n y: 'Job-3',\n legend: 'Not Started',\n color: DataVizPalette.error,\n gradient: ['#B10E1C', '#CC2635'],\n },\n {\n x: {\n start: new Date('2017-04-01'),\n end: new Date('2017-04-20'),\n },\n y: 'Job-3',\n legend: 'Not Started',\n color: DataVizPalette.error,\n gradient: ['#B10E1C', '#CC2635'],\n },\n {\n x: {\n start: new Date('2017-05-18'),\n end: new Date(new Date('2017-06-18')),\n },\n y: 'Job-3',\n legend: 'Not Started',\n color: DataVizPalette.error,\n gradient: ['#B10E1C', '#CC2635'],\n },\n];\n\nexport const ganttDataWithLongY: GanttChartDataPoint[] = [\n {\n x: {\n start: new Date('2024-05-01'),\n end: new Date('2024-05-07'),\n },\n y: 'Site Preparation',\n legend: 'No',\n color: '#637cefff',\n },\n {\n x: {\n start: new Date('2024-05-08'),\n end: new Date('2024-05-21'),\n },\n y: 'Foundation Work',\n legend: 'No',\n color: '#637cefff',\n },\n {\n x: {\n start: new Date('2024-05-22'),\n end: new Date('2024-06-02'),\n },\n y: 'Framing',\n legend: 'No',\n color: '#637cefff',\n },\n {\n x: {\n start: new Date('2024-06-03'),\n end: new Date('2024-06-09'),\n },\n y: 'Roof Installation',\n legend: 'No',\n color: '#637cefff',\n },\n {\n x: {\n start: new Date('2024-06-10'),\n end: new Date('2024-06-23'),\n },\n y: 'Plumbing/Electrical',\n legend: 'No',\n color: '#637cefff',\n },\n {\n x: {\n start: new Date('2024-07-08'),\n end: new Date('2024-07-17'),\n },\n y: 'Exterior Finishing',\n legend: 'No',\n color: '#637cefff',\n },\n {\n x: {\n start: new Date('2024-06-24'),\n end: new Date('2024-07-07'),\n },\n y: 'Interior Finishing',\n legend: 'Yes (Phase 1)',\n color: '#f7630cff',\n },\n {\n x: {\n start: new Date('2024-07-18'),\n end: new Date('2024-07-24'),\n },\n y: 'Final Inspections',\n legend: 'Yes (Phase 2)',\n color: '#57811bff',\n },\n];\n\nexport const ganttDataWithNumericY: GanttChartDataPoint[] = [\n {\n x: {\n start: new Date('2021-01-01'),\n end: new Date('2022-01-10'),\n },\n y: 1,\n legend: 'HR',\n color: '#637cefff',\n },\n {\n x: {\n start: new Date('2022-01-15'),\n end: new Date('2022-01-20'),\n },\n y: 2,\n legend: 'Finance',\n color: '#f7630cff',\n },\n {\n x: {\n start: new Date('2022-02-01'),\n end: new Date('2022-02-08'),\n },\n y: 3,\n legend: 'IT',\n color: '#57811bff',\n },\n {\n x: {\n start: new Date('2022-02-10'),\n end: new Date('2022-02-20'),\n },\n y: 4,\n legend: 'Operations',\n color: '#9373c0ff',\n },\n {\n x: {\n start: new Date('2022-03-01'),\n end: new Date('2022-03-10'),\n },\n y: 5,\n legend: 'Customer Support',\n color: '#ca5010ff',\n },\n {\n x: {\n start: new Date('2022-03-05'),\n end: new Date('2022-03-15'),\n },\n y: 6,\n legend: 'Legal',\n color: '#3a96ddff',\n },\n];\n"],"names":["DataVizPalette","chartPointsVBC","x","y","legend","color","xAxisCalloutData","yAxisCalloutData","firstChartPointsVSBC","data","secondChartPointsVSBC","chartPointsVSBC","chartData","xAxisPoint","chartPoints2VSBC","lineData","emptychartPointsVSBC","pointsHBCWA","pointsDC","pointsDCElevateMinimumsExample","chartPointsDC","chartTitle","chartPointsDCElevateMinimums","chartPointsHBCWA","chartPointsWithStringYAxisHBCWA","chartPointsWithAxisToolTipHBCWA","allNegativeChartPointsVBC","color1","color2","color3","negativeChartPointsVBC","ganttData","start","Date","end","success","gradient","warning","error","ganttDataWithLongY","ganttDataWithNumericY"],"mappings":";;;;;;;;;;;IA2Oa0B,yBAAAA;;;oBA9JAZ;;;IAkEAM,aAAAA;;;gCAKAE;;;oBAKAC;eAAAA;;IA9IAtB,cAAAA;;;mBA6DAU;;;mCA4IAc;;;mCAvBAD;;;wBAnGAR;;;IAuMAe,SAAAA;;;sBAmFAQ;;;yBA2EAC;;;IAzLAV,sBAAAA;;;YAtIAZ;;;kCAMAC;eAAAA;;eA1CAF;;;;uBAnFN,WAAW;AAEX,uBAAuB;IAC5B;QACEf,GAAG;QACHC,GAAG;QACHC,QAAQ;QACRC,OAAO;QACPC,kBAAkB;QAClBC,kBAAkB;IACpB;IACA;QACEL,GAAG;QACHC,GAAG;QACHC,QAAQ;QACRC,OAAO;QACPC,kBAAkB;QAClBC,kBAAkB;IACpB;IACA;QACEL,GA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IAC1D;QACEtC,GAAG;YACD8B,OAAO,IAAIC,KAAK;YAChBC,KAAK,IAAID,KAAK;QAChB;QACA9B,GAAG;QACHC,QAAQ;QACRC,OAAO;IACT;IACA;QACEH,GAAG;YACD8B,OAAO,IAAIC,KAAK;YAChBC,KAAK,IAAID,KAAK;QAChB;QACA9B,GAAG;QACHC,QAAQ;QACRC,OAAO;IACT;IACA;QACEH,GAAG;YACD8B,OAAO,IAAIC,KAAK;YAChBC,KAAK,IAAID,KAAK;QAChB;QACA9B,GAAG;QACHC,QAAQ;QACRC,OAAO;IACT;IACA;QACEH,GAAG;YACD8B,OAAO,IAAIC,KAAK;YAChBC,KAAK,IAAID,KAAK;QAChB;QACA9B,GAAG;QACHC,QAAQ;QACRC,OAAO;IACT;IACA;QACEH,GAAG;YACD8B,OAAO,IAAIC,KAAK;YAChBC,KAAK,IAAID,KAAK;QAChB;QACA9B,GAAG;QACHC,QAAQ;QACRC,OAAO;IACT;IACA;QACEH,GAAG;YACD8B,OAAO,IAAIC,KAAK;YAChBC,KAAK,IAAID,KAAK;QAChB;QACA9B,GAAG;QACHC,QAAQ;QACRC,OAAO;IACT;CACD,CAAC"}
1
+ {"version":3,"sources":["../src/utilities/test-data.ts"],"sourcesContent":["import {\n ChartDataPoint,\n ChartProps,\n HorizontalBarChartWithAxisDataPoint,\n VSChartDataPoint,\n GanttChartDataPoint,\n VerticalStackedChartProps,\n VerticalBarChartDataPoint,\n DataVizPalette,\n} from '../index';\n\nexport const chartPointsVBC = [\n {\n x: 0,\n y: 10000,\n legend: 'First',\n color: 'aqua',\n xAxisCalloutData: '2020/04/30',\n yAxisCalloutData: '10%',\n },\n {\n x: 10000,\n y: 50000,\n legend: 'Second',\n color: 'blue',\n xAxisCalloutData: '2020/04/30',\n yAxisCalloutData: '20%',\n },\n {\n x: 25000,\n y: 30000,\n legend: 'Third',\n color: 'navy',\n xAxisCalloutData: '2020/04/30',\n yAxisCalloutData: '37%',\n },\n];\n\nconst firstChartPointsVSBC: VSChartDataPoint[] = [\n {\n legend: 'Metadata1',\n data: 40,\n color: 'aqua',\n xAxisCalloutData: '2020/04/30',\n yAxisCalloutData: '40%',\n },\n {\n legend: 'Metadata2',\n data: 5,\n color: 'navy',\n xAxisCalloutData: '2020/04/30',\n yAxisCalloutData: '5%',\n },\n];\n\nconst secondChartPointsVSBC: VSChartDataPoint[] = [\n {\n legend: 'Metadata1',\n data: 30,\n color: 'aqua',\n xAxisCalloutData: '2020/04/30',\n yAxisCalloutData: '30%',\n },\n {\n legend: 'Metadata2',\n data: 20,\n color: 'navy',\n xAxisCalloutData: '2020/04/30',\n yAxisCalloutData: '20%',\n },\n];\n\nexport const chartPointsVSBC: VerticalStackedChartProps[] = [\n { chartData: firstChartPointsVSBC, xAxisPoint: 0 },\n { chartData: secondChartPointsVSBC, xAxisPoint: 20 },\n];\n\nexport const chartPoints2VSBC: VerticalStackedChartProps[] = [\n {\n chartData: firstChartPointsVSBC,\n xAxisPoint: 0,\n lineData: [{ y: 15, legend: 'Line1', color: 'yellow' }],\n },\n {\n chartData: secondChartPointsVSBC,\n xAxisPoint: 20,\n lineData: [{ y: 30, legend: 'Line1', color: 'yellow' }],\n },\n];\n\nexport const emptychartPointsVSBC: VerticalStackedChartProps[] = [{ chartData: [], xAxisPoint: 0 }];\n\nexport const pointsHBCWA = [\n {\n x: 10000,\n y: 5000,\n legend: 'Oranges',\n color: 'aqua',\n xAxisCalloutData: '2020/04/30',\n yAxisCalloutData: '10%',\n },\n {\n x: 20000,\n y: 50000,\n legend: 'Dogs',\n color: 'blue',\n xAxisCalloutData: '2020/04/30',\n yAxisCalloutData: '20%',\n },\n {\n x: 25000,\n y: 30000,\n legend: 'Apples',\n color: 'navy',\n xAxisCalloutData: '2020/04/30',\n yAxisCalloutData: '37%',\n },\n\n {\n x: 40000,\n y: 13000,\n legend: 'Bananas',\n color: 'teal',\n xAxisCalloutData: '2020/04/30',\n yAxisCalloutData: '88%',\n },\n];\n\nexport const pointsDC: ChartDataPoint[] = [\n { legend: 'first', data: 20000, color: '#E5E5E5', xAxisCalloutData: '2020/04/30' },\n { legend: 'second', data: 39000, color: '#0078D4', xAxisCalloutData: '2020/04/20' },\n { legend: 'third', data: 45000, color: '#DADADA', xAxisCalloutData: '2020/04/25' },\n];\n\nexport const pointsDCElevateMinimumsExample: ChartDataPoint[] = [\n { legend: 'first', data: 39000, color: '#E5E5E5', xAxisCalloutData: '2020/04/30' },\n { legend: 'second', data: 20, color: '#0078D4', xAxisCalloutData: '2020/04/20' },\n { legend: 'third', data: 20, color: '#DADADA', xAxisCalloutData: '2020/04/25' },\n { legend: 'fourth', data: 20, color: '#DADADA', xAxisCalloutData: '2020/04/25' },\n { legend: 'fifth', data: 20, color: '#DADADA', xAxisCalloutData: '2020/04/25' },\n { legend: 'sixth', data: 20, color: '#DADADA', xAxisCalloutData: '2020/04/25' },\n];\n\nexport const chartPointsDC: ChartProps = {\n chartTitle: 'Donut chart example',\n chartData: pointsDC,\n};\n\nexport const chartPointsDCElevateMinimums: ChartProps = {\n chartTitle: 'Donut chart example',\n chartData: pointsDC,\n};\n\nexport const chartPointsHBCWA: HorizontalBarChartWithAxisDataPoint[] = [\n {\n x: 10000,\n y: 5000,\n legend: 'Oranges',\n color: 'aqua',\n yAxisCalloutData: '2020/04/30',\n xAxisCalloutData: '10%',\n },\n {\n x: 20000,\n y: 50000,\n legend: 'Grapes',\n color: 'blue',\n yAxisCalloutData: '2020/04/30',\n xAxisCalloutData: '20%',\n },\n {\n x: 25000,\n y: 30000,\n legend: 'Apples',\n color: 'navy',\n yAxisCalloutData: '2020/04/30',\n xAxisCalloutData: '37%',\n },\n\n {\n x: 40000,\n y: 13000,\n legend: 'Bananas',\n color: 'teal',\n yAxisCalloutData: '2020/04/30',\n xAxisCalloutData: '88%',\n },\n];\n\nexport const chartPointsWithStringYAxisHBCWA: HorizontalBarChartWithAxisDataPoint[] = [\n {\n y: 'String One',\n x: 1000,\n color: 'aqua',\n },\n {\n y: 'String Two',\n x: 5000,\n color: 'blue',\n },\n {\n y: 'String Three',\n x: 3000,\n color: 'navy',\n },\n {\n y: 'String Four',\n x: 2000,\n color: 'blue',\n },\n];\n\nexport const chartPointsWithAxisToolTipHBCWA: HorizontalBarChartWithAxisDataPoint[] = [\n {\n x: 1000,\n y: 1000,\n color: 'aqua',\n },\n {\n x: 2000,\n y: 5000,\n color: 'blue',\n },\n {\n x: 3000,\n y: 3000,\n color: 'navy',\n },\n {\n x: 4000,\n y: 2000,\n color: 'blue',\n },\n];\n\nexport const allNegativeChartPointsVBC: VerticalBarChartDataPoint[] = [\n {\n x: 0,\n y: -10000,\n legend: 'First',\n color: DataVizPalette.color1,\n xAxisCalloutData: '2020/04/30',\n yAxisCalloutData: '10%',\n },\n {\n x: 10000,\n y: -50000,\n legend: 'Second',\n color: DataVizPalette.color2,\n xAxisCalloutData: '2020/04/30',\n yAxisCalloutData: '20%',\n },\n {\n x: 25000,\n y: -30000,\n legend: 'Third',\n color: DataVizPalette.color3,\n xAxisCalloutData: '2020/04/30',\n yAxisCalloutData: '37%',\n },\n];\n\nexport const negativeChartPointsVBC: VerticalBarChartDataPoint[] = [\n {\n x: 0,\n y: 10000,\n legend: 'First',\n color: DataVizPalette.color1,\n xAxisCalloutData: '2020/04/30',\n yAxisCalloutData: '10%',\n },\n {\n x: 10000,\n y: -50000,\n legend: 'Second',\n color: DataVizPalette.color2,\n xAxisCalloutData: '2020/04/30',\n yAxisCalloutData: '20%',\n },\n {\n x: 25000,\n y: 30000,\n legend: 'Third',\n color: DataVizPalette.color3,\n xAxisCalloutData: '2020/04/30',\n yAxisCalloutData: '37%',\n },\n];\n\nexport const ganttData: GanttChartDataPoint[] = [\n {\n x: {\n start: new Date('2017-01-01'),\n end: new Date('2017-02-02'),\n },\n y: 'Job-1',\n legend: 'Complete',\n color: DataVizPalette.success,\n gradient: ['#0C5E0C', '#107C10'],\n },\n {\n x: {\n start: new Date('2017-01-17'),\n end: new Date('2017-02-17'),\n },\n y: 'Job-2',\n legend: 'Complete',\n color: DataVizPalette.success,\n gradient: ['#0C5E0C', '#107C10'],\n },\n {\n x: {\n start: new Date('2017-01-14'),\n end: new Date('2017-03-14'),\n },\n y: 'Job-4',\n legend: 'Complete',\n color: DataVizPalette.success,\n gradient: ['#0C5E0C', '#107C10'],\n },\n {\n x: {\n start: new Date('2017-02-15'),\n end: new Date('2017-03-15'),\n },\n y: 'Job-1',\n legend: 'Incomplete',\n color: DataVizPalette.warning,\n gradient: ['#DE590B', '#F7630C'],\n },\n {\n x: {\n start: new Date('2017-01-17'),\n end: new Date('2017-02-17'),\n },\n y: 'Job-2',\n legend: 'Not Started',\n color: DataVizPalette.error,\n gradient: ['#B10E1C', '#CC2635'],\n },\n {\n x: {\n start: new Date('2017-03-10'),\n end: new Date('2017-03-20'),\n },\n y: 'Job-3',\n legend: 'Not Started',\n color: DataVizPalette.error,\n gradient: ['#B10E1C', '#CC2635'],\n },\n {\n x: {\n start: new Date('2017-04-01'),\n end: new Date('2017-04-20'),\n },\n y: 'Job-3',\n legend: 'Not Started',\n color: DataVizPalette.error,\n gradient: ['#B10E1C', '#CC2635'],\n },\n {\n x: {\n start: new Date('2017-05-18'),\n end: new Date(new Date('2017-06-18')),\n },\n y: 'Job-3',\n legend: 'Not Started',\n color: DataVizPalette.error,\n gradient: ['#B10E1C', '#CC2635'],\n },\n];\n\nexport const ganttDataWithLongY: GanttChartDataPoint[] = [\n {\n x: {\n start: new Date('2024-05-01'),\n end: new Date('2024-05-07'),\n },\n y: 'Site Preparation',\n legend: 'No',\n color: '#637cefff',\n },\n {\n x: {\n start: new Date('2024-05-08'),\n end: new Date('2024-05-21'),\n },\n y: 'Foundation Work',\n legend: 'No',\n color: '#637cefff',\n },\n {\n x: {\n start: new Date('2024-05-22'),\n end: new Date('2024-06-02'),\n },\n y: 'Framing',\n legend: 'No',\n color: '#637cefff',\n },\n {\n x: {\n start: new Date('2024-06-03'),\n end: new Date('2024-06-09'),\n },\n y: 'Roof Installation',\n legend: 'No',\n color: '#637cefff',\n },\n {\n x: {\n start: new Date('2024-06-10'),\n end: new Date('2024-06-23'),\n },\n y: 'Plumbing/Electrical',\n legend: 'No',\n color: '#637cefff',\n },\n {\n x: {\n start: new Date('2024-07-08'),\n end: new Date('2024-07-17'),\n },\n y: 'Exterior Finishing',\n legend: 'No',\n color: '#637cefff',\n },\n {\n x: {\n start: new Date('2024-06-24'),\n end: new Date('2024-07-07'),\n },\n y: 'Interior Finishing',\n legend: 'Yes (Phase 1)',\n color: '#f7630cff',\n },\n {\n x: {\n start: new Date('2024-07-18'),\n end: new Date('2024-07-24'),\n },\n y: 'Final Inspections',\n legend: 'Yes (Phase 2)',\n color: '#57811bff',\n },\n];\n\nexport const ganttDataWithNumericY: GanttChartDataPoint[] = [\n {\n x: {\n start: new Date('2021-01-01'),\n end: new Date('2022-01-10'),\n },\n y: 1,\n legend: 'HR',\n color: '#637cefff',\n },\n {\n x: {\n start: new Date('2022-01-15'),\n end: new Date('2022-01-20'),\n },\n y: 2,\n legend: 'Finance',\n color: '#f7630cff',\n },\n {\n x: {\n start: new Date('2022-02-01'),\n end: new Date('2022-02-08'),\n },\n y: 3,\n legend: 'IT',\n color: '#57811bff',\n },\n {\n x: {\n start: new Date('2022-02-10'),\n end: new Date('2022-02-20'),\n },\n y: 4,\n legend: 'Operations',\n color: '#9373c0ff',\n },\n {\n x: {\n start: new Date('2022-03-01'),\n end: new Date('2022-03-10'),\n },\n y: 5,\n legend: 'Customer Support',\n color: '#ca5010ff',\n },\n {\n x: {\n start: new Date('2022-03-05'),\n end: new Date('2022-03-15'),\n },\n y: 6,\n legend: 'Legal',\n color: '#3a96ddff',\n },\n];\n"],"names":["DataVizPalette","chartPointsVBC","x","y","legend","color","xAxisCalloutData","yAxisCalloutData","firstChartPointsVSBC","data","secondChartPointsVSBC","chartPointsVSBC","chartData","xAxisPoint","chartPoints2VSBC","lineData","emptychartPointsVSBC","pointsHBCWA","pointsDC","pointsDCElevateMinimumsExample","chartPointsDC","chartTitle","chartPointsDCElevateMinimums","chartPointsHBCWA","chartPointsWithStringYAxisHBCWA","chartPointsWithAxisToolTipHBCWA","allNegativeChartPointsVBC","color1","color2","color3","negativeChartPointsVBC","ganttData","start","Date","end","success","gradient","warning","error","ganttDataWithLongY","ganttDataWithNumericY"],"mappings":";;;;;;;;;;;IA2Oa0B,yBAAAA;;;oBA9JAZ;;;IAkEAM,aAAAA;;;gCAKAE;;;oBAKAC;eAAAA;;IA9IAtB,cAAAA;;;mBA6DAU;;;mCA4IAc;;;mCAvBAD;;;wBAnGAR;;;IAuMAe,SAAAA;;;sBAmFAQ;;;yBA2EAC;;;IAzLAV,sBAAAA;;;YAtIAZ;;;kCAMAC;eAAAA;;eA1CAF;;;;uBAnFN,WAAW;AAEX,uBAAuB;IAC5B;QACEf,GAAG;QACHC,GAAG;QACHC,QAAQ;QACRC,OAAO;QACPC,kBAAkB;QAClBC,kBAAkB;IACpB;IACA;QACEL,GAAG;QACHC,GAAG;QACHC,QAAQ;QACRC,OAAO;QACPC,kBAAkB;QAClBC,kBAAkB;IACpB;IACA;QACEL,GAAG;QACHC,GAAG;QACHC,QAAQ;QACRC,OAAO;QACPC,kBAAkB;QAClBC,kBAAkB;IACpB;CACD,CAAC;AAEF,MAAMC,uBAA2C;IAC/C;QACEJ,QAAQ;QACRK,MAAM;QACNJ,OAAO;QACPC,kBAAkB;QAClBC,kBAAkB;IACpB;IACA;QACEH,QAAQ;QACRK,MAAM;QACNJ,OAAO;QACPC,kBAAkB;QAClBC,kBAAkB;IACpB;CACD;AAED,MAAMG,wBAA4C;IAChD;QACEN,QAAQ;QACRK,MAAM;QACNJ,OAAO;QACPC,kBAAkB;QAClBC,kBAAkB;IACpB;IACA;QACEH,QAAQ;QACRK,MAAM;QACNJ,OAAO;QACPC,kBAAkB;QAClBC,kBAAkB;IACpB;CACD;AAEM,MAAMI,kBAA+C;IAC1D;QAAEC,WAAWJ;QAAsBK,YAAY;IAAE;IACjD;QAAED,WAAWF;QAAuBG,YAAY;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G;QACHC,QAAQ;QACRC,OAAO;IACT;IACA;QACEH,GAAG;YACD8B,OAAO,IAAIC,KAAK;YAChBC,KAAK,IAAID,KAAK;QAChB;QACA9B,GAAG;QACHC,QAAQ;QACRC,OAAO;IACT;CACD,CAAC"}
@@ -48,9 +48,15 @@ _export(exports, {
48
48
  computeLongestBars: function() {
49
49
  return computeLongestBars;
50
50
  },
51
+ copyStyle: function() {
52
+ return copyStyle;
53
+ },
51
54
  createDateXAxis: function() {
52
55
  return createDateXAxis;
53
56
  },
57
+ createMeasurementSpan: function() {
58
+ return createMeasurementSpan;
59
+ },
54
60
  createNumericXAxis: function() {
55
61
  return createNumericXAxis;
56
62
  },
@@ -1380,14 +1386,14 @@ function formatScientificLimitWidth(value) {
1380
1386
  }
1381
1387
  const DEFAULT_BAR_WIDTH = 16;
1382
1388
  const MIN_BAR_WIDTH = 1;
1383
- const getBarWidth = (barWidthProp, maxBarWidthProp, adjustedValue = DEFAULT_BAR_WIDTH)=>{
1389
+ const getBarWidth = (barWidthProp, maxBarWidthProp, adjustedValue = DEFAULT_BAR_WIDTH, modeProp)=>{
1384
1390
  let barWidth;
1385
- if (typeof barWidthProp === 'number') {
1391
+ if (barWidthProp === 'auto' || modeProp === 'histogram') {
1392
+ barWidth = adjustedValue;
1393
+ } else if (typeof barWidthProp === 'number') {
1386
1394
  barWidth = barWidthProp;
1387
- } else if (barWidthProp === 'default' || typeof barWidthProp === 'undefined') {
1388
- barWidth = Math.min(adjustedValue, DEFAULT_BAR_WIDTH);
1389
1395
  } else {
1390
- barWidth = adjustedValue;
1396
+ barWidth = Math.min(adjustedValue, DEFAULT_BAR_WIDTH);
1391
1397
  }
1392
1398
  if (typeof maxBarWidthProp === 'number') {
1393
1399
  barWidth = Math.min(barWidth, maxBarWidthProp);
@@ -1531,3 +1537,48 @@ const sortAxisCategories = (categoryToValues, categoryOrder)=>{
1531
1537
  }
1532
1538
  return Object.keys(categoryToValues);
1533
1539
  };
1540
+ function copyStyle(properties, fromEl, toEl) {
1541
+ const styles = getComputedStyle(fromEl);
1542
+ if (Array.isArray(properties)) {
1543
+ properties.forEach((prop)=>{
1544
+ (0, _d3selection.select)(toEl).style(prop, styles.getPropertyValue(prop));
1545
+ });
1546
+ } else {
1547
+ Object.entries(properties).forEach(([fromProp, toProp])=>{
1548
+ (0, _d3selection.select)(toEl).style(toProp, styles.getPropertyValue(fromProp));
1549
+ });
1550
+ }
1551
+ }
1552
+ let measurementSpanCounter = 0;
1553
+ function getUniqueMeasurementSpanId() {
1554
+ measurementSpanCounter++;
1555
+ return `measurement_span_${measurementSpanCounter}`;
1556
+ }
1557
+ const MEASUREMENT_SPAN_STYLE = {
1558
+ position: 'absolute',
1559
+ visibility: 'hidden',
1560
+ top: '-20000px',
1561
+ left: 0,
1562
+ padding: 0,
1563
+ margin: 0,
1564
+ border: 'none',
1565
+ whiteSpace: 'pre'
1566
+ };
1567
+ const createMeasurementSpan = (text, className, parentElement)=>{
1568
+ const MEASUREMENT_SPAN_ID = getUniqueMeasurementSpanId();
1569
+ let measurementSpan = document.getElementById(MEASUREMENT_SPAN_ID);
1570
+ if (!measurementSpan) {
1571
+ measurementSpan = document.createElement('span');
1572
+ measurementSpan.setAttribute('id', MEASUREMENT_SPAN_ID);
1573
+ measurementSpan.setAttribute('aria-hidden', 'true');
1574
+ if (parentElement) {
1575
+ parentElement.appendChild(measurementSpan);
1576
+ } else {
1577
+ document.body.appendChild(measurementSpan);
1578
+ }
1579
+ }
1580
+ measurementSpan.setAttribute('class', className);
1581
+ Object.assign(measurementSpan.style, MEASUREMENT_SPAN_STYLE);
1582
+ measurementSpan.textContent = `${text}`;
1583
+ return measurementSpan;
1584
+ };