@mui/x-charts 9.8.0 → 9.9.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 (300) hide show
  1. package/BarChart/AnimatedBarElement.d.mts +1 -1
  2. package/BarChart/AnimatedBarElement.d.ts +1 -1
  3. package/BarChart/BarClipPath.d.mts +1 -1
  4. package/BarChart/BarClipPath.d.ts +1 -1
  5. package/BarChart/BarElement.d.mts +1 -1
  6. package/BarChart/BarElement.d.ts +1 -1
  7. package/BarChart/BarLabel/BarLabelItem.d.mts +1 -1
  8. package/BarChart/BarLabel/BarLabelItem.d.ts +1 -1
  9. package/BarChart/BarLabel/BarLabelPlot.d.mts +2 -1
  10. package/BarChart/BarLabel/BarLabelPlot.d.ts +2 -1
  11. package/BarChart/BatchBarPlot/BarGroup.d.mts +1 -1
  12. package/BarChart/BatchBarPlot/BarGroup.d.ts +1 -1
  13. package/BarChart/BatchBarPlot/BatchBarPlot.d.mts +2 -1
  14. package/BarChart/BatchBarPlot/BatchBarPlot.d.ts +2 -1
  15. package/BarChart/FocusedBar.d.mts +1 -1
  16. package/BarChart/FocusedBar.d.ts +1 -1
  17. package/BarChart/IndividualBarPlot.d.mts +2 -1
  18. package/BarChart/IndividualBarPlot.d.ts +2 -1
  19. package/BarChart/seriesConfig/bar/tooltipPosition.d.mts +2 -3
  20. package/BarChart/seriesConfig/bar/tooltipPosition.d.ts +2 -3
  21. package/BarChart/seriesConfig/bar/tooltipPosition.js +19 -15
  22. package/BarChart/seriesConfig/bar/tooltipPosition.mjs +18 -14
  23. package/BarChart/seriesConfig/index.js +2 -2
  24. package/BarChart/seriesConfig/index.mjs +2 -2
  25. package/BarChart/useBarPlotData.d.mts +5 -1
  26. package/BarChart/useBarPlotData.d.ts +5 -1
  27. package/BarChart/useBarPlotData.js +102 -25
  28. package/BarChart/useBarPlotData.mjs +102 -26
  29. package/CHANGELOG.md +119 -0
  30. package/ChartsAxis/ChartsAxis.d.mts +2 -1
  31. package/ChartsAxis/ChartsAxis.d.ts +2 -1
  32. package/ChartsAxisHighlight/ChartsAxisHighlight.d.mts +2 -1
  33. package/ChartsAxisHighlight/ChartsAxisHighlight.d.ts +2 -1
  34. package/ChartsAxisHighlight/ChartsXAxisHighlight.d.mts +2 -1
  35. package/ChartsAxisHighlight/ChartsXAxisHighlight.d.ts +2 -1
  36. package/ChartsAxisHighlight/ChartsXAxisHighlight.js +22 -5
  37. package/ChartsAxisHighlight/ChartsXAxisHighlight.mjs +23 -6
  38. package/ChartsAxisHighlight/ChartsYAxisHighlight.d.mts +2 -1
  39. package/ChartsAxisHighlight/ChartsYAxisHighlight.d.ts +2 -1
  40. package/ChartsAxisHighlight/ChartsYAxisHighlight.js +22 -5
  41. package/ChartsAxisHighlight/ChartsYAxisHighlight.mjs +23 -6
  42. package/ChartsAxisHighlight/getSampledBandHighlight.d.mts +27 -0
  43. package/ChartsAxisHighlight/getSampledBandHighlight.d.ts +27 -0
  44. package/ChartsAxisHighlight/getSampledBandHighlight.js +35 -0
  45. package/ChartsAxisHighlight/getSampledBandHighlight.mjs +29 -0
  46. package/ChartsAxisHighlightValue/ChartsAxisHighlightValue.d.mts +1 -1
  47. package/ChartsAxisHighlightValue/ChartsAxisHighlightValue.d.ts +1 -1
  48. package/ChartsAxisHighlightValue/ChartsAxisHighlightValueItem.d.mts +2 -1
  49. package/ChartsAxisHighlightValue/ChartsAxisHighlightValueItem.d.ts +2 -1
  50. package/ChartsBrushOverlay/ChartsBrushOverlay.d.mts +2 -1
  51. package/ChartsBrushOverlay/ChartsBrushOverlay.d.ts +2 -1
  52. package/ChartsClipPath/ChartsClipPath.d.mts +1 -1
  53. package/ChartsClipPath/ChartsClipPath.d.ts +1 -1
  54. package/ChartsDataProvider/ChartsDataProvider.d.mts +1 -1
  55. package/ChartsDataProvider/ChartsDataProvider.d.ts +1 -1
  56. package/ChartsGrid/ChartsGrid.d.mts +1 -1
  57. package/ChartsGrid/ChartsGrid.d.ts +1 -1
  58. package/ChartsGrid/ChartsHorizontalGrid.d.mts +2 -1
  59. package/ChartsGrid/ChartsHorizontalGrid.d.ts +2 -1
  60. package/ChartsGrid/ChartsVerticalGrid.d.mts +2 -1
  61. package/ChartsGrid/ChartsVerticalGrid.d.ts +2 -1
  62. package/ChartsLocalizationProvider/ChartsLocalizationProvider.d.mts +1 -1
  63. package/ChartsLocalizationProvider/ChartsLocalizationProvider.d.ts +1 -1
  64. package/ChartsOverlay/ChartsLoadingOverlay.d.mts +1 -1
  65. package/ChartsOverlay/ChartsLoadingOverlay.d.ts +1 -1
  66. package/ChartsOverlay/ChartsNoDataOverlay.d.mts +1 -1
  67. package/ChartsOverlay/ChartsNoDataOverlay.d.ts +1 -1
  68. package/ChartsOverlay/ChartsOverlay.d.mts +1 -1
  69. package/ChartsOverlay/ChartsOverlay.d.ts +1 -1
  70. package/ChartsRadialAxisHighlight/ChartsRadialAxisHighlight.d.mts +2 -1
  71. package/ChartsRadialAxisHighlight/ChartsRadialAxisHighlight.d.ts +2 -1
  72. package/ChartsRadialAxisHighlight/ChartsRadiusAxisHighlight.d.mts +2 -1
  73. package/ChartsRadialAxisHighlight/ChartsRadiusAxisHighlight.d.ts +2 -1
  74. package/ChartsRadialAxisHighlight/ChartsRotationAxisHighlight.d.mts +2 -1
  75. package/ChartsRadialAxisHighlight/ChartsRotationAxisHighlight.d.ts +2 -1
  76. package/ChartsRadialDataProvider/ChartsRadialDataProvider.d.mts +1 -1
  77. package/ChartsRadialDataProvider/ChartsRadialDataProvider.d.ts +1 -1
  78. package/ChartsRadialGrid/ChartsRadialGrid.d.mts +1 -1
  79. package/ChartsRadialGrid/ChartsRadialGrid.d.ts +1 -1
  80. package/ChartsRadialGrid/ChartsRadiusGrid.d.mts +2 -1
  81. package/ChartsRadialGrid/ChartsRadiusGrid.d.ts +2 -1
  82. package/ChartsRadialGrid/ChartsRotationGrid.d.mts +2 -1
  83. package/ChartsRadialGrid/ChartsRotationGrid.d.ts +2 -1
  84. package/ChartsRadiusAxis/ChartsRadiusAxis.d.mts +1 -1
  85. package/ChartsRadiusAxis/ChartsRadiusAxis.d.ts +1 -1
  86. package/ChartsReferenceLine/ChartsReferenceLine.d.mts +1 -1
  87. package/ChartsReferenceLine/ChartsReferenceLine.d.ts +1 -1
  88. package/ChartsReferenceLine/ChartsXReferenceLine.d.mts +1 -1
  89. package/ChartsReferenceLine/ChartsXReferenceLine.d.ts +1 -1
  90. package/ChartsReferenceLine/ChartsYReferenceLine.d.mts +1 -1
  91. package/ChartsReferenceLine/ChartsYReferenceLine.d.ts +1 -1
  92. package/ChartsRotationAxis/ChartsRotationAxis.d.mts +1 -1
  93. package/ChartsRotationAxis/ChartsRotationAxis.d.ts +1 -1
  94. package/ChartsText/ChartsText.d.mts +1 -1
  95. package/ChartsText/ChartsText.d.ts +1 -1
  96. package/ChartsTooltip/ChartsAxisTooltipContent.d.mts +1 -1
  97. package/ChartsTooltip/ChartsAxisTooltipContent.d.ts +1 -1
  98. package/ChartsTooltip/ChartsItemTooltipContent.d.mts +2 -1
  99. package/ChartsTooltip/ChartsItemTooltipContent.d.ts +2 -1
  100. package/ChartsTooltip/ChartsTooltip.d.mts +1 -1
  101. package/ChartsTooltip/ChartsTooltip.d.ts +1 -1
  102. package/ChartsTooltip/ChartsTooltipContainer.d.mts +1 -1
  103. package/ChartsTooltip/ChartsTooltipContainer.d.ts +1 -1
  104. package/ChartsTooltip/ChartsTooltipContainer.js +1 -5
  105. package/ChartsTooltip/ChartsTooltipContainer.mjs +2 -6
  106. package/ChartsXAxis/ChartsGroupedXAxisTicks.d.mts +2 -1
  107. package/ChartsXAxis/ChartsGroupedXAxisTicks.d.ts +2 -1
  108. package/ChartsXAxis/ChartsSingleXAxisTicks.d.mts +2 -1
  109. package/ChartsXAxis/ChartsSingleXAxisTicks.d.ts +2 -1
  110. package/ChartsXAxis/ChartsXAxis.d.mts +1 -1
  111. package/ChartsXAxis/ChartsXAxis.d.ts +1 -1
  112. package/ChartsXAxis/ChartsXAxisImpl.d.mts +2 -1
  113. package/ChartsXAxis/ChartsXAxisImpl.d.ts +2 -1
  114. package/ChartsYAxis/ChartsGroupedYAxisTicks.d.mts +2 -1
  115. package/ChartsYAxis/ChartsGroupedYAxisTicks.d.ts +2 -1
  116. package/ChartsYAxis/ChartsSingleYAxisTicks.d.mts +2 -1
  117. package/ChartsYAxis/ChartsSingleYAxisTicks.d.ts +2 -1
  118. package/ChartsYAxis/ChartsYAxis.d.mts +1 -1
  119. package/ChartsYAxis/ChartsYAxis.d.ts +1 -1
  120. package/ChartsYAxis/ChartsYAxisImpl.d.mts +2 -1
  121. package/ChartsYAxis/ChartsYAxisImpl.d.ts +2 -1
  122. package/Gauge/GaugeProvider.d.mts +1 -1
  123. package/Gauge/GaugeProvider.d.ts +1 -1
  124. package/Gauge/GaugeReferenceArc.d.mts +1 -1
  125. package/Gauge/GaugeReferenceArc.d.ts +1 -1
  126. package/Gauge/GaugeValueArc.d.mts +1 -1
  127. package/Gauge/GaugeValueArc.d.ts +1 -1
  128. package/Gauge/GaugeValueText.d.mts +1 -1
  129. package/Gauge/GaugeValueText.d.ts +1 -1
  130. package/LineChart/AnimatedArea.d.mts +1 -1
  131. package/LineChart/AnimatedArea.d.ts +1 -1
  132. package/LineChart/AppearingMask.d.mts +1 -1
  133. package/LineChart/AppearingMask.d.ts +1 -1
  134. package/LineChart/AreaElement.d.mts +1 -1
  135. package/LineChart/AreaElement.d.ts +1 -1
  136. package/LineChart/AreaPlot.d.mts +1 -1
  137. package/LineChart/AreaPlot.d.ts +1 -1
  138. package/LineChart/CircleMarkElement.d.mts +1 -1
  139. package/LineChart/CircleMarkElement.d.ts +1 -1
  140. package/LineChart/FocusedLineMark.d.mts +1 -1
  141. package/LineChart/FocusedLineMark.d.ts +1 -1
  142. package/LineChart/LineElement.d.mts +1 -1
  143. package/LineChart/LineElement.d.ts +1 -1
  144. package/LineChart/LineHighlightElement.d.mts +1 -1
  145. package/LineChart/LineHighlightElement.d.ts +1 -1
  146. package/LineChart/LineHighlightPlot.d.mts +1 -1
  147. package/LineChart/LineHighlightPlot.d.ts +1 -1
  148. package/LineChart/LinePlot.d.mts +1 -1
  149. package/LineChart/LinePlot.d.ts +1 -1
  150. package/LineChart/LinePlot.js +3 -2
  151. package/LineChart/LinePlot.mjs +3 -2
  152. package/LineChart/MarkElement.d.mts +1 -1
  153. package/LineChart/MarkElement.d.ts +1 -1
  154. package/LineChart/MarkPlot.d.mts +1 -1
  155. package/LineChart/MarkPlot.d.ts +1 -1
  156. package/LineChart/seriesConfig/index.js +2 -2
  157. package/LineChart/seriesConfig/index.mjs +2 -2
  158. package/LineChart/seriesConfig/tooltipPosition.d.mts +2 -3
  159. package/LineChart/seriesConfig/tooltipPosition.d.ts +2 -3
  160. package/LineChart/seriesConfig/tooltipPosition.js +14 -14
  161. package/LineChart/seriesConfig/tooltipPosition.mjs +13 -13
  162. package/LineChart/useLinePlotData.d.mts +13 -1
  163. package/LineChart/useLinePlotData.d.ts +13 -1
  164. package/LineChart/useLinePlotData.js +90 -33
  165. package/LineChart/useLinePlotData.mjs +92 -34
  166. package/PieChart/FocusedPieArc.d.mts +1 -1
  167. package/PieChart/FocusedPieArc.d.ts +1 -1
  168. package/PieChart/PieArcLabelPlot.d.mts +1 -1
  169. package/PieChart/PieArcLabelPlot.d.ts +1 -1
  170. package/PieChart/PieArcPlot.d.mts +1 -1
  171. package/PieChart/PieArcPlot.d.ts +1 -1
  172. package/PieChart/PiePlot.d.mts +1 -1
  173. package/PieChart/PiePlot.d.ts +1 -1
  174. package/PieChart/seriesConfig/index.js +2 -2
  175. package/PieChart/seriesConfig/index.mjs +2 -2
  176. package/PieChart/seriesConfig/tooltipPosition.d.mts +2 -3
  177. package/PieChart/seriesConfig/tooltipPosition.d.ts +2 -3
  178. package/PieChart/seriesConfig/tooltipPosition.js +7 -11
  179. package/PieChart/seriesConfig/tooltipPosition.mjs +6 -10
  180. package/RadarChart/FocusedRadarMark.d.mts +1 -1
  181. package/RadarChart/FocusedRadarMark.d.ts +1 -1
  182. package/RadarChart/RadarAxis/RadarAxis.d.mts +1 -1
  183. package/RadarChart/RadarAxis/RadarAxis.d.ts +1 -1
  184. package/RadarChart/RadarAxisHighlight/RadarAxisHighlight.d.mts +1 -1
  185. package/RadarChart/RadarAxisHighlight/RadarAxisHighlight.d.ts +1 -1
  186. package/RadarChart/RadarDataProvider/RadarDataProvider.d.mts +2 -1
  187. package/RadarChart/RadarDataProvider/RadarDataProvider.d.ts +2 -1
  188. package/RadarChart/RadarGrid/CircularRadarGrid.d.mts +2 -1
  189. package/RadarChart/RadarGrid/CircularRadarGrid.d.ts +2 -1
  190. package/RadarChart/RadarGrid/CircularRadarStripes.d.mts +2 -1
  191. package/RadarChart/RadarGrid/CircularRadarStripes.d.ts +2 -1
  192. package/RadarChart/RadarGrid/RadarGrid.d.mts +2 -1
  193. package/RadarChart/RadarGrid/RadarGrid.d.ts +2 -1
  194. package/RadarChart/RadarGrid/SharpRadarGrid.d.mts +2 -1
  195. package/RadarChart/RadarGrid/SharpRadarGrid.d.ts +2 -1
  196. package/RadarChart/RadarGrid/SharpRadarStripes.d.mts +2 -1
  197. package/RadarChart/RadarGrid/SharpRadarStripes.d.ts +2 -1
  198. package/RadarChart/RadarMetricLabels/RadarMetricLabels.d.mts +2 -1
  199. package/RadarChart/RadarMetricLabels/RadarMetricLabels.d.ts +2 -1
  200. package/RadarChart/RadarSeriesPlot/RadarSeriesArea.d.mts +2 -1
  201. package/RadarChart/RadarSeriesPlot/RadarSeriesArea.d.ts +2 -1
  202. package/RadarChart/RadarSeriesPlot/RadarSeriesMarks.d.mts +2 -1
  203. package/RadarChart/RadarSeriesPlot/RadarSeriesMarks.d.ts +2 -1
  204. package/RadarChart/RadarSeriesPlot/RadarSeriesPlot.d.mts +1 -1
  205. package/RadarChart/RadarSeriesPlot/RadarSeriesPlot.d.ts +1 -1
  206. package/RadarChart/seriesConfig/index.js +2 -2
  207. package/RadarChart/seriesConfig/index.mjs +2 -2
  208. package/RadarChart/seriesConfig/tooltipPosition.d.mts +2 -3
  209. package/RadarChart/seriesConfig/tooltipPosition.d.ts +2 -3
  210. package/RadarChart/seriesConfig/tooltipPosition.js +9 -16
  211. package/RadarChart/seriesConfig/tooltipPosition.mjs +8 -15
  212. package/ScatterChart/BatchScatter.d.mts +2 -1
  213. package/ScatterChart/BatchScatter.d.ts +2 -1
  214. package/ScatterChart/FocusedScatterMark.d.mts +1 -1
  215. package/ScatterChart/FocusedScatterMark.d.ts +1 -1
  216. package/ScatterChart/HighlightedScatterMark.d.mts +1 -1
  217. package/ScatterChart/HighlightedScatterMark.d.ts +1 -1
  218. package/ScatterChart/Scatter.d.mts +1 -1
  219. package/ScatterChart/Scatter.d.ts +1 -1
  220. package/ScatterChart/ScatterMarker.d.mts +1 -1
  221. package/ScatterChart/ScatterMarker.d.ts +1 -1
  222. package/ScatterChart/ScatterPlot.d.mts +1 -1
  223. package/ScatterChart/ScatterPlot.d.ts +1 -1
  224. package/ScatterChart/async/ScatterAsync.d.mts +2 -1
  225. package/ScatterChart/async/ScatterAsync.d.ts +2 -1
  226. package/ScatterChart/async/ScatterAsyncBatch.d.mts +1 -1
  227. package/ScatterChart/async/ScatterAsyncBatch.d.ts +1 -1
  228. package/ScatterChart/seriesConfig/index.js +2 -2
  229. package/ScatterChart/seriesConfig/index.mjs +2 -2
  230. package/ScatterChart/seriesConfig/tooltipPosition.d.mts +2 -3
  231. package/ScatterChart/seriesConfig/tooltipPosition.d.ts +2 -3
  232. package/ScatterChart/seriesConfig/tooltipPosition.js +13 -13
  233. package/ScatterChart/seriesConfig/tooltipPosition.mjs +12 -12
  234. package/context/ChartsProvider/ChartsProvider.d.mts +1 -1
  235. package/context/ChartsProvider/ChartsProvider.d.ts +1 -1
  236. package/context/ChartsSlotsContext.d.mts +1 -1
  237. package/context/ChartsSlotsContext.d.ts +1 -1
  238. package/index.js +1 -1
  239. package/index.mjs +1 -1
  240. package/internals/components/ChartsAccessibilityProxy/ChartsAccessibilityProxy.d.mts +2 -1
  241. package/internals/components/ChartsAccessibilityProxy/ChartsAccessibilityProxy.d.ts +2 -1
  242. package/internals/components/ChartsAxesGradients/ChartsAxesGradients.d.mts +2 -1
  243. package/internals/components/ChartsAxesGradients/ChartsAxesGradients.d.ts +2 -1
  244. package/internals/components/ChartsAxesGradients/ChartsContinuousGradient.d.mts +1 -1
  245. package/internals/components/ChartsAxesGradients/ChartsContinuousGradient.d.ts +1 -1
  246. package/internals/components/ChartsAxesGradients/ChartsContinuousGradientObjectBound.d.mts +1 -1
  247. package/internals/components/ChartsAxesGradients/ChartsContinuousGradientObjectBound.d.ts +1 -1
  248. package/internals/components/ChartsAxesGradients/ChartsPiecewiseGradient.d.mts +2 -1
  249. package/internals/components/ChartsAxesGradients/ChartsPiecewiseGradient.d.ts +2 -1
  250. package/internals/createGetBarDimensions.d.mts +14 -1
  251. package/internals/createGetBarDimensions.d.ts +14 -1
  252. package/internals/createGetBarDimensions.js +45 -0
  253. package/internals/createGetBarDimensions.mjs +45 -0
  254. package/internals/geometry.js +1 -1
  255. package/internals/geometry.mjs +1 -1
  256. package/internals/index.d.mts +1 -2
  257. package/internals/index.d.ts +1 -2
  258. package/internals/index.js +12 -8
  259. package/internals/index.mjs +1 -2
  260. package/internals/plugins/corePlugins/useChartSeries/useChartSeries.selectors.d.mts +2 -2
  261. package/internals/plugins/corePlugins/useChartSeries/useChartSeries.selectors.d.ts +2 -2
  262. package/internals/plugins/corePlugins/useChartSeriesConfig/types/index.d.mts +1 -1
  263. package/internals/plugins/corePlugins/useChartSeriesConfig/types/index.d.ts +1 -1
  264. package/internals/plugins/corePlugins/useChartSeriesConfig/types/index.js +4 -4
  265. package/internals/plugins/corePlugins/useChartSeriesConfig/types/index.mjs +1 -1
  266. package/internals/plugins/corePlugins/useChartSeriesConfig/types/seriesConfig.types.d.mts +11 -6
  267. package/internals/plugins/corePlugins/useChartSeriesConfig/types/seriesConfig.types.d.ts +11 -6
  268. package/internals/plugins/corePlugins/useChartSeriesConfig/types/tooltipItemPositionSelector.types.d.mts +18 -0
  269. package/internals/plugins/corePlugins/useChartSeriesConfig/types/tooltipItemPositionSelector.types.d.ts +18 -0
  270. package/internals/plugins/featurePlugins/useChartCartesianAxis/index.d.mts +2 -0
  271. package/internals/plugins/featurePlugins/useChartCartesianAxis/index.d.ts +2 -0
  272. package/internals/plugins/featurePlugins/useChartCartesianAxis/index.js +12 -0
  273. package/internals/plugins/featurePlugins/useChartCartesianAxis/index.mjs +1 -0
  274. package/internals/plugins/featurePlugins/useChartCartesianAxis/sampling.selectors.d.mts +26 -0
  275. package/internals/plugins/featurePlugins/useChartCartesianAxis/sampling.selectors.d.ts +26 -0
  276. package/internals/plugins/featurePlugins/useChartCartesianAxis/sampling.selectors.js +89 -0
  277. package/internals/plugins/featurePlugins/useChartCartesianAxis/sampling.selectors.mjs +81 -0
  278. package/internals/plugins/featurePlugins/useChartCartesianAxis/sampling.types.d.mts +93 -0
  279. package/internals/plugins/featurePlugins/useChartCartesianAxis/sampling.types.d.ts +93 -0
  280. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.types.d.mts +5 -0
  281. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.types.d.ts +5 -0
  282. package/internals/plugins/featurePlugins/useChartTooltip/useChartTooltip.selectors.d.mts +3 -8
  283. package/internals/plugins/featurePlugins/useChartTooltip/useChartTooltip.selectors.d.ts +3 -8
  284. package/internals/plugins/featurePlugins/useChartTooltip/useChartTooltip.selectors.js +2 -53
  285. package/internals/plugins/featurePlugins/useChartTooltip/useChartTooltip.selectors.mjs +2 -53
  286. package/models/seriesType/config.d.mts +6 -2
  287. package/models/seriesType/config.d.ts +6 -2
  288. package/package.json +5 -5
  289. package/internals/plugins/corePlugins/useChartSeriesConfig/types/tooltipItemPositionGetter.types.d.mts +0 -45
  290. package/internals/plugins/corePlugins/useChartSeriesConfig/types/tooltipItemPositionGetter.types.d.ts +0 -45
  291. package/internals/plugins/featurePlugins/useGeoProjection/useGeoProjection.selectors.d.mts +0 -48
  292. package/internals/plugins/featurePlugins/useGeoProjection/useGeoProjection.selectors.d.ts +0 -48
  293. package/internals/plugins/featurePlugins/useGeoProjection/useGeoProjection.selectors.js +0 -124
  294. package/internals/plugins/featurePlugins/useGeoProjection/useGeoProjection.selectors.mjs +0 -117
  295. package/internals/plugins/featurePlugins/useGeoProjection/useGeoProjection.types.d.mts +0 -73
  296. package/internals/plugins/featurePlugins/useGeoProjection/useGeoProjection.types.d.ts +0 -73
  297. /package/internals/plugins/corePlugins/useChartSeriesConfig/types/{tooltipItemPositionGetter.types.js → tooltipItemPositionSelector.types.js} +0 -0
  298. /package/internals/plugins/corePlugins/useChartSeriesConfig/types/{tooltipItemPositionGetter.types.mjs → tooltipItemPositionSelector.types.mjs} +0 -0
  299. /package/internals/plugins/featurePlugins/{useGeoProjection/useGeoProjection.types.js → useChartCartesianAxis/sampling.types.js} +0 -0
  300. /package/internals/plugins/featurePlugins/{useGeoProjection/useGeoProjection.types.mjs → useChartCartesianAxis/sampling.types.mjs} +0 -0
