@mui/x-charts-pro 8.0.0-alpha.9 → 8.0.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (452) hide show
  1. package/BarChartPro/BarChartPro.d.ts +4 -4
  2. package/BarChartPro/BarChartPro.js +240 -284
  3. package/BarChartPro/BarChartPro.plugins.d.ts +4 -0
  4. package/BarChartPro/BarChartPro.plugins.js +9 -0
  5. package/BarChartPro/index.d.ts +1 -1
  6. package/BarChartPro/index.js +16 -1
  7. package/CHANGELOG.md +1446 -0
  8. package/ChartContainerPro/ChartContainerPro.d.ts +8 -9
  9. package/ChartContainerPro/ChartContainerPro.js +181 -174
  10. package/ChartContainerPro/index.d.ts +2 -1
  11. package/ChartContainerPro/index.js +17 -1
  12. package/ChartContainerPro/useChartContainerProProps.d.ts +5 -5
  13. package/ChartContainerPro/useChartContainerProProps.js +28 -19
  14. package/ChartDataProviderPro/ChartDataProviderPro.d.ts +7 -7
  15. package/ChartDataProviderPro/ChartDataProviderPro.js +40 -220
  16. package/ChartDataProviderPro/index.d.ts +2 -1
  17. package/ChartDataProviderPro/index.js +17 -1
  18. package/ChartDataProviderPro/useChartDataProviderProProps.d.ts +7 -7
  19. package/ChartDataProviderPro/useChartDataProviderProProps.js +10 -6
  20. package/FunnelChart/FunnelChart.d.ts +37 -0
  21. package/FunnelChart/FunnelChart.js +218 -0
  22. package/FunnelChart/FunnelPlot.d.ts +16 -0
  23. package/FunnelChart/FunnelPlot.js +191 -0
  24. package/FunnelChart/FunnelSection.d.ts +15 -0
  25. package/FunnelChart/FunnelSection.js +62 -0
  26. package/FunnelChart/categoryAxis.types.d.ts +24 -0
  27. package/FunnelChart/funnel.types.d.ts +124 -0
  28. package/FunnelChart/funnelPlotSlots.types.d.ts +20 -0
  29. package/FunnelChart/funnelSectionClasses.d.ts +13 -0
  30. package/FunnelChart/funnelSectionClasses.js +28 -0
  31. package/FunnelChart/funnelSlots.types.d.ts +19 -0
  32. package/FunnelChart/funnelStepCurve.d.ts +4 -0
  33. package/FunnelChart/funnelStepCurve.js +74 -0
  34. package/FunnelChart/index.d.ts +7 -0
  35. package/FunnelChart/index.js +59 -0
  36. package/FunnelChart/labelUtils.d.ts +42 -0
  37. package/FunnelChart/labelUtils.js +174 -0
  38. package/FunnelChart/seriesConfig/extremums.d.ts +3 -0
  39. package/FunnelChart/seriesConfig/extremums.js +50 -0
  40. package/FunnelChart/seriesConfig/getColor.d.ts +3 -0
  41. package/FunnelChart/seriesConfig/getColor.js +10 -0
  42. package/FunnelChart/seriesConfig/getSeriesWithDefaultValues.d.ts +3 -0
  43. package/FunnelChart/seriesConfig/getSeriesWithDefaultValues.js +18 -0
  44. package/FunnelChart/seriesConfig/index.d.ts +2 -0
  45. package/FunnelChart/seriesConfig/index.js +22 -0
  46. package/FunnelChart/seriesConfig/legend.d.ts +3 -0
  47. package/FunnelChart/seriesConfig/legend.js +31 -0
  48. package/FunnelChart/seriesConfig/seriesProcessor.d.ts +3 -0
  49. package/FunnelChart/seriesConfig/seriesProcessor.js +96 -0
  50. package/FunnelChart/seriesConfig/tooltip.d.ts +3 -0
  51. package/FunnelChart/seriesConfig/tooltip.js +36 -0
  52. package/FunnelChart/useFunnelChartProps.d.ts +30 -0
  53. package/FunnelChart/useFunnelChartProps.js +168 -0
  54. package/Heatmap/Heatmap.d.ts +45 -45
  55. package/Heatmap/Heatmap.js +236 -244
  56. package/Heatmap/Heatmap.plugins.d.ts +3 -0
  57. package/Heatmap/Heatmap.plugins.js +8 -0
  58. package/Heatmap/HeatmapItem.d.ts +33 -33
  59. package/Heatmap/HeatmapItem.js +43 -36
  60. package/Heatmap/HeatmapPlot.d.ts +4 -5
  61. package/Heatmap/HeatmapPlot.js +22 -16
  62. package/Heatmap/HeatmapTooltip.d.ts +3 -4
  63. package/Heatmap/HeatmapTooltip.js +101 -89
  64. package/Heatmap/heatmapClasses.d.ts +7 -7
  65. package/Heatmap/heatmapClasses.js +15 -7
  66. package/Heatmap/index.d.ts +4 -4
  67. package/Heatmap/index.js +47 -4
  68. package/Heatmap/{extremums.d.ts → seriesConfig/extremums.d.ts} +1 -1
  69. package/Heatmap/{getColor.d.ts → seriesConfig/getColor.d.ts} +1 -1
  70. package/Heatmap/seriesConfig/getSeriesWithDefaultValues.d.ts +3 -0
  71. package/Heatmap/seriesConfig/getSeriesWithDefaultValues.js +15 -0
  72. package/Heatmap/seriesConfig/index.d.ts +2 -0
  73. package/Heatmap/seriesConfig/index.js +21 -0
  74. package/Heatmap/seriesConfig/seriesProcessor.d.ts +3 -0
  75. package/{node/Heatmap/formatter.js → Heatmap/seriesConfig/seriesProcessor.js} +2 -2
  76. package/Heatmap/seriesConfig/tooltip.d.ts +3 -0
  77. package/Heatmap/seriesConfig/tooltip.js +31 -0
  78. package/LineChartPro/LineChartPro.d.ts +4 -4
  79. package/LineChartPro/LineChartPro.js +242 -340
  80. package/LineChartPro/LineChartPro.plugins.d.ts +4 -0
  81. package/LineChartPro/LineChartPro.plugins.js +9 -0
  82. package/LineChartPro/index.d.ts +1 -1
  83. package/LineChartPro/index.js +16 -1
  84. package/README.md +1 -1
  85. package/ScatterChartPro/ScatterChartPro.d.ts +4 -4
  86. package/ScatterChartPro/ScatterChartPro.js +244 -235
  87. package/ScatterChartPro/ScatterChartPro.plugins.d.ts +4 -0
  88. package/ScatterChartPro/ScatterChartPro.plugins.js +9 -0
  89. package/ScatterChartPro/index.d.ts +1 -1
  90. package/ScatterChartPro/index.js +16 -1
  91. package/esm/BarChartPro/BarChartPro.d.ts +18 -0
  92. package/esm/BarChartPro/BarChartPro.js +404 -0
  93. package/esm/BarChartPro/BarChartPro.plugins.d.ts +4 -0
  94. package/esm/BarChartPro/BarChartPro.plugins.js +3 -0
  95. package/esm/BarChartPro/index.d.ts +1 -0
  96. package/esm/BarChartPro/index.js +1 -0
  97. package/esm/ChartContainerPro/ChartContainerPro.d.ts +35 -0
  98. package/esm/ChartContainerPro/ChartContainerPro.js +290 -0
  99. package/esm/ChartContainerPro/index.d.ts +2 -0
  100. package/esm/ChartContainerPro/index.js +2 -0
  101. package/esm/ChartContainerPro/useChartContainerProProps.d.ts +9 -0
  102. package/esm/ChartContainerPro/useChartContainerProProps.js +35 -0
  103. package/esm/ChartDataProviderPro/ChartDataProviderPro.d.ts +37 -0
  104. package/esm/ChartDataProviderPro/ChartDataProviderPro.js +106 -0
  105. package/esm/ChartDataProviderPro/index.d.ts +2 -0
  106. package/esm/ChartDataProviderPro/index.js +2 -0
  107. package/esm/ChartDataProviderPro/useChartDataProviderProProps.d.ts +8 -0
  108. package/esm/ChartDataProviderPro/useChartDataProviderProProps.js +15 -0
  109. package/esm/FunnelChart/FunnelChart.d.ts +37 -0
  110. package/esm/FunnelChart/FunnelChart.js +212 -0
  111. package/esm/FunnelChart/FunnelPlot.d.ts +16 -0
  112. package/esm/FunnelChart/FunnelPlot.js +184 -0
  113. package/esm/FunnelChart/FunnelSection.d.ts +15 -0
  114. package/esm/FunnelChart/FunnelSection.js +56 -0
  115. package/esm/FunnelChart/categoryAxis.types.d.ts +24 -0
  116. package/esm/FunnelChart/funnel.types.d.ts +124 -0
  117. package/esm/FunnelChart/funnelPlotSlots.types.d.ts +20 -0
  118. package/esm/FunnelChart/funnelPlotSlots.types.js +1 -0
  119. package/esm/FunnelChart/funnelSectionClasses.d.ts +13 -0
  120. package/esm/FunnelChart/funnelSectionClasses.js +20 -0
  121. package/esm/FunnelChart/funnelSlots.types.d.ts +19 -0
  122. package/esm/FunnelChart/funnelSlots.types.js +1 -0
  123. package/esm/FunnelChart/funnelStepCurve.d.ts +4 -0
  124. package/esm/FunnelChart/funnelStepCurve.js +67 -0
  125. package/esm/FunnelChart/index.d.ts +7 -0
  126. package/esm/FunnelChart/index.js +5 -0
  127. package/esm/FunnelChart/labelUtils.d.ts +42 -0
  128. package/esm/FunnelChart/labelUtils.js +166 -0
  129. package/esm/FunnelChart/seriesConfig/extremums.d.ts +3 -0
  130. package/esm/FunnelChart/seriesConfig/extremums.js +42 -0
  131. package/esm/FunnelChart/seriesConfig/getColor.d.ts +3 -0
  132. package/esm/FunnelChart/seriesConfig/getColor.js +4 -0
  133. package/esm/FunnelChart/seriesConfig/getSeriesWithDefaultValues.d.ts +3 -0
  134. package/esm/FunnelChart/seriesConfig/getSeriesWithDefaultValues.js +11 -0
  135. package/esm/FunnelChart/seriesConfig/index.d.ts +2 -0
  136. package/esm/FunnelChart/seriesConfig/index.js +15 -0
  137. package/esm/FunnelChart/seriesConfig/legend.d.ts +3 -0
  138. package/esm/FunnelChart/seriesConfig/legend.js +25 -0
  139. package/esm/FunnelChart/seriesConfig/seriesProcessor.d.ts +3 -0
  140. package/esm/FunnelChart/seriesConfig/seriesProcessor.js +89 -0
  141. package/esm/FunnelChart/seriesConfig/tooltip.d.ts +3 -0
  142. package/esm/FunnelChart/seriesConfig/tooltip.js +29 -0
  143. package/esm/FunnelChart/useFunnelChartProps.d.ts +30 -0
  144. package/esm/FunnelChart/useFunnelChartProps.js +161 -0
  145. package/esm/Heatmap/Heatmap.d.ts +57 -0
  146. package/esm/Heatmap/Heatmap.js +387 -0
  147. package/esm/Heatmap/Heatmap.plugins.d.ts +3 -0
  148. package/esm/Heatmap/Heatmap.plugins.js +2 -0
  149. package/esm/Heatmap/HeatmapItem.d.ts +49 -0
  150. package/esm/Heatmap/HeatmapItem.js +106 -0
  151. package/esm/Heatmap/HeatmapPlot.d.ts +8 -0
  152. package/{node → esm}/Heatmap/HeatmapPlot.js +16 -22
  153. package/esm/Heatmap/HeatmapTooltip.d.ts +8 -0
  154. package/esm/Heatmap/HeatmapTooltip.js +280 -0
  155. package/esm/Heatmap/heatmapClasses.d.ts +11 -0
  156. package/esm/Heatmap/heatmapClasses.js +14 -0
  157. package/esm/Heatmap/index.d.ts +4 -0
  158. package/esm/Heatmap/index.js +4 -0
  159. package/esm/Heatmap/seriesConfig/extremums.d.ts +2 -0
  160. package/esm/Heatmap/seriesConfig/getColor.d.ts +3 -0
  161. package/esm/Heatmap/seriesConfig/getSeriesWithDefaultValues.d.ts +3 -0
  162. package/esm/Heatmap/seriesConfig/getSeriesWithDefaultValues.js +8 -0
  163. package/esm/Heatmap/seriesConfig/index.d.ts +2 -0
  164. package/esm/Heatmap/seriesConfig/index.js +14 -0
  165. package/esm/Heatmap/seriesConfig/seriesProcessor.d.ts +3 -0
  166. package/{Heatmap/formatter.js → esm/Heatmap/seriesConfig/seriesProcessor.js} +2 -2
  167. package/esm/Heatmap/seriesConfig/tooltip.d.ts +3 -0
  168. package/esm/Heatmap/seriesConfig/tooltip.js +25 -0
  169. package/esm/LineChartPro/LineChartPro.d.ts +17 -0
  170. package/esm/LineChartPro/LineChartPro.js +401 -0
  171. package/esm/LineChartPro/LineChartPro.plugins.d.ts +4 -0
  172. package/esm/LineChartPro/LineChartPro.plugins.js +3 -0
  173. package/esm/LineChartPro/index.d.ts +1 -0
  174. package/esm/LineChartPro/index.js +1 -0
  175. package/esm/ScatterChartPro/ScatterChartPro.d.ts +17 -0
  176. package/esm/ScatterChartPro/ScatterChartPro.js +395 -0
  177. package/esm/ScatterChartPro/ScatterChartPro.plugins.d.ts +4 -0
  178. package/esm/ScatterChartPro/ScatterChartPro.plugins.js +3 -0
  179. package/esm/ScatterChartPro/index.d.ts +1 -0
  180. package/esm/ScatterChartPro/index.js +1 -0
  181. package/esm/hooks/index.d.ts +2 -0
  182. package/esm/hooks/index.js +2 -0
  183. package/esm/hooks/useFunnelSeries.d.ts +33 -0
  184. package/esm/hooks/useFunnelSeries.js +42 -0
  185. package/esm/hooks/useHeatmapSeries.d.ts +33 -0
  186. package/esm/hooks/useHeatmapSeries.js +42 -0
  187. package/esm/hooks/zoom/index.d.ts +1 -0
  188. package/esm/hooks/zoom/index.js +1 -0
  189. package/esm/hooks/zoom/useIsZoomInteracting.d.ts +6 -0
  190. package/esm/hooks/zoom/useIsZoomInteracting.js +14 -0
  191. package/esm/index.d.ts +34 -0
  192. package/esm/index.js +45 -0
  193. package/esm/internals/plugins/allPlugins.d.ts +8 -0
  194. package/esm/internals/plugins/allPlugins.js +6 -0
  195. package/esm/internals/plugins/useChartProZoom/index.d.ts +3 -0
  196. package/esm/internals/plugins/useChartProZoom/index.js +3 -0
  197. package/esm/internals/plugins/useChartProZoom/useChartProZoom.d.ts +3 -0
  198. package/{node → esm}/internals/plugins/useChartProZoom/useChartProZoom.js +94 -54
  199. package/esm/internals/plugins/useChartProZoom/useChartProZoom.selectors.d.ts +203 -0
  200. package/esm/internals/plugins/useChartProZoom/useChartProZoom.selectors.js +4 -0
  201. package/esm/internals/plugins/useChartProZoom/useChartProZoom.types.d.ts +53 -0
  202. package/esm/internals/plugins/useChartProZoom/useChartProZoom.types.js +1 -0
  203. package/esm/internals/plugins/useChartProZoom/useChartProZoom.utils.d.ts +45 -0
  204. package/{node → esm}/internals/plugins/useChartProZoom/useChartProZoom.utils.js +8 -22
  205. package/esm/internals/utils/releaseInfo.d.ts +1 -0
  206. package/esm/internals/utils/releaseInfo.js +13 -0
  207. package/esm/models/index.d.ts +2 -0
  208. package/esm/models/index.js +2 -0
  209. package/esm/models/seriesType/heatmap.d.ts +28 -0
  210. package/esm/models/seriesType/heatmap.js +1 -0
  211. package/esm/models/seriesType/index.d.ts +1 -0
  212. package/esm/models/seriesType/index.js +1 -0
  213. package/esm/package.json +1 -0
  214. package/esm/themeAugmentation/components.d.ts +23 -0
  215. package/esm/themeAugmentation/index.d.ts +4 -0
  216. package/esm/themeAugmentation/index.js +0 -0
  217. package/esm/themeAugmentation/overrides.d.ts +11 -0
  218. package/esm/themeAugmentation/props.d.ts +20 -0
  219. package/esm/typeOverloads/index.d.ts +1 -0
  220. package/esm/typeOverloads/index.js +1 -0
  221. package/esm/typeOverloads/modules.d.ts +33 -0
  222. package/esm/typeOverloads/modules.js +1 -0
  223. package/hooks/index.d.ts +2 -2
  224. package/hooks/index.js +27 -2
  225. package/hooks/useFunnelSeries.d.ts +33 -0
  226. package/hooks/useFunnelSeries.js +48 -0
  227. package/hooks/useHeatmapSeries.d.ts +33 -0
  228. package/hooks/useHeatmapSeries.js +48 -0
  229. package/hooks/zoom/index.d.ts +1 -1
  230. package/hooks/zoom/index.js +16 -1
  231. package/hooks/zoom/useIsZoomInteracting.d.ts +1 -1
  232. package/hooks/zoom/useIsZoomInteracting.js +10 -5
  233. package/index.d.ts +10 -8
  234. package/index.js +369 -37
  235. package/internals/plugins/allPlugins.d.ts +7 -9
  236. package/internals/plugins/allPlugins.js +10 -3
  237. package/internals/plugins/useChartProZoom/index.d.ts +3 -3
  238. package/internals/plugins/useChartProZoom/index.js +38 -3
  239. package/internals/plugins/useChartProZoom/useChartProZoom.d.ts +2 -2
  240. package/internals/plugins/useChartProZoom/useChartProZoom.js +101 -47
  241. package/internals/plugins/useChartProZoom/useChartProZoom.selectors.d.ts +154 -328
  242. package/internals/plugins/useChartProZoom/useChartProZoom.selectors.js +11 -10
  243. package/internals/plugins/useChartProZoom/useChartProZoom.types.d.ts +42 -39
  244. package/internals/plugins/useChartProZoom/useChartProZoom.types.js +5 -1
  245. package/internals/plugins/useChartProZoom/useChartProZoom.utils.d.ts +13 -13
  246. package/internals/plugins/useChartProZoom/useChartProZoom.utils.js +22 -8
  247. package/internals/utils/releaseInfo.d.ts +1 -1
  248. package/internals/utils/releaseInfo.js +13 -5
  249. package/models/index.d.ts +1 -1
  250. package/models/index.js +16 -2
  251. package/models/seriesType/heatmap.d.ts +18 -19
  252. package/models/seriesType/heatmap.js +5 -1
  253. package/models/seriesType/index.d.ts +1 -1
  254. package/models/seriesType/index.js +16 -1
  255. package/modern/BarChartPro/BarChartPro.d.ts +18 -0
  256. package/modern/BarChartPro/BarChartPro.js +35 -85
  257. package/modern/BarChartPro/BarChartPro.plugins.d.ts +4 -0
  258. package/modern/BarChartPro/BarChartPro.plugins.js +3 -0
  259. package/modern/BarChartPro/index.d.ts +1 -0
  260. package/modern/ChartContainerPro/ChartContainerPro.d.ts +35 -0
  261. package/modern/ChartContainerPro/ChartContainerPro.js +4 -3
  262. package/modern/ChartContainerPro/index.d.ts +2 -0
  263. package/modern/ChartContainerPro/index.js +1 -0
  264. package/modern/ChartContainerPro/useChartContainerProProps.d.ts +9 -0
  265. package/modern/ChartContainerPro/useChartContainerProProps.js +15 -13
  266. package/modern/ChartDataProviderPro/ChartDataProviderPro.d.ts +37 -0
  267. package/modern/ChartDataProviderPro/ChartDataProviderPro.js +18 -204
  268. package/modern/ChartDataProviderPro/index.d.ts +2 -0
  269. package/modern/ChartDataProviderPro/index.js +1 -0
  270. package/modern/ChartDataProviderPro/useChartDataProviderProProps.d.ts +8 -0
  271. package/modern/ChartDataProviderPro/useChartDataProviderProProps.js +0 -2
  272. package/modern/FunnelChart/FunnelChart.d.ts +37 -0
  273. package/modern/FunnelChart/FunnelChart.js +212 -0
  274. package/modern/FunnelChart/FunnelPlot.d.ts +16 -0
  275. package/modern/FunnelChart/FunnelPlot.js +184 -0
  276. package/modern/FunnelChart/FunnelSection.d.ts +15 -0
  277. package/modern/FunnelChart/FunnelSection.js +56 -0
  278. package/modern/FunnelChart/categoryAxis.types.d.ts +24 -0
  279. package/modern/FunnelChart/categoryAxis.types.js +1 -0
  280. package/modern/FunnelChart/funnel.types.d.ts +124 -0
  281. package/modern/FunnelChart/funnel.types.js +1 -0
  282. package/modern/FunnelChart/funnelPlotSlots.types.d.ts +20 -0
  283. package/modern/FunnelChart/funnelPlotSlots.types.js +1 -0
  284. package/modern/FunnelChart/funnelSectionClasses.d.ts +13 -0
  285. package/modern/FunnelChart/funnelSectionClasses.js +20 -0
  286. package/modern/FunnelChart/funnelSlots.types.d.ts +19 -0
  287. package/modern/FunnelChart/funnelSlots.types.js +1 -0
  288. package/modern/FunnelChart/funnelStepCurve.d.ts +4 -0
  289. package/modern/FunnelChart/funnelStepCurve.js +67 -0
  290. package/modern/FunnelChart/index.d.ts +7 -0
  291. package/modern/FunnelChart/index.js +5 -0
  292. package/modern/FunnelChart/labelUtils.d.ts +42 -0
  293. package/modern/FunnelChart/labelUtils.js +166 -0
  294. package/modern/FunnelChart/seriesConfig/extremums.d.ts +3 -0
  295. package/modern/FunnelChart/seriesConfig/extremums.js +42 -0
  296. package/modern/FunnelChart/seriesConfig/getColor.d.ts +3 -0
  297. package/modern/FunnelChart/seriesConfig/getColor.js +4 -0
  298. package/modern/FunnelChart/seriesConfig/getSeriesWithDefaultValues.d.ts +3 -0
  299. package/modern/FunnelChart/seriesConfig/getSeriesWithDefaultValues.js +11 -0
  300. package/modern/FunnelChart/seriesConfig/index.d.ts +2 -0
  301. package/modern/FunnelChart/seriesConfig/index.js +15 -0
  302. package/modern/FunnelChart/seriesConfig/legend.d.ts +3 -0
  303. package/modern/FunnelChart/seriesConfig/legend.js +25 -0
  304. package/modern/FunnelChart/seriesConfig/seriesProcessor.d.ts +3 -0
  305. package/modern/FunnelChart/seriesConfig/seriesProcessor.js +89 -0
  306. package/modern/FunnelChart/seriesConfig/tooltip.d.ts +3 -0
  307. package/modern/FunnelChart/seriesConfig/tooltip.js +29 -0
  308. package/modern/FunnelChart/useFunnelChartProps.d.ts +30 -0
  309. package/modern/FunnelChart/useFunnelChartProps.js +161 -0
  310. package/modern/Heatmap/Heatmap.d.ts +57 -0
  311. package/modern/Heatmap/Heatmap.js +47 -61
  312. package/modern/Heatmap/Heatmap.plugins.d.ts +3 -0
  313. package/modern/Heatmap/Heatmap.plugins.js +2 -0
  314. package/modern/Heatmap/HeatmapItem.d.ts +49 -0
  315. package/modern/Heatmap/HeatmapItem.js +7 -7
  316. package/modern/Heatmap/HeatmapPlot.d.ts +8 -0
  317. package/modern/Heatmap/HeatmapPlot.js +2 -2
  318. package/modern/Heatmap/HeatmapTooltip.d.ts +8 -0
  319. package/modern/Heatmap/HeatmapTooltip.js +10 -4
  320. package/modern/Heatmap/heatmapClasses.d.ts +11 -0
  321. package/modern/Heatmap/index.d.ts +4 -0
  322. package/modern/Heatmap/seriesConfig/extremums.d.ts +2 -0
  323. package/modern/Heatmap/seriesConfig/getColor.d.ts +3 -0
  324. package/modern/Heatmap/seriesConfig/getSeriesWithDefaultValues.d.ts +3 -0
  325. package/modern/Heatmap/seriesConfig/getSeriesWithDefaultValues.js +8 -0
  326. package/modern/Heatmap/seriesConfig/index.d.ts +2 -0
  327. package/modern/Heatmap/seriesConfig/index.js +14 -0
  328. package/modern/Heatmap/seriesConfig/seriesProcessor.d.ts +3 -0
  329. package/modern/Heatmap/{formatter.js → seriesConfig/seriesProcessor.js} +2 -2
  330. package/modern/Heatmap/seriesConfig/tooltip.d.ts +3 -0
  331. package/modern/Heatmap/seriesConfig/tooltip.js +25 -0
  332. package/modern/LineChartPro/LineChartPro.d.ts +17 -0
  333. package/modern/LineChartPro/LineChartPro.js +36 -140
  334. package/modern/LineChartPro/LineChartPro.plugins.d.ts +4 -0
  335. package/modern/LineChartPro/LineChartPro.plugins.js +3 -0
  336. package/modern/LineChartPro/index.d.ts +1 -0
  337. package/modern/ScatterChartPro/ScatterChartPro.d.ts +17 -0
  338. package/modern/ScatterChartPro/ScatterChartPro.js +40 -37
  339. package/modern/ScatterChartPro/ScatterChartPro.plugins.d.ts +4 -0
  340. package/modern/ScatterChartPro/ScatterChartPro.plugins.js +3 -0
  341. package/modern/ScatterChartPro/index.d.ts +1 -0
  342. package/modern/hooks/index.d.ts +2 -0
  343. package/modern/hooks/index.js +1 -1
  344. package/modern/hooks/useFunnelSeries.d.ts +33 -0
  345. package/modern/hooks/useFunnelSeries.js +42 -0
  346. package/modern/hooks/useHeatmapSeries.d.ts +33 -0
  347. package/modern/hooks/useHeatmapSeries.js +42 -0
  348. package/modern/hooks/zoom/index.d.ts +1 -0
  349. package/modern/hooks/zoom/useIsZoomInteracting.d.ts +6 -0
  350. package/modern/index.d.ts +34 -0
  351. package/modern/index.js +5 -4
  352. package/modern/internals/plugins/allPlugins.d.ts +8 -0
  353. package/modern/internals/plugins/allPlugins.js +3 -2
  354. package/modern/internals/plugins/useChartProZoom/index.d.ts +3 -0
  355. package/modern/internals/plugins/useChartProZoom/useChartProZoom.d.ts +3 -0
  356. package/modern/internals/plugins/useChartProZoom/useChartProZoom.js +65 -18
  357. package/modern/internals/plugins/useChartProZoom/useChartProZoom.selectors.d.ts +203 -0
  358. package/modern/internals/plugins/useChartProZoom/useChartProZoom.selectors.js +1 -7
  359. package/modern/internals/plugins/useChartProZoom/useChartProZoom.types.d.ts +53 -0
  360. package/modern/internals/plugins/useChartProZoom/useChartProZoom.utils.d.ts +45 -0
  361. package/modern/internals/utils/releaseInfo.d.ts +1 -0
  362. package/modern/internals/utils/releaseInfo.js +1 -1
  363. package/modern/models/index.d.ts +2 -0
  364. package/modern/models/seriesType/heatmap.d.ts +28 -0
  365. package/modern/models/seriesType/index.d.ts +1 -0
  366. package/modern/package.json +1 -0
  367. package/modern/themeAugmentation/components.d.ts +23 -0
  368. package/modern/themeAugmentation/index.d.ts +4 -0
  369. package/modern/themeAugmentation/overrides.d.ts +11 -0
  370. package/modern/themeAugmentation/props.d.ts +20 -0
  371. package/modern/typeOverloads/index.d.ts +1 -0
  372. package/modern/typeOverloads/modules.d.ts +33 -0
  373. package/package.json +44 -11
  374. package/themeAugmentation/components.d.ts +1 -3
  375. package/themeAugmentation/index.d.ts +1 -1
  376. package/themeAugmentation/index.js +1 -0
  377. package/themeAugmentation/overrides.d.ts +2 -4
  378. package/themeAugmentation/props.d.ts +5 -7
  379. package/tsconfig.build.tsbuildinfo +1 -0
  380. package/typeOverloads/index.d.ts +1 -1
  381. package/typeOverloads/index.js +6 -1
  382. package/typeOverloads/modules.d.ts +32 -24
  383. package/typeOverloads/modules.js +5 -1
  384. package/BarChartPro/package.json +0 -6
  385. package/ChartContainerPro/package.json +0 -6
  386. package/ChartDataProviderPro/package.json +0 -6
  387. package/Heatmap/formatter.d.ts +0 -3
  388. package/Heatmap/package.json +0 -6
  389. package/Heatmap/plugin.d.ts +0 -2
  390. package/Heatmap/plugin.js +0 -10
  391. package/LineChartPro/package.json +0 -6
  392. package/ScatterChartPro/package.json +0 -6
  393. package/hooks/package.json +0 -6
  394. package/hooks/useSeries.d.ts +0 -11
  395. package/hooks/useSeries.js +0 -16
  396. package/internals/plugins/useChartProZoom/creatZoomLookup.d.ts +0 -3
  397. package/internals/plugins/useChartProZoom/creatZoomLookup.js +0 -12
  398. package/internals/plugins/useChartProZoom/defaultizeZoom.d.ts +0 -2
  399. package/internals/plugins/useChartProZoom/defaultizeZoom.js +0 -25
  400. package/internals/plugins/useChartProZoom/zoom.types.d.ts +0 -53
  401. package/models/package.json +0 -6
  402. package/modern/Heatmap/plugin.js +0 -10
  403. package/modern/hooks/useSeries.js +0 -16
  404. package/modern/internals/plugins/useChartProZoom/creatZoomLookup.js +0 -12
  405. package/modern/internals/plugins/useChartProZoom/defaultizeZoom.js +0 -25
  406. package/node/BarChartPro/BarChartPro.js +0 -460
  407. package/node/BarChartPro/index.js +0 -16
  408. package/node/ChartContainerPro/ChartContainerPro.js +0 -295
  409. package/node/ChartContainerPro/index.js +0 -16
  410. package/node/ChartContainerPro/useChartContainerProProps.js +0 -40
  411. package/node/ChartDataProviderPro/ChartDataProviderPro.js +0 -298
  412. package/node/ChartDataProviderPro/index.js +0 -16
  413. package/node/ChartDataProviderPro/useChartDataProviderProProps.js +0 -23
  414. package/node/Heatmap/Heatmap.js +0 -407
  415. package/node/Heatmap/HeatmapItem.js +0 -113
  416. package/node/Heatmap/HeatmapTooltip.js +0 -280
  417. package/node/Heatmap/heatmapClasses.js +0 -22
  418. package/node/Heatmap/index.js +0 -47
  419. package/node/Heatmap/plugin.js +0 -17
  420. package/node/LineChartPro/LineChartPro.js +0 -511
  421. package/node/LineChartPro/index.js +0 -16
  422. package/node/ScatterChartPro/ScatterChartPro.js +0 -398
  423. package/node/ScatterChartPro/index.js +0 -16
  424. package/node/hooks/index.js +0 -27
  425. package/node/hooks/useSeries.js +0 -21
  426. package/node/hooks/zoom/index.js +0 -16
  427. package/node/hooks/zoom/useIsZoomInteracting.js +0 -19
  428. package/node/index.js +0 -365
  429. package/node/internals/plugins/allPlugins.js +0 -11
  430. package/node/internals/plugins/useChartProZoom/creatZoomLookup.js +0 -19
  431. package/node/internals/plugins/useChartProZoom/defaultizeZoom.js +0 -33
  432. package/node/internals/plugins/useChartProZoom/index.js +0 -38
  433. package/node/internals/plugins/useChartProZoom/useChartProZoom.selectors.js +0 -18
  434. package/node/internals/utils/releaseInfo.js +0 -21
  435. package/node/models/index.js +0 -16
  436. package/node/models/seriesType/index.js +0 -16
  437. package/node/themeAugmentation/index.js +0 -1
  438. package/node/typeOverloads/index.js +0 -6
  439. package/themeAugmentation/package.json +0 -6
  440. package/typeOverloads/package.json +0 -6
  441. /package/{node/internals/plugins/useChartProZoom/useChartProZoom.types.js → FunnelChart/categoryAxis.types.js} +0 -0
  442. /package/{node/internals/plugins/useChartProZoom/zoom.types.js → FunnelChart/funnel.types.js} +0 -0
  443. /package/{node/models/seriesType/heatmap.js → FunnelChart/funnelPlotSlots.types.js} +0 -0
  444. /package/{node/typeOverloads/modules.js → FunnelChart/funnelSlots.types.js} +0 -0
  445. /package/{node/Heatmap → Heatmap/seriesConfig}/extremums.js +0 -0
  446. /package/{node/Heatmap → Heatmap/seriesConfig}/getColor.js +0 -0
  447. /package/{internals/plugins/useChartProZoom/zoom.types.js → esm/FunnelChart/categoryAxis.types.js} +0 -0
  448. /package/{modern/internals/plugins/useChartProZoom/zoom.types.js → esm/FunnelChart/funnel.types.js} +0 -0
  449. /package/{Heatmap → esm/Heatmap/seriesConfig}/extremums.js +0 -0
  450. /package/{Heatmap → esm/Heatmap/seriesConfig}/getColor.js +0 -0
  451. /package/modern/Heatmap/{extremums.js → seriesConfig/extremums.js} +0 -0
  452. /package/modern/Heatmap/{getColor.js → seriesConfig/getColor.js} +0 -0
@@ -0,0 +1,218 @@
1
+ "use strict";
2
+ 'use client';
3
+
4
+ var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
5
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
6
+ Object.defineProperty(exports, "__esModule", {
7
+ value: true
8
+ });
9
+ exports.FunnelChart = void 0;
10
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
11
+ var React = _interopRequireWildcard(require("react"));
12
+ var _styles = require("@mui/material/styles");
13
+ var _propTypes = _interopRequireDefault(require("prop-types"));
14
+ var _ChartsOverlay = require("@mui/x-charts/ChartsOverlay");
15
+ var _ChartsTooltip = require("@mui/x-charts/ChartsTooltip");
16
+ var _internals = require("@mui/x-charts/internals");
17
+ var _ChartsLegend = require("@mui/x-charts/ChartsLegend");
18
+ var _ChartsClipPath = require("@mui/x-charts/ChartsClipPath");
19
+ var _ChartsSurface = require("@mui/x-charts/ChartsSurface");
20
+ var _ChartsAxisHighlight = require("@mui/x-charts/ChartsAxisHighlight");
21
+ var _ChartsAxis = require("@mui/x-charts/ChartsAxis");
22
+ var _FunnelPlot = require("./FunnelPlot");
23
+ var _useFunnelChartProps = require("./useFunnelChartProps");
24
+ var _seriesConfig = require("./seriesConfig");
25
+ var _useChartContainerProProps = require("../ChartContainerPro/useChartContainerProProps");
26
+ var _ChartDataProviderPro = require("../ChartDataProviderPro");
27
+ var _jsxRuntime = require("react/jsx-runtime");
28
+ const seriesConfig = {
29
+ funnel: _seriesConfig.seriesConfig
30
+ };
31
+ const FunnelChart = exports.FunnelChart = /*#__PURE__*/React.forwardRef(function FunnelChart(props, ref) {
32
+ const themedProps = (0, _styles.useThemeProps)({
33
+ props,
34
+ name: 'MuiFunnelChart'
35
+ });
36
+ const {
37
+ chartContainerProps,
38
+ funnelPlotProps,
39
+ overlayProps,
40
+ legendProps,
41
+ clipPathGroupProps,
42
+ chartsAxisProps,
43
+ clipPathProps,
44
+ chartsWrapperProps,
45
+ axisHighlightProps,
46
+ children
47
+ } = (0, _useFunnelChartProps.useFunnelChartProps)(themedProps);
48
+ const {
49
+ chartDataProviderProProps,
50
+ chartsSurfaceProps
51
+ } = (0, _useChartContainerProProps.useChartContainerProProps)(chartContainerProps, ref);
52
+ const Tooltip = themedProps.slots?.tooltip ?? _ChartsTooltip.ChartsTooltip;
53
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartDataProviderPro.ChartDataProviderPro, (0, _extends2.default)({}, chartDataProviderProProps, {
54
+ seriesConfig: seriesConfig,
55
+ children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_internals.ChartsWrapper, (0, _extends2.default)({}, chartsWrapperProps, {
56
+ children: [!themedProps.hideLegend && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsLegend.ChartsLegend, (0, _extends2.default)({}, legendProps)), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_ChartsSurface.ChartsSurface, (0, _extends2.default)({}, chartsSurfaceProps, {
57
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("g", (0, _extends2.default)({}, clipPathGroupProps, {
58
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_FunnelPlot.FunnelPlot, (0, _extends2.default)({}, funnelPlotProps)), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsOverlay.ChartsOverlay, (0, _extends2.default)({}, overlayProps)), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsAxisHighlight.ChartsAxisHighlight, (0, _extends2.default)({}, axisHighlightProps))]
59
+ })), !themedProps.loading && /*#__PURE__*/(0, _jsxRuntime.jsx)(Tooltip, (0, _extends2.default)({}, themedProps.slotProps?.tooltip, {
60
+ trigger: "item"
61
+ })), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsAxis.ChartsAxis, (0, _extends2.default)({}, chartsAxisProps)), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsClipPath.ChartsClipPath, (0, _extends2.default)({}, clipPathProps)), children]
62
+ }))]
63
+ }))
64
+ }));
65
+ });
66
+ process.env.NODE_ENV !== "production" ? FunnelChart.propTypes = {
67
+ // ----------------------------- Warning --------------------------------
68
+ // | These PropTypes are generated from the TypeScript type definitions |
69
+ // | To update them edit the TypeScript types and run "pnpm proptypes" |
70
+ // ----------------------------------------------------------------------
71
+ apiRef: _propTypes.default.shape({
72
+ current: _propTypes.default.shape({
73
+ setZoomData: _propTypes.default.func.isRequired
74
+ })
75
+ }),
76
+ /**
77
+ * The configuration of axes highlight.
78
+ * Default is set to 'band' in the bar direction.
79
+ * Depends on `layout` prop.
80
+ * @see See {@link https://mui.com/x/react-charts/highlighting/ highlighting docs} for more details.
81
+ */
82
+ axisHighlight: _propTypes.default.shape({
83
+ x: _propTypes.default.oneOf(['band', 'line', 'none']),
84
+ y: _propTypes.default.oneOf(['band', 'line', 'none'])
85
+ }),
86
+ /**
87
+ * The configuration of the category axis.
88
+ *
89
+ * @default { position: 'none' }
90
+ */
91
+ categoryAxis: _propTypes.default.shape({
92
+ categories: _propTypes.default.arrayOf(_propTypes.default.string),
93
+ disableLine: _propTypes.default.bool,
94
+ disableTicks: _propTypes.default.bool,
95
+ id: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
96
+ position: _propTypes.default.oneOf(['bottom', 'left', 'none', 'right', 'top']),
97
+ scaleType: _propTypes.default.oneOf(['band', 'linear', 'log', 'point', 'pow', 'sqrt', 'time', 'utc']),
98
+ size: _propTypes.default.number,
99
+ tickLabelStyle: _propTypes.default.object,
100
+ tickSize: _propTypes.default.number
101
+ }),
102
+ children: _propTypes.default.node,
103
+ className: _propTypes.default.string,
104
+ /**
105
+ * Color palette used to colorize multiple series.
106
+ * @default rainbowSurgePalette
107
+ */
108
+ colors: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.string), _propTypes.default.func]),
109
+ desc: _propTypes.default.string,
110
+ /**
111
+ * If `true`, the charts will not listen to the mouse move event.
112
+ * It might break interactive features, but will improve performance.
113
+ * @default false
114
+ */
115
+ disableAxisListener: _propTypes.default.bool,
116
+ /**
117
+ * The height of the chart in px. If not defined, it takes the height of the parent element.
118
+ */
119
+ height: _propTypes.default.number,
120
+ /**
121
+ * If `true`, the legend is not rendered.
122
+ * @default false
123
+ */
124
+ hideLegend: _propTypes.default.bool,
125
+ /**
126
+ * The highlighted item.
127
+ * Used when the highlight is controlled.
128
+ */
129
+ highlightedItem: _propTypes.default.shape({
130
+ dataIndex: _propTypes.default.number,
131
+ seriesId: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]).isRequired
132
+ }),
133
+ /**
134
+ * This prop is used to help implement the accessibility logic.
135
+ * If you don't provide this prop. It falls back to a randomly generated id.
136
+ */
137
+ id: _propTypes.default.string,
138
+ /**
139
+ * The list of zoom data related to each axis.
140
+ * Used to initialize the zoom in a specific configuration without controlling it.
141
+ */
142
+ initialZoom: _propTypes.default.arrayOf(_propTypes.default.shape({
143
+ axisId: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]).isRequired,
144
+ end: _propTypes.default.number.isRequired,
145
+ start: _propTypes.default.number.isRequired
146
+ })),
147
+ /**
148
+ * If `true`, a loading overlay is displayed.
149
+ * @default false
150
+ */
151
+ loading: _propTypes.default.bool,
152
+ /**
153
+ * The margin between the SVG and the drawing area.
154
+ * It's used for leaving some space for extra information such as the x- and y-axis or legend.
155
+ *
156
+ * Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`.
157
+ */
158
+ margin: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.shape({
159
+ bottom: _propTypes.default.number,
160
+ left: _propTypes.default.number,
161
+ right: _propTypes.default.number,
162
+ top: _propTypes.default.number
163
+ })]),
164
+ /**
165
+ * The function called for onClick events.
166
+ * The second argument contains information about all line/bar elements at the current mouse position.
167
+ * @param {MouseEvent} event The mouse event recorded on the `<svg/>` element.
168
+ * @param {null | AxisData} data The data about the clicked axis and items associated with it.
169
+ */
170
+ onAxisClick: _propTypes.default.func,
171
+ /**
172
+ * The callback fired when the highlighted item changes.
173
+ *
174
+ * @param {HighlightItemData | null} highlightedItem The newly highlighted item.
175
+ */
176
+ onHighlightChange: _propTypes.default.func,
177
+ /**
178
+ * Callback fired when a funnel item is clicked.
179
+ * @param {React.MouseEvent<SVGElement, MouseEvent>} event The event source of the callback.
180
+ * @param {FunnelItemIdentifier} funnelItemIdentifier The funnel item identifier.
181
+ */
182
+ onItemClick: _propTypes.default.func,
183
+ /**
184
+ * The series to display in the funnel chart.
185
+ * An array of [[FunnelSeriesType]] objects.
186
+ */
187
+ series: _propTypes.default.arrayOf(_propTypes.default.object).isRequired,
188
+ /**
189
+ * If `true`, animations are skipped.
190
+ * If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting.
191
+ */
192
+ skipAnimation: _propTypes.default.bool,
193
+ /**
194
+ * The props used for each component slot.
195
+ * @default {}
196
+ */
197
+ slotProps: _propTypes.default.object,
198
+ /**
199
+ * Overridable component slots.
200
+ * @default {}
201
+ */
202
+ slots: _propTypes.default.object,
203
+ sx: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object, _propTypes.default.bool])), _propTypes.default.func, _propTypes.default.object]),
204
+ theme: _propTypes.default.oneOf(['dark', 'light']),
205
+ title: _propTypes.default.string,
206
+ /**
207
+ * The width of the chart in px. If not defined, it takes the width of the parent element.
208
+ */
209
+ width: _propTypes.default.number,
210
+ /**
211
+ * The list of zoom data related to each axis.
212
+ */
213
+ zoomData: _propTypes.default.arrayOf(_propTypes.default.shape({
214
+ axisId: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]).isRequired,
215
+ end: _propTypes.default.number.isRequired,
216
+ start: _propTypes.default.number.isRequired
217
+ }))
218
+ } : void 0;
@@ -0,0 +1,16 @@
1
+ import * as React from 'react';
2
+ import { FunnelItemIdentifier } from "./funnel.types.js";
3
+ import { FunnelPlotSlotExtension } from "./funnelPlotSlots.types.js";
4
+ export interface FunnelPlotProps extends FunnelPlotSlotExtension {
5
+ /**
6
+ * Callback fired when a funnel item is clicked.
7
+ * @param {React.MouseEvent<SVGElement, MouseEvent>} event The event source of the callback.
8
+ * @param {FunnelItemIdentifier} funnelItemIdentifier The funnel item identifier.
9
+ */
10
+ onItemClick?: (event: React.MouseEvent<SVGElement, MouseEvent>, funnelItemIdentifier: FunnelItemIdentifier) => void;
11
+ }
12
+ declare function FunnelPlot(props: FunnelPlotProps): React.JSX.Element;
13
+ declare namespace FunnelPlot {
14
+ var propTypes: any;
15
+ }
16
+ export { FunnelPlot };
@@ -0,0 +1,191 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+ var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.FunnelPlot = FunnelPlot;
9
+ var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
10
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
11
+ var _react = _interopRequireWildcard(require("react"));
12
+ var React = _react;
13
+ var _propTypes = _interopRequireDefault(require("prop-types"));
14
+ var _d3Shape = require("@mui/x-charts-vendor/d3-shape");
15
+ var _internals = require("@mui/x-charts/internals");
16
+ var _hooks = require("@mui/x-charts/hooks");
17
+ var _styles = require("@mui/material/styles");
18
+ var _FunnelSection = require("./FunnelSection");
19
+ var _labelUtils = require("./labelUtils");
20
+ var _funnelStepCurve = require("./funnelStepCurve");
21
+ var _useFunnelSeries = require("../hooks/useFunnelSeries");
22
+ var _jsxRuntime = require("react/jsx-runtime");
23
+ const _excluded = ["onItemClick"];
24
+ _internals.cartesianSeriesTypes.addType('funnel');
25
+ const getFunnelCurve = (curve, isHorizontal) => {
26
+ if (curve === 'step') {
27
+ return isHorizontal ? _funnelStepCurve.funnelHorizontalStepCurve : _funnelStepCurve.funnelVerticalStepCurve;
28
+ }
29
+ if (curve === 'bump') {
30
+ return isHorizontal ? (0, _internals.getCurveFactory)('bumpX') : (0, _internals.getCurveFactory)('bumpY');
31
+ }
32
+ return (0, _internals.getCurveFactory)(curve ?? 'linear');
33
+ };
34
+ const useAggregatedData = () => {
35
+ const seriesData = (0, _useFunnelSeries.useFunnelSeriesContext)();
36
+ const {
37
+ xAxis,
38
+ xAxisIds
39
+ } = (0, _hooks.useXAxes)();
40
+ const {
41
+ yAxis,
42
+ yAxisIds
43
+ } = (0, _hooks.useYAxes)();
44
+ const allData = React.useMemo(() => {
45
+ if (seriesData === undefined) {
46
+ return [];
47
+ }
48
+ const {
49
+ series,
50
+ seriesOrder
51
+ } = seriesData;
52
+ const defaultXAxisId = xAxisIds[0];
53
+ const defaultYAxisId = yAxisIds[0];
54
+ const isHorizontal = Object.values(series).some(s => s.layout === 'horizontal');
55
+ const result = seriesOrder.map(seriesId => {
56
+ const currentSeries = series[seriesId];
57
+ const xAxisId = currentSeries.xAxisId ?? defaultXAxisId;
58
+ const yAxisId = currentSeries.yAxisId ?? defaultYAxisId;
59
+ const valueFormatter = currentSeries.valueFormatter;
60
+ const baseScaleConfig = isHorizontal ? xAxis[xAxisId] : yAxis[yAxisId];
61
+ const isXAxisBand = xAxis[xAxisId].scaleType === 'band';
62
+ const isYAxisBand = yAxis[yAxisId].scaleType === 'band';
63
+ const bandWidth = (isXAxisBand || isYAxisBand) && baseScaleConfig.scale?.bandwidth() || 0;
64
+ const xScale = xAxis[xAxisId].scale;
65
+ const yScale = yAxis[yAxisId].scale;
66
+ const curve = getFunnelCurve(currentSeries.curve, isHorizontal);
67
+ const xPosition = (value, bandIndex, stackOffset, useBand) => {
68
+ if (isXAxisBand) {
69
+ const position = xScale(bandIndex);
70
+ return useBand ? position + bandWidth : position;
71
+ }
72
+ return xScale(isHorizontal ? value + (stackOffset || 0) : value);
73
+ };
74
+ const yPosition = (value, bandIndex, stackOffset, useBand) => {
75
+ if (isYAxisBand) {
76
+ const position = yScale(bandIndex);
77
+ return useBand ? position + bandWidth : position;
78
+ }
79
+ return yScale(isHorizontal ? value : value + (stackOffset || 0));
80
+ };
81
+ return currentSeries.dataPoints.map((values, dataIndex) => {
82
+ const color = currentSeries.data[dataIndex].color;
83
+ const id = `${seriesId}-${dataIndex}`;
84
+ const sectionLabel = typeof currentSeries.sectionLabel === 'function' ? currentSeries.sectionLabel({
85
+ dataIndex,
86
+ seriesId,
87
+ value: currentSeries.data[dataIndex].value
88
+ }) : currentSeries.sectionLabel;
89
+ const line = (0, _d3Shape.line)().x(d => xPosition(d.x, baseScaleConfig.data?.[dataIndex], d.stackOffset, d.useBandWidth)).y(d => yPosition(d.y, baseScaleConfig.data?.[dataIndex], d.stackOffset, d.useBandWidth)).curve(curve);
90
+ return {
91
+ d: line(values),
92
+ color,
93
+ id,
94
+ seriesId,
95
+ dataIndex,
96
+ label: sectionLabel !== false && (0, _extends2.default)({}, (0, _labelUtils.positionLabel)((0, _extends2.default)({}, sectionLabel, {
97
+ xPosition,
98
+ yPosition,
99
+ isHorizontal,
100
+ values,
101
+ dataIndex,
102
+ baseScaleData: baseScaleConfig.data ?? []
103
+ })), (0, _labelUtils.alignLabel)(sectionLabel ?? {}), {
104
+ value: valueFormatter ? valueFormatter(currentSeries.data[dataIndex], {
105
+ dataIndex
106
+ }) : currentSeries.data[dataIndex].value?.toLocaleString()
107
+ })
108
+ };
109
+ });
110
+ });
111
+ return result.flat();
112
+ }, [seriesData, xAxis, xAxisIds, yAxis, yAxisIds]);
113
+ return allData;
114
+ };
115
+ function FunnelPlot(props) {
116
+ const {
117
+ onItemClick
118
+ } = props,
119
+ other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
120
+ const theme = (0, _styles.useTheme)();
121
+ const data = useAggregatedData();
122
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(React.Fragment, {
123
+ children: [data.map(({
124
+ d,
125
+ color,
126
+ id,
127
+ seriesId,
128
+ dataIndex
129
+ }) => /*#__PURE__*/(0, _react.createElement)(_FunnelSection.FunnelSection, (0, _extends2.default)({}, other, {
130
+ d: d,
131
+ color: color,
132
+ key: id,
133
+ dataIndex: dataIndex,
134
+ seriesId: seriesId,
135
+ onClick: onItemClick && (event => {
136
+ onItemClick(event, {
137
+ type: 'funnel',
138
+ seriesId,
139
+ dataIndex
140
+ });
141
+ })
142
+ }))), data.map(({
143
+ id,
144
+ label
145
+ }) => {
146
+ if (!label) {
147
+ return null;
148
+ }
149
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)("text", {
150
+ x: label.x,
151
+ y: label.y,
152
+ textAnchor: label.textAnchor,
153
+ dominantBaseline: label.dominantBaseline,
154
+ stroke: "none",
155
+ pointerEvents: "none",
156
+ fontFamily: theme.typography.body2.fontFamily,
157
+ fontSize: theme.typography.body2.fontSize,
158
+ fontSizeAdjust: theme.typography.body2.fontSizeAdjust,
159
+ fontWeight: theme.typography.body2.fontWeight,
160
+ letterSpacing: theme.typography.body2.letterSpacing,
161
+ fontStretch: theme.typography.body2.fontStretch,
162
+ fontStyle: theme.typography.body2.fontStyle,
163
+ fontVariant: theme.typography.body2.fontVariant,
164
+ fill: (theme.vars || theme)?.palette?.text?.primary,
165
+ children: label.value
166
+ }, id);
167
+ })]
168
+ });
169
+ }
170
+ process.env.NODE_ENV !== "production" ? FunnelPlot.propTypes = {
171
+ // ----------------------------- Warning --------------------------------
172
+ // | These PropTypes are generated from the TypeScript type definitions |
173
+ // | To update them edit the TypeScript types and run "pnpm proptypes" |
174
+ // ----------------------------------------------------------------------
175
+ /**
176
+ * Callback fired when a funnel item is clicked.
177
+ * @param {React.MouseEvent<SVGElement, MouseEvent>} event The event source of the callback.
178
+ * @param {FunnelItemIdentifier} funnelItemIdentifier The funnel item identifier.
179
+ */
180
+ onItemClick: _propTypes.default.func,
181
+ /**
182
+ * The props used for each component slot.
183
+ * @default {}
184
+ */
185
+ slotProps: _propTypes.default.object,
186
+ /**
187
+ * Overridable component slots.
188
+ * @default {}
189
+ */
190
+ slots: _propTypes.default.object
191
+ } : void 0;
@@ -0,0 +1,15 @@
1
+ import * as React from 'react';
2
+ import { SeriesId } from '@mui/x-charts/internals';
3
+ import { FunnelSectionClasses } from "./funnelSectionClasses.js";
4
+ export interface FunnelSectionProps extends Omit<React.SVGProps<SVGPathElement>, 'ref' | 'id'> {
5
+ seriesId: SeriesId;
6
+ dataIndex: number;
7
+ color: string;
8
+ classes?: Partial<FunnelSectionClasses>;
9
+ }
10
+ export declare const FunnelSectionPath: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, React.SVGProps<SVGPathElement>, {}>;
11
+ /**
12
+ * @ignore - internal component.
13
+ */
14
+ declare const FunnelSection: React.ForwardRefExoticComponent<FunnelSectionProps & React.RefAttributes<{}>>;
15
+ export { FunnelSection };
@@ -0,0 +1,62 @@
1
+ "use strict";
2
+ 'use client';
3
+
4
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
5
+ var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
6
+ Object.defineProperty(exports, "__esModule", {
7
+ value: true
8
+ });
9
+ exports.FunnelSectionPath = exports.FunnelSection = void 0;
10
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
11
+ var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
12
+ var React = _interopRequireWildcard(require("react"));
13
+ var _styles = require("@mui/material/styles");
14
+ var _internals = require("@mui/x-charts/internals");
15
+ var _hooks = require("@mui/x-charts/hooks");
16
+ var _clsx = _interopRequireDefault(require("clsx"));
17
+ var _funnelSectionClasses = require("./funnelSectionClasses");
18
+ var _jsxRuntime = require("react/jsx-runtime");
19
+ const _excluded = ["seriesId", "dataIndex", "classes", "color", "onClick", "className"];
20
+ const FunnelSectionPath = exports.FunnelSectionPath = (0, _styles.styled)('path')(() => ({
21
+ transition: 'opacity 0.2s ease-in, fill 0.2s ease-in'
22
+ }));
23
+
24
+ /**
25
+ * @ignore - internal component.
26
+ */
27
+ const FunnelSection = exports.FunnelSection = (0, _internals.consumeSlots)('MuiFunnelSection', 'funnelSection', {
28
+ classesResolver: _funnelSectionClasses.useUtilityClasses
29
+ }, /*#__PURE__*/React.forwardRef(function FunnelSection(props, ref) {
30
+ const {
31
+ seriesId,
32
+ dataIndex,
33
+ classes,
34
+ color,
35
+ onClick,
36
+ className
37
+ } = props,
38
+ other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
39
+ const interactionProps = (0, _internals.useInteractionItemProps)({
40
+ type: 'funnel',
41
+ seriesId,
42
+ dataIndex
43
+ });
44
+ const {
45
+ isFaded,
46
+ isHighlighted
47
+ } = (0, _hooks.useItemHighlighted)({
48
+ seriesId,
49
+ dataIndex
50
+ });
51
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(FunnelSectionPath, (0, _extends2.default)({}, interactionProps, {
52
+ filter: isHighlighted ? 'brightness(120%)' : undefined,
53
+ opacity: isFaded ? 0.3 : 1,
54
+ fill: color,
55
+ stroke: "none",
56
+ cursor: onClick ? 'pointer' : 'unset',
57
+ onClick: onClick,
58
+ className: (0, _clsx.default)(classes?.root, className, isHighlighted && classes?.highlighted, isFaded && classes?.faded)
59
+ }, other, {
60
+ ref: ref
61
+ }));
62
+ }));
@@ -0,0 +1,24 @@
1
+ import { AxisConfig, ScaleName } from '@mui/x-charts/models';
2
+ import { MakeOptional } from '@mui/x-internals/types';
3
+ export type CategoryAxis = {
4
+ /**
5
+ * The categories to be displayed on the axis.
6
+ * The order of the categories is the order in which they are displayed.
7
+ */
8
+ categories?: string[];
9
+ /**
10
+ * The position of the axis.
11
+ * - 'left' - The axis is positioned on the left side of the chart.
12
+ * - 'right' - The axis is positioned on the right side of the chart.
13
+ * - 'top' - The axis is positioned on the top side of the chart.
14
+ * - 'bottom' - The axis is positioned on the bottom side of the chart.
15
+ * - 'none' - The axis is not displayed.
16
+ */
17
+ position?: 'left' | 'right' | 'top' | 'bottom' | 'none';
18
+ /**
19
+ * The size of the axis.
20
+ * - If the axis is horizontal, the size is the height of the axis.
21
+ * - If the axis is vertical, the size is the width of the axis.
22
+ */
23
+ size?: number;
24
+ } & MakeOptional<Pick<AxisConfig<ScaleName, any>, 'disableLine' | 'disableTicks' | 'scaleType' | 'tickLabelStyle' | 'tickSize' | 'id'>, 'id'>;
@@ -0,0 +1,124 @@
1
+ import { ChartsLabelMarkProps } from '@mui/x-charts/ChartsLabel';
2
+ import { CommonSeriesType, CartesianSeriesType, CommonDefaultizedProps, SeriesId } from '@mui/x-charts/internals';
3
+ import { CurveType, Position } from '@mui/x-charts/models';
4
+ import { DefaultizedProps, MakeRequired } from '@mui/x-internals/types';
5
+ export type FunnelItemId = string | number;
6
+ export type FunnelCurveType = Extract<CurveType, 'linear' | 'step'> | 'bump';
7
+ export type FunnelValueType = {
8
+ /**
9
+ * A unique identifier of the funnel section.
10
+ */
11
+ id?: FunnelItemId;
12
+ /**
13
+ * The value of the funnel section.
14
+ */
15
+ value: number;
16
+ /**
17
+ * The label to display on the tooltip, funnel section, or the legend. It can be a string or a function.
18
+ */
19
+ label?: string | ((location: 'tooltip' | 'legend' | 'section') => string);
20
+ /**
21
+ * The color of the funnel section
22
+ */
23
+ color?: string;
24
+ /**
25
+ * Defines the mark type for the funnel item.
26
+ * @default 'square'
27
+ */
28
+ labelMarkType?: ChartsLabelMarkProps['type'];
29
+ };
30
+ export interface FunnelSeriesType extends Omit<CommonSeriesType<FunnelValueType>, 'color'>, CartesianSeriesType {
31
+ type: 'funnel';
32
+ /**
33
+ * Data associated to the funnel section.
34
+ */
35
+ data: Readonly<FunnelValueType[]>;
36
+ /**
37
+ * The label to display on the tooltip or the legend. It can be a string or a function.
38
+ */
39
+ label?: string | ((location: 'tooltip' | 'legend') => string);
40
+ /**
41
+ * Layout of the funnel.
42
+ * @default 'vertical'
43
+ */
44
+ layout?: 'horizontal' | 'vertical';
45
+ /**
46
+ * The type of curve to use for the line. Read more about curves at
47
+ * [line interpolation](https://mui.com/x/react-charts/lines/#interpolation).
48
+ * @default 'linear'
49
+ */
50
+ curve?: FunnelCurveType;
51
+ /**
52
+ * The label configuration for the funnel plot.
53
+ * Allows to customize the position and margin of the label that is displayed on the funnel sections.
54
+ *
55
+ * If set to `false`, the label will not be displayed.
56
+ * @default { vertical: 'middle', horizontal: 'center' }
57
+ */
58
+ sectionLabel?: FunnelLabelOptions | ((item: FunnelItem) => FunnelLabelOptions | false) | false;
59
+ }
60
+ /**
61
+ * An object that allows to identify a funnel item.
62
+ * Used for item interaction
63
+ */
64
+ export type FunnelItemIdentifier = {
65
+ type: 'funnel';
66
+ /**
67
+ * The series id of the funnel.
68
+ */
69
+ seriesId: SeriesId;
70
+ /**
71
+ * The index of the data point in the series.
72
+ */
73
+ dataIndex: number;
74
+ };
75
+ export type FunnelItem = {
76
+ /**
77
+ * The series id of the funnel.
78
+ */
79
+ seriesId: SeriesId;
80
+ /**
81
+ * The index of the data point in the series.
82
+ */
83
+ dataIndex: number;
84
+ /**
85
+ * The value of the data point.
86
+ */
87
+ value: number;
88
+ };
89
+ export interface DefaultizedFunnelSeriesType extends DefaultizedProps<FunnelSeriesType, CommonDefaultizedProps | 'layout'> {
90
+ dataPoints: FunnelDataPoints[][];
91
+ data: Readonly<MakeRequired<FunnelValueType, 'id' | 'color'>[]>;
92
+ }
93
+ export type FunnelDataPoints = Record<'x' | 'y', number> & {
94
+ useBandWidth: boolean;
95
+ stackOffset: number;
96
+ };
97
+ export type FunnelLabelOptions = {
98
+ /**
99
+ * The position of the label.
100
+ * @default { vertical: 'middle', horizontal: 'center' }
101
+ */
102
+ position?: Position;
103
+ /**
104
+ * The text anchor of the label. Affects the horizontal alignment of the text.
105
+ *
106
+ * Default value depends on the position.
107
+ */
108
+ textAnchor?: 'start' | 'middle' | 'end';
109
+ /**
110
+ * The dominant baseline of the label. Affects the vertical alignment of the text.
111
+ *
112
+ * Default value depends on the position.
113
+ */
114
+ dominantBaseline?: 'auto' | 'baseline' | 'hanging' | 'middle' | 'central' | 'text-after-edge' | 'text-before-edge';
115
+ /**
116
+ * The offset of the label from the anchor point.
117
+ * If a single number is provided, the offset will be applied in both directions.
118
+ * @default 0
119
+ */
120
+ offset?: number | {
121
+ x?: number;
122
+ y?: number;
123
+ };
124
+ };
@@ -0,0 +1,20 @@
1
+ import * as React from 'react';
2
+ import type { FunnelSectionProps } from './FunnelSection';
3
+ export interface FunnelPlotSlots {
4
+ funnelSection?: React.ElementType<FunnelSectionProps>;
5
+ }
6
+ export interface FunnelPlotSlotProps {
7
+ funnelSection?: FunnelSectionProps;
8
+ }
9
+ export interface FunnelPlotSlotExtension {
10
+ /**
11
+ * Overridable component slots.
12
+ * @default {}
13
+ */
14
+ slots?: FunnelPlotSlots;
15
+ /**
16
+ * The props used for each component slot.
17
+ * @default {}
18
+ */
19
+ slotProps?: FunnelPlotSlotProps;
20
+ }