@mui/x-charts-premium 9.5.0 → 9.7.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 (314) hide show
  1. package/BarChartPremium/BarChartPremium.d.mts +4 -4
  2. package/BarChartPremium/BarChartPremium.d.ts +4 -4
  3. package/BarChartPremium/BarChartPremium.js +5 -3
  4. package/BarChartPremium/BarChartPremium.mjs +5 -3
  5. package/BarChartPremium/BarChartPremium.plugins.d.mts +2 -2
  6. package/BarChartPremium/BarChartPremium.plugins.d.ts +2 -2
  7. package/BarChartPremium/BarPlotPremium.d.mts +1 -1
  8. package/BarChartPremium/BarPlotPremium.d.ts +1 -1
  9. package/BarChartPremium/BarPlotPremium.js +1 -1
  10. package/BarChartPremium/BarPlotPremium.mjs +1 -1
  11. package/BarChartPremium/RangeBar/AnimatedRangeBarElement.d.mts +1 -1
  12. package/BarChartPremium/RangeBar/AnimatedRangeBarElement.d.ts +1 -1
  13. package/BarChartPremium/RangeBar/RangeBarPlot.d.mts +2 -2
  14. package/BarChartPremium/RangeBar/RangeBarPlot.d.ts +2 -2
  15. package/BarChartPremium/RangeBar/RangeBarPlot.js +2 -2
  16. package/BarChartPremium/RangeBar/RangeBarPlot.mjs +2 -2
  17. package/BarChartPremium/RangeBar/createGetRangeBarDimensions.d.mts +1 -1
  18. package/BarChartPremium/RangeBar/createGetRangeBarDimensions.d.ts +1 -1
  19. package/BarChartPremium/RangeBar/seriesConfig/descriptionGetter.d.mts +1 -1
  20. package/BarChartPremium/RangeBar/seriesConfig/descriptionGetter.d.ts +1 -1
  21. package/BarChartPremium/RangeBar/seriesConfig/extrema.d.mts +1 -1
  22. package/BarChartPremium/RangeBar/seriesConfig/extrema.d.ts +1 -1
  23. package/BarChartPremium/RangeBar/seriesConfig/getColor.d.mts +1 -1
  24. package/BarChartPremium/RangeBar/seriesConfig/getColor.d.ts +1 -1
  25. package/BarChartPremium/RangeBar/seriesConfig/getColor.js +2 -5
  26. package/BarChartPremium/RangeBar/seriesConfig/getColor.mjs +2 -5
  27. package/BarChartPremium/RangeBar/seriesConfig/getSeriesWithDefaultValues.d.mts +1 -1
  28. package/BarChartPremium/RangeBar/seriesConfig/getSeriesWithDefaultValues.d.ts +1 -1
  29. package/BarChartPremium/RangeBar/seriesConfig/index.d.mts +1 -1
  30. package/BarChartPremium/RangeBar/seriesConfig/index.d.ts +1 -1
  31. package/BarChartPremium/RangeBar/seriesConfig/keyboardFocusHandler.d.mts +1 -1
  32. package/BarChartPremium/RangeBar/seriesConfig/keyboardFocusHandler.d.ts +1 -1
  33. package/BarChartPremium/RangeBar/seriesConfig/legend.d.mts +1 -1
  34. package/BarChartPremium/RangeBar/seriesConfig/legend.d.ts +1 -1
  35. package/BarChartPremium/RangeBar/seriesConfig/seriesProcessor.d.mts +1 -1
  36. package/BarChartPremium/RangeBar/seriesConfig/seriesProcessor.d.ts +1 -1
  37. package/BarChartPremium/RangeBar/seriesConfig/tooltip.d.mts +1 -1
  38. package/BarChartPremium/RangeBar/seriesConfig/tooltip.d.ts +1 -1
  39. package/BarChartPremium/RangeBar/seriesConfig/tooltipPosition.d.mts +1 -1
  40. package/BarChartPremium/RangeBar/seriesConfig/tooltipPosition.d.ts +1 -1
  41. package/BarChartPremium/RangeBar/useRangeBarPlotData.d.mts +4 -4
  42. package/BarChartPremium/RangeBar/useRangeBarPlotData.d.ts +4 -4
  43. package/BarChartPremium/useBarChartPremiumProps.d.mts +5 -5
  44. package/BarChartPremium/useBarChartPremiumProps.d.ts +5 -5
  45. package/BarChartPremium/webgl/BarWebGLProgram.d.mts +1 -1
  46. package/BarChartPremium/webgl/BarWebGLProgram.d.ts +1 -1
  47. package/BarChartPremium/webgl/useBarWebGLPlotData.d.mts +3 -3
  48. package/BarChartPremium/webgl/useBarWebGLPlotData.d.ts +3 -3
  49. package/BarChartPremium/webgl/useWebGLBarLikePlotData.d.mts +3 -3
  50. package/BarChartPremium/webgl/useWebGLBarLikePlotData.d.ts +3 -3
  51. package/CHANGELOG.md +261 -0
  52. package/CandlestickChart/CandlestickChart.d.mts +12 -12
  53. package/CandlestickChart/CandlestickChart.d.ts +12 -12
  54. package/CandlestickChart/CandlestickChart.js +1 -1
  55. package/CandlestickChart/CandlestickChart.mjs +1 -1
  56. package/CandlestickChart/CandlestickChart.plugins.d.mts +2 -2
  57. package/CandlestickChart/CandlestickChart.plugins.d.ts +2 -2
  58. package/CandlestickChart/CandlestickWebGLProgram.d.mts +1 -1
  59. package/CandlestickChart/CandlestickWebGLProgram.d.ts +1 -1
  60. package/CandlestickChart/checkCandlestickScaleErrors.d.mts +2 -2
  61. package/CandlestickChart/checkCandlestickScaleErrors.d.ts +2 -2
  62. package/CandlestickChart/seriesConfig/OHLCTooltipContent.d.mts +1 -1
  63. package/CandlestickChart/seriesConfig/OHLCTooltipContent.d.ts +1 -1
  64. package/CandlestickChart/seriesConfig/descriptionGetter.d.mts +1 -1
  65. package/CandlestickChart/seriesConfig/descriptionGetter.d.ts +1 -1
  66. package/CandlestickChart/seriesConfig/extrema.d.mts +1 -1
  67. package/CandlestickChart/seriesConfig/extrema.d.ts +1 -1
  68. package/CandlestickChart/seriesConfig/getColor.d.mts +1 -1
  69. package/CandlestickChart/seriesConfig/getColor.d.ts +1 -1
  70. package/CandlestickChart/seriesConfig/getColor.js +2 -5
  71. package/CandlestickChart/seriesConfig/getColor.mjs +2 -5
  72. package/CandlestickChart/seriesConfig/getSeriesWithDefaultValues.d.mts +1 -1
  73. package/CandlestickChart/seriesConfig/getSeriesWithDefaultValues.d.ts +1 -1
  74. package/CandlestickChart/seriesConfig/index.d.mts +1 -1
  75. package/CandlestickChart/seriesConfig/index.d.ts +1 -1
  76. package/CandlestickChart/seriesConfig/legend.d.mts +1 -1
  77. package/CandlestickChart/seriesConfig/legend.d.ts +1 -1
  78. package/CandlestickChart/seriesConfig/seriesProcessor.d.mts +1 -1
  79. package/CandlestickChart/seriesConfig/seriesProcessor.d.ts +1 -1
  80. package/CandlestickChart/seriesConfig/tooltip.d.mts +1 -1
  81. package/CandlestickChart/seriesConfig/tooltip.d.ts +1 -1
  82. package/CandlestickChart/seriesConfig/tooltipPosition.d.mts +1 -1
  83. package/CandlestickChart/seriesConfig/tooltipPosition.d.ts +1 -1
  84. package/CandlestickChart/useCandlestickChartProps.d.mts +9 -9
  85. package/CandlestickChart/useCandlestickChartProps.d.ts +9 -9
  86. package/CandlestickChart/useCandlestickChartProps.mjs +0 -1
  87. package/CandlestickChart/useCandlestickPlotData.d.mts +3 -3
  88. package/CandlestickChart/useCandlestickPlotData.d.ts +3 -3
  89. package/ChartsContainerPremium/ChartsContainerPremium.d.mts +4 -4
  90. package/ChartsContainerPremium/ChartsContainerPremium.d.ts +4 -4
  91. package/ChartsContainerPremium/useChartsContainerPremiumProps.d.mts +2 -2
  92. package/ChartsContainerPremium/useChartsContainerPremiumProps.d.ts +2 -2
  93. package/ChartsDataProviderPremium/ChartsDataProviderPremium.d.mts +4 -4
  94. package/ChartsDataProviderPremium/ChartsDataProviderPremium.d.ts +4 -4
  95. package/ChartsDataProviderPremium/ChartsDataProviderPremium.js +7 -3
  96. package/ChartsDataProviderPremium/ChartsDataProviderPremium.mjs +8 -5
  97. package/ChartsDataProviderPremium/useChartsDataProviderPremiumProps.d.mts +1 -1
  98. package/ChartsDataProviderPremium/useChartsDataProviderPremiumProps.d.ts +1 -1
  99. package/ChartsGeoDataProviderPremium/ChartsGeoDataProviderPremium.d.mts +4 -4
  100. package/ChartsGeoDataProviderPremium/ChartsGeoDataProviderPremium.d.ts +4 -4
  101. package/ChartsGeoDataProviderPremium/ChartsGeoDataProviderPremium.js +11 -3
  102. package/ChartsGeoDataProviderPremium/ChartsGeoDataProviderPremium.mjs +11 -3
  103. package/ChartsGeoDataProviderPremium/ChartsGeoDataProviderPremium.plugins.d.mts +4 -4
  104. package/ChartsGeoDataProviderPremium/ChartsGeoDataProviderPremium.plugins.d.ts +4 -4
  105. package/ChartsGeoDataProviderPremium/useChartsGeoDataProviderPremiumProps.d.mts +2 -2
  106. package/ChartsGeoDataProviderPremium/useChartsGeoDataProviderPremiumProps.d.ts +2 -2
  107. package/ChartsRadialDataProviderPremium/ChartsRadialDataProviderPremium.d.mts +4 -4
  108. package/ChartsRadialDataProviderPremium/ChartsRadialDataProviderPremium.d.ts +4 -4
  109. package/ChartsRadialDataProviderPremium/ChartsRadialDataProviderPremium.js +11 -3
  110. package/ChartsRadialDataProviderPremium/ChartsRadialDataProviderPremium.mjs +11 -3
  111. package/ChartsRadialDataProviderPremium/ChartsRadialDataProviderPremium.plugins.d.mts +3 -3
  112. package/ChartsRadialDataProviderPremium/ChartsRadialDataProviderPremium.plugins.d.ts +3 -3
  113. package/ChartsRadialDataProviderPremium/useChartsRadialDataProviderPremiumProps.d.mts +1 -1
  114. package/ChartsRadialDataProviderPremium/useChartsRadialDataProviderPremiumProps.d.ts +1 -1
  115. package/ChartsRenderer/ChartsRenderer.js +1 -1
  116. package/ChartsRenderer/ChartsRenderer.mjs +1 -1
  117. package/ChartsRenderer/colors.d.mts +1 -1
  118. package/ChartsRenderer/colors.d.ts +1 -1
  119. package/ChartsRenderer/configuration.d.mts +1 -1
  120. package/ChartsRenderer/configuration.d.ts +1 -1
  121. package/ChartsZoomSlider/internals/previews/CandlestickPreviewPlot.d.mts +1 -1
  122. package/ChartsZoomSlider/internals/previews/CandlestickPreviewPlot.d.ts +1 -1
  123. package/ChartsZoomSlider/internals/previews/RangeBarPreviewPlot.d.mts +1 -1
  124. package/ChartsZoomSlider/internals/previews/RangeBarPreviewPlot.d.ts +1 -1
  125. package/HeatmapPremium/HeatmapPlotPremium.d.mts +1 -1
  126. package/HeatmapPremium/HeatmapPlotPremium.d.ts +1 -1
  127. package/HeatmapPremium/HeatmapPremium.d.mts +1 -1
  128. package/HeatmapPremium/HeatmapPremium.d.ts +1 -1
  129. package/HeatmapPremium/HeatmapPremium.js +5 -3
  130. package/HeatmapPremium/HeatmapPremium.mjs +5 -3
  131. package/HeatmapPremium/HeatmapPremium.plugins.d.mts +2 -2
  132. package/HeatmapPremium/HeatmapPremium.plugins.d.ts +2 -2
  133. package/HeatmapPremium/useHeatmapPremiumProps.d.mts +2 -2
  134. package/HeatmapPremium/useHeatmapPremiumProps.d.ts +2 -2
  135. package/HeatmapPremium/webgl/useHeatmapPlotData.d.mts +3 -3
  136. package/HeatmapPremium/webgl/useHeatmapPlotData.d.ts +3 -3
  137. package/Map/GeoDataPlot.js +1 -1
  138. package/Map/GeoDataPlot.mjs +1 -1
  139. package/Map/MapShape.d.mts +4 -1
  140. package/Map/MapShape.d.ts +4 -1
  141. package/Map/MapShape.js +10 -1
  142. package/Map/MapShape.mjs +9 -0
  143. package/Map/MapShapePlot.d.mts +5 -1
  144. package/Map/MapShapePlot.d.ts +5 -1
  145. package/Map/MapShapePlot.js +27 -3
  146. package/Map/MapShapePlot.mjs +28 -4
  147. package/Map/index.d.mts +3 -1
  148. package/Map/index.d.ts +3 -1
  149. package/Map/seriesConfig/descriptionGetter.d.mts +1 -1
  150. package/Map/seriesConfig/descriptionGetter.d.ts +1 -1
  151. package/Map/seriesConfig/getColor.js +4 -9
  152. package/Map/seriesConfig/getColor.mjs +4 -9
  153. package/Map/seriesConfig/index.d.mts +1 -1
  154. package/Map/seriesConfig/index.d.ts +1 -1
  155. package/Map/seriesConfig/index.js +2 -0
  156. package/Map/seriesConfig/index.mjs +2 -0
  157. package/Map/seriesConfig/keyboardFocusHandler.d.mts +1 -1
  158. package/Map/seriesConfig/keyboardFocusHandler.d.ts +1 -1
  159. package/Map/seriesConfig/legend.d.mts +1 -1
  160. package/Map/seriesConfig/legend.d.ts +1 -1
  161. package/Map/seriesConfig/seriesProcessor.d.mts +1 -1
  162. package/Map/seriesConfig/seriesProcessor.d.ts +1 -1
  163. package/Map/seriesConfig/tooltip.d.mts +1 -1
  164. package/Map/seriesConfig/tooltip.d.ts +1 -1
  165. package/Map/seriesConfig/tooltip.js +5 -1
  166. package/Map/seriesConfig/tooltip.mjs +5 -1
  167. package/Map/seriesConfig/tooltipPosition.d.mts +3 -0
  168. package/Map/seriesConfig/tooltipPosition.d.ts +3 -0
  169. package/Map/seriesConfig/tooltipPosition.js +64 -0
  170. package/Map/seriesConfig/tooltipPosition.mjs +58 -0
  171. package/RadialBarChart/RadialBarChart.d.mts +10 -10
  172. package/RadialBarChart/RadialBarChart.d.ts +10 -10
  173. package/RadialBarChart/RadialBarChart.js +1 -1
  174. package/RadialBarChart/RadialBarChart.mjs +1 -1
  175. package/RadialBarChart/RadialBarChart.plugins.d.mts +2 -2
  176. package/RadialBarChart/RadialBarChart.plugins.d.ts +2 -2
  177. package/RadialBarChart/RadialBarElement.d.mts +2 -2
  178. package/RadialBarChart/RadialBarElement.d.ts +2 -2
  179. package/RadialBarChart/RadialBarPlot.js +1 -1
  180. package/RadialBarChart/RadialBarPlot.mjs +1 -1
  181. package/RadialBarChart/seriesConfig/descriptionGetter.d.mts +1 -1
  182. package/RadialBarChart/seriesConfig/descriptionGetter.d.ts +1 -1
  183. package/RadialBarChart/seriesConfig/extremums.d.mts +1 -1
  184. package/RadialBarChart/seriesConfig/extremums.d.ts +1 -1
  185. package/RadialBarChart/seriesConfig/getColor.d.mts +1 -1
  186. package/RadialBarChart/seriesConfig/getColor.d.ts +1 -1
  187. package/RadialBarChart/seriesConfig/getItemAtPosition.d.mts +1 -1
  188. package/RadialBarChart/seriesConfig/getItemAtPosition.d.ts +1 -1
  189. package/RadialBarChart/seriesConfig/index.d.mts +1 -1
  190. package/RadialBarChart/seriesConfig/index.d.ts +1 -1
  191. package/RadialBarChart/seriesConfig/keyboardFocusHandler.d.mts +1 -1
  192. package/RadialBarChart/seriesConfig/keyboardFocusHandler.d.ts +1 -1
  193. package/RadialBarChart/seriesConfig/tooltip.d.mts +1 -1
  194. package/RadialBarChart/seriesConfig/tooltip.d.ts +1 -1
  195. package/RadialBarChart/useRadialBarChartProps.d.mts +6 -6
  196. package/RadialBarChart/useRadialBarChartProps.d.ts +6 -6
  197. package/RadialBarChart/useRadialBarPlotData.d.mts +1 -1
  198. package/RadialBarChart/useRadialBarPlotData.d.ts +1 -1
  199. package/RadialBarChart/useRadialBarPlotData.js +4 -1
  200. package/RadialBarChart/useRadialBarPlotData.mjs +3 -1
  201. package/RadialLineChart/RadialArea.d.mts +1 -1
  202. package/RadialLineChart/RadialArea.d.ts +1 -1
  203. package/RadialLineChart/RadialAreaPlot.d.mts +6 -2
  204. package/RadialLineChart/RadialAreaPlot.d.ts +6 -2
  205. package/RadialLineChart/RadialAreaPlot.js +10 -1
  206. package/RadialLineChart/RadialAreaPlot.mjs +11 -2
  207. package/RadialLineChart/RadialLine.d.mts +2 -2
  208. package/RadialLineChart/RadialLine.d.ts +2 -2
  209. package/RadialLineChart/RadialLineChart.d.mts +10 -10
  210. package/RadialLineChart/RadialLineChart.d.ts +10 -10
  211. package/RadialLineChart/RadialLineChart.js +1 -1
  212. package/RadialLineChart/RadialLineChart.mjs +1 -1
  213. package/RadialLineChart/RadialLineChart.plugins.d.mts +2 -2
  214. package/RadialLineChart/RadialLineChart.plugins.d.ts +2 -2
  215. package/RadialLineChart/RadialLineHighlightElement.d.mts +4 -1
  216. package/RadialLineChart/RadialLineHighlightElement.d.ts +4 -1
  217. package/RadialLineChart/RadialLineHighlightElement.js +10 -1
  218. package/RadialLineChart/RadialLineHighlightElement.mjs +9 -0
  219. package/RadialLineChart/RadialLineHighlightPlot.d.mts +5 -2
  220. package/RadialLineChart/RadialLineHighlightPlot.d.ts +5 -2
  221. package/RadialLineChart/RadialLineHighlightPlot.js +18 -1
  222. package/RadialLineChart/RadialLineHighlightPlot.mjs +17 -0
  223. package/RadialLineChart/RadialLinePlot.d.mts +6 -2
  224. package/RadialLineChart/RadialLinePlot.d.ts +6 -2
  225. package/RadialLineChart/RadialLinePlot.js +10 -1
  226. package/RadialLineChart/RadialLinePlot.mjs +11 -2
  227. package/RadialLineChart/RadialMarkPlot.d.mts +6 -2
  228. package/RadialLineChart/RadialMarkPlot.d.ts +6 -2
  229. package/RadialLineChart/RadialMarkPlot.js +10 -1
  230. package/RadialLineChart/RadialMarkPlot.mjs +11 -2
  231. package/RadialLineChart/seriesConfig/descriptionGetter.d.mts +1 -1
  232. package/RadialLineChart/seriesConfig/descriptionGetter.d.ts +1 -1
  233. package/RadialLineChart/seriesConfig/extremums.d.mts +1 -1
  234. package/RadialLineChart/seriesConfig/extremums.d.ts +1 -1
  235. package/RadialLineChart/seriesConfig/getColor.d.mts +1 -1
  236. package/RadialLineChart/seriesConfig/getColor.d.ts +1 -1
  237. package/RadialLineChart/seriesConfig/getItemAtPosition.d.mts +1 -1
  238. package/RadialLineChart/seriesConfig/getItemAtPosition.d.ts +1 -1
  239. package/RadialLineChart/seriesConfig/getItemAtPosition.mjs +1 -2
  240. package/RadialLineChart/seriesConfig/index.d.mts +1 -1
  241. package/RadialLineChart/seriesConfig/index.d.ts +1 -1
  242. package/RadialLineChart/seriesConfig/keyboardFocusHandler.d.mts +1 -1
  243. package/RadialLineChart/seriesConfig/keyboardFocusHandler.d.ts +1 -1
  244. package/RadialLineChart/seriesConfig/legend.d.mts +1 -1
  245. package/RadialLineChart/seriesConfig/legend.d.ts +1 -1
  246. package/RadialLineChart/seriesConfig/seriesProcessor.d.mts +1 -1
  247. package/RadialLineChart/seriesConfig/seriesProcessor.d.ts +1 -1
  248. package/RadialLineChart/seriesConfig/tooltip.d.mts +1 -1
  249. package/RadialLineChart/seriesConfig/tooltip.d.ts +1 -1
  250. package/RadialLineChart/useRadialLineChartProps.d.mts +7 -7
  251. package/RadialLineChart/useRadialLineChartProps.d.ts +7 -7
  252. package/RadialLineChart/useRadialLinePlotData.d.mts +1 -1
  253. package/RadialLineChart/useRadialLinePlotData.d.ts +1 -1
  254. package/ScatterChartPremium/ScatterChartPremium.d.mts +6 -6
  255. package/ScatterChartPremium/ScatterChartPremium.d.ts +6 -6
  256. package/ScatterChartPremium/ScatterChartPremium.js +5 -3
  257. package/ScatterChartPremium/ScatterChartPremium.mjs +5 -3
  258. package/ScatterChartPremium/ScatterChartPremium.plugins.d.mts +1 -1
  259. package/ScatterChartPremium/ScatterChartPremium.plugins.d.ts +1 -1
  260. package/ScatterChartPremium/ScatterPlotPremium.d.mts +19 -3
  261. package/ScatterChartPremium/ScatterPlotPremium.d.ts +19 -3
  262. package/ScatterChartPremium/ScatterPlotPremium.js +34 -1
  263. package/ScatterChartPremium/ScatterPlotPremium.mjs +36 -2
  264. package/ScatterChartPremium/index.d.mts +1 -1
  265. package/ScatterChartPremium/index.d.ts +1 -1
  266. package/ScatterChartPremium/webgl/ScatterWebGLProgram.d.mts +1 -1
  267. package/ScatterChartPremium/webgl/ScatterWebGLProgram.d.ts +1 -1
  268. package/context/ChartPremiumApi.d.mts +4 -1
  269. package/context/ChartPremiumApi.d.ts +4 -1
  270. package/context/useChartPremiumApiContext.d.mts +1 -1
  271. package/context/useChartPremiumApiContext.d.ts +1 -1
  272. package/hooks/animation/useAnimateRangeBar.d.mts +1 -1
  273. package/hooks/animation/useAnimateRangeBar.d.ts +1 -1
  274. package/hooks/useChartPremiumApiRef.d.mts +4 -4
  275. package/hooks/useChartPremiumApiRef.d.ts +4 -4
  276. package/hooks/useGeoData.d.mts +1 -1
  277. package/hooks/useGeoData.d.ts +1 -1
  278. package/hooks/useGeoData.js +1 -1
  279. package/hooks/useGeoData.mjs +2 -3
  280. package/hooks/useGeoFeatureIndexesByName.mjs +0 -1
  281. package/hooks/useGeoPath.d.mts +1 -1
  282. package/hooks/useGeoPath.d.ts +1 -1
  283. package/hooks/useGeoPath.mjs +0 -1
  284. package/hooks/useMapShapeSeries.d.mts +2 -2
  285. package/hooks/useMapShapeSeries.d.ts +2 -2
  286. package/hooks/useOHLCSeries.d.mts +2 -2
  287. package/hooks/useOHLCSeries.d.ts +2 -2
  288. package/hooks/useRadialLineSeries.d.mts +2 -2
  289. package/hooks/useRadialLineSeries.d.ts +2 -2
  290. package/hooks/useRangeBarSeries.d.mts +2 -2
  291. package/hooks/useRangeBarSeries.d.ts +2 -2
  292. package/index.js +1 -1
  293. package/index.mjs +1 -1
  294. package/internals/plugins/allPlugins.d.mts +2 -2
  295. package/internals/plugins/allPlugins.d.ts +2 -2
  296. package/internals/plugins/useGeoProjection/useGeoProjection.d.mts +2 -2
  297. package/internals/plugins/useGeoProjection/useGeoProjection.d.ts +2 -2
  298. package/internals/plugins/useGeoProjection/useGeoProjection.js +32 -3
  299. package/internals/plugins/useGeoProjection/useGeoProjection.mjs +32 -3
  300. package/internals/plugins/useGeoProjection/useGeoProjection.selectors.d.mts +12 -34
  301. package/internals/plugins/useGeoProjection/useGeoProjection.selectors.d.ts +12 -34
  302. package/internals/plugins/useGeoProjection/useGeoProjection.selectors.js +8 -129
  303. package/internals/plugins/useGeoProjection/useGeoProjection.selectors.mjs +8 -128
  304. package/internals/plugins/useGeoProjection/useGeoProjection.types.d.mts +2 -55
  305. package/internals/plugins/useGeoProjection/useGeoProjection.types.d.ts +2 -55
  306. package/models/seriesType/ohlc.d.mts +2 -2
  307. package/models/seriesType/ohlc.d.ts +2 -2
  308. package/models/seriesType/rangeBar.d.mts +2 -2
  309. package/models/seriesType/rangeBar.d.ts +2 -2
  310. package/moduleAugmentation/rangeBarOnClick.d.mts +1 -1
  311. package/moduleAugmentation/rangeBarOnClick.d.ts +1 -1
  312. package/package.json +9 -6
  313. package/plugins/selectors/useChartCandlestickPosition.selectors.d.mts +1 -1
  314. package/plugins/selectors/useChartCandlestickPosition.selectors.d.ts +1 -1
