@elliemae/ds-dataviz 3.80.0-next.67 → 3.80.0-next.71

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 (398) hide show
  1. package/dist/cjs/constants/index.js +73 -0
  2. package/dist/cjs/constants/index.js.map +7 -0
  3. package/dist/cjs/graphs/Chart/Chart.js +6 -1
  4. package/dist/cjs/graphs/Chart/Chart.js.map +2 -2
  5. package/dist/cjs/graphs/Chart/ChartContext.js.map +2 -2
  6. package/dist/cjs/graphs/Chart/SingleStackedBar/SingleStackedBar.js +36 -24
  7. package/dist/cjs/graphs/Chart/SingleStackedBar/SingleStackedBar.js.map +3 -3
  8. package/dist/cjs/graphs/Chart/SingleStackedBar/styles.js +12 -5
  9. package/dist/cjs/graphs/Chart/SingleStackedBar/styles.js.map +2 -2
  10. package/dist/cjs/graphs/Chart/config/chartInteractionStore.js +98 -0
  11. package/dist/cjs/graphs/Chart/config/chartInteractionStore.js.map +7 -0
  12. package/dist/cjs/graphs/Chart/config/useChart.js +56 -40
  13. package/dist/cjs/graphs/Chart/config/useChart.js.map +2 -2
  14. package/dist/cjs/graphs/Chart/config/useChartDescription.js +62 -0
  15. package/dist/cjs/graphs/Chart/config/useChartDescription.js.map +7 -0
  16. package/dist/cjs/graphs/Chart/config/useEntranceAnimation.js +141 -0
  17. package/dist/cjs/graphs/Chart/config/useEntranceAnimation.js.map +7 -0
  18. package/dist/cjs/graphs/Chart/config/useGetters.js +10 -0
  19. package/dist/cjs/graphs/Chart/config/useGetters.js.map +2 -2
  20. package/dist/cjs/graphs/Chart/config/useInternalMargins.js +25 -5
  21. package/dist/cjs/graphs/Chart/config/useInternalMargins.js.map +2 -2
  22. package/dist/cjs/graphs/Chart/config/useKeyboardNavigation.js +35 -51
  23. package/dist/cjs/graphs/Chart/config/useKeyboardNavigation.js.map +2 -2
  24. package/dist/cjs/graphs/Chart/config/useScales.js +200 -67
  25. package/dist/cjs/graphs/Chart/config/useScales.js.map +2 -2
  26. package/dist/cjs/graphs/Chart/config/useValidateProps.js +53 -4
  27. package/dist/cjs/graphs/Chart/config/useValidateProps.js.map +2 -2
  28. package/dist/cjs/graphs/Chart/config/useValueAxisTransition.js +128 -0
  29. package/dist/cjs/graphs/Chart/config/useValueAxisTransition.js.map +7 -0
  30. package/dist/cjs/graphs/Chart/config/useWheelScroll.js +111 -0
  31. package/dist/cjs/graphs/Chart/config/useWheelScroll.js.map +7 -0
  32. package/dist/cjs/graphs/Chart/helpers/alignedTicks.js +56 -0
  33. package/dist/cjs/graphs/Chart/helpers/alignedTicks.js.map +7 -0
  34. package/dist/cjs/graphs/Chart/helpers/barPath.js +53 -0
  35. package/dist/cjs/graphs/Chart/helpers/barPath.js.map +7 -0
  36. package/dist/cjs/graphs/Chart/{react-desc-prop-types.js → helpers/dataInView.js} +26 -27
  37. package/dist/cjs/graphs/Chart/helpers/dataInView.js.map +7 -0
  38. package/dist/cjs/graphs/Chart/helpers/index.js +34 -0
  39. package/dist/cjs/graphs/Chart/helpers/index.js.map +2 -2
  40. package/dist/cjs/graphs/Chart/{SingleStackedBar/exported-related/theming.js → helpers/logAxis.js} +13 -9
  41. package/dist/cjs/graphs/Chart/helpers/logAxis.js.map +7 -0
  42. package/dist/cjs/graphs/Chart/helpers/tickRotation.js +54 -0
  43. package/dist/cjs/graphs/Chart/helpers/tickRotation.js.map +7 -0
  44. package/dist/cjs/graphs/Chart/helpers/timeTicks.js +56 -0
  45. package/dist/cjs/graphs/Chart/helpers/timeTicks.js.map +7 -0
  46. package/dist/cjs/graphs/Chart/helpers/trend.js +45 -0
  47. package/dist/cjs/graphs/Chart/helpers/trend.js.map +7 -0
  48. package/dist/cjs/graphs/Chart/{SingleStackedBar/exported-related/index.js → helpers/useSerieDimming.js} +20 -6
  49. package/dist/cjs/graphs/Chart/helpers/useSerieDimming.js.map +7 -0
  50. package/dist/cjs/graphs/Chart/helpers/useUniqueData.js +15 -18
  51. package/dist/cjs/graphs/Chart/helpers/useUniqueData.js.map +2 -2
  52. package/dist/cjs/graphs/Chart/helpers/useVirtualizedSeries.js +12 -5
  53. package/dist/cjs/graphs/Chart/helpers/useVirtualizedSeries.js.map +2 -2
  54. package/dist/cjs/graphs/Chart/{DataTestIds.js → helpers/zeroLine.js} +12 -9
  55. package/dist/cjs/graphs/Chart/helpers/zeroLine.js.map +7 -0
  56. package/dist/cjs/graphs/Chart/parts/A11yRegion.js +8 -2
  57. package/dist/cjs/graphs/Chart/parts/A11yRegion.js.map +2 -2
  58. package/dist/cjs/graphs/Chart/parts/Axis/Axis.js +40 -4
  59. package/dist/cjs/graphs/Chart/parts/Axis/Axis.js.map +2 -2
  60. package/dist/cjs/graphs/Chart/parts/Axis/AxisBottom.js +18 -4
  61. package/dist/cjs/graphs/Chart/parts/Axis/AxisBottom.js.map +2 -2
  62. package/dist/cjs/graphs/Chart/parts/Axis/AxisLeft.js +14 -6
  63. package/dist/cjs/graphs/Chart/parts/Axis/AxisLeft.js.map +2 -2
  64. package/dist/cjs/graphs/Chart/parts/Axis/AxisRight.js +14 -4
  65. package/dist/cjs/graphs/Chart/parts/Axis/AxisRight.js.map +2 -2
  66. package/dist/cjs/graphs/Chart/parts/Axis/GridLine.js +15 -1
  67. package/dist/cjs/graphs/Chart/parts/Axis/GridLine.js.map +2 -2
  68. package/dist/cjs/graphs/Chart/parts/Axis/Tick.js +10 -4
  69. package/dist/cjs/graphs/Chart/parts/Axis/Tick.js.map +2 -2
  70. package/dist/cjs/graphs/Chart/parts/Axis/useTickTransition.js +170 -0
  71. package/dist/cjs/graphs/Chart/parts/Axis/useTickTransition.js.map +7 -0
  72. package/dist/cjs/graphs/Chart/parts/ChartContainer.js +41 -19
  73. package/dist/cjs/graphs/Chart/parts/ChartContainer.js.map +2 -2
  74. package/dist/cjs/graphs/Chart/parts/FocusableRegion.js +6 -3
  75. package/dist/cjs/graphs/Chart/parts/FocusableRegion.js.map +2 -2
  76. package/dist/cjs/graphs/Chart/parts/HoverBand.js +86 -0
  77. package/dist/cjs/graphs/Chart/parts/HoverBand.js.map +7 -0
  78. package/dist/cjs/graphs/Chart/parts/Labels/Label.js +12 -1
  79. package/dist/cjs/graphs/Chart/parts/Labels/Label.js.map +2 -2
  80. package/dist/cjs/graphs/Chart/parts/Labels/index.js +12 -4
  81. package/dist/cjs/graphs/Chart/parts/Labels/index.js.map +2 -2
  82. package/dist/cjs/graphs/Chart/parts/Legend/BottomLegend.js +6 -3
  83. package/dist/cjs/graphs/Chart/parts/Legend/BottomLegend.js.map +2 -2
  84. package/dist/cjs/graphs/Chart/parts/Legend/LeftLegend.js +2 -6
  85. package/dist/cjs/graphs/Chart/parts/Legend/LeftLegend.js.map +2 -2
  86. package/dist/cjs/graphs/Chart/parts/Legend/LegendItem.js +91 -9
  87. package/dist/cjs/graphs/Chart/parts/Legend/LegendItem.js.map +2 -2
  88. package/dist/cjs/graphs/Chart/parts/Legend/RightLegend.js +3 -4
  89. package/dist/cjs/graphs/Chart/parts/Legend/RightLegend.js.map +2 -2
  90. package/dist/cjs/graphs/Chart/parts/Legend/TopLegend.js +8 -6
  91. package/dist/cjs/graphs/Chart/parts/Legend/TopLegend.js.map +2 -2
  92. package/dist/cjs/graphs/Chart/parts/Scrapper/Scrapper.js +29 -3
  93. package/dist/cjs/graphs/Chart/parts/Scrapper/Scrapper.js.map +2 -2
  94. package/dist/cjs/graphs/Chart/parts/Scrapper/ScrapperLine.js +82 -55
  95. package/dist/cjs/graphs/Chart/parts/Scrapper/ScrapperLine.js.map +3 -3
  96. package/dist/cjs/graphs/Chart/parts/Scrapper/VerticalScrapper.js +14 -6
  97. package/dist/cjs/graphs/Chart/parts/Scrapper/VerticalScrapper.js.map +2 -2
  98. package/dist/cjs/graphs/Chart/parts/Scrapper/VerticalScrapperLine.js +67 -43
  99. package/dist/cjs/graphs/Chart/parts/Scrapper/VerticalScrapperLine.js.map +2 -2
  100. package/dist/cjs/graphs/Chart/{SingleStackedBar/exported-related/data-test-ids.js → parts/ScreenReaderText.js} +17 -7
  101. package/dist/cjs/graphs/Chart/parts/ScreenReaderText.js.map +7 -0
  102. package/dist/cjs/graphs/Chart/parts/Scroller/BlurMask.js +14 -9
  103. package/dist/cjs/graphs/Chart/parts/Scroller/BlurMask.js.map +2 -2
  104. package/dist/cjs/graphs/Chart/parts/Scroller/Controllers.js +152 -49
  105. package/dist/cjs/graphs/Chart/parts/Scroller/Controllers.js.map +2 -2
  106. package/dist/cjs/graphs/Chart/parts/Scroller/ScrollBarX.js +22 -6
  107. package/dist/cjs/graphs/Chart/parts/Scroller/ScrollBarX.js.map +2 -2
  108. package/dist/cjs/graphs/Chart/parts/Scroller/ScrollBarY.js +13 -6
  109. package/dist/cjs/graphs/Chart/parts/Scroller/ScrollBarY.js.map +2 -2
  110. package/dist/cjs/graphs/Chart/parts/Scroller/ScrollableContainerX.js +42 -35
  111. package/dist/cjs/graphs/Chart/parts/Scroller/ScrollableContainerX.js.map +2 -2
  112. package/dist/cjs/graphs/Chart/parts/Scroller/ScrollableContainerY.js +9 -4
  113. package/dist/cjs/graphs/Chart/parts/Scroller/ScrollableContainerY.js.map +2 -2
  114. package/dist/cjs/graphs/Chart/parts/SeriesFactory.js +39 -30
  115. package/dist/cjs/graphs/Chart/parts/SeriesFactory.js.map +2 -2
  116. package/dist/cjs/graphs/Chart/parts/TrendHighlight.js +57 -19
  117. package/dist/cjs/graphs/Chart/parts/TrendHighlight.js.map +2 -2
  118. package/dist/cjs/graphs/Chart/parts/ZeroLine.js +66 -0
  119. package/dist/cjs/graphs/Chart/parts/ZeroLine.js.map +7 -0
  120. package/dist/cjs/graphs/Chart/scales/index.js +50 -20
  121. package/dist/cjs/graphs/Chart/scales/index.js.map +3 -3
  122. package/dist/cjs/graphs/Chart/series/Area.js +76 -9
  123. package/dist/cjs/graphs/Chart/series/Area.js.map +2 -2
  124. package/dist/cjs/graphs/Chart/series/Bars.js +3 -1
  125. package/dist/cjs/graphs/Chart/series/Bars.js.map +2 -2
  126. package/dist/cjs/graphs/Chart/series/HorizontalBars.js +4 -1
  127. package/dist/cjs/graphs/Chart/series/HorizontalBars.js.map +2 -2
  128. package/dist/cjs/graphs/Chart/series/HorizontalStackedBars.js +14 -7
  129. package/dist/cjs/graphs/Chart/series/HorizontalStackedBars.js.map +2 -2
  130. package/dist/cjs/graphs/Chart/series/Line.js +9 -7
  131. package/dist/cjs/graphs/Chart/series/Line.js.map +2 -2
  132. package/dist/cjs/graphs/Chart/series/Point.js +114 -128
  133. package/dist/cjs/graphs/Chart/series/Point.js.map +3 -3
  134. package/dist/cjs/graphs/Chart/series/Points.js +8 -2
  135. package/dist/cjs/graphs/Chart/series/Points.js.map +2 -2
  136. package/dist/cjs/graphs/Chart/series/Rect.js +133 -122
  137. package/dist/cjs/graphs/Chart/series/Rect.js.map +3 -3
  138. package/dist/cjs/graphs/Chart/series/StackedBar.js +14 -6
  139. package/dist/cjs/graphs/Chart/series/StackedBar.js.map +2 -2
  140. package/dist/cjs/graphs/Chart/styles.js +65 -34
  141. package/dist/cjs/graphs/Chart/styles.js.map +2 -2
  142. package/dist/cjs/graphs/constants.js +24 -9
  143. package/dist/cjs/graphs/constants.js.map +2 -2
  144. package/dist/cjs/index.js +17 -6
  145. package/dist/cjs/index.js.map +3 -3
  146. package/dist/cjs/react-desc-prop-types.js +150 -0
  147. package/dist/cjs/react-desc-prop-types.js.map +7 -0
  148. package/dist/cjs/typescript-testing/slot-props.js +69 -0
  149. package/dist/cjs/typescript-testing/slot-props.js.map +7 -0
  150. package/dist/cjs/typescript-testing/typescript-data-viz-valid.js +34 -2
  151. package/dist/cjs/typescript-testing/typescript-data-viz-valid.js.map +2 -2
  152. package/dist/cjs/typescript-testing/typescript-single-stacked-bar-valid.js +93 -0
  153. package/dist/cjs/typescript-testing/typescript-single-stacked-bar-valid.js.map +7 -0
  154. package/dist/esm/constants/index.js +43 -0
  155. package/dist/esm/constants/index.js.map +7 -0
  156. package/dist/esm/graphs/Chart/Chart.js +6 -1
  157. package/dist/esm/graphs/Chart/Chart.js.map +2 -2
  158. package/dist/esm/graphs/Chart/ChartContext.js.map +2 -2
  159. package/dist/esm/graphs/Chart/SingleStackedBar/SingleStackedBar.js +40 -23
  160. package/dist/esm/graphs/Chart/SingleStackedBar/SingleStackedBar.js.map +2 -2
  161. package/dist/esm/graphs/Chart/SingleStackedBar/styles.js +12 -5
  162. package/dist/esm/graphs/Chart/SingleStackedBar/styles.js.map +2 -2
  163. package/dist/esm/graphs/Chart/config/chartInteractionStore.js +68 -0
  164. package/dist/esm/graphs/Chart/config/chartInteractionStore.js.map +7 -0
  165. package/dist/esm/graphs/Chart/config/useChart.js +58 -42
  166. package/dist/esm/graphs/Chart/config/useChart.js.map +2 -2
  167. package/dist/esm/graphs/Chart/config/useChartDescription.js +32 -0
  168. package/dist/esm/graphs/Chart/config/useChartDescription.js.map +7 -0
  169. package/dist/esm/graphs/Chart/config/useEntranceAnimation.js +111 -0
  170. package/dist/esm/graphs/Chart/config/useEntranceAnimation.js.map +7 -0
  171. package/dist/esm/graphs/Chart/config/useGetters.js +10 -0
  172. package/dist/esm/graphs/Chart/config/useGetters.js.map +2 -2
  173. package/dist/esm/graphs/Chart/config/useInternalMargins.js +26 -6
  174. package/dist/esm/graphs/Chart/config/useInternalMargins.js.map +2 -2
  175. package/dist/esm/graphs/Chart/config/useKeyboardNavigation.js +35 -51
  176. package/dist/esm/graphs/Chart/config/useKeyboardNavigation.js.map +2 -2
  177. package/dist/esm/graphs/Chart/config/useScales.js +202 -69
  178. package/dist/esm/graphs/Chart/config/useScales.js.map +2 -2
  179. package/dist/esm/graphs/Chart/config/useValidateProps.js +53 -4
  180. package/dist/esm/graphs/Chart/config/useValidateProps.js.map +2 -2
  181. package/dist/esm/graphs/Chart/config/useValueAxisTransition.js +98 -0
  182. package/dist/esm/graphs/Chart/config/useValueAxisTransition.js.map +7 -0
  183. package/dist/esm/graphs/Chart/config/useWheelScroll.js +81 -0
  184. package/dist/esm/graphs/Chart/config/useWheelScroll.js.map +7 -0
  185. package/dist/esm/graphs/Chart/helpers/alignedTicks.js +26 -0
  186. package/dist/esm/graphs/Chart/helpers/alignedTicks.js.map +7 -0
  187. package/dist/esm/graphs/Chart/helpers/barPath.js +23 -0
  188. package/dist/esm/graphs/Chart/helpers/barPath.js.map +7 -0
  189. package/dist/esm/graphs/Chart/helpers/dataInView.js +28 -0
  190. package/dist/esm/graphs/Chart/helpers/dataInView.js.map +7 -0
  191. package/dist/esm/graphs/Chart/helpers/index.js +34 -0
  192. package/dist/esm/graphs/Chart/helpers/index.js.map +2 -2
  193. package/dist/esm/graphs/Chart/helpers/logAxis.js +14 -0
  194. package/dist/esm/graphs/Chart/helpers/logAxis.js.map +7 -0
  195. package/dist/esm/graphs/Chart/helpers/tickRotation.js +24 -0
  196. package/dist/esm/graphs/Chart/helpers/tickRotation.js.map +7 -0
  197. package/dist/esm/graphs/Chart/helpers/timeTicks.js +26 -0
  198. package/dist/esm/graphs/Chart/helpers/timeTicks.js.map +7 -0
  199. package/dist/esm/graphs/Chart/helpers/trend.js +15 -0
  200. package/dist/esm/graphs/Chart/helpers/trend.js.map +7 -0
  201. package/dist/esm/graphs/Chart/helpers/useSerieDimming.js +15 -0
  202. package/dist/esm/graphs/Chart/helpers/useSerieDimming.js.map +7 -0
  203. package/dist/esm/graphs/Chart/helpers/useUniqueData.js +15 -18
  204. package/dist/esm/graphs/Chart/helpers/useUniqueData.js.map +2 -2
  205. package/dist/esm/graphs/Chart/helpers/useVirtualizedSeries.js +12 -5
  206. package/dist/esm/graphs/Chart/helpers/useVirtualizedSeries.js.map +2 -2
  207. package/dist/esm/graphs/Chart/helpers/zeroLine.js +13 -0
  208. package/dist/esm/graphs/Chart/helpers/zeroLine.js.map +7 -0
  209. package/dist/esm/graphs/Chart/parts/A11yRegion.js +7 -1
  210. package/dist/esm/graphs/Chart/parts/A11yRegion.js.map +2 -2
  211. package/dist/esm/graphs/Chart/parts/Axis/Axis.js +40 -4
  212. package/dist/esm/graphs/Chart/parts/Axis/Axis.js.map +2 -2
  213. package/dist/esm/graphs/Chart/parts/Axis/AxisBottom.js +18 -4
  214. package/dist/esm/graphs/Chart/parts/Axis/AxisBottom.js.map +2 -2
  215. package/dist/esm/graphs/Chart/parts/Axis/AxisLeft.js +14 -6
  216. package/dist/esm/graphs/Chart/parts/Axis/AxisLeft.js.map +2 -2
  217. package/dist/esm/graphs/Chart/parts/Axis/AxisRight.js +14 -4
  218. package/dist/esm/graphs/Chart/parts/Axis/AxisRight.js.map +2 -2
  219. package/dist/esm/graphs/Chart/parts/Axis/GridLine.js +16 -2
  220. package/dist/esm/graphs/Chart/parts/Axis/GridLine.js.map +2 -2
  221. package/dist/esm/graphs/Chart/parts/Axis/Tick.js +11 -5
  222. package/dist/esm/graphs/Chart/parts/Axis/Tick.js.map +2 -2
  223. package/dist/esm/graphs/Chart/parts/Axis/useTickTransition.js +140 -0
  224. package/dist/esm/graphs/Chart/parts/Axis/useTickTransition.js.map +7 -0
  225. package/dist/esm/graphs/Chart/parts/ChartContainer.js +41 -19
  226. package/dist/esm/graphs/Chart/parts/ChartContainer.js.map +2 -2
  227. package/dist/esm/graphs/Chart/parts/FocusableRegion.js +7 -4
  228. package/dist/esm/graphs/Chart/parts/FocusableRegion.js.map +2 -2
  229. package/dist/esm/graphs/Chart/parts/HoverBand.js +56 -0
  230. package/dist/esm/graphs/Chart/parts/HoverBand.js.map +7 -0
  231. package/dist/esm/graphs/Chart/parts/Labels/Label.js +12 -1
  232. package/dist/esm/graphs/Chart/parts/Labels/Label.js.map +2 -2
  233. package/dist/esm/graphs/Chart/parts/Labels/index.js +12 -4
  234. package/dist/esm/graphs/Chart/parts/Labels/index.js.map +2 -2
  235. package/dist/esm/graphs/Chart/parts/Legend/BottomLegend.js +7 -4
  236. package/dist/esm/graphs/Chart/parts/Legend/BottomLegend.js.map +2 -2
  237. package/dist/esm/graphs/Chart/parts/Legend/LeftLegend.js +3 -7
  238. package/dist/esm/graphs/Chart/parts/Legend/LeftLegend.js.map +2 -2
  239. package/dist/esm/graphs/Chart/parts/Legend/LegendItem.js +91 -9
  240. package/dist/esm/graphs/Chart/parts/Legend/LegendItem.js.map +2 -2
  241. package/dist/esm/graphs/Chart/parts/Legend/RightLegend.js +4 -5
  242. package/dist/esm/graphs/Chart/parts/Legend/RightLegend.js.map +2 -2
  243. package/dist/esm/graphs/Chart/parts/Legend/TopLegend.js +9 -7
  244. package/dist/esm/graphs/Chart/parts/Legend/TopLegend.js.map +2 -2
  245. package/dist/esm/graphs/Chart/parts/Scrapper/Scrapper.js +29 -3
  246. package/dist/esm/graphs/Chart/parts/Scrapper/Scrapper.js.map +2 -2
  247. package/dist/esm/graphs/Chart/parts/Scrapper/ScrapperLine.js +83 -56
  248. package/dist/esm/graphs/Chart/parts/Scrapper/ScrapperLine.js.map +3 -3
  249. package/dist/esm/graphs/Chart/parts/Scrapper/VerticalScrapper.js +14 -6
  250. package/dist/esm/graphs/Chart/parts/Scrapper/VerticalScrapper.js.map +2 -2
  251. package/dist/esm/graphs/Chart/parts/Scrapper/VerticalScrapperLine.js +68 -44
  252. package/dist/esm/graphs/Chart/parts/Scrapper/VerticalScrapperLine.js.map +2 -2
  253. package/dist/esm/graphs/Chart/parts/ScreenReaderText.js +18 -0
  254. package/dist/esm/graphs/Chart/parts/ScreenReaderText.js.map +7 -0
  255. package/dist/esm/graphs/Chart/parts/Scroller/BlurMask.js +14 -9
  256. package/dist/esm/graphs/Chart/parts/Scroller/BlurMask.js.map +2 -2
  257. package/dist/esm/graphs/Chart/parts/Scroller/Controllers.js +154 -51
  258. package/dist/esm/graphs/Chart/parts/Scroller/Controllers.js.map +2 -2
  259. package/dist/esm/graphs/Chart/parts/Scroller/ScrollBarX.js +22 -6
  260. package/dist/esm/graphs/Chart/parts/Scroller/ScrollBarX.js.map +2 -2
  261. package/dist/esm/graphs/Chart/parts/Scroller/ScrollBarY.js +13 -6
  262. package/dist/esm/graphs/Chart/parts/Scroller/ScrollBarY.js.map +2 -2
  263. package/dist/esm/graphs/Chart/parts/Scroller/ScrollableContainerX.js +43 -36
  264. package/dist/esm/graphs/Chart/parts/Scroller/ScrollableContainerX.js.map +2 -2
  265. package/dist/esm/graphs/Chart/parts/Scroller/ScrollableContainerY.js +10 -5
  266. package/dist/esm/graphs/Chart/parts/Scroller/ScrollableContainerY.js.map +2 -2
  267. package/dist/esm/graphs/Chart/parts/SeriesFactory.js +40 -31
  268. package/dist/esm/graphs/Chart/parts/SeriesFactory.js.map +2 -2
  269. package/dist/esm/graphs/Chart/parts/TrendHighlight.js +58 -20
  270. package/dist/esm/graphs/Chart/parts/TrendHighlight.js.map +2 -2
  271. package/dist/esm/graphs/Chart/parts/ZeroLine.js +36 -0
  272. package/dist/esm/graphs/Chart/parts/ZeroLine.js.map +7 -0
  273. package/dist/esm/graphs/Chart/scales/index.js +51 -21
  274. package/dist/esm/graphs/Chart/scales/index.js.map +3 -3
  275. package/dist/esm/graphs/Chart/series/Area.js +77 -10
  276. package/dist/esm/graphs/Chart/series/Area.js.map +2 -2
  277. package/dist/esm/graphs/Chart/series/Bars.js +3 -1
  278. package/dist/esm/graphs/Chart/series/Bars.js.map +2 -2
  279. package/dist/esm/graphs/Chart/series/HorizontalBars.js +4 -1
  280. package/dist/esm/graphs/Chart/series/HorizontalBars.js.map +2 -2
  281. package/dist/esm/graphs/Chart/series/HorizontalStackedBars.js +15 -8
  282. package/dist/esm/graphs/Chart/series/HorizontalStackedBars.js.map +2 -2
  283. package/dist/esm/graphs/Chart/series/Line.js +9 -7
  284. package/dist/esm/graphs/Chart/series/Line.js.map +2 -2
  285. package/dist/esm/graphs/Chart/series/Point.js +120 -130
  286. package/dist/esm/graphs/Chart/series/Point.js.map +3 -3
  287. package/dist/esm/graphs/Chart/series/Points.js +8 -2
  288. package/dist/esm/graphs/Chart/series/Points.js.map +2 -2
  289. package/dist/esm/graphs/Chart/series/Rect.js +134 -123
  290. package/dist/esm/graphs/Chart/series/Rect.js.map +3 -3
  291. package/dist/esm/graphs/Chart/series/StackedBar.js +15 -7
  292. package/dist/esm/graphs/Chart/series/StackedBar.js.map +2 -2
  293. package/dist/esm/graphs/Chart/styles.js +66 -35
  294. package/dist/esm/graphs/Chart/styles.js.map +2 -2
  295. package/dist/esm/graphs/constants.js +25 -10
  296. package/dist/esm/graphs/constants.js.map +2 -2
  297. package/dist/esm/index.js +19 -7
  298. package/dist/esm/index.js.map +2 -2
  299. package/dist/esm/react-desc-prop-types.js +125 -0
  300. package/dist/esm/react-desc-prop-types.js.map +7 -0
  301. package/dist/esm/typescript-testing/slot-props.js +46 -0
  302. package/dist/esm/typescript-testing/slot-props.js.map +7 -0
  303. package/dist/esm/typescript-testing/typescript-data-viz-valid.js +35 -3
  304. package/dist/esm/typescript-testing/typescript-data-viz-valid.js.map +2 -2
  305. package/dist/esm/typescript-testing/typescript-single-stacked-bar-valid.js +70 -0
  306. package/dist/esm/typescript-testing/typescript-single-stacked-bar-valid.js.map +7 -0
  307. package/dist/types/constants/index.d.ts +42 -0
  308. package/dist/types/graphs/Chart/Chart.d.ts +4 -2
  309. package/dist/types/graphs/Chart/ChartContext.d.ts +9 -11
  310. package/dist/types/graphs/Chart/SingleStackedBar/SingleStackedBar.d.ts +1 -1
  311. package/dist/types/graphs/Chart/config/chartInteractionStore.d.ts +32 -0
  312. package/dist/types/graphs/Chart/config/useChart.d.ts +9 -11
  313. package/dist/types/graphs/Chart/config/useChartDescription.d.ts +5 -0
  314. package/dist/types/graphs/Chart/config/useEntranceAnimation.d.ts +16 -0
  315. package/dist/types/graphs/Chart/config/useGetters.d.ts +1 -1
  316. package/dist/types/graphs/Chart/config/useInternalMargins.d.ts +4 -1
  317. package/dist/types/graphs/Chart/config/useKeyboardNavigation.d.ts +1 -1
  318. package/dist/types/graphs/Chart/config/useScales.d.ts +8 -2
  319. package/dist/types/graphs/Chart/config/useValidateProps.d.ts +7 -1
  320. package/dist/types/graphs/Chart/config/useValueAxisTransition.d.ts +6 -0
  321. package/dist/types/graphs/Chart/config/useWheelScroll.d.ts +2 -0
  322. package/dist/types/graphs/Chart/helpers/alignedTicks.d.ts +1 -0
  323. package/dist/types/graphs/Chart/helpers/barPath.d.ts +11 -0
  324. package/dist/types/graphs/Chart/helpers/dataInView.d.ts +6 -0
  325. package/dist/types/graphs/Chart/helpers/index.d.ts +10 -1
  326. package/dist/types/graphs/Chart/helpers/logAxis.d.ts +8 -0
  327. package/dist/types/graphs/Chart/helpers/tickRotation.d.ts +2 -0
  328. package/dist/types/graphs/Chart/helpers/timeTicks.d.ts +2 -0
  329. package/dist/types/graphs/Chart/helpers/trend.d.ts +3 -0
  330. package/dist/types/graphs/Chart/helpers/useSerieDimming.d.ts +3 -0
  331. package/dist/types/graphs/Chart/helpers/useUniqueData.d.ts +1 -1
  332. package/dist/types/graphs/Chart/helpers/useVirtualizedSeries.d.ts +1 -1
  333. package/dist/types/graphs/Chart/helpers/zeroLine.d.ts +2 -0
  334. package/dist/types/graphs/Chart/parts/Axis/Axis.d.ts +4 -1
  335. package/dist/types/graphs/Chart/parts/Axis/Tick.d.ts +1 -0
  336. package/dist/types/graphs/Chart/parts/Axis/useTickTransition.d.ts +24 -0
  337. package/dist/types/graphs/Chart/parts/HoverBand.d.ts +2 -0
  338. package/dist/types/graphs/Chart/parts/Labels/Label.d.ts +3 -0
  339. package/dist/types/graphs/Chart/parts/Scrapper/ScrapperLine.d.ts +11 -1
  340. package/dist/types/graphs/Chart/parts/Scrapper/VerticalScrapperLine.d.ts +6 -7
  341. package/dist/types/graphs/Chart/parts/ScreenReaderText.d.ts +5 -0
  342. package/dist/types/graphs/Chart/parts/TrendHighlight.d.ts +3 -2
  343. package/dist/types/graphs/Chart/parts/ZeroLine.d.ts +2 -0
  344. package/dist/types/graphs/Chart/scales/index.d.ts +10 -3
  345. package/dist/types/graphs/Chart/series/Area.d.ts +1 -1
  346. package/dist/types/graphs/Chart/series/Bars.d.ts +1 -1
  347. package/dist/types/graphs/Chart/series/HorizontalBars.d.ts +1 -1
  348. package/dist/types/graphs/Chart/series/HorizontalStackedBars.d.ts +1 -1
  349. package/dist/types/graphs/Chart/series/Line.d.ts +1 -1
  350. package/dist/types/graphs/Chart/series/Point.d.ts +3 -2
  351. package/dist/types/graphs/Chart/series/Points.d.ts +1 -1
  352. package/dist/types/graphs/Chart/series/Rect.d.ts +3 -2
  353. package/dist/types/graphs/Chart/series/StackedBar.d.ts +1 -1
  354. package/dist/types/graphs/Chart/styles.d.ts +18 -5
  355. package/dist/types/graphs/constants.d.ts +13 -1
  356. package/dist/types/index.d.ts +6 -1
  357. package/dist/types/react-desc-prop-types.d.ts +228 -0
  358. package/package.json +8 -7
  359. package/dist/cjs/graphs/Chart/DataTestIds.js.map +0 -7
  360. package/dist/cjs/graphs/Chart/SingleStackedBar/exported-related/data-test-ids.js.map +0 -7
  361. package/dist/cjs/graphs/Chart/SingleStackedBar/exported-related/index.js.map +0 -7
  362. package/dist/cjs/graphs/Chart/SingleStackedBar/exported-related/theming.js.map +0 -7
  363. package/dist/cjs/graphs/Chart/SingleStackedBar/index.js +0 -31
  364. package/dist/cjs/graphs/Chart/SingleStackedBar/index.js.map +0 -7
  365. package/dist/cjs/graphs/Chart/SingleStackedBar/react-desc-prop-types.js +0 -51
  366. package/dist/cjs/graphs/Chart/SingleStackedBar/react-desc-prop-types.js.map +0 -7
  367. package/dist/cjs/graphs/Chart/index.js +0 -33
  368. package/dist/cjs/graphs/Chart/index.js.map +0 -7
  369. package/dist/cjs/graphs/Chart/react-desc-prop-types.js.map +0 -7
  370. package/dist/cjs/graphs/index.js +0 -31
  371. package/dist/cjs/graphs/index.js.map +0 -7
  372. package/dist/esm/graphs/Chart/DataTestIds.js +0 -10
  373. package/dist/esm/graphs/Chart/DataTestIds.js.map +0 -7
  374. package/dist/esm/graphs/Chart/SingleStackedBar/exported-related/data-test-ids.js +0 -8
  375. package/dist/esm/graphs/Chart/SingleStackedBar/exported-related/data-test-ids.js.map +0 -7
  376. package/dist/esm/graphs/Chart/SingleStackedBar/exported-related/index.js +0 -4
  377. package/dist/esm/graphs/Chart/SingleStackedBar/exported-related/index.js.map +0 -7
  378. package/dist/esm/graphs/Chart/SingleStackedBar/exported-related/theming.js +0 -10
  379. package/dist/esm/graphs/Chart/SingleStackedBar/exported-related/theming.js.map +0 -7
  380. package/dist/esm/graphs/Chart/SingleStackedBar/index.js +0 -4
  381. package/dist/esm/graphs/Chart/SingleStackedBar/index.js.map +0 -7
  382. package/dist/esm/graphs/Chart/SingleStackedBar/react-desc-prop-types.js +0 -21
  383. package/dist/esm/graphs/Chart/SingleStackedBar/react-desc-prop-types.js.map +0 -7
  384. package/dist/esm/graphs/Chart/index.js +0 -6
  385. package/dist/esm/graphs/Chart/index.js.map +0 -7
  386. package/dist/esm/graphs/Chart/react-desc-prop-types.js +0 -29
  387. package/dist/esm/graphs/Chart/react-desc-prop-types.js.map +0 -7
  388. package/dist/esm/graphs/index.js +0 -4
  389. package/dist/esm/graphs/index.js.map +0 -7
  390. package/dist/types/graphs/Chart/DataTestIds.d.ts +0 -5
  391. package/dist/types/graphs/Chart/SingleStackedBar/exported-related/data-test-ids.d.ts +0 -3
  392. package/dist/types/graphs/Chart/SingleStackedBar/exported-related/index.d.ts +0 -2
  393. package/dist/types/graphs/Chart/SingleStackedBar/exported-related/theming.d.ts +0 -4
  394. package/dist/types/graphs/Chart/SingleStackedBar/index.d.ts +0 -3
  395. package/dist/types/graphs/Chart/SingleStackedBar/react-desc-prop-types.d.ts +0 -44
  396. package/dist/types/graphs/Chart/index.d.ts +0 -4
  397. package/dist/types/graphs/Chart/react-desc-prop-types.d.ts +0 -510
  398. package/dist/types/graphs/index.d.ts +0 -2