@@ -1,48 +0,0 @@
1
- import type { ExtendedFeatureCollection, GeoProjection, GeoPath } from '@mui/x-charts-vendor/d3-geo';
2
- import type { D3NamedProjection, GeoProjectionInput, GeoTooltipPosition, UseGeoProjectionSignature, UseGeoProjectionState } from "./useGeoProjection.types.js";
3
- import type { ChartState } from "../../models/chart.js";
4
- export declare const selectorChartGeoProjectionState: (state: ChartState<[], [UseGeoProjectionSignature]>) => UseGeoProjectionState["geoProjection"] | undefined;
5
- export declare const selectorChartGeoData: (state: ChartState<[], [UseGeoProjectionSignature]>) => ExtendedFeatureCollection | null;
6
- export declare const selectorChartGeoFeatureKey: (args_0: import("../../corePlugins/useChartId/useChartId.types.js").UseChartIdState & import("../../corePlugins/useChartSeriesConfig/useChartSeriesConfig.types.js").UseChartSeriesConfigState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../../corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types.js").UseChartExperimentalFeaturesState & import("../../corePlugins/useChartDimensions/useChartDimensions.types.js").UseChartDimensionsState & import("../../corePlugins/useChartSeries/useChartSeries.types.js").UseChartSeriesState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../../corePlugins/useChartAnimation/useChartAnimation.types.js").UseChartAnimationState & import("../../../index.js").UseChartInteractionListenerState & Partial<UseGeoProjectionState> & {
7
- cacheKey: import("../../models/index.js").ChartStateCacheKey;
8
- }) => string | ((feature: ExtendedFeatureCollection["features"][number]) => string | null);
9
- export declare const selectorChartRawProjection: (args_0: import("../../corePlugins/useChartId/useChartId.types.js").UseChartIdState & import("../../corePlugins/useChartSeriesConfig/useChartSeriesConfig.types.js").UseChartSeriesConfigState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../../corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types.js").UseChartExperimentalFeaturesState & import("../../corePlugins/useChartDimensions/useChartDimensions.types.js").UseChartDimensionsState & import("../../corePlugins/useChartSeries/useChartSeries.types.js").UseChartSeriesState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../../corePlugins/useChartAnimation/useChartAnimation.types.js").UseChartAnimationState & import("../../../index.js").UseChartInteractionListenerState & Partial<UseGeoProjectionState> & {
10
- cacheKey: import("../../models/index.js").ChartStateCacheKey;
11
- }) => GeoProjectionInput | null;
12
- export declare const selectorChartProjectionFactory: (args_0: import("../../corePlugins/useChartId/useChartId.types.js").UseChartIdState & import("../../corePlugins/useChartSeriesConfig/useChartSeriesConfig.types.js").UseChartSeriesConfigState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../../corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types.js").UseChartExperimentalFeaturesState & import("../../corePlugins/useChartDimensions/useChartDimensions.types.js").UseChartDimensionsState & import("../../corePlugins/useChartSeries/useChartSeries.types.js").UseChartSeriesState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../../corePlugins/useChartAnimation/useChartAnimation.types.js").UseChartAnimationState & import("../../../index.js").UseChartInteractionListenerState & Partial<UseGeoProjectionState> & {
13
- cacheKey: import("../../models/index.js").ChartStateCacheKey;
14
- }) => Record<D3NamedProjection, (() => GeoProjection) | undefined> | null;
15
- export declare const selectorChartRawScale: (args_0: import("../../corePlugins/useChartId/useChartId.types.js").UseChartIdState & import("../../corePlugins/useChartSeriesConfig/useChartSeriesConfig.types.js").UseChartSeriesConfigState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../../corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types.js").UseChartExperimentalFeaturesState & import("../../corePlugins/useChartDimensions/useChartDimensions.types.js").UseChartDimensionsState & import("../../corePlugins/useChartSeries/useChartSeries.types.js").UseChartSeriesState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../../corePlugins/useChartAnimation/useChartAnimation.types.js").UseChartAnimationState & import("../../../index.js").UseChartInteractionListenerState & Partial<UseGeoProjectionState> & {
16
- cacheKey: import("../../models/index.js").ChartStateCacheKey;
17
- }) => number | null;
18
- /**
19
- * Map a feature's `properties.name` to its index in `geoData.features`,
20
- * for fast lookup by name when joining series rows to features.
21
- *
22
- * Features without a string `properties.name` are skipped; on duplicates,
23
- * the first occurrence wins.
24
- */
25
- export declare const selectorChartGeoFeatureIndexesByName: (args_0: import("../../corePlugins/useChartId/useChartId.types.js").UseChartIdState & import("../../corePlugins/useChartSeriesConfig/useChartSeriesConfig.types.js").UseChartSeriesConfigState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../../corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types.js").UseChartExperimentalFeaturesState & import("../../corePlugins/useChartDimensions/useChartDimensions.types.js").UseChartDimensionsState & import("../../corePlugins/useChartSeries/useChartSeries.types.js").UseChartSeriesState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../../corePlugins/useChartAnimation/useChartAnimation.types.js").UseChartAnimationState & import("../../../index.js").UseChartInteractionListenerState & Partial<UseGeoProjectionState> & {
26
- cacheKey: import("../../models/index.js").ChartStateCacheKey;
27
- }) => ReadonlyMap<string, number[]>;
28
- /**
29
- * Resolves the raw `projection` input into a ready-to-use `GeoProjection` instance
30
- * fitted to the chart's drawing area.
31
- *
32
- * - String inputs (e.g. `'mercator'`) are mapped to the matching d3-geo factory.
33
- * - `GeoProjection` instances are used as-is, then fitted.
34
- * - Returns `null` when no projection is registered or the name is unknown.
35
- */
36
- export declare const selectorChartProjection: (args_0: import("../../corePlugins/useChartId/useChartId.types.js").UseChartIdState & import("../../corePlugins/useChartSeriesConfig/useChartSeriesConfig.types.js").UseChartSeriesConfigState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../../corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types.js").UseChartExperimentalFeaturesState & import("../../corePlugins/useChartDimensions/useChartDimensions.types.js").UseChartDimensionsState & import("../../corePlugins/useChartSeries/useChartSeries.types.js").UseChartSeriesState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../../corePlugins/useChartAnimation/useChartAnimation.types.js").UseChartAnimationState & import("../../../index.js").UseChartInteractionListenerState & Partial<UseGeoProjectionState> & {
37
- cacheKey: import("../../models/index.js").ChartStateCacheKey;
38
- }) => GeoProjection | null;
39
- /**
40
- * Resolves the raw `projection` input into a ready-to-use `GeoPath` instance
41
- * fitted to the chart's drawing area.
42
- */
43
- export declare const selectorChartGeoPath: (args_0: import("../../corePlugins/useChartId/useChartId.types.js").UseChartIdState & import("../../corePlugins/useChartSeriesConfig/useChartSeriesConfig.types.js").UseChartSeriesConfigState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../../corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types.js").UseChartExperimentalFeaturesState & import("../../corePlugins/useChartDimensions/useChartDimensions.types.js").UseChartDimensionsState & import("../../corePlugins/useChartSeries/useChartSeries.types.js").UseChartSeriesState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../../corePlugins/useChartAnimation/useChartAnimation.types.js").UseChartAnimationState & import("../../../index.js").UseChartInteractionListenerState & Partial<UseGeoProjectionState> & {
44
- cacheKey: import("../../models/index.js").ChartStateCacheKey;
45
- }) => GeoPath<any, import("@mui/x-charts-vendor/d3-geo").GeoPermissibleObjects> | null;
46
- export declare const selectorGeoTooltipPosition: (args_0: import("../../corePlugins/useChartId/useChartId.types.js").UseChartIdState & import("../../corePlugins/useChartSeriesConfig/useChartSeriesConfig.types.js").UseChartSeriesConfigState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../../corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types.js").UseChartExperimentalFeaturesState & import("../../corePlugins/useChartDimensions/useChartDimensions.types.js").UseChartDimensionsState & import("../../corePlugins/useChartSeries/useChartSeries.types.js").UseChartSeriesState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../../corePlugins/useChartAnimation/useChartAnimation.types.js").UseChartAnimationState & import("../../../index.js").UseChartInteractionListenerState & Partial<UseGeoProjectionState> & {
47
- cacheKey: import("../../models/index.js").ChartStateCacheKey;
48
- }) => GeoTooltipPosition;
@@ -1,124 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.selectorGeoTooltipPosition = exports.selectorChartRawScale = exports.selectorChartRawProjection = exports.selectorChartProjectionFactory = exports.selectorChartProjection = exports.selectorChartGeoProjectionState = exports.selectorChartGeoPath = exports.selectorChartGeoFeatureKey = exports.selectorChartGeoFeatureIndexesByName = exports.selectorChartGeoData = void 0;
7
- var _store = require("@mui/x-internals/store");
8
- var _d3Geo = require("@mui/x-charts-vendor/d3-geo");
9
- var _useChartDimensions = require("../../corePlugins/useChartDimensions/useChartDimensions.selectors");
10
- const isConicProjection = projection => {
11
- return 'parallels' in projection && typeof projection.parallels === 'function';
12
- };
13
- const selectorChartGeoProjectionState = state => state.geoProjection;
14
- exports.selectorChartGeoProjectionState = selectorChartGeoProjectionState;
15
- const selectorChartGeoData = exports.selectorChartGeoData = (0, _store.createSelector)(selectorChartGeoProjectionState, geoProjection => geoProjection?.geoData ?? null);
16
- const selectorChartGeoFeatureKey = exports.selectorChartGeoFeatureKey = (0, _store.createSelector)(selectorChartGeoProjectionState, geoProjection => geoProjection?.geoFeatureKey ?? 'name');
17
- const selectorChartRawProjection = exports.selectorChartRawProjection = (0, _store.createSelector)(selectorChartGeoProjectionState, geoProjection => geoProjection?.projection ?? null);
18
- const selectorChartProjectionFactory = exports.selectorChartProjectionFactory = (0, _store.createSelector)(selectorChartGeoProjectionState, geoProjection => geoProjection?.factories ?? null);
19
- const selectorChartRawScale = exports.selectorChartRawScale = (0, _store.createSelector)(selectorChartGeoProjectionState, geoProjection => geoProjection?.scale ?? null);
20
- const selectorChartRotate = (0, _store.createSelectorMemoized)(selectorChartGeoProjectionState, geoProjection => geoProjection?.rotate ?? null);
21
- const selectorChartTranslate = (0, _store.createSelectorMemoized)(selectorChartGeoProjectionState, geoProjection => geoProjection?.translate ?? null);
22
- const selectorChartParallels = (0, _store.createSelectorMemoized)(selectorChartGeoProjectionState, selectorChartRotate, (geoProjection, rotate) => geoProjection?.parallels ?? (rotate ? [rotate[1] - 15, rotate[1] + 15] : [30, 30]));
23
- /**
24
- * Map a feature's `properties.name` to its index in `geoData.features`,
25
- * for fast lookup by name when joining series rows to features.
26
- *
27
- * Features without a string `properties.name` are skipped; on duplicates,
28
- * the first occurrence wins.
29
- */
30
- const selectorChartGeoFeatureIndexesByName = exports.selectorChartGeoFeatureIndexesByName = (0, _store.createSelectorMemoized)(selectorChartGeoData, selectorChartGeoFeatureKey, (geoData, geoFeatureKey) => {
31
- const map = new Map();
32
- if (!geoData) {
33
- return map;
34
- }
35
- geoData.features.forEach((feature, index) => {
36
- const name = typeof geoFeatureKey === 'function' ? geoFeatureKey(feature) : feature.properties?.[geoFeatureKey];
37
- if (typeof name !== 'string') {
38
- return;
39
- }
40
- if (map.has(name)) {
41
- map.get(name).push(index);
42
- return;
43
- }
44
- map.set(name, [index]);
45
- });
46
- return map;
47
- });
48
-
49
- /**
50
- * Resolves the raw `projection` input into a ready-to-use `GeoProjection` instance
51
- * fitted to the chart's drawing area.
52
- *
53
- * - String inputs (e.g. `'mercator'`) are mapped to the matching d3-geo factory.
54
- * - `GeoProjection` instances are used as-is, then fitted.
55
- * - Returns `null` when no projection is registered or the name is unknown.
56
- */
57
- const selectorChartProjection = exports.selectorChartProjection = (0, _store.createSelectorMemoized)(selectorChartRawProjection, selectorChartProjectionFactory, selectorChartGeoData, selectorChartParallels, selectorChartRotate, selectorChartTranslate, selectorChartRawScale, _useChartDimensions.selectorChartDrawingArea, (projectionInput, projectionFactory, geoData, parallels, rotate, translate, scale, drawingArea) => {
58
- if (!projectionInput || !projectionFactory) {
59
- return null;
60
- }
61
- let projection;
62
- if (typeof projectionInput === 'string') {
63
- const factory = projectionFactory[projectionInput];
64
- if (!factory) {
65
- if (process.env.NODE_ENV !== 'production') {
66
- console.error(`MUI X Charts: Unknown projection name '${projectionInput}'. ` + `Expected one of: ${Object.keys(projectionFactory).join(', ')}.`);
67
- }
68
- return null;
69
- }
70
- projection = factory();
71
- if (isConicProjection(projection)) {
72
- projection.parallels(parallels);
73
- }
74
- } else {
75
- projection = projectionInput;
76
- }
77
- if (geoData) {
78
- if (isConicProjection(projection)) {
79
- if (rotate) {
80
- projection.rotate?.(rotate);
81
- }
82
- if (!scale) {
83
- const [[x0, y0], [x1, y1]] = (0, _d3Geo.geoPath)(projection).bounds(geoData);
84
- const currentScale = projection.scale();
85
- const fitScale = Math.min(currentScale * (drawingArea.width / (x1 - x0)), currentScale * (drawingArea.height / (y1 - y0)));
86
- projection.scale(fitScale);
87
- } else {
88
- projection.scale(scale);
89
- }
90
- return projection;
91
- }
92
- if (rotate) {
93
- projection.rotate?.(rotate);
94
- }
95
- if (scale) {
96
- projection.scale(scale);
97
- projection.clipExtent?.([[drawingArea.left, drawingArea.top], [drawingArea.left + drawingArea.width, drawingArea.top + drawingArea.height]]);
98
- } else {
99
- projection.fitExtent?.([[drawingArea.left, drawingArea.top], [drawingArea.left + drawingArea.width, drawingArea.top + drawingArea.height]], geoData);
100
- }
101
- if (translate) {
102
- projection.translate(translate);
103
- }
104
- }
105
- return projection;
106
- });
107
-
108
- /**
109
- * Resolves the raw `projection` input into a ready-to-use `GeoPath` instance
110
- * fitted to the chart's drawing area.
111
- */
112
- const selectorChartGeoPath = exports.selectorChartGeoPath = (0, _store.createSelectorMemoized)(selectorChartProjection, projection => {
113
- if (!projection) {
114
- return null;
115
- }
116
- return (0, _d3Geo.geoPath)(projection);
117
- });
118
- const selectorGeoTooltipPosition = exports.selectorGeoTooltipPosition = (0, _store.createSelectorMemoized)(selectorChartGeoData, selectorChartProjection, selectorChartGeoFeatureIndexesByName, (geoData, projection, featureIndexesByName) => {
119
- return {
120
- geoData,
121
- projection,
122
- featureIndexesByName
123
- };
124
- });
@@ -1,117 +0,0 @@
1
- import { createSelector, createSelectorMemoized } from '@mui/x-internals/store';
2
- import { geoPath } from '@mui/x-charts-vendor/d3-geo';
3
- import { selectorChartDrawingArea } from "../../corePlugins/useChartDimensions/useChartDimensions.selectors.mjs";
4
- const isConicProjection = projection => {
5
- return 'parallels' in projection && typeof projection.parallels === 'function';
6
- };
7
- export const selectorChartGeoProjectionState = state => state.geoProjection;
8
- export const selectorChartGeoData = createSelector(selectorChartGeoProjectionState, geoProjection => geoProjection?.geoData ?? null);
9
- export const selectorChartGeoFeatureKey = createSelector(selectorChartGeoProjectionState, geoProjection => geoProjection?.geoFeatureKey ?? 'name');
10
- export const selectorChartRawProjection = createSelector(selectorChartGeoProjectionState, geoProjection => geoProjection?.projection ?? null);
11
- export const selectorChartProjectionFactory = createSelector(selectorChartGeoProjectionState, geoProjection => geoProjection?.factories ?? null);
12
- export const selectorChartRawScale = createSelector(selectorChartGeoProjectionState, geoProjection => geoProjection?.scale ?? null);
13
- const selectorChartRotate = createSelectorMemoized(selectorChartGeoProjectionState, geoProjection => geoProjection?.rotate ?? null);
14
- const selectorChartTranslate = createSelectorMemoized(selectorChartGeoProjectionState, geoProjection => geoProjection?.translate ?? null);
15
- const selectorChartParallels = createSelectorMemoized(selectorChartGeoProjectionState, selectorChartRotate, (geoProjection, rotate) => geoProjection?.parallels ?? (rotate ? [rotate[1] - 15, rotate[1] + 15] : [30, 30]));
16
- /**
17
- * Map a feature's `properties.name` to its index in `geoData.features`,
18
- * for fast lookup by name when joining series rows to features.
19
- *
20
- * Features without a string `properties.name` are skipped; on duplicates,
21
- * the first occurrence wins.
22
- */
23
- export const selectorChartGeoFeatureIndexesByName = createSelectorMemoized(selectorChartGeoData, selectorChartGeoFeatureKey, (geoData, geoFeatureKey) => {
24
- const map = new Map();
25
- if (!geoData) {
26
- return map;
27
- }
28
- geoData.features.forEach((feature, index) => {
29
- const name = typeof geoFeatureKey === 'function' ? geoFeatureKey(feature) : feature.properties?.[geoFeatureKey];
30
- if (typeof name !== 'string') {
31
- return;
32
- }
33
- if (map.has(name)) {
34
- map.get(name).push(index);
35
- return;
36
- }
37
- map.set(name, [index]);
38
- });
39
- return map;
40
- });
41
-
42
- /**
43
- * Resolves the raw `projection` input into a ready-to-use `GeoProjection` instance
44
- * fitted to the chart's drawing area.
45
- *
46
- * - String inputs (e.g. `'mercator'`) are mapped to the matching d3-geo factory.
47
- * - `GeoProjection` instances are used as-is, then fitted.
48
- * - Returns `null` when no projection is registered or the name is unknown.
49
- */
50
- export const selectorChartProjection = createSelectorMemoized(selectorChartRawProjection, selectorChartProjectionFactory, selectorChartGeoData, selectorChartParallels, selectorChartRotate, selectorChartTranslate, selectorChartRawScale, selectorChartDrawingArea, (projectionInput, projectionFactory, geoData, parallels, rotate, translate, scale, drawingArea) => {
51
- if (!projectionInput || !projectionFactory) {
52
- return null;
53
- }
54
- let projection;
55
- if (typeof projectionInput === 'string') {
56
- const factory = projectionFactory[projectionInput];
57
- if (!factory) {
58
- if (process.env.NODE_ENV !== 'production') {
59
- console.error(`MUI X Charts: Unknown projection name '${projectionInput}'. ` + `Expected one of: ${Object.keys(projectionFactory).join(', ')}.`);
60
- }
61
- return null;
62
- }
63
- projection = factory();
64
- if (isConicProjection(projection)) {
65
- projection.parallels(parallels);
66
- }
67
- } else {
68
- projection = projectionInput;
69
- }
70
- if (geoData) {
71
- if (isConicProjection(projection)) {
72
- if (rotate) {
73
- projection.rotate?.(rotate);
74
- }
75
- if (!scale) {
76
- const [[x0, y0], [x1, y1]] = geoPath(projection).bounds(geoData);
77
- const currentScale = projection.scale();
78
- const fitScale = Math.min(currentScale * (drawingArea.width / (x1 - x0)), currentScale * (drawingArea.height / (y1 - y0)));
79
- projection.scale(fitScale);
80
- } else {
81
- projection.scale(scale);
82
- }
83
- return projection;
84
- }
85
- if (rotate) {
86
- projection.rotate?.(rotate);
87
- }
88
- if (scale) {
89
- projection.scale(scale);
90
- projection.clipExtent?.([[drawingArea.left, drawingArea.top], [drawingArea.left + drawingArea.width, drawingArea.top + drawingArea.height]]);
91
- } else {
92
- projection.fitExtent?.([[drawingArea.left, drawingArea.top], [drawingArea.left + drawingArea.width, drawingArea.top + drawingArea.height]], geoData);
93
- }
94
- if (translate) {
95
- projection.translate(translate);
96
- }
97
- }
98
- return projection;
99
- });
100
-
101
- /**
102
- * Resolves the raw `projection` input into a ready-to-use `GeoPath` instance
103
- * fitted to the chart's drawing area.
104
- */
105
- export const selectorChartGeoPath = createSelectorMemoized(selectorChartProjection, projection => {
106
- if (!projection) {
107
- return null;
108
- }
109
- return geoPath(projection);
110
- });
111
- export const selectorGeoTooltipPosition = createSelectorMemoized(selectorChartGeoData, selectorChartProjection, selectorChartGeoFeatureIndexesByName, (geoData, projection, featureIndexesByName) => {
112
- return {
113
- geoData,
114
- projection,
115
- featureIndexesByName
116
- };
117
- });
@@ -1,73 +0,0 @@
1
- import type { GeoProjection, ExtendedFeatureCollection } from '@mui/x-charts-vendor/d3-geo';
2
- import type { ChartPluginSignature } from "../../models/plugin.mjs";
3
- /**
4
- * Geo data used to position a map series tooltip: the resolved projection, the
5
- * feature collection, and a feature-name-to-index lookup.
6
- */
7
- export type GeoTooltipPosition = {
8
- geoData: ExtendedFeatureCollection | null;
9
- projection: GeoProjection | null;
10
- featureIndexesByName: ReadonlyMap<string, number[]>;
11
- };
12
- export type D3NamedProjection = 'azimuthalEqualArea' | 'azimuthalEquidistant' | 'gnomonic' | 'orthographic' | 'stereographic' | 'conicConformal' | 'conicEqualArea' | 'conicEquidistant' | 'albers' | 'albersUsa' | 'equirectangular' | 'mercator' | 'transverseMercator' | 'equalEarth' | 'naturalEarth1';
13
- /**
14
- * A d3-geo projection accepted by `useGeoProjection`.
15
- *
16
- * Either a built-in projection name (e.g. `'mercator'`, `'naturalEarth1'`)
17
- * or a `GeoProjection` instance returned by a d3-geo factory.
18
- */
19
- export type GeoProjectionInput = D3NamedProjection | GeoProjection;
20
- export interface UseGeoProjectionParameters {
21
- /**
22
- * The GeoJSON `FeatureCollection` whose features will be rendered on the map.
23
- */
24
- geoData?: ExtendedFeatureCollection;
25
- /**
26
- * The key, or value getter, used to identify each feature in `geoData`.
27
- * - If a string is provided, `feature.properties[geoFeatureKey]` will be used.
28
- * - If a function is provided, it will be called with each feature and should return a key for that feature.
29
- * @default 'name'
30
- */
31
- geoFeatureKey?: string | ((feature: ExtendedFeatureCollection['features'][number]) => string | null);
32
- /**
33
- * The d3-geo projection used to map geographic coordinates to SVG coordinates.
34
- * Accepts a d3-geo projection name (e.g. `'mercator'`, `'naturalEarth1'`)
35
- * or a custom `GeoProjection` instance.
36
- */
37
- projection?: GeoProjectionInput;
38
- /**
39
- * The center of the projection, specified as a `[longitude, latitude]` pair in degrees.
40
- */
41
- translate?: [number, number];
42
- /**
43
- * The rotation of the projection, specified as a `[longitude, latitude]` pair in degrees.
44
- */
45
- rotate?: [number, number];
46
- /**
47
- * The scale of the projection.
48
- * If not provided, the scale will default to fit the entire geoData in the drawing area.
49
- */
50
- scale?: number;
51
- }
52
- export type UseGeoProjectionDefaultizedParameters = UseGeoProjectionParameters;
53
- export interface UseGeoProjectionState {
54
- geoProjection: {
55
- geoData: ExtendedFeatureCollection | null;
56
- geoFeatureKey: string | ((feature: ExtendedFeatureCollection['features'][number]) => string | null);
57
- projection: GeoProjectionInput | null;
58
- translate: [number, number] | null;
59
- rotate: [number, number] | null;
60
- scale: number | null;
61
- factories: Record<D3NamedProjection, (() => GeoProjection) | undefined>;
62
- /**
63
- * The two standard parallels used by conic projections, if applicable.
64
- * Used for projection 'conicConformal', 'conicEqualArea', 'conicEquidistant'.
65
- */
66
- parallels?: [number, number] | null;
67
- };
68
- }
69
- export type UseGeoProjectionSignature = ChartPluginSignature<{
70
- params: UseGeoProjectionParameters;
71
- defaultizedParams: UseGeoProjectionDefaultizedParameters;
72
- state: UseGeoProjectionState;
73
- }>;
@@ -1,73 +0,0 @@
1
- import type { GeoProjection, ExtendedFeatureCollection } from '@mui/x-charts-vendor/d3-geo';
2
- import type { ChartPluginSignature } from "../../models/plugin.js";
3
- /**
4
- * Geo data used to position a map series tooltip: the resolved projection, the
5
- * feature collection, and a feature-name-to-index lookup.
6
- */
7
- export type GeoTooltipPosition = {
8
- geoData: ExtendedFeatureCollection | null;
9
- projection: GeoProjection | null;
10
- featureIndexesByName: ReadonlyMap<string, number[]>;
11
- };
12
- export type D3NamedProjection = 'azimuthalEqualArea' | 'azimuthalEquidistant' | 'gnomonic' | 'orthographic' | 'stereographic' | 'conicConformal' | 'conicEqualArea' | 'conicEquidistant' | 'albers' | 'albersUsa' | 'equirectangular' | 'mercator' | 'transverseMercator' | 'equalEarth' | 'naturalEarth1';
13
- /**
14
- * A d3-geo projection accepted by `useGeoProjection`.
15
- *
16
- * Either a built-in projection name (e.g. `'mercator'`, `'naturalEarth1'`)
17
- * or a `GeoProjection` instance returned by a d3-geo factory.
18
- */
19
- export type GeoProjectionInput = D3NamedProjection | GeoProjection;
20
- export interface UseGeoProjectionParameters {
21
- /**
22
- * The GeoJSON `FeatureCollection` whose features will be rendered on the map.
23
- */
24
- geoData?: ExtendedFeatureCollection;
25
- /**
26
- * The key, or value getter, used to identify each feature in `geoData`.
27
- * - If a string is provided, `feature.properties[geoFeatureKey]` will be used.
28
- * - If a function is provided, it will be called with each feature and should return a key for that feature.
29
- * @default 'name'
30
- */
31
- geoFeatureKey?: string | ((feature: ExtendedFeatureCollection['features'][number]) => string | null);
32
- /**
33
- * The d3-geo projection used to map geographic coordinates to SVG coordinates.
34
- * Accepts a d3-geo projection name (e.g. `'mercator'`, `'naturalEarth1'`)
35
- * or a custom `GeoProjection` instance.
36
- */
37
- projection?: GeoProjectionInput;
38
- /**
39
- * The center of the projection, specified as a `[longitude, latitude]` pair in degrees.
40
- */
41
- translate?: [number, number];
42
- /**
43
- * The rotation of the projection, specified as a `[longitude, latitude]` pair in degrees.
44
- */
45
- rotate?: [number, number];
46
- /**
47
- * The scale of the projection.
48
- * If not provided, the scale will default to fit the entire geoData in the drawing area.
49
- */
50
- scale?: number;
51
- }
52
- export type UseGeoProjectionDefaultizedParameters = UseGeoProjectionParameters;
53
- export interface UseGeoProjectionState {
54
- geoProjection: {
55
- geoData: ExtendedFeatureCollection | null;
56
- geoFeatureKey: string | ((feature: ExtendedFeatureCollection['features'][number]) => string | null);
57
- projection: GeoProjectionInput | null;
58
- translate: [number, number] | null;
59
- rotate: [number, number] | null;
60
- scale: number | null;
61
- factories: Record<D3NamedProjection, (() => GeoProjection) | undefined>;
62
- /**
63
- * The two standard parallels used by conic projections, if applicable.
64
- * Used for projection 'conicConformal', 'conicEqualArea', 'conicEquidistant'.
65
- */
66
- parallels?: [number, number] | null;
67
- };
68
- }
69
- export type UseGeoProjectionSignature = ChartPluginSignature<{
70
- params: UseGeoProjectionParameters;
71
- defaultizedParams: UseGeoProjectionDefaultizedParameters;
72
- state: UseGeoProjectionState;
73
- }>;