@@ -9,12 +9,36 @@ Object.defineProperty(exports, "__esModule", {
9
9
  exports.useGeoProjection = void 0;
10
10
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
11
11
  var React = _interopRequireWildcard(require("react"));
12
+ var _d3Geo = require("@mui/x-charts-vendor/d3-geo");
13
+ const PROJECTION_FACTORIES = {
14
+ // Azimuthal projections (https://d3js.org/d3-geo/azimuthal)
15
+ azimuthalEqualArea: _d3Geo.geoAzimuthalEqualArea,
16
+ azimuthalEquidistant: _d3Geo.geoAzimuthalEquidistant,
17
+ gnomonic: _d3Geo.geoGnomonic,
18
+ orthographic: _d3Geo.geoOrthographic,
19
+ stereographic: _d3Geo.geoStereographic,
20
+ // Conic projections (https://d3js.org/d3-geo/conic)
21
+ conicConformal: _d3Geo.geoConicConformal,
22
+ conicEqualArea: _d3Geo.geoConicEqualArea,
23
+ conicEquidistant: _d3Geo.geoConicEquidistant,
24
+ albers: _d3Geo.geoAlbers,
25
+ albersUsa: _d3Geo.geoAlbersUsa,
26
+ // Special composition for the USA with an edge case for Alaska and Hawaii.
27
+
28
+ // Cylindrical projections (https://d3js.org/d3-geo/cylindrical)
29
+ equirectangular: _d3Geo.geoEquirectangular,
30
+ mercator: _d3Geo.geoMercator,
31
+ transverseMercator: _d3Geo.geoTransverseMercator,
32
+ equalEarth: _d3Geo.geoEqualEarth,
33
+ naturalEarth1: _d3Geo.geoNaturalEarth1
34
+ };
12
35
  const useGeoProjection = ({
13
36
  params,
14
37
  store
15
38
  }) => {
16
39
  const {
17
40
  geoData,
41
+ geoFeatureKey,
18
42
  projection,
19
43
  translate,
20
44
  rotate,
@@ -28,17 +52,20 @@ const useGeoProjection = ({
28
52
  }
29
53
  store.set('geoProjection', {
30
54
  geoData: geoData ?? null,
55
+ geoFeatureKey: geoFeatureKey ?? 'name',
31
56
  projection: projection ?? null,
32
57
  translate: translate ?? null,
33
58
  rotate: rotate ?? null,
34
- scale: scale ?? null
59
+ scale: scale ?? null,
60
+ factories: PROJECTION_FACTORIES
35
61
  });
36
- }, [geoData, projection, translate, rotate, scale, store]);
62
+ }, [geoData, geoFeatureKey, projection, translate, rotate, scale, store]);
37
63
  return {};
38
64
  };