@@ -1,132 +1,143 @@
1
1
  import * as React from "react";
2
2
  import { jsx, jsxs } from "react/jsx-runtime";
3
- import { useMemo, useContext, useCallback } from "react";
3
+ import React2, { useMemo, useContext, useCallback } from "react";
4
+ import { ThemeContext } from "@elliemae/ds-system";
4
5
  import { ChartContext } from "../ChartContext.js";
5
- import { FOCUS_RING } from "../../constants.js";
6
+ import { useChartInteraction } from "../config/chartInteractionStore.js";
7
+ import { FOCUS_RING, MARKS } from "../../constants.js";
6
8
  import { FocusableRegion } from "../parts/FocusableRegion.js";
7
- import { DataVizDataTestIds } from "../DataTestIds.js";
8
- const Rect = ({
9
- name,
10
- width,
11
- height,
12
- isNegative = false,
13
- x = 0,
14
- y = 0,
15
- id,
16
- xValue,
17
- yValue,
18
- datum
19
- }) => {
20
- const {
21
- activePoint,
22
- chartId,
23
- isHorizontal,
24
- setActivePoint,
25
- getYValueFormatted,
26
- getXValueFormatted,
27
- props: { TooltipRenderer, scrapper, xAxis, yAxis, y2Axis }
28
- } = useContext(ChartContext);
29
- const finalYAxis = datum.scale === "y2" ? y2Axis : yAxis;
30
- const yValueFormatted = getYValueFormatted(datum);
31
- const xValueFormatted = getXValueFormatted(datum);
32
- const isFocused = activePoint?.key === id;
33
- const clipPathSign = useMemo(() => {
34
- if (isHorizontal) return "";
35
- if (isNegative) return `url(#rects-negative-${chartId})`;
36
- return `url(#rects-positive-${chartId})`;
37
- }, [chartId, isHorizontal, isNegative]);
38
- const transform = useMemo(() => {
39
- if (isHorizontal) return ``;
40
- return `scale(1,-1) translate(0,${-height})`;
41
- }, [height, isHorizontal]);
42
- const handleMouseEnter = useCallback(() => {
43
- if (!scrapper) setActivePoint(datum);
44
- }, [datum, scrapper, setActivePoint]);
45
- const handleOnMouseLeave = useCallback(() => {
46
- if (!scrapper) setActivePoint(null);
47
- }, [scrapper, setActivePoint]);
48
- return useMemo(
49
- () => /* @__PURE__ */ jsx("g", { clipPath: clipPathSign, children: /* @__PURE__ */ jsxs(
50
- "g",
51
- {
52
- id: isFocused ? `data-focused-${chartId}` : "",
53
- transform,
54
- onMouseEnter: handleMouseEnter,
55
- onMouseLeave: handleOnMouseLeave,
56
- "data-testid": DataVizDataTestIds.BAR,
57
- children: [
58
- isFocused ? /* @__PURE__ */ jsx(
59
- "rect",
60
- {
61
- x: (isHorizontal ? x : 0) - FOCUS_RING.STROKE_WIDTH,
62
- y: (!isHorizontal ? -y : 0) - FOCUS_RING.STROKE_WIDTH,
63
- width: width + FOCUS_RING.OFFSET,
64
- height: height + FOCUS_RING.OFFSET,
65
- fill: "none",
66
- rx: "1",
67
- ry: "1",
68
- stroke: FOCUS_RING.COLOR,
69
- strokeWidth: FOCUS_RING.STROKE_WIDTH
70
- }
71
- ) : null,
72
- /* @__PURE__ */ jsx(
73
- "rect",
74
- {
75
- width,
76
- height,
77
- y: -y,
78
- x,
79
- "aria-label": `${datum.serie} ${xAxis.label || ""} ${xValueFormatted} ${finalYAxis?.label || ""} ${yValueFormatted}`,
80
- role: "img",
81
- tabIndex: -1,
82
- ref: (_ref) => {
83
- if (isFocused) {
84
- _ref?.focus();
85
- }
86
- }
87
- }
88
- ),
89
- activePoint?.key === id && TooltipRenderer ? /* @__PURE__ */ jsx(
90
- FocusableRegion,
91
- {
92
- id,
93
- y,
94
- x,
95
- width,
96
- height,
97
- transform,
98
- content: /* @__PURE__ */ jsx(TooltipRenderer, { data: [{ name, yValue, xValue, datum }] })
99
- }
100
- ) : ""
101
- ]
102
- }
103
- ) }),
104
- [
105
- clipPathSign,
106
- isFocused,
9
+ import { StyledBarGroup } from "../styles.js";
10
+ import { getBarPath } from "../helpers/barPath.js";
11
+ import { getDatumLabel } from "../helpers/index.js";
12
+ const FOCUS_RING_DISTANCE = FOCUS_RING.GAP + FOCUS_RING.STROKE_WIDTH / 2;
13
+ const getDataEnd = (isHorizontal, isNegativeValue, isStackEdge) => {
14
+ if (!isStackEdge) return "none";
15
+ if (isHorizontal) return isNegativeValue ? "left" : "right";
16
+ return isNegativeValue ? "bottom" : "top";
17
+ };
18
+ const Rect = React2.memo(
19
+ ({ name, width, height, isNegative = false, isStackEdge = true, x = 0, y = 0, id, xValue, yValue, datum }) => {
20
+ const {
107
21
  chartId,
108
- transform,
109
- handleMouseEnter,
110
- handleOnMouseLeave,
111
22
  isHorizontal,
112
- x,
113
- y,
114
- width,
115
- height,
116
- datum,
117
- xAxis.label,
118
- xValueFormatted,
119
- finalYAxis?.label,
120
- yValueFormatted,
121
- activePoint?.key,
122
- id,
123
- TooltipRenderer,
124
- name,
125
- yValue,
126
- xValue
127
- ]
128
- );
129
- };
23
+ setActivePoint,
24
+ getYValueFormatted,
25
+ getXValueFormatted,
26
+ getOwnerProps,
27
+ containerRef,
28
+ props: { TooltipRenderer, scrapper, xAxis, yAxis, y2Axis }
29
+ } = useContext(ChartContext);
30
+ const theme = useContext(ThemeContext);
31
+ const focusRingColor = theme?.colors?.brand?.["700"] ?? FOCUS_RING.COLOR;
32
+ const finalYAxis = datum.scale === "y2" ? y2Axis : yAxis;
33
+ const yValueFormatted = getYValueFormatted(datum);
34
+ const xValueFormatted = getXValueFormatted(datum);
35
+ const isFocused = useChartInteraction((state) => state.activePoint?.key === id);
36
+ const clipPathSign = useMemo(() => {
37
+ if (isHorizontal) return "";
38
+ if (isNegative) return `url(#rects-negative-${chartId})`;
39
+ return `url(#rects-positive-${chartId})`;
40
+ }, [chartId, isHorizontal, isNegative]);
41
+ const bar = useMemo(() => {
42
+ const rawValue = typeof datum.value === "number" ? datum.value : datum.value?.[isHorizontal ? "x" : "y"];
43
+ const isNegativeValue = isNegative || (rawValue ?? 0) < 0;
44
+ if (isHorizontal) {
45
+ const thickness2 = Math.min(height, MARKS.BAR_MAX_THICKNESS);
46
+ const dataEnd2 = getDataEnd(true, isNegativeValue, isStackEdge);
47
+ return { x, y: -y + (height - thickness2) / 2, width: Math.max(width, 0), height: thickness2, dataEnd: dataEnd2 };
48
+ }
49
+ const thickness = Math.min(width, MARKS.BAR_MAX_THICKNESS);
50
+ const dataEnd = getDataEnd(false, isNegativeValue, isStackEdge);
51
+ return { x: x + (width - thickness) / 2, y, width: thickness, height: Math.max(height, 0), dataEnd };
52
+ }, [datum.value, height, isHorizontal, isNegative, isStackEdge, width, x, y]);
53
+ const handleMouseEnter = useCallback(() => {
54
+ if (!scrapper) setActivePoint(datum);
55
+ }, [datum, scrapper, setActivePoint]);
56
+ const handleOnMouseLeave = useCallback(() => {
57
+ if (!scrapper) setActivePoint(null);
58
+ }, [scrapper, setActivePoint]);
59
+ return useMemo(
60
+ () => /* @__PURE__ */ jsx("g", { clipPath: clipPathSign, children: /* @__PURE__ */ jsxs(
61
+ StyledBarGroup,
62
+ {
63
+ id: isFocused ? `data-focused-${chartId}` : "",
64
+ onMouseEnter: handleMouseEnter,
65
+ onMouseLeave: handleOnMouseLeave,
66
+ getOwnerProps,
67
+ getOwnerPropsArguments: () => ({ datum }),
68
+ children: [
69
+ isFocused ? /* @__PURE__ */ jsx(
70
+ "rect",
71
+ {
72
+ x: bar.x - FOCUS_RING_DISTANCE,
73
+ y: bar.y - FOCUS_RING_DISTANCE,
74
+ width: bar.width + FOCUS_RING_DISTANCE * 2,
75
+ height: bar.height + FOCUS_RING_DISTANCE * 2,
76
+ fill: "none",
77
+ rx: MARKS.BAR_RADIUS + FOCUS_RING_DISTANCE,
78
+ stroke: focusRingColor,
79
+ strokeWidth: FOCUS_RING.STROKE_WIDTH
80
+ }
81
+ ) : null,
82
+ /* @__PURE__ */ jsx(
83
+ "path",
84
+ {
85
+ d: getBarPath({ ...bar, radius: MARKS.BAR_RADIUS }),
86
+ "aria-label": getDatumLabel([
87
+ datum.serie,
88
+ xAxis.label,
89
+ xValueFormatted,
90
+ finalYAxis?.label,
91
+ yValueFormatted
92
+ ]),
93
+ role: "img",
94
+ tabIndex: -1,
95
+ ref: (_ref) => {
96
+ if (isFocused && containerRef?.contains(document.activeElement)) {
97
+ _ref?.focus();
98
+ }
99
+ }
100
+ }
101
+ ),
102
+ isFocused && TooltipRenderer && !scrapper ? /* @__PURE__ */ jsx(
103
+ FocusableRegion,
104
+ {
105
+ id,
106
+ y: bar.y,
107
+ x: bar.x,
108
+ width: bar.width,
109
+ height: bar.height,
110
+ content: /* @__PURE__ */ jsx(TooltipRenderer, { data: [{ name, yValue, xValue, datum }] })
111
+ }
112
+ ) : ""
113
+ ]
114
+ }
115
+ ) }),
116
+ [
117
+ clipPathSign,
118
+ isFocused,
119
+ chartId,
120
+ handleMouseEnter,
121
+ handleOnMouseLeave,
122
+ bar,
123
+ focusRingColor,
124
+ datum,
125
+ xAxis.label,
126
+ xValueFormatted,
127
+ finalYAxis?.label,
128
+ yValueFormatted,
129
+ id,
130
+ TooltipRenderer,
131
+ scrapper,
132
+ name,
133
+ yValue,
134
+ xValue,
135
+ getOwnerProps,
136
+ containerRef
137
+ ]
138
+ );
139
+ }
140
+ );
130
141
  export {
131
142
  Rect
132
143
  };
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../../../scripts/build/transpile/react-shim.js", "../../../../../src/graphs/Chart/series/Rect.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useMemo, useContext, useCallback } from 'react';\nimport { ChartContext } from '../ChartContext.js';\nimport { FOCUS_RING } from '../../constants.js';\nimport { FocusableRegion } from '../parts/FocusableRegion.js';\nimport { DataVizDataTestIds } from '../DataTestIds.js';\nimport type { DSChartT } from '../react-desc-prop-types.js';\ninterface RectProps {\n name: string;\n width: number;\n height: number;\n isNegative?: boolean;\n x?: number;\n y?: number;\n id: string;\n xValue: number;\n yValue: number;\n datum: DSChartT.InternalDatum;\n}\n\nexport const Rect: React.ComponentType<RectProps> = ({\n name,\n width,\n height,\n isNegative = false,\n x = 0,\n y = 0,\n id,\n xValue,\n yValue,\n datum,\n}) => {\n const {\n activePoint,\n chartId,\n isHorizontal,\n setActivePoint,\n getYValueFormatted,\n getXValueFormatted,\n props: { TooltipRenderer, scrapper, xAxis, yAxis, y2Axis },\n } = useContext(ChartContext);\n const finalYAxis = datum.scale === 'y2' ? y2Axis : yAxis;\n const yValueFormatted = getYValueFormatted(datum);\n const xValueFormatted = getXValueFormatted(datum);\n\n const isFocused = activePoint?.key === id;\n const clipPathSign = useMemo(() => {\n // @todo horizontal clip paths\n if (isHorizontal) return '';\n if (isNegative) return `url(#rects-negative-${chartId})`;\n return `url(#rects-positive-${chartId})`;\n }, [chartId, isHorizontal, isNegative]);\n\n const transform = useMemo(() => {\n if (isHorizontal) return ``;\n return `scale(1,-1) translate(0,${-height})`;\n }, [height, isHorizontal]);\n\n const handleMouseEnter = useCallback(() => {\n if (!scrapper) setActivePoint(datum);\n }, [datum, scrapper, setActivePoint]);\n\n const handleOnMouseLeave = useCallback(() => {\n if (!scrapper) setActivePoint(null);\n }, [scrapper, setActivePoint]);\n\n return useMemo(\n () => (\n <g clipPath={clipPathSign}>\n <g\n id={isFocused ? `data-focused-${chartId}` : ''}\n transform={transform}\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleOnMouseLeave}\n data-testid={DataVizDataTestIds.BAR}\n >\n {isFocused ? (\n <rect\n x={(isHorizontal ? x : 0) - FOCUS_RING.STROKE_WIDTH}\n y={(!isHorizontal ? -y : 0) - FOCUS_RING.STROKE_WIDTH}\n width={width + FOCUS_RING.OFFSET}\n height={height + FOCUS_RING.OFFSET}\n fill=\"none\"\n rx=\"1\"\n ry=\"1\"\n stroke={FOCUS_RING.COLOR}\n strokeWidth={FOCUS_RING.STROKE_WIDTH}\n ></rect>\n ) : null}\n <rect\n width={width}\n height={height}\n y={-y}\n x={x}\n aria-label={`${datum.serie} ${xAxis.label || ''} ${xValueFormatted} ${\n finalYAxis?.label || ''\n } ${yValueFormatted}`}\n role=\"img\"\n tabIndex={-1}\n ref={(_ref) => {\n if (isFocused) {\n _ref?.focus();\n }\n }}\n ></rect>\n {activePoint?.key === id && TooltipRenderer ? (\n <FocusableRegion\n id={id}\n y={y}\n x={x}\n width={width}\n height={height}\n transform={transform}\n content={<TooltipRenderer data={[{ name, yValue, xValue, datum }]} />}\n />\n ) : (\n ''\n )}\n </g>\n </g>\n ),\n [\n clipPathSign,\n isFocused,\n chartId,\n transform,\n handleMouseEnter,\n handleOnMouseLeave,\n isHorizontal,\n x,\n y,\n width,\n height,\n datum,\n xAxis.label,\n xValueFormatted,\n finalYAxis?.label,\n yValueFormatted,\n activePoint?.key,\n id,\n Too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ACA;AAAA,MACA;AAAA,MACA,MAAM;AAAA,MACN;AAAA,MACA,YAAY;AAAA,MACZ;AAAA,MACA,aAAa;AAAA,MACb;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF;AACF;",
6
- "names": []
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable complexity */\nimport React, { useMemo, useContext, useCallback } from 'react';\nimport { ThemeContext } from '@elliemae/ds-system';\nimport { ChartContext } from '../ChartContext.js';\nimport { useChartInteraction } from '../config/chartInteractionStore.js';\nimport { FOCUS_RING, MARKS } from '../../constants.js';\nimport { FocusableRegion } from '../parts/FocusableRegion.js';\nimport { StyledBarGroup } from '../styles.js';\nimport { getBarPath, type BarDataEndT } from '../helpers/barPath.js';\nimport { getDatumLabel } from '../helpers/index.js';\nimport type { DSChartT } from '../../../react-desc-prop-types.js';\ninterface RectProps {\n name: string;\n width: number;\n height: number;\n isNegative?: boolean;\n // false for the inner segments of a stack: only the outer end of a stack is rounded\n isStackEdge?: boolean;\n x?: number;\n y?: number;\n id: string;\n xValue: number;\n yValue: number;\n datum: DSChartT.InternalDatum;\n}\n\n// distance from the bar to the middle of its focus ring stroke: the gap, then half the stroke\nconst FOCUS_RING_DISTANCE = FOCUS_RING.GAP + FOCUS_RING.STROKE_WIDTH / 2;\n\n// the end of the bar away from its baseline; none for the inner segments of a stack\nconst getDataEnd = (isHorizontal: boolean, isNegativeValue: boolean, isStackEdge: boolean): BarDataEndT => {\n if (!isStackEdge) return 'none';\n if (isHorizontal) return isNegativeValue ? 'left' : 'right';\n return isNegativeValue ? 'bottom' : 'top';\n};\n\n// Memoized, like Point: the bars that stay in the window of a scrollable chart skip the render when it moves\nexport const Rect = React.memo<RectProps>(\n ({ name, width, height, isNegative = false, isStackEdge = true, x = 0, y = 0, id, xValue, yValue, datum }) => {\n const {\n chartId,\n isHorizontal,\n setActivePoint,\n getYValueFormatted,\n getXValueFormatted,\n getOwnerProps,\n containerRef,\n props: { TooltipRenderer, scrapper, xAxis, yAxis, y2Axis },\n } = useContext(ChartContext);\n const theme = useContext(ThemeContext);\n const focusRingColor = theme?.colors?.brand?.['700'] ?? FOCUS_RING.COLOR;\n const finalYAxis = datum.scale === 'y2' ? y2Axis : yAxis;\n const yValueFormatted = getYValueFormatted(datum);\n const xValueFormatted = getXValueFormatted(datum);\n\n // its own slice of the hover state: a hover re-renders this bar only when it becomes active or stops being so\n const isFocused = useChartInteraction((state) => state.activePoint?.key === id);\n const clipPathSign = useMemo(() => {\n // @todo horizontal clip paths\n if (isHorizontal) return '';\n if (isNegative) return `url(#rects-negative-${chartId})`;\n return `url(#rects-positive-${chartId})`;\n }, [chartId, isHorizontal, isNegative]);\n\n // The visible bar: as thick as its band allows up to the maximum thickness, centered in the band, with its data end\n // (the end away from the baseline) rounded. The sign comes from the raw value, the stacked ones receive a length.\n const bar = useMemo(() => {\n const rawValue = typeof datum.value === 'number' ? datum.value : datum.value?.[isHorizontal ? 'x' : 'y'];\n const isNegativeValue = isNegative || (rawValue ?? 0) < 0;\n if (isHorizontal) {\n const thickness = Math.min(height, MARKS.BAR_MAX_THICKNESS);\n const dataEnd = getDataEnd(true, isNegativeValue, isStackEdge);\n return { x, y: -y + (height - thickness) / 2, width: Math.max(width, 0), height: thickness, dataEnd };\n }\n const thickness = Math.min(width, MARKS.BAR_MAX_THICKNESS);\n const dataEnd = getDataEnd(false, isNegativeValue, isStackEdge);\n return { x: x + (width - thickness) / 2, y, width: thickness, height: Math.max(height, 0), dataEnd };\n }, [datum.value, height, isHorizontal, isNegative, isStackEdge, width, x, y]);\n\n const handleMouseEnter = useCallback(() => {\n if (!scrapper) setActivePoint(datum);\n }, [datum, scrapper, setActivePoint]);\n\n const handleOnMouseLeave = useCallback(() => {\n if (!scrapper) setActivePoint(null);\n }, [scrapper, setActivePoint]);\n\n return useMemo(\n () => (\n <g clipPath={clipPathSign}>\n <StyledBarGroup\n id={isFocused ? `data-focused-${chartId}` : ''}\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleOnMouseLeave}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={() => ({ datum })}\n >\n {isFocused ? (\n <rect\n x={bar.x - FOCUS_RING_DISTANCE}\n y={bar.y - FOCUS_RING_DISTANCE}\n width={bar.width + FOCUS_RING_DISTANCE * 2}\n height={bar.height + FOCUS_RING_DISTANCE * 2}\n fill=\"none\"\n rx={MARKS.BAR_RADIUS + FOCUS_RING_DISTANCE}\n stroke={focusRingColor}\n strokeWidth={FOCUS_RING.STROKE_WIDTH}\n ></rect>\n ) : null}\n <path\n d={getBarPath({ ...bar, radius: MARKS.BAR_RADIUS })}\n aria-label={getDatumLabel([\n datum.serie,\n xAxis.label,\n xValueFormatted,\n finalYAxis?.label,\n yValueFormatted,\n ])}\n role=\"img\"\n tabIndex={-1}\n ref={(_ref) => {\n // the keyboard focus follows the active point only while it is already in the chart: hovering a bar\n // must not pull the focus away from the rest of the page\n if (isFocused && containerRef?.contains(document.activeElement)) {\n _ref?.focus();\n }\n }}\n ></path>\n {/* with a scrapper, its tooltip shows every series of the position, this one included */}\n {isFocused && TooltipRenderer && !scrapper ? (\n <FocusableRegion\n id={id}\n y={bar.y}\n x={bar.x}\n width={bar.width}\n height={bar.height}\n content={<TooltipRenderer data={[{ name, yValue, xValue, datum }]} />}\n />\n ) : (\n ''\n )}\n </StyledBarGroup>\n </g>\n ),\n [\n clipPathSign,\n isFocused,\n chartId,\n handleMouseEnter,\n handleOnMouseLeave,\n bar,\n focusRingColor,\n datum,\n xAxis.label,\n xValueFormatted,\n finalYAxis?.label,\n yValueFormatted,\n id,\n TooltipRenderer,\n scrapper,\n name,\n yValue,\n xValue,\n getOwnerProps,\n containerRef,\n ],\n );\n },\n);\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;AC0Fb,SAQI,KARJ;AAzFV,OAAOA,UAAS,SAAS,YAAY,mBAAmB;AACxD,SAAS,oBAAoB;AAC7B,SAAS,oBAAoB;AAC7B,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BACvB,QAAQ;AAAA,gBACR,aAAa,WAAW;AAAA;AAAA,YACzB,IACC;AAAA,YACJ;AAAA,cAAC;AAAA;AAAA,gBACC,GAAG,WAAW,EAAE,GAAG,KAAK,QAAQ,MAAM,WAAW,CAAC;AAAA,gBAClD,cAAY,cAAc;AAAA,kBACxB,MAAM;AAAA,kBACN,MAAM;AAAA,kBACN;AAAA,kBACA,YAAY;AAAA,kBACZ;AAAA,gBACF,CAAC;AAAA,gBACD,MAAK;AAAA,gBACL,UAAU;AAAA,gBACV,KAAK,CAAC,SAAS;AAGb,sBAAI,aAAa,cAAc,SAAS,SAAS,aAAa,GAAG;AAC/D,0BAAM,MAAM;AAAA,kBACd;AAAA,gBACF;AAAA;AAAA,YACD;AAAA,YAEA,aAAa,mBAAmB,CAAC,WAChC;AAAA,cAAC;AAAA;AAAA,gBACC;AAAA,gBACA,GAAG,IAAI;AAAA,gBACP,GAAG,IAAI;AAAA,gBACP,OAAO,IAAI;AAAA,gBACX,QAAQ,IAAI;AAAA,gBACZ,SAAS,oBAAC,mBAAgB,MAAM,CAAC,EAAE,MAAM,QAAQ,QAAQ,MAAM,CAAC,GAAG;AAAA;AAAA,YACrE,IAEA;AAAA;AAAA;AAAA,MAEJ,GACF;AAAA,MAEF;AAAA,QACE;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA,MAAM;AAAA,QACN;AAAA,QACA,YAAY;AAAA,QACZ;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF;",
6
+ "names": ["React", "thickness", "dataEnd"]
7
7
  }
@@ -3,7 +3,9 @@ import { jsx } from "react/jsx-runtime";
3
3
  import { useContext } from "react";
4
4
  import { Rect } from "./Rect.js";
5
5
  import { ChartContext } from "../ChartContext.js";
6
- import { getStackedData, getStackedIndex } from "../helpers/index.js";
6
+ import { useSerieDimming } from "../helpers/useSerieDimming.js";
7
+ import { getStackedData, getStackedIndex, isStackedSegmentEdge } from "../helpers/index.js";
8
+ import { MARKS } from "../../constants.js";
7
9
  const StackedBar = ({ serie }) => {
8
10
  const {
9
11
  props: { groups },
@@ -11,6 +13,7 @@ const StackedBar = ({ serie }) => {
11
13
  yScale,
12
14
  stackedData,
13
15
  subGroupScale,
16
+ getBandwidth,
14
17
  colorScale,
15
18
  chartId,
16
19
  getXValue,
@@ -18,16 +21,20 @@ const StackedBar = ({ serie }) => {
18
21
  } = useContext(ChartContext);
19
22
  const serieWithStackedValues = getStackedData(stackedData, serie);
20
23
  const stackIndex = getStackedIndex(groups, serie.name);
21
- return /* @__PURE__ */ jsx("g", { clipPath: `url(#rect-focus-ring-${chartId})`, children: serie.data.map((bar, i) => {
24
+ const dimmedStyle = useSerieDimming(serie.name);
25
+ return /* @__PURE__ */ jsx("g", { clipPath: `url(#rect-focus-ring-${chartId})`, style: dimmedStyle, children: serie.data.map((bar, i) => {
22
26
  const sequence = serieWithStackedValues ? serieWithStackedValues[bar.position] : [0, 0];
23
- const isFloorStack = sequence[0] === 0;
27
+ const isNegativeSegment = sequence[0] < 0;
28
+ const gapBelow = !isNegativeSegment && sequence[0] > 0 ? MARKS.STACK_GAP : 0;
29
+ const gapAbove = isNegativeSegment && sequence[1] < 0 ? MARKS.STACK_GAP : 0;
24
30
  const xValue = getXValue(bar);
25
31
  const xScaleValue = getXScaleValue(bar) ?? 0;
26
32
  const yValue = sequence[1] - sequence[0];
27
33
  const width = subGroupScale?.bandwidth() ?? 0;
28
- const height = (yScale?.get(sequence[0]) ?? 0) - (yScale?.get(sequence[1]) ?? 0) - (!isFloorStack ? 1 : 0);
29
- const transformY = (yScale?.get(sequence[1]) ?? 0) + (sequence[0] < 0 ? 2 : 0);
30
- const transformX = xScale?.type !== "BAND" ? xScaleValue - width / 2 : xScaleValue + (subGroupScale ? subGroupScale(`stacked-data-${stackIndex}`) ?? 0 : 0);
34
+ const height = (yScale?.get(sequence[0]) ?? 0) - (yScale?.get(sequence[1]) ?? 0) - gapBelow - gapAbove;
35
+ const transformY = (yScale?.get(sequence[1]) ?? 0) + gapAbove;
36
+ const slotStart = xScale?.type !== "BAND" ? xScaleValue - getBandwidth() / 2 : xScaleValue;
37
+ const transformX = slotStart + (subGroupScale ? subGroupScale(`stacked-data-${stackIndex}`) ?? 0 : 0);
31
38
  return /* @__PURE__ */ jsx("g", { fill: colorScale(serie.name), transform: `translate(${transformX},0)`, children: /* @__PURE__ */ jsx(
32
39
  Rect,
33
40
  {
@@ -38,7 +45,8 @@ const StackedBar = ({ serie }) => {
38
45
  y: transformY,
39
46
  id: serie.data[i].key,
40
47
  name: serie.name,
41
- datum: bar
48
+ datum: bar,
49
+ isStackEdge: isStackedSegmentEdge(stackedData, serie, bar.position)
42
50
  }
43
51
  ) }, serie.data[i].key);
44
52
  }) });
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../../../scripts/build/transpile/react-shim.js", "../../../../../src/graphs/Chart/series/StackedBar.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable complexity */\n/* prettier-ignore */\nimport React, { useContext } from 'react';\nimport { Rect } from './Rect.js';\nimport { ChartContext } from '../ChartContext.js';\nimport { getStackedData, getStackedIndex } from '../helpers/index.js';\nimport type { DSChartT } from '../react-desc-prop-types.js';\n\nexport const StackedBar: React.ComponentType<DSChartT.SerieComponentT> = ({ serie }) => {\n const {\n props: { groups },\n xScale,\n yScale,\n stackedData,\n subGroupScale,\n colorScale,\n chartId,\n getXValue,\n getXScaleValue,\n } = useContext(ChartContext);\n\n const serieWithStackedValues = getStackedData(stackedData, serie);\n const stackIndex = getStackedIndex(groups, serie.name);\n return (\n <g clipPath={`url(#rect-focus-ring-${chartId})`}>\n {serie.data.map((bar, i) => {\n const sequence = serieWithStackedValues ? serieWithStackedValues[bar.position] : [0, 0];\n\n const isFloorStack = sequence[0] === 0;\n\n const xValue = getXValue(bar) as number;\n const xScaleValue = getXScaleValue(bar) ?? 0;\n const yValue = sequence[1] - sequence[0];\n const width = subGroupScale?.bandwidth() ?? 0;\n const height =\n (yScale?.get(sequence[0] as never) ?? 0) - (yScale?.get(sequence[1] as never) ?? 0) - (!isFloorStack ? 1 : 0);\n const transformY = (yScale?.get(sequence[1] as never) ?? 0) + (sequence[0] < 0 ? 2 : 0);\n\n const transformX =\n xScale?.type !== 'BAND'\n ? xScaleValue - width / 2\n : xScaleValue + (subGroupScale ? (subGroupScale(`stacked-data-${stackIndex}`) ?? 0) : 0);\n return (\n <g key={serie.data[i].key} fill={colorScale(serie.name) as string} transform={`translate(${transformX},0)`}>\n <Rect\n width={width}\n height={height}\n xValue={xValue}\n yValue={yValue}\n y={transformY}\n id={serie.data[i].key}\n name={serie.name}\n datum={bar}\n />\n </g>\n );\n })}\n </g>\n );\n};\n"],
5
- "mappings": "AAAA,YAAY,WAAW;AC4CX;AA1CZ,SAAgB,kBAAkB;AAClC,SAAS,YAAY;AACrB,SAAS,oBAAoB;AAC7B,SAAS,gBAAgB,uBAAuB;AAGzC,MAAM,aAA4D,CAAC,EAAE,MAAM,MAAM;AACtF,QAAM;AAAA,IACJ,OAAO,EAAE,OAAO;AAAA,IAChB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI,WAAW,YAAY;AAE3B,QAAM,yBAAyB,eAAe,aAAa,KAAK;AAChE,QAAM,aAAa,gBAAgB,QAAQ,MAAM,IAAI;AACrD,SACE,oBAAC,OAAE,UAAU,wBAAwB,OAAO,KACzC,gBAAM,KAAK,IAAI,CAAC,KAAK,MAAM;AAC1B,UAAM,WAAW,yBAAyB,uBAAuB,IAAI,QAAQ,IAAI,CAAC,GAAG,CAAC;AAEtF,UAAM,eAAe,SAAS,CAAC,MAAM;AAErC,UAAM,SAAS,UAAU,GAAG;AAC5B,UAAM,cAAc,eAAe,GAAG,KAAK;AAC3C,UAAM,SAAS,SAAS,CAAC,IAAI,SAAS,CAAC;AACvC,UAAM,QAAQ,eAAe,UAAU,KAAK;AAC5C,UAAM,UACH,QAAQ,IAAI,SAAS,CAAC,CAAU,KAAK,MAAM,QAAQ,IAAI,SAAS,CAAC,CAAU,KAAK,MAAM,CAAC,eAAe,IAAI;AAC7G,UAAM,cAAc,QAAQ,IAAI,SAAS,CAAC,CAAU,KAAK,MAAM,SAAS,CAAC,IAAI,IAAI,IAAI;AAErF,UAAM,aACJ,QAAQ,SAAS,SACb,cAAc,QAAQ,IACtB,eAAe,gBAAiB,cAAc,gBAAgB,UAAU,EAAE,KAAK,IAAK;AAC1F,WACE,oBAAC,OAA0B,MAAM,WAAW,MAAM,IAAI,GAAa,WAAW,aAAa,UAAU,OACnG;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA,GAAG;AAAA,QACH,IAAI,MAAM,KAAK,CAAC,EAAE;AAAA,QAClB,MAAM,MAAM;AAAA,QACZ,OAAO;AAAA;AAAA,IACT,KAVM,MAAM,KAAK,CAAC,EAAE,GAWtB;AAAA,EAEJ,CAAC,GACH;AAEJ;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable complexity */\n/* prettier-ignore */\nimport React, { useContext } from 'react';\nimport { Rect } from './Rect.js';\nimport { ChartContext } from '../ChartContext.js';\nimport { useSerieDimming } from '../helpers/useSerieDimming.js';\nimport { getStackedData, getStackedIndex, isStackedSegmentEdge } from '../helpers/index.js';\nimport { MARKS } from '../../constants.js';\nimport type { DSChartT } from '../../../react-desc-prop-types.js';\n\nexport const StackedBar: React.ComponentType<DSChartT.SerieComponentT> = ({ serie }) => {\n const {\n props: { groups },\n xScale,\n yScale,\n stackedData,\n subGroupScale,\n getBandwidth,\n colorScale,\n chartId,\n getXValue,\n getXScaleValue,\n } = useContext(ChartContext);\n\n const serieWithStackedValues = getStackedData(stackedData, serie);\n const stackIndex = getStackedIndex(groups, serie.name);\n const dimmedStyle = useSerieDimming(serie.name);\n return (\n <g clipPath={`url(#rect-focus-ring-${chartId})`} style={dimmedStyle}>\n {serie.data.map((bar, i) => {\n const sequence = serieWithStackedValues ? serieWithStackedValues[bar.position] : [0, 0];\n\n // the surface gap sits on the side of the previous segment: below a positive one, above a negative one\n const isNegativeSegment = sequence[0] < 0;\n const gapBelow = !isNegativeSegment && sequence[0] > 0 ? MARKS.STACK_GAP : 0;\n const gapAbove = isNegativeSegment && sequence[1] < 0 ? MARKS.STACK_GAP : 0;\n\n const xValue = getXValue(bar) as number;\n const xScaleValue = getXScaleValue(bar) ?? 0;\n const yValue = sequence[1] - sequence[0];\n const width = subGroupScale?.bandwidth() ?? 0;\n const height =\n (yScale?.get(sequence[0] as never) ?? 0) - (yScale?.get(sequence[1] as never) ?? 0) - gapBelow - gapAbove;\n const transformY = (yScale?.get(sequence[1] as never) ?? 0) + gapAbove;\n\n // the slot of the value, centered on it on a linear or a time axis, with each stack in its place (see Bars)\n const slotStart = xScale?.type !== 'BAND' ? xScaleValue - getBandwidth() / 2 : xScaleValue;\n const transformX = slotStart + (subGroupScale ? (subGroupScale(`stacked-data-${stackIndex}`) ?? 0) : 0);\n return (\n <g key={serie.data[i].key} fill={colorScale(serie.name) as string} transform={`translate(${transformX},0)`}>\n <Rect\n width={width}\n height={height}\n xValue={xValue}\n yValue={yValue}\n y={transformY}\n id={serie.data[i].key}\n name={serie.name}\n datum={bar}\n isStackEdge={isStackedSegmentEdge(stackedData, serie, bar.position)}\n />\n </g>\n );\n })}\n </g>\n );\n};\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACkDX;AAhDZ,SAAgB,kBAAkB;AAClC,SAAS,YAAY;AACrB,SAAS,oBAAoB;AAC7B,SAAS,uBAAuB;AAChC,SAAS,gBAAgB,iBAAiB,4BAA4B;AACtE,SAAS,aAAa;AAGf,MAAM,aAA4D,CAAC,EAA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ACA;AAAA,QACA;AAAA,QACA;AAAA,QACA,GAAG;AAAA,QACH,IAAI,MAAM,KAAK,CAAC,EAAE;AAAA,QAClB,MAAM,MAAM;AAAA,QACZ,OAAO;AAAA,QACP,aAAa,qBAAqB,aAAa,OAAO,IAAI,QAAQ;AAAA;AAAA,IACpE,KAXM,MAAM,KAAK,CAAC,EAAE,GAYtB;AAAA,EAEJ,CAAC,GACH;AAEJ;",
6
6
  "names": []
7
7
  }
@@ -1,10 +1,13 @@
1
1
  import * as React from "react";
2
- import { styled } from "@elliemae/ds-system";
3
- const StyledSVGWrapper = styled.div`
2
+ import { css, styled } from "@elliemae/ds-system";
3
+ import { DATAVIZ_SLOTS, DSDatavizName } from "../../constants/index.js";
4
+ const StyledSVGWrapper = styled("div", { name: DSDatavizName, slot: DATAVIZ_SLOTS.ROOT })`
4
5
  rect:focus,
5
6
  rect:focus-visible,
6
7
  circle:focus,
7
- circle:focus-visible {
8
+ circle:focus-visible,
9
+ path:focus,
10
+ path:focus-visible {
8
11
  outline: none;
9
12
  }
10
13
 
@@ -13,51 +16,55 @@ const StyledSVGWrapper = styled.div`
13
16
  outline: none;
14
17
  }
15
18
 
19
+ /* the series that step back while a legend item is hovered fade in and out (see useSerieDimming); the roots of the
20
+ series are the groups of the content, or of the groups that tell how each series enters */
21
+ g.content > g,
22
+ g.content > [data-entrance-animation] > g {
23
+ transition: opacity 150ms ease-out;
24
+ }
25
+
26
+ /* a legend item reached with the keyboard, in the color of the focus ring of the data points */
27
+ g.cell:focus-visible {
28
+ outline: 2px solid ${({ theme }) => theme.colors.brand["700"]};
29
+ outline-offset: 2px;
30
+ }
31
+
16
32
  cursor: ${({ isGrabbed }) => isGrabbed ? "grabbing" : "default"};
17
33
 
18
34
  text {
19
- font-size: 1rem;
35
+ font-size: ${({ theme }) => theme.fontSizes.label[300]};
20
36
  }
21
37
 
22
38
  min-width: 300px;
23
39
  `;
24
- const StyledAxis = styled("line")`
25
- stroke-width: 2px;
26
- stroke: ${({ theme }) => theme.colors.neutral["700"]};
40
+ const StyledAxis = styled("line", { name: DSDatavizName, slot: DATAVIZ_SLOTS.AXIS_LINE })`
41
+ stroke-width: 1px;
42
+ shape-rendering: crispEdges;
43
+ /* a hairline baseline; the vertical axes rely on their labels and the grid unless they are given a color */
44
+ stroke: ${({ theme, isVertical }) => isVertical ? "transparent" : theme.colors.neutral["300"]};
27
45
  ${({ axisColor }) => axisColor ? `stroke: ${axisColor}` : ""}
28
46
  `;
29
- const StyledAxisLabel = styled("text")`
30
- font-size: 1rem;
47
+ const StyledAxisLabel = styled("text", { name: DSDatavizName, slot: DATAVIZ_SLOTS.AXIS_LABEL })`
31
48
  font-weight: 600;
49
+ fill: ${({ theme }) => theme.colors.neutral["700"]};
32
50
  `;
33
- const StyledGrid = styled("g")`
34
- line {
35
- opacity: 0.2;
36
- }
37
- `;
38
- const StyleFocusableRegion = styled.div`
39
- width: ${({ size = 1 }) => size * 2}px;
40
- height: ${({ size = 1 }) => size * 2}px;
41
- outline: none;
42
- &:focus {
43
- outline: none;
44
- }
45
- `;
46
- const StyledLine = styled("path")`
47
- fill: none;
51
+ const StyledLineGroup = styled("g", { name: DSDatavizName, slot: DATAVIZ_SLOTS.LINE })``;
52
+ const StyledArea = styled("path", { name: DSDatavizName, slot: DATAVIZ_SLOTS.AREA })`
48
53
  stroke-width: 3;
49
54
  stroke-linejoin: round;
50
55
  `;
51
- const StyledArea = styled("path")`
52
- stroke-width: 3;
53
- stroke-linejoin: round;
54
- opacity: 0.2;
55
- `;
56
- const StyledTooltipContainer = styled.div`
56
+ const StyledBarGroup = styled("g", { name: DSDatavizName, slot: DATAVIZ_SLOTS.BAR })``;
57
+ const StyledPointGroup = styled("g", { name: DSDatavizName, slot: DATAVIZ_SLOTS.POINT })``;
58
+ const StyledTooltipContainer = styled("div", { name: DSDatavizName, slot: DATAVIZ_SLOTS.TOOLTIP })`
57
59
  max-width: 350px;
58
60
  background-color: white;
61
+ border-radius: inherit;
59
62
  `;
60
- const StyledMouseOverDetectionBox = styled.div`
63
+ const TOOLTIP_CONTENT_SLOT_PROPS = { style: { borderRadius: "4px" } };
64
+ const StyledMouseOverDetectionBox = styled("div", {
65
+ name: DSDatavizName,
66
+ slot: DATAVIZ_SLOTS.TOOLTIP_HOVER_AREA
67
+ })`
61
68
  position: absolute;
62
69
  top: -15px;
63
70
  right: -15px;
@@ -65,15 +72,39 @@ const StyledMouseOverDetectionBox = styled.div`
65
72
  height: calc(100% + 30px);
66
73
  z-index: -1;
67
74
  `;
75
+ const toolbarButtonStyles = css`
76
+ cursor: ${({ isDisabled }) => isDisabled ? "not-allowed" : "pointer"};
77
+ opacity: ${({ isDisabled }) => isDisabled ? "0.4" : "1"};
78
+ &:focus {
79
+ outline: none;
80
+ }
81
+ &:focus-visible {
82
+ outline: 2px solid ${({ theme }) => theme.colors.brand["700"]};
83
+ outline-offset: 2px;
84
+ }
85
+ `;
86
+ const StyledResetter = styled("g", { name: DSDatavizName, slot: DATAVIZ_SLOTS.RESET_ZOOM_BUTTON })`
87
+ ${toolbarButtonStyles}
88
+ `;
89
+ const StyledZoomInButton = styled("g", { name: DSDatavizName, slot: DATAVIZ_SLOTS.ZOOM_IN_BUTTON })`
90
+ ${toolbarButtonStyles}
91
+ `;
92
+ const StyledZoomOutButton = styled("g", { name: DSDatavizName, slot: DATAVIZ_SLOTS.ZOOM_OUT_BUTTON })`
93
+ ${toolbarButtonStyles}
94
+ `;
68
95
  export {
69
- StyleFocusableRegion,
70
96
  StyledArea,
71
97
  StyledAxis,
72
98
  StyledAxisLabel,
73
- StyledGrid,
74
- StyledLine,
99
+ StyledBarGroup,
100
+ StyledLineGroup,
75
101
  StyledMouseOverDetectionBox,
102
+ StyledPointGroup,
103
+ StyledResetter,
76
104
  StyledSVGWrapper,
77
- StyledTooltipContainer
105
+ StyledTooltipContainer,
106
+ StyledZoomInButton,
107
+ StyledZoomOutButton,
108
+ TOOLTIP_CONTENT_SLOT_PROPS
78
109
  };
79
110
  //# sourceMappingURL=styles.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/graphs/Chart/styles.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { styled } from '@elliemae/ds-system';\n\ninterface StyledAxisT {\n axisColor: string;\n}\nexport const StyledSVGWrapper = styled.div<{ isGrabbed: boolean }>`\n rect:focus,\n rect:focus-visible,\n circle:focus,\n circle:focus-visible {\n outline: none;\n }\n\n :focus,\n :focus-visible {\n outline: none;\n }\n\n cursor: ${({ isGrabbed }) => (isGrabbed ? 'grabbing' : 'default')};\n\n text {\n font-size: 1rem;\n }\n\n min-width: 300px;\n`;\n\nexport const StyledAxis = styled('line')<StyledAxisT>`\n stroke-width: 2px;\n stroke: ${({ theme }) => theme.colors.neutral['700']};\n ${({ axisColor }) => (axisColor ? `stroke: ${axisColor}` : '')}\n`;\n\nexport const StyledAxisLabel = styled('text')`\n font-size: 1rem;\n font-weight: 600;\n`;\n\nexport const StyledGrid = styled('g')`\n line {\n opacity: 0.2;\n }\n`;\n\nexport const StyleFocusableRegion = styled.div<{ size?: number }>`\n width: ${({ size = 1 }) => size * 2}px;\n height: ${({ size = 1 }) => size * 2}px;\n outline: none;\n &:focus {\n outline: none;\n }\n`;\n\nexport const StyledLine = styled('path')`\n fill: none;\n stroke-width: 3;\n stroke-linejoin: round;\n`;\nexport const StyledArea = styled('path')`\n stroke-width: 3;\n stroke-linejoin: round;\n opacity: 0.2;\n`;\n\nexport const StyledTooltipContainer = styled.div`\n max-width: 350px;\n background-color: white;\n`;\n\nexport const StyledMouseOverDetectionBox = styled.div`\n position: absolute;\n top: -15px;\n right: -15px;\n width: calc(100% + 30px);\n height: calc(100% + 30px);\n z-index: -1;\n`;\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,cAAc;AAKhB,MAAM,mBAAmB,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,YAa3B,CAAC,EAAE,UAAU,MAAO,YAAY,aAAa,SAAU;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAS5D,MAAM,aAAa,OAAO,MAAM;AAAA;AAAA,YAE3B,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,QAAQ,KAAK,CAAC;AAAA,IAClD,CAAC,EAAE,UAAU,MAAO,YAAY,WAAW,SAAS,KAAK,EAAG;AAAA;AAGzD,MAAM,kBAAkB,OAAO,MAAM;AAAA;AAAA;AAAA;AAKrC,MAAM,aAAa,OAAO,GAAG;AAAA;AAAA;AAAA;AAAA;AAM7B,MAAM,uBAAuB,OAAO;AAAA,WAChC,CAAC,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAAA,YACzB,CAAC,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAO/B,MAAM,aAAa,OAAO,MAAM;AAAA;AAAA;AAAA;AAAA;AAKhC,MAAM,aAAa,OAAO,MAAM;AAAA;AAAA;AAAA;AAAA;AAMhC,MAAM,yBAAyB,OAAO;AAAA;AAAA;AAAA;AAKtC,MAAM,8BAA8B,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { css, styled } from '@elliemae/ds-system';\nimport { DATAVIZ_SLOTS, DSDatavizName } from '../../constants/index.js';\n\ninterface StyledAxisT {\n axisColor: string;\n isVertical: boolean;\n}\nexport const StyledSVGWrapper = styled('div', { name: DSDatavizName, slot: DATAVIZ_SLOTS.ROOT })<{\n isGrabbed: boolean;\n}>`\n rect:focus,\n rect:focus-visible,\n circle:focus,\n circle:focus-visible,\n path:focus,\n path:focus-visible {\n outline: none;\n }\n\n :focus,\n :focus-visible {\n outline: none;\n }\n\n /* the series that step back while a legend item is hovered fade in and out (see useSerieDimming); the roots of the\n series are the groups of the content, or of the groups that tell how each series enters */\n g.content > g,\n g.content > [data-entrance-animation] > g {\n transition: opacity 150ms ease-out;\n }\n\n /* a legend item reached with the keyboard, in the color of the focus ring of the data points */\n g.cell:focus-visible {\n outline: 2px solid ${({ theme }) => theme.colors.brand['700']};\n outline-offset: 2px;\n }\n\n cursor: ${({ isGrabbed }) => (isGrabbed ? 'grabbing' : 'default')};\n\n text {\n font-size: ${({ theme }) => theme.fontSizes.label[300]};\n }\n\n min-width: 300px;\n`;\n\nexport const StyledAxis = styled('line', { name: DSDatavizName, slot: DATAVIZ_SLOTS.AXIS_LINE })<StyledAxisT>`\n stroke-width: 1px;\n shape-rendering: crispEdges;\n /* a hairline baseline; the vertical axes rely on their labels and the grid unless they are given a color */\n stroke: ${({ theme, isVertical }) => (isVertical ? 'transparent' : theme.colors.neutral['300'])};\n ${({ axisColor }) => (axisColor ? `stroke: ${axisColor}` : '')}\n`;\n\nexport const StyledAxisLabel = styled('text', { name: DSDatavizName, slot: DATAVIZ_SLOTS.AXIS_LABEL })`\n font-weight: 600;\n fill: ${({ theme }) => theme.colors.neutral['700']};\n`;\n\n// the line series is drawn with d3 inside this group, so the group is the slot\nexport const StyledLineGroup = styled('g', { name: DSDatavizName, slot: DATAVIZ_SLOTS.LINE })``;\n\n// filled with a vertical gradient of the series color (see Area), so overlapping areas stay readable\nexport const StyledArea = styled('path', { name: DSDatavizName, slot: DATAVIZ_SLOTS.AREA })`\n stroke-width: 3;\n stroke-linejoin: round;\n`;\n\nexport const StyledBarGroup = styled('g', { name: DSDatavizName, slot: DATAVIZ_SLOTS.BAR })``;\n\nexport const StyledPointGroup = styled('g', { name: DSDatavizName, slot: DATAVIZ_SLOTS.POINT })``;\n\nexport const StyledTooltipContainer = styled('div', { name: DSDatavizName, slot: DATAVIZ_SLOTS.TOOLTIP })`\n max-width: 350px;\n background-color: white;\n border-radius: inherit;\n`;\n\n// slot props for the content box of the floating wrapper, the box that carries the tooltip shadow: rounded corners\nexport const TOOLTIP_CONTENT_SLOT_PROPS = { style: { borderRadius: '4px' } };\n\nexport const StyledMouseOverDetectionBox = styled('div', {\n name: DSDatavizName,\n slot: DATAVIZ_SLOTS.TOOLTIP_HOVER_AREA,\n})`\n position: absolute;\n top: -15px;\n right: -15px;\n width: calc(100% + 30px);\n height: calc(100% + 30px);\n z-index: -1;\n`;\n\n// the buttons of the zoom toolbar: a disabled one fades and keeps its place; the focus ring is the one of the data\n// points (the \"&focus\" selector it had matched nothing, so the buttons showed no focus)\nconst toolbarButtonStyles = css<{ isDisabled: boolean }>`\n cursor: ${({ isDisabled }) => (isDisabled ? 'not-allowed' : 'pointer')};\n opacity: ${({ isDisabled }) => (isDisabled ? '0.4' : '1')};\n &:focus {\n outline: none;\n }\n &:focus-visible {\n outline: 2px solid ${({ theme }) => theme.colors.brand['700']};\n outline-offset: 2px;\n }\n`;\n\nexport const StyledResetter = styled('g', { name: DSDatavizName, slot: DATAVIZ_SLOTS.RESET_ZOOM_BUTTON })<{\n isDisabled: boolean;\n}>`\n ${toolbarButtonStyles}\n`;\n\nexport const StyledZoomInButton = styled('g', { name: DSDatavizName, slot: DATAVIZ_SLOTS.ZOOM_IN_BUTTON })<{\n isDisabled: boolean;\n}>`\n ${toolbarButtonStyles}\n`;\n\nexport const StyledZoomOutButton = styled('g', { name: DSDatavizName, slot: DATAVIZ_SLOTS.ZOOM_OUT_BUTTON })<{\n isDisabled: boolean;\n}>`\n ${toolbarButtonStyles}\n`;\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,KAAK,cAAc;AAC5B,SAAS,eAAe,qBAAqB;AAMtC,MAAM,mBAAmB,OAAO,OAAO,EAAE,MAAM,eAAe,MAAM,cAAc,KAAK,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,yBA0BtE,CAAC,EAAE,MAAM,MAA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WD,MAAM,sBAAsB;AAAA,YAChB,CAAC,EAAE,WAAW,MAAO,aAAa,gBAAgB,SAAU;AAAA,aAC3D,CAAC,EAAE,WAAW,MAAO,aAAa,QAAQ,GAAI;AAAA;AAAA;AAAA;AAAA;AAAA,yBAKlC,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,MAAM,KAAK,CAAC;AAAA;AAAA;AAAA;AAK1D,MAAM,iBAAiB,OAAO,KAAK,EAAE,MAAM,eAAe,MAAM,cAAc,kBAAkB,CAAC;AAAA,IAGpG,mBAAmB;AAAA;AAGhB,MAAM,qBAAqB,OAAO,KAAK,EAAE,MAAM,eAAe,MAAM,cAAc,eAAe,CAAC;AAAA,IAGrG,mBAAmB;AAAA;AAGhB,MAAM,sBAAsB,OAAO,KAAK,EAAE,MAAM,eAAe,MAAM,cAAc,gBAAgB,CAAC;AAAA,IAGvG,mBAAmB;AAAA;",
6
6
  "names": []
7
7
  }
@@ -1,5 +1,5 @@
1
1
  import * as React from "react";
2
- import { curveLinear, curveMonotoneX, timeDay, timeMonth, timeHour, timeMinute, timeWeek } from "d3";
2
+ import { curveLinear, curveMonotoneX, utcDay, utcHour, utcMinute, utcMonth, utcWeek, utcYear } from "d3";
3
3
  const SCALE_TYPES = {
4
4
  LINEAR: "linear",
5
5
  BAND: "band",
@@ -7,9 +7,20 @@ const SCALE_TYPES = {
7
7
  TIME: "time"
8
8
  };
9
9
  const FOCUS_RING = {
10
- COLOR: "#335cad",
10
+ COLOR: "#006AA9",
11
+ // brand-700, the fallback when no theme is provided
11
12
  STROKE_WIDTH: 2,
12
- OFFSET: 4
13
+ OFFSET: 4,
14
+ // space between a mark and its focus ring (surface color shows through)
15
+ GAP: 2
16
+ };
17
+ const MARKS = {
18
+ BAR_MAX_THICKNESS: 24,
19
+ BAR_RADIUS: 4,
20
+ STACK_GAP: 2,
21
+ MARKER_RING: 2,
22
+ AREA_TOP_OPACITY: 0.24,
23
+ AREA_BOTTOM_OPACITY: 0.02
13
24
  };
14
25
  const SERIE_TYPES = { LINE: "line", BAR: "bar", AREA: "area", POINT: "point" };
15
26
  const SCRAPPER = {
@@ -50,20 +61,24 @@ const TOOLBAR = {
50
61
  WIDTH: 21
51
62
  }
52
63
  };
53
- const TIME_OFFSET = {
54
- HOUR: timeHour,
55
- MINUTE: timeMinute,
56
- WEEK: timeWeek,
57
- DAY: timeDay,
58
- MONTH: timeMonth
64
+ const TIME_INTERVALS = {
65
+ MINUTE: utcMinute,
66
+ HOUR: utcHour,
67
+ DAY: utcDay,
68
+ WEEK: utcWeek,
69
+ MONTH: utcMonth,
70
+ YEAR: utcYear
59
71
  };
72
+ const SCRAPPER_DEFAULT_TOOLTIP_PREFERENCE = "top";
60
73
  export {
61
74
  FOCUS_RING,
62
75
  LINE,
76
+ MARKS,
63
77
  SCALE_TYPES,
64
78
  SCRAPPER,
79
+ SCRAPPER_DEFAULT_TOOLTIP_PREFERENCE,
65
80
  SERIE_TYPES,
66
- TIME_OFFSET,
81
+ TIME_INTERVALS,
67
82
  TOOLBAR,
68
83
  curveStyleMap
69
84
  };