39
65
  exports.useGeoProjection = useGeoProjection;
40
66
  useGeoProjection.params = {
41
67
  geoData: true,
68
+ geoFeatureKey: true,
42
69
  projection: true,
43
70
  translate: true,
44
71
  rotate: true,
@@ -50,9 +77,11 @@ useGeoProjection.getDefaultizedParams = ({
50
77
  useGeoProjection.getInitialState = params => ({
51
78
  geoProjection: {
52
79
  geoData: params.geoData ?? null,
80
+ geoFeatureKey: params.geoFeatureKey ?? 'name',
53
81
  projection: params.projection ?? null,
54
82
  translate: params.translate ?? null,
55
83
  rotate: params.rotate ?? null,
56
- scale: params.scale ?? null
84
+ scale: params.scale ?? null,
85
+ factories: PROJECTION_FACTORIES
57
86
  }
58
87
  });
@@ -2,12 +2,36 @@
2
2
 
3
3
  import _extends from "@babel/runtime/helpers/esm/extends";
4
4
  import * as React from 'react';
5
+ import { geoAlbers, geoAlbersUsa, geoAzimuthalEqualArea, geoAzimuthalEquidistant, geoConicConformal, geoConicEqualArea, geoConicEquidistant, geoEqualEarth, geoEquirectangular, geoGnomonic, geoMercator, geoNaturalEarth1, geoOrthographic, geoStereographic, geoTransverseMercator } from '@mui/x-charts-vendor/d3-geo';
6
+ const PROJECTION_FACTORIES = {
7
+ // Azimuthal projections (https://d3js.org/d3-geo/azimuthal)
8
+ azimuthalEqualArea: geoAzimuthalEqualArea,
9
+ azimuthalEquidistant: geoAzimuthalEquidistant,
10
+ gnomonic: geoGnomonic,
11
+ orthographic: geoOrthographic,
12
+ stereographic: geoStereographic,
13
+ // Conic projections (https://d3js.org/d3-geo/conic)
14
+ conicConformal: geoConicConformal,
15
+ conicEqualArea: geoConicEqualArea,
16
+ conicEquidistant: geoConicEquidistant,
17
+ albers: geoAlbers,
18
+ albersUsa: geoAlbersUsa,
19
+ // Special composition for the USA with an edge case for Alaska and Hawaii.
20
+
21
+ // Cylindrical projections (https://d3js.org/d3-geo/cylindrical)
22
+ equirectangular: geoEquirectangular,
23
+ mercator: geoMercator,
24
+ transverseMercator: geoTransverseMercator,
25
+ equalEarth: geoEqualEarth,
26
+ naturalEarth1: geoNaturalEarth1
27
+ };
5
28
  export const useGeoProjection = ({
6
29
  params,
7
30
  store
8
31
  }) => {
9
32
  const {
10
33
  geoData,
34
+ geoFeatureKey,
11
35
  projection,
12
36
  translate,
13
37
  rotate,
@@ -21,16 +45,19 @@ export const useGeoProjection = ({
21
45
  }
22
46
  store.set('geoProjection', {
23
47
  geoData: geoData ?? null,
48
+ geoFeatureKey: geoFeatureKey ?? 'name',
24
49
  projection: projection ?? null,
25
50
  translate: translate ?? null,
26
51
  rotate: rotate ?? null,
27
- scale: scale ?? null
52
+ scale: scale ?? null,
53
+ factories: PROJECTION_FACTORIES
28
54
  });
29
- }, [geoData, projection, translate, rotate, scale, store]);
55
+ }, [geoData, geoFeatureKey, projection, translate, rotate, scale, store]);
30
56
  return {};
31
57
  };
32
58
  useGeoProjection.params = {
33
59
  geoData: true,
60
+ geoFeatureKey: true,
34
61
  projection: true,
35
62
  translate: true,
36
63
  rotate: true,
@@ -42,9 +69,11 @@ useGeoProjection.getDefaultizedParams = ({
42
69
  useGeoProjection.getInitialState = params => ({
43
70
  geoProjection: {
44
71
  geoData: params.geoData ?? null,
72
+ geoFeatureKey: params.geoFeatureKey ?? 'name',
45
73
  projection: params.projection ?? null,
46
74
  translate: params.translate ?? null,
47
75
  rotate: params.rotate ?? null,
48
- scale: params.scale ?? null
76
+ scale: params.scale ?? null,
77
+ factories: PROJECTION_FACTORIES
49
78
  }
50
79
  });
@@ -1,39 +1,17 @@
1
- import { type ChartState } from '@mui/x-charts/internals';
2
- import { type ExtendedFeatureCollection, type GeoProjection, type GeoPath } from '@mui/x-charts-vendor/d3-geo';
3
- import type { GeoProjectionInput, UseGeoProjectionSignature, UseGeoProjectionState } from "./useGeoProjection.types.mjs";
4
- export declare const selectorChartGeoProjectionState: (state: ChartState<[], [UseGeoProjectionSignature]>) => UseGeoProjectionState["geoProjection"] | undefined;
5
- export declare const selectorChartRawGeoData: (state: ChartState<[], [UseGeoProjectionSignature]>) => ExtendedFeatureCollection | null;
6
- export declare const selectorChartRawProjection: (args_0: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeriesConfig/useChartSeriesConfig.types").UseChartSeriesConfigState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types").UseChartExperimentalFeaturesState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.types").UseChartAnimationState & import("@mui/x-charts/internals").UseChartInteractionListenerState & Partial<UseGeoProjectionState> & {
1
+ export declare const selectorChartGeoFeatureIndexesByName: (args_0: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeriesConfig/useChartSeriesConfig.types").UseChartSeriesConfigState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types").UseChartExperimentalFeaturesState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.types").UseChartAnimationState & import("@mui/x-charts/internals").UseChartInteractionListenerState & Partial<import("@mui/x-charts/internals/plugins/featurePlugins/useGeoProjection/useGeoProjection.types").UseGeoProjectionState> & {
7
2
  cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
8
- }) => GeoProjectionInput | null;
9
- export declare const selectorChartRawScale: (args_0: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeriesConfig/useChartSeriesConfig.types").UseChartSeriesConfigState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types").UseChartExperimentalFeaturesState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.types").UseChartAnimationState & import("@mui/x-charts/internals").UseChartInteractionListenerState & Partial<UseGeoProjectionState> & {
3
+ }) => ReadonlyMap<string, number[]>;
4
+ export declare const selectorChartGeoProjectionState: (state: import("@mui/x-charts/internals").ChartState<[], [import("@mui/x-charts/internals/plugins/featurePlugins/useGeoProjection/useGeoProjection.types").UseGeoProjectionSignature]>) => import("@mui/x-charts/internals/plugins/featurePlugins/useGeoProjection/useGeoProjection.types").UseGeoProjectionState["geoProjection"] | undefined;
5
+ export declare const selectorChartGeoData: (state: import("@mui/x-charts/internals").ChartState<[], [import("@mui/x-charts/internals/plugins/featurePlugins/useGeoProjection/useGeoProjection.types").UseGeoProjectionSignature]>) => import("@mui/x-charts-vendor/d3-geo").ExtendedFeatureCollection | null;
6
+ export declare const selectorChartRawProjection: (args_0: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeriesConfig/useChartSeriesConfig.types").UseChartSeriesConfigState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types").UseChartExperimentalFeaturesState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.types").UseChartAnimationState & import("@mui/x-charts/internals").UseChartInteractionListenerState & Partial<import("@mui/x-charts/internals/plugins/featurePlugins/useGeoProjection/useGeoProjection.types").UseGeoProjectionState> & {
10
7
  cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
11
- }) => number | null;
12
- /**
13
- * Map a feature's `properties.name` to its index in `geoData.features`,
14
- * for fast lookup by name when joining series rows to features.
15
- *
16
- * Features without a string `properties.name` are skipped; on duplicates,
17
- * the first occurrence wins.
18
- */
19
- export declare const selectorChartGeoFeatureIndexesByName: (args_0: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeriesConfig/useChartSeriesConfig.types").UseChartSeriesConfigState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types").UseChartExperimentalFeaturesState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.types").UseChartAnimationState & import("@mui/x-charts/internals").UseChartInteractionListenerState & Partial<UseGeoProjectionState> & {
8
+ }) => import("@mui/x-charts/internals/plugins/featurePlugins/useGeoProjection/useGeoProjection.types").GeoProjectionInput | null;
9
+ export declare const selectorChartRawScale: (args_0: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeriesConfig/useChartSeriesConfig.types").UseChartSeriesConfigState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types").UseChartExperimentalFeaturesState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.types").UseChartAnimationState & import("@mui/x-charts/internals").UseChartInteractionListenerState & Partial<import("@mui/x-charts/internals/plugins/featurePlugins/useGeoProjection/useGeoProjection.types").UseGeoProjectionState> & {
20
10
  cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
21
- }) => ReadonlyMap<string, number[]>;
22
- /**
23
- * Resolves the raw `projection` input into a ready-to-use `GeoProjection` instance
24
- * fitted to the chart's drawing area.
25
- *
26
- * - String inputs (e.g. `'mercator'`) are mapped to the matching d3-geo factory.
27
- * - `GeoProjection` instances are used as-is, then fitted.
28
- * - Returns `null` when no projection is registered or the name is unknown.
29
- */
30
- export declare const selectorChartProjection: (args_0: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeriesConfig/useChartSeriesConfig.types").UseChartSeriesConfigState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types").UseChartExperimentalFeaturesState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.types").UseChartAnimationState & import("@mui/x-charts/internals").UseChartInteractionListenerState & Partial<UseGeoProjectionState> & {
11
+ }) => number | null;
12
+ export declare const selectorChartProjection: (args_0: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeriesConfig/useChartSeriesConfig.types").UseChartSeriesConfigState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types").UseChartExperimentalFeaturesState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.types").UseChartAnimationState & import("@mui/x-charts/internals").UseChartInteractionListenerState & Partial<import("@mui/x-charts/internals/plugins/featurePlugins/useGeoProjection/useGeoProjection.types").UseGeoProjectionState> & {
31
13
  cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
32
- }) => GeoProjection | null;
33
- /**
34
- * Resolves the raw `projection` input into a ready-to-use `GeoPath` instance
35
- * fitted to the chart's drawing area.
36
- */
37
- export declare const selectorChartGeoPath: (args_0: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeriesConfig/useChartSeriesConfig.types").UseChartSeriesConfigState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types").UseChartExperimentalFeaturesState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.types").UseChartAnimationState & import("@mui/x-charts/internals").UseChartInteractionListenerState & Partial<UseGeoProjectionState> & {
14
+ }) => import("@mui/x-charts-vendor/d3-geo").GeoProjection | null;
15
+ export declare const selectorChartGeoPath: (args_0: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeriesConfig/useChartSeriesConfig.types").UseChartSeriesConfigState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types").UseChartExperimentalFeaturesState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.types").UseChartAnimationState & import("@mui/x-charts/internals").UseChartInteractionListenerState & Partial<import("@mui/x-charts/internals/plugins/featurePlugins/useGeoProjection/useGeoProjection.types").UseGeoProjectionState> & {
38
16
  cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
39
- }) => GeoPath<any, import("@mui/x-charts-vendor/d3-geo").GeoPermissibleObjects> | null;
17
+ }) => import("@mui/x-charts-vendor/d3-geo").GeoPath<any, import("@mui/x-charts-vendor/d3-geo").GeoPermissibleObjects> | null;
@@ -1,39 +1,17 @@
1
- import { type ChartState } from '@mui/x-charts/internals';
2
- import { type ExtendedFeatureCollection, type GeoProjection, type GeoPath } from '@mui/x-charts-vendor/d3-geo';
3
- import type { GeoProjectionInput, UseGeoProjectionSignature, UseGeoProjectionState } from "./useGeoProjection.types.js";
4
- export declare const selectorChartGeoProjectionState: (state: ChartState<[], [UseGeoProjectionSignature]>) => UseGeoProjectionState["geoProjection"] | undefined;
5
- export declare const selectorChartRawGeoData: (state: ChartState<[], [UseGeoProjectionSignature]>) => ExtendedFeatureCollection | null;
6
- export declare const selectorChartRawProjection: (args_0: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeriesConfig/useChartSeriesConfig.types").UseChartSeriesConfigState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types").UseChartExperimentalFeaturesState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.types").UseChartAnimationState & import("@mui/x-charts/internals").UseChartInteractionListenerState & Partial<UseGeoProjectionState> & {
1
+ export declare const selectorChartGeoFeatureIndexesByName: (args_0: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeriesConfig/useChartSeriesConfig.types").UseChartSeriesConfigState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types").UseChartExperimentalFeaturesState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.types").UseChartAnimationState & import("@mui/x-charts/internals").UseChartInteractionListenerState & Partial<import("@mui/x-charts/internals/plugins/featurePlugins/useGeoProjection/useGeoProjection.types").UseGeoProjectionState> & {
7
2
  cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
8
- }) => GeoProjectionInput | null;
9
- export declare const selectorChartRawScale: (args_0: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeriesConfig/useChartSeriesConfig.types").UseChartSeriesConfigState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types").UseChartExperimentalFeaturesState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.types").UseChartAnimationState & import("@mui/x-charts/internals").UseChartInteractionListenerState & Partial<UseGeoProjectionState> & {
3
+ }) => ReadonlyMap<string, number[]>;
4
+ export declare const selectorChartGeoProjectionState: (state: import("@mui/x-charts/internals").ChartState<[], [import("@mui/x-charts/internals/plugins/featurePlugins/useGeoProjection/useGeoProjection.types").UseGeoProjectionSignature]>) => import("@mui/x-charts/internals/plugins/featurePlugins/useGeoProjection/useGeoProjection.types").UseGeoProjectionState["geoProjection"] | undefined;
5
+ export declare const selectorChartGeoData: (state: import("@mui/x-charts/internals").ChartState<[], [import("@mui/x-charts/internals/plugins/featurePlugins/useGeoProjection/useGeoProjection.types").UseGeoProjectionSignature]>) => import("@mui/x-charts-vendor/d3-geo").ExtendedFeatureCollection | null;
6
+ export declare const selectorChartRawProjection: (args_0: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeriesConfig/useChartSeriesConfig.types").UseChartSeriesConfigState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types").UseChartExperimentalFeaturesState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.types").UseChartAnimationState & import("@mui/x-charts/internals").UseChartInteractionListenerState & Partial<import("@mui/x-charts/internals/plugins/featurePlugins/useGeoProjection/useGeoProjection.types").UseGeoProjectionState> & {
10
7
  cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
11
- }) => number | null;
12
- /**
13
- * Map a feature's `properties.name` to its index in `geoData.features`,
14
- * for fast lookup by name when joining series rows to features.
15
- *
16
- * Features without a string `properties.name` are skipped; on duplicates,
17
- * the first occurrence wins.
18
- */
19
- export declare const selectorChartGeoFeatureIndexesByName: (args_0: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeriesConfig/useChartSeriesConfig.types").UseChartSeriesConfigState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types").UseChartExperimentalFeaturesState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.types").UseChartAnimationState & import("@mui/x-charts/internals").UseChartInteractionListenerState & Partial<UseGeoProjectionState> & {
8
+ }) => import("@mui/x-charts/internals/plugins/featurePlugins/useGeoProjection/useGeoProjection.types").GeoProjectionInput | null;
9
+ export declare const selectorChartRawScale: (args_0: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeriesConfig/useChartSeriesConfig.types").UseChartSeriesConfigState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types").UseChartExperimentalFeaturesState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.types").UseChartAnimationState & import("@mui/x-charts/internals").UseChartInteractionListenerState & Partial<import("@mui/x-charts/internals/plugins/featurePlugins/useGeoProjection/useGeoProjection.types").UseGeoProjectionState> & {
20
10
  cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
21
- }) => ReadonlyMap<string, number[]>;
22
- /**
23
- * Resolves the raw `projection` input into a ready-to-use `GeoProjection` instance
24
- * fitted to the chart's drawing area.
25
- *
26
- * - String inputs (e.g. `'mercator'`) are mapped to the matching d3-geo factory.
27
- * - `GeoProjection` instances are used as-is, then fitted.
28
- * - Returns `null` when no projection is registered or the name is unknown.
29
- */
30
- export declare const selectorChartProjection: (args_0: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeriesConfig/useChartSeriesConfig.types").UseChartSeriesConfigState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types").UseChartExperimentalFeaturesState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.types").UseChartAnimationState & import("@mui/x-charts/internals").UseChartInteractionListenerState & Partial<UseGeoProjectionState> & {
11
+ }) => number | null;
12
+ export declare const selectorChartProjection: (args_0: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeriesConfig/useChartSeriesConfig.types").UseChartSeriesConfigState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types").UseChartExperimentalFeaturesState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.types").UseChartAnimationState & import("@mui/x-charts/internals").UseChartInteractionListenerState & Partial<import("@mui/x-charts/internals/plugins/featurePlugins/useGeoProjection/useGeoProjection.types").UseGeoProjectionState> & {
31
13
  cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
32
- }) => GeoProjection | null;
33
- /**
34
- * Resolves the raw `projection` input into a ready-to-use `GeoPath` instance
35
- * fitted to the chart's drawing area.
36
- */
37
- export declare const selectorChartGeoPath: (args_0: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeriesConfig/useChartSeriesConfig.types").UseChartSeriesConfigState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types").UseChartExperimentalFeaturesState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.types").UseChartAnimationState & import("@mui/x-charts/internals").UseChartInteractionListenerState & Partial<UseGeoProjectionState> & {
14
+ }) => import("@mui/x-charts-vendor/d3-geo").GeoProjection | null;
15
+ export declare const selectorChartGeoPath: (args_0: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeriesConfig/useChartSeriesConfig.types").UseChartSeriesConfigState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types").UseChartExperimentalFeaturesState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.types").UseChartAnimationState & import("@mui/x-charts/internals").UseChartInteractionListenerState & Partial<import("@mui/x-charts/internals/plugins/featurePlugins/useGeoProjection/useGeoProjection.types").UseGeoProjectionState> & {
38
16
  cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
39
- }) => GeoPath<any, import("@mui/x-charts-vendor/d3-geo").GeoPermissibleObjects> | null;
17
+ }) => import("@mui/x-charts-vendor/d3-geo").GeoPath<any, import("@mui/x-charts-vendor/d3-geo").GeoPermissibleObjects> | null;
@@ -3,133 +3,12 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.selectorChartRawScale = exports.selectorChartRawProjection = exports.selectorChartRawGeoData = exports.selectorChartProjection = exports.selectorChartGeoProjectionState = exports.selectorChartGeoPath = exports.selectorChartGeoFeatureIndexesByName = void 0;
7
- var _store = require("@mui/x-internals/store");
6
+ exports.selectorChartRawScale = exports.selectorChartRawProjection = exports.selectorChartProjection = exports.selectorChartGeoProjectionState = exports.selectorChartGeoPath = exports.selectorChartGeoFeatureIndexesByName = exports.selectorChartGeoData = void 0;
8
7
  var _internals = require("@mui/x-charts/internals");
9
- var _d3Geo = require("@mui/x-charts-vendor/d3-geo");
10
- const PROJECTION_FACTORIES = {
11
- // Azimuthal projections (https://d3js.org/d3-geo/azimuthal)
12
- azimuthalEqualArea: _d3Geo.geoAzimuthalEqualArea,
13
- azimuthalEquidistant: _d3Geo.geoAzimuthalEquidistant,
14
- gnomonic: _d3Geo.geoGnomonic,
15
- orthographic: _d3Geo.geoOrthographic,
16
- stereographic: _d3Geo.geoStereographic,
17
- // Conic projections (https://d3js.org/d3-geo/conic)
18
- conicConformal: _d3Geo.geoConicConformal,
19
- conicEqualArea: _d3Geo.geoConicEqualArea,
20
- conicEquidistant: _d3Geo.geoConicEquidistant,
21
- albers: _d3Geo.geoAlbers,
22
- albersUsa: _d3Geo.geoAlbersUsa,
23
- // Special composition for the USA with an edge case for Alaska and Hawaii.
24
-
25
- // Cylindrical projections (https://d3js.org/d3-geo/cylindrical)
26
- equirectangular: _d3Geo.geoEquirectangular,
27
- mercator: _d3Geo.geoMercator,
28
- transverseMercator: _d3Geo.geoTransverseMercator,
29
- equalEarth: _d3Geo.geoEqualEarth,
30
- naturalEarth1: _d3Geo.geoNaturalEarth1
31
- };
32
- const isConicProjection = projection => {
33
- return 'parallels' in projection && typeof projection.parallels === 'function';
34
- };
35
- const selectorChartGeoProjectionState = state => state.geoProjection;
36
- exports.selectorChartGeoProjectionState = selectorChartGeoProjectionState;
37
- const selectorChartRawGeoData = exports.selectorChartRawGeoData = (0, _store.createSelector)(selectorChartGeoProjectionState, geoProjection => geoProjection?.geoData ?? null);
38
- const selectorChartRawProjection = exports.selectorChartRawProjection = (0, _store.createSelector)(selectorChartGeoProjectionState, geoProjection => geoProjection?.projection ?? null);
39
- const selectorChartRawScale = exports.selectorChartRawScale = (0, _store.createSelector)(selectorChartGeoProjectionState, geoProjection => geoProjection?.scale ?? null);
40
- const selectorChartRotate = (0, _store.createSelectorMemoized)(selectorChartGeoProjectionState, geoProjection => geoProjection?.rotate ?? null);
41
- const selectorChartTranslate = (0, _store.createSelectorMemoized)(selectorChartGeoProjectionState, geoProjection => geoProjection?.translate ?? null);
42
- const selectorChartParallels = (0, _store.createSelectorMemoized)(selectorChartGeoProjectionState, selectorChartRotate, (geoProjection, rotate) => geoProjection?.parallels ?? (rotate ? [rotate[1] - 15, rotate[1] + 15] : [30, 30]));
43
- /**
44
- * Map a feature's `properties.name` to its index in `geoData.features`,
45
- * for fast lookup by name when joining series rows to features.
46
- *
47
- * Features without a string `properties.name` are skipped; on duplicates,
48
- * the first occurrence wins.
49
- */
50
- const selectorChartGeoFeatureIndexesByName = exports.selectorChartGeoFeatureIndexesByName = (0, _store.createSelectorMemoized)(selectorChartRawGeoData, geoData => {
51
- const map = new Map();
52
- if (!geoData) {
53
- return map;
54
- }
55
- geoData.features.forEach((feature, index) => {
56
- const name = feature.properties?.name;
57
- if (typeof name !== 'string') {
58
- return;
59
- }
60
- if (map.has(name)) {
61
- map.get(name).push(index);
62
- return;
63
- }
64
- map.set(name, [index]);
65
- });
66
- return map;
67
- });
68
-
69
- /**
70
- * Resolves the raw `projection` input into a ready-to-use `GeoProjection` instance
71
- * fitted to the chart's drawing area.
72
- *
73
- * - String inputs (e.g. `'mercator'`) are mapped to the matching d3-geo factory.
74
- * - `GeoProjection` instances are used as-is, then fitted.
75
- * - Returns `null` when no projection is registered or the name is unknown.
76
- */
77
- const selectorChartProjection = exports.selectorChartProjection = (0, _store.createSelectorMemoized)(selectorChartRawProjection, selectorChartRawGeoData, selectorChartParallels, selectorChartRotate, selectorChartTranslate, selectorChartRawScale, _internals.selectorChartDrawingArea, (projectionInput, geoData, parallels, rotate, translate, scale, drawingArea) => {
78
- if (!projectionInput) {
79
- return null;
80
- }
81
- let projection;
82
- if (typeof projectionInput === 'string') {
83
- const factory = PROJECTION_FACTORIES[projectionInput];
84
- if (!factory) {
85
- if (process.env.NODE_ENV !== 'production') {
86
- console.error(`MUI X Charts: Unknown projection name '${projectionInput}'. ` + `Expected one of: ${Object.keys(PROJECTION_FACTORIES).join(', ')}.`);
87
- }
88
- return null;
89
- }
90
- projection = factory();
91
- if (isConicProjection(projection)) {
92
- projection.parallels(parallels);
93
- }
94
- } else {
95
- projection = projectionInput;
96
- }
97
- if (geoData) {
98
- if (isConicProjection(projection)) {
99
- if (rotate) {
100
- projection.rotate?.(rotate);
101
- }
102
- if (!scale) {
103
- const [[x0, y0], [x1, y1]] = (0, _d3Geo.geoPath)(projection).bounds(geoData);
104
- const currentScale = projection.scale();
105
- const fitScale = Math.min(currentScale * (drawingArea.width / (x1 - x0)), currentScale * (drawingArea.height / (y1 - y0)));
106
- projection.scale(fitScale);
107
- } else {
108
- projection.scale(scale);
109
- }
110
- return projection;
111
- }
112
- if (rotate) {
113
- projection.rotate?.(rotate);
114
- }
115
- if (scale) {
116
- projection.scale(scale);
117
- projection.clipExtent?.([[drawingArea.left, drawingArea.top], [drawingArea.left + drawingArea.width, drawingArea.top + drawingArea.height]]);
118
- } else {
119
- projection.fitExtent?.([[drawingArea.left, drawingArea.top], [drawingArea.left + drawingArea.width, drawingArea.top + drawingArea.height]], geoData);
120
- }
121
- projection.translate(translate ?? [drawingArea.left + drawingArea.width / 2, drawingArea.top + drawingArea.height / 2]);
122
- }
123
- return projection;
124
- });
125
-
126
- /**
127
- * Resolves the raw `projection` input into a ready-to-use `GeoPath` instance
128
- * fitted to the chart's drawing area.
129
- */
130
- const selectorChartGeoPath = exports.selectorChartGeoPath = (0, _store.createSelectorMemoized)(selectorChartProjection, projection => {
131
- if (!projection) {
132
- return null;
133
- }
134
- return (0, _d3Geo.geoPath)(projection);
135
- });
8
+ const selectorChartGeoFeatureIndexesByName = exports.selectorChartGeoFeatureIndexesByName = _internals.useGeoProjectionSelectors.selectorChartGeoFeatureIndexesByName;
9
+ const selectorChartGeoProjectionState = exports.selectorChartGeoProjectionState = _internals.useGeoProjectionSelectors.selectorChartGeoProjectionState;
10
+ const selectorChartGeoData = exports.selectorChartGeoData = _internals.useGeoProjectionSelectors.selectorChartGeoData;
11
+ const selectorChartRawProjection = exports.selectorChartRawProjection = _internals.useGeoProjectionSelectors.selectorChartRawProjection;
12
+ const selectorChartRawScale = exports.selectorChartRawScale = _internals.useGeoProjectionSelectors.selectorChartRawScale;
13
+ const selectorChartProjection = exports.selectorChartProjection = _internals.useGeoProjectionSelectors.selectorChartProjection;
14
+ const selectorChartGeoPath = exports.selectorChartGeoPath = _internals.useGeoProjectionSelectors.selectorChartGeoPath;
@@ -1,128 +1,8 @@
1
- import { createSelector, createSelectorMemoized } from '@mui/x-internals/store';
2
- import { selectorChartDrawingArea } from '@mui/x-charts/internals';
3
- import { geoAlbers, geoAlbersUsa, geoAzimuthalEqualArea, geoAzimuthalEquidistant, geoConicConformal, geoConicEqualArea, geoConicEquidistant, geoEqualEarth, geoEquirectangular, geoGnomonic, geoMercator, geoNaturalEarth1, geoOrthographic, geoStereographic, geoTransverseMercator, geoPath } from '@mui/x-charts-vendor/d3-geo';
4
- const PROJECTION_FACTORIES = {
5
- // Azimuthal projections (https://d3js.org/d3-geo/azimuthal)
6
- azimuthalEqualArea: geoAzimuthalEqualArea,
7
- azimuthalEquidistant: geoAzimuthalEquidistant,
8
- gnomonic: geoGnomonic,
9
- orthographic: geoOrthographic,
10
- stereographic: geoStereographic,
11
- // Conic projections (https://d3js.org/d3-geo/conic)
12
- conicConformal: geoConicConformal,
13
- conicEqualArea: geoConicEqualArea,
14
- conicEquidistant: geoConicEquidistant,
15
- albers: geoAlbers,
16
- albersUsa: geoAlbersUsa,
17
- // Special composition for the USA with an edge case for Alaska and Hawaii.
18
-
19
- // Cylindrical projections (https://d3js.org/d3-geo/cylindrical)
20
- equirectangular: geoEquirectangular,
21
- mercator: geoMercator,
22
- transverseMercator: geoTransverseMercator,
23
- equalEarth: geoEqualEarth,
24
- naturalEarth1: geoNaturalEarth1
25
- };
26
- const isConicProjection = projection => {
27
- return 'parallels' in projection && typeof projection.parallels === 'function';
28
- };
29
- export const selectorChartGeoProjectionState = state => state.geoProjection;
30
- export const selectorChartRawGeoData = createSelector(selectorChartGeoProjectionState, geoProjection => geoProjection?.geoData ?? null);
31
- export const selectorChartRawProjection = createSelector(selectorChartGeoProjectionState, geoProjection => geoProjection?.projection ?? null);
32
- export const selectorChartRawScale = createSelector(selectorChartGeoProjectionState, geoProjection => geoProjection?.scale ?? null);
33
- const selectorChartRotate = createSelectorMemoized(selectorChartGeoProjectionState, geoProjection => geoProjection?.rotate ?? null);
34
- const selectorChartTranslate = createSelectorMemoized(selectorChartGeoProjectionState, geoProjection => geoProjection?.translate ?? null);
35
- const selectorChartParallels = createSelectorMemoized(selectorChartGeoProjectionState, selectorChartRotate, (geoProjection, rotate) => geoProjection?.parallels ?? (rotate ? [rotate[1] - 15, rotate[1] + 15] : [30, 30]));
36
- /**
37
- * Map a feature's `properties.name` to its index in `geoData.features`,
38
- * for fast lookup by name when joining series rows to features.
39
- *
40
- * Features without a string `properties.name` are skipped; on duplicates,
41
- * the first occurrence wins.
42
- */
43
- export const selectorChartGeoFeatureIndexesByName = createSelectorMemoized(selectorChartRawGeoData, geoData => {
44
- const map = new Map();
45
- if (!geoData) {
46
- return map;
47
- }
48
- geoData.features.forEach((feature, index) => {
49
- const name = feature.properties?.name;
50
- if (typeof name !== 'string') {
51
- return;
52
- }
53
- if (map.has(name)) {
54
- map.get(name).push(index);
55
- return;
56
- }
57
- map.set(name, [index]);
58
- });
59
- return map;
60
- });
61
-
62
- /**
63
- * Resolves the raw `projection` input into a ready-to-use `GeoProjection` instance
64
- * fitted to the chart's drawing area.
65
- *
66
- * - String inputs (e.g. `'mercator'`) are mapped to the matching d3-geo factory.
67
- * - `GeoProjection` instances are used as-is, then fitted.
68
- * - Returns `null` when no projection is registered or the name is unknown.
69
- */
70
- export const selectorChartProjection = createSelectorMemoized(selectorChartRawProjection, selectorChartRawGeoData, selectorChartParallels, selectorChartRotate, selectorChartTranslate, selectorChartRawScale, selectorChartDrawingArea, (projectionInput, geoData, parallels, rotate, translate, scale, drawingArea) => {
71
- if (!projectionInput) {
72
- return null;
73
- }
74
- let projection;
75
- if (typeof projectionInput === 'string') {
76
- const factory = PROJECTION_FACTORIES[projectionInput];
77
- if (!factory) {
78
- if (process.env.NODE_ENV !== 'production') {
79
- console.error(`MUI X Charts: Unknown projection name '${projectionInput}'. ` + `Expected one of: ${Object.keys(PROJECTION_FACTORIES).join(', ')}.`);
80
- }
81
- return null;
82
- }
83
- projection = factory();
84
- if (isConicProjection(projection)) {
85
- projection.parallels(parallels);
86
- }
87
- } else {
88
- projection = projectionInput;
89
- }
90
- if (geoData) {
91
- if (isConicProjection(projection)) {
92
- if (rotate) {
93
- projection.rotate?.(rotate);
94
- }
95
- if (!scale) {
96
- const [[x0, y0], [x1, y1]] = geoPath(projection).bounds(geoData);
97
- const currentScale = projection.scale();
98
- const fitScale = Math.min(currentScale * (drawingArea.width / (x1 - x0)), currentScale * (drawingArea.height / (y1 - y0)));
99
- projection.scale(fitScale);
100
- } else {
101
- projection.scale(scale);
102
- }
103
- return projection;
104
- }
105
- if (rotate) {
106
- projection.rotate?.(rotate);
107
- }
108
- if (scale) {
109
- projection.scale(scale);
110
- projection.clipExtent?.([[drawingArea.left, drawingArea.top], [drawingArea.left + drawingArea.width, drawingArea.top + drawingArea.height]]);
111
- } else {
112
- projection.fitExtent?.([[drawingArea.left, drawingArea.top], [drawingArea.left + drawingArea.width, drawingArea.top + drawingArea.height]], geoData);
113
- }
114
- projection.translate(translate ?? [drawingArea.left + drawingArea.width / 2, drawingArea.top + drawingArea.height / 2]);
115
- }
116
- return projection;
117
- });
118
-
119
- /**
120
- * Resolves the raw `projection` input into a ready-to-use `GeoPath` instance
121
- * fitted to the chart's drawing area.
122
- */
123
- export const selectorChartGeoPath = createSelectorMemoized(selectorChartProjection, projection => {
124
- if (!projection) {
125
- return null;
126
- }
127
- return geoPath(projection);
128
- });
1
+ import { useGeoProjectionSelectors } from '@mui/x-charts/internals';
2
+ export const selectorChartGeoFeatureIndexesByName = useGeoProjectionSelectors.selectorChartGeoFeatureIndexesByName;
3
+ export const selectorChartGeoProjectionState = useGeoProjectionSelectors.selectorChartGeoProjectionState;
4
+ export const selectorChartGeoData = useGeoProjectionSelectors.selectorChartGeoData;
5
+ export const selectorChartRawProjection = useGeoProjectionSelectors.selectorChartRawProjection;
6
+ export const selectorChartRawScale = useGeoProjectionSelectors.selectorChartRawScale;
7
+ export const selectorChartProjection = useGeoProjectionSelectors.selectorChartProjection;
8
+ export const selectorChartGeoPath = useGeoProjectionSelectors.selectorChartGeoPath;
@@ -1,55 +1,2 @@
1
- import { type ChartPluginSignature } from '@mui/x-charts/internals';
2
- import { type GeoProjection, type ExtendedFeatureCollection } from '@mui/x-charts-vendor/d3-geo';
3
- export type D3NamedProjection = 'azimuthalEqualArea' | 'azimuthalEquidistant' | 'gnomonic' | 'orthographic' | 'stereographic' | 'conicConformal' | 'conicEqualArea' | 'conicEquidistant' | 'albers' | 'albersUsa' | 'equirectangular' | 'mercator' | 'transverseMercator' | 'equalEarth' | 'naturalEarth1';
4
- /**
5
- * A d3-geo projection accepted by `useGeoProjection`.
6
- *
7
- * Either a built-in projection name (e.g. `'mercator'`, `'naturalEarth1'`)
8
- * or a `GeoProjection` instance returned by a d3-geo factory.
9
- */
10
- export type GeoProjectionInput = D3NamedProjection | GeoProjection;
11
- export interface UseGeoProjectionParameters {
12
- /**
13
- * The GeoJSON `FeatureCollection` whose features will be rendered on the map.
14
- */
15
- geoData?: ExtendedFeatureCollection;
16
- /**
17
- * The d3-geo projection used to map geographic coordinates to SVG coordinates.
18
- * Accepts a d3-geo projection name (e.g. `'mercator'`, `'naturalEarth1'`)
19
- * or a custom `GeoProjection` instance.
20
- */
21
- projection?: GeoProjectionInput;
22
- /**
23
- * The center of the projection, specified as a `[longitude, latitude]` pair in degrees.
24
- */
25
- translate?: [number, number];
26
- /**
27
- * The rotation of the projection, specified as a `[longitude, latitude]` pair in degrees.
28
- */
29
- rotate?: [number, number];
30
- /**
31
- * The scale of the projection.
32
- * Id not provided the scale will default to fit the entire geoData in the drawing area.
33
- */
34
- scale?: number;
35
- }
36
- export type UseGeoProjectionDefaultizedParameters = UseGeoProjectionParameters;
37
- export interface UseGeoProjectionState {
38
- geoProjection: {
39
- geoData: ExtendedFeatureCollection | null;
40
- projection: GeoProjectionInput | null;
41
- translate: [number, number] | null;
42
- rotate: [number, number] | null;
43
- scale: number | null;
44
- /**
45
- * The two standard parallels used by conic projections, if applicable.
46
- * Used for projection 'conicConformal', 'conicEqualArea', 'conicEquidistant'.
47
- */
48
- parallels?: [number, number] | null;
49
- };
50
- }
51
- export type UseGeoProjectionSignature = ChartPluginSignature<{
52
- params: UseGeoProjectionParameters;
53
- defaultizedParams: UseGeoProjectionDefaultizedParameters;
54
- state: UseGeoProjectionState;
55
- }>;
1
+ import type { useGeoProjectionTypes } from '@mui/x-charts/internals';
2
+ export type UseGeoProjectionSignature = useGeoProjectionTypes.UseGeoProjectionSignature;