@mui/x-charts 9.7.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.
- package/BarChart/AnimatedBarElement.d.mts +1 -1
- package/BarChart/AnimatedBarElement.d.ts +1 -1
- package/BarChart/BarClipPath.d.mts +1 -1
- package/BarChart/BarClipPath.d.ts +1 -1
- package/BarChart/BarElement.d.mts +1 -1
- package/BarChart/BarElement.d.ts +1 -1
- package/BarChart/BarLabel/BarLabelItem.d.mts +1 -1
- package/BarChart/BarLabel/BarLabelItem.d.ts +1 -1
- package/BarChart/BarLabel/BarLabelPlot.d.mts +2 -1
- package/BarChart/BarLabel/BarLabelPlot.d.ts +2 -1
- package/BarChart/BatchBarPlot/BarGroup.d.mts +1 -1
- package/BarChart/BatchBarPlot/BarGroup.d.ts +1 -1
- package/BarChart/BatchBarPlot/BatchBarPlot.d.mts +2 -1
- package/BarChart/BatchBarPlot/BatchBarPlot.d.ts +2 -1
- package/BarChart/FocusedBar.d.mts +1 -1
- package/BarChart/FocusedBar.d.ts +1 -1
- package/BarChart/IndividualBarPlot.d.mts +2 -1
- package/BarChart/IndividualBarPlot.d.ts +2 -1
- package/BarChart/seriesConfig/bar/tooltipPosition.d.mts +2 -3
- package/BarChart/seriesConfig/bar/tooltipPosition.d.ts +2 -3
- package/BarChart/seriesConfig/bar/tooltipPosition.js +19 -15
- package/BarChart/seriesConfig/bar/tooltipPosition.mjs +18 -14
- package/BarChart/seriesConfig/index.js +2 -2
- package/BarChart/seriesConfig/index.mjs +2 -2
- package/BarChart/useBarPlotData.d.mts +5 -1
- package/BarChart/useBarPlotData.d.ts +5 -1
- package/BarChart/useBarPlotData.js +102 -25
- package/BarChart/useBarPlotData.mjs +102 -26
- package/CHANGELOG.md +249 -1
- package/ChartsAxis/ChartsAxis.d.mts +2 -1
- package/ChartsAxis/ChartsAxis.d.ts +2 -1
- package/ChartsAxisHighlight/ChartsAxisHighlight.d.mts +2 -1
- package/ChartsAxisHighlight/ChartsAxisHighlight.d.ts +2 -1
- package/ChartsAxisHighlight/ChartsXAxisHighlight.d.mts +2 -1
- package/ChartsAxisHighlight/ChartsXAxisHighlight.d.ts +2 -1
- package/ChartsAxisHighlight/ChartsXAxisHighlight.js +22 -5
- package/ChartsAxisHighlight/ChartsXAxisHighlight.mjs +23 -6
- package/ChartsAxisHighlight/ChartsYAxisHighlight.d.mts +2 -1
- package/ChartsAxisHighlight/ChartsYAxisHighlight.d.ts +2 -1
- package/ChartsAxisHighlight/ChartsYAxisHighlight.js +22 -5
- package/ChartsAxisHighlight/ChartsYAxisHighlight.mjs +23 -6
- package/ChartsAxisHighlight/getSampledBandHighlight.d.mts +27 -0
- package/ChartsAxisHighlight/getSampledBandHighlight.d.ts +27 -0
- package/ChartsAxisHighlight/getSampledBandHighlight.js +35 -0
- package/ChartsAxisHighlight/getSampledBandHighlight.mjs +29 -0
- package/ChartsAxisHighlightValue/ChartsAxisHighlightValue.d.mts +1 -1
- package/ChartsAxisHighlightValue/ChartsAxisHighlightValue.d.ts +1 -1
- package/ChartsAxisHighlightValue/ChartsAxisHighlightValueItem.d.mts +2 -1
- package/ChartsAxisHighlightValue/ChartsAxisHighlightValueItem.d.ts +2 -1
- package/ChartsBrushOverlay/ChartsBrushOverlay.d.mts +2 -1
- package/ChartsBrushOverlay/ChartsBrushOverlay.d.ts +2 -1
- package/ChartsClipPath/ChartsClipPath.d.mts +1 -1
- package/ChartsClipPath/ChartsClipPath.d.ts +1 -1
- package/ChartsDataProvider/ChartsDataProvider.d.mts +1 -1
- package/ChartsDataProvider/ChartsDataProvider.d.ts +1 -1
- package/ChartsGrid/ChartsGrid.d.mts +1 -1
- package/ChartsGrid/ChartsGrid.d.ts +1 -1
- package/ChartsGrid/ChartsHorizontalGrid.d.mts +2 -1
- package/ChartsGrid/ChartsHorizontalGrid.d.ts +2 -1
- package/ChartsGrid/ChartsVerticalGrid.d.mts +2 -1
- package/ChartsGrid/ChartsVerticalGrid.d.ts +2 -1
- package/ChartsLocalizationProvider/ChartsLocalizationProvider.d.mts +1 -1
- package/ChartsLocalizationProvider/ChartsLocalizationProvider.d.ts +1 -1
- package/ChartsOverlay/ChartsLoadingOverlay.d.mts +1 -1
- package/ChartsOverlay/ChartsLoadingOverlay.d.ts +1 -1
- package/ChartsOverlay/ChartsNoDataOverlay.d.mts +1 -1
- package/ChartsOverlay/ChartsNoDataOverlay.d.ts +1 -1
- package/ChartsOverlay/ChartsOverlay.d.mts +1 -1
- package/ChartsOverlay/ChartsOverlay.d.ts +1 -1
- package/ChartsRadialAxisHighlight/ChartsRadialAxisHighlight.d.mts +2 -1
- package/ChartsRadialAxisHighlight/ChartsRadialAxisHighlight.d.ts +2 -1
- package/ChartsRadialAxisHighlight/ChartsRadiusAxisHighlight.d.mts +2 -1
- package/ChartsRadialAxisHighlight/ChartsRadiusAxisHighlight.d.ts +2 -1
- package/ChartsRadialAxisHighlight/ChartsRotationAxisHighlight.d.mts +2 -1
- package/ChartsRadialAxisHighlight/ChartsRotationAxisHighlight.d.ts +2 -1
- package/ChartsRadialDataProvider/ChartsRadialDataProvider.d.mts +1 -1
- package/ChartsRadialDataProvider/ChartsRadialDataProvider.d.ts +1 -1
- package/ChartsRadialGrid/ChartsRadialGrid.d.mts +1 -1
- package/ChartsRadialGrid/ChartsRadialGrid.d.ts +1 -1
- package/ChartsRadialGrid/ChartsRadiusGrid.d.mts +2 -1
- package/ChartsRadialGrid/ChartsRadiusGrid.d.ts +2 -1
- package/ChartsRadialGrid/ChartsRotationGrid.d.mts +2 -1
- package/ChartsRadialGrid/ChartsRotationGrid.d.ts +2 -1
- package/ChartsRadiusAxis/ChartsRadiusAxis.d.mts +1 -1
- package/ChartsRadiusAxis/ChartsRadiusAxis.d.ts +1 -1
- package/ChartsReferenceLine/ChartsReferenceLine.d.mts +1 -1
- package/ChartsReferenceLine/ChartsReferenceLine.d.ts +1 -1
- package/ChartsReferenceLine/ChartsXReferenceLine.d.mts +1 -1
- package/ChartsReferenceLine/ChartsXReferenceLine.d.ts +1 -1
- package/ChartsReferenceLine/ChartsYReferenceLine.d.mts +1 -1
- package/ChartsReferenceLine/ChartsYReferenceLine.d.ts +1 -1
- package/ChartsRotationAxis/ChartsRotationAxis.d.mts +1 -1
- package/ChartsRotationAxis/ChartsRotationAxis.d.ts +1 -1
- package/ChartsText/ChartsText.d.mts +1 -1
- package/ChartsText/ChartsText.d.ts +1 -1
- package/ChartsTooltip/ChartsAxisTooltipContent.d.mts +1 -1
- package/ChartsTooltip/ChartsAxisTooltipContent.d.ts +1 -1
- package/ChartsTooltip/ChartsItemTooltipContent.d.mts +2 -1
- package/ChartsTooltip/ChartsItemTooltipContent.d.ts +2 -1
- package/ChartsTooltip/ChartsTooltip.d.mts +1 -1
- package/ChartsTooltip/ChartsTooltip.d.ts +1 -1
- package/ChartsTooltip/ChartsTooltipContainer.d.mts +1 -1
- package/ChartsTooltip/ChartsTooltipContainer.d.ts +1 -1
- package/ChartsTooltip/ChartsTooltipContainer.js +10 -3
- package/ChartsTooltip/ChartsTooltipContainer.mjs +11 -4
- package/ChartsXAxis/ChartsGroupedXAxisTicks.d.mts +2 -1
- package/ChartsXAxis/ChartsGroupedXAxisTicks.d.ts +2 -1
- package/ChartsXAxis/ChartsGroupedXAxisTicks.js +3 -13
- package/ChartsXAxis/ChartsGroupedXAxisTicks.mjs +2 -12
- package/ChartsXAxis/ChartsSingleXAxisTicks.d.mts +2 -1
- package/ChartsXAxis/ChartsSingleXAxisTicks.d.ts +2 -1
- package/ChartsXAxis/ChartsXAxis.d.mts +1 -1
- package/ChartsXAxis/ChartsXAxis.d.ts +1 -1
- package/ChartsXAxis/ChartsXAxisImpl.d.mts +2 -1
- package/ChartsXAxis/ChartsXAxisImpl.d.ts +2 -1
- package/ChartsYAxis/ChartsGroupedYAxisTicks.d.mts +2 -1
- package/ChartsYAxis/ChartsGroupedYAxisTicks.d.ts +2 -1
- package/ChartsYAxis/ChartsGroupedYAxisTicks.js +4 -16
- package/ChartsYAxis/ChartsGroupedYAxisTicks.mjs +3 -13
- package/ChartsYAxis/ChartsSingleYAxisTicks.d.mts +2 -1
- package/ChartsYAxis/ChartsSingleYAxisTicks.d.ts +2 -1
- package/ChartsYAxis/ChartsYAxis.d.mts +1 -1
- package/ChartsYAxis/ChartsYAxis.d.ts +1 -1
- package/ChartsYAxis/ChartsYAxisImpl.d.mts +2 -1
- package/ChartsYAxis/ChartsYAxisImpl.d.ts +2 -1
- package/Gauge/GaugeProvider.d.mts +1 -1
- package/Gauge/GaugeProvider.d.ts +1 -1
- package/Gauge/GaugeReferenceArc.d.mts +1 -1
- package/Gauge/GaugeReferenceArc.d.ts +1 -1
- package/Gauge/GaugeValueArc.d.mts +1 -1
- package/Gauge/GaugeValueArc.d.ts +1 -1
- package/Gauge/GaugeValueText.d.mts +1 -1
- package/Gauge/GaugeValueText.d.ts +1 -1
- package/LineChart/AnimatedArea.d.mts +1 -1
- package/LineChart/AnimatedArea.d.ts +1 -1
- package/LineChart/AppearingMask.d.mts +1 -1
- package/LineChart/AppearingMask.d.ts +1 -1
- package/LineChart/AreaElement.d.mts +1 -1
- package/LineChart/AreaElement.d.ts +1 -1
- package/LineChart/AreaPlot.d.mts +1 -1
- package/LineChart/AreaPlot.d.ts +1 -1
- package/LineChart/CircleMarkElement.d.mts +1 -1
- package/LineChart/CircleMarkElement.d.ts +1 -1
- package/LineChart/FocusedLineMark.d.mts +1 -1
- package/LineChart/FocusedLineMark.d.ts +1 -1
- package/LineChart/LineElement.d.mts +1 -1
- package/LineChart/LineElement.d.ts +1 -1
- package/LineChart/LineHighlightElement.d.mts +1 -1
- package/LineChart/LineHighlightElement.d.ts +1 -1
- package/LineChart/LineHighlightPlot.d.mts +1 -1
- package/LineChart/LineHighlightPlot.d.ts +1 -1
- package/LineChart/LinePlot.d.mts +1 -1
- package/LineChart/LinePlot.d.ts +1 -1
- package/LineChart/LinePlot.js +3 -2
- package/LineChart/LinePlot.mjs +3 -2
- package/LineChart/MarkElement.d.mts +1 -1
- package/LineChart/MarkElement.d.ts +1 -1
- package/LineChart/MarkPlot.d.mts +1 -1
- package/LineChart/MarkPlot.d.ts +1 -1
- package/LineChart/seriesConfig/index.js +2 -2
- package/LineChart/seriesConfig/index.mjs +2 -2
- package/LineChart/seriesConfig/tooltipPosition.d.mts +2 -3
- package/LineChart/seriesConfig/tooltipPosition.d.ts +2 -3
- package/LineChart/seriesConfig/tooltipPosition.js +14 -14
- package/LineChart/seriesConfig/tooltipPosition.mjs +13 -13
- package/LineChart/useLinePlotData.d.mts +13 -1
- package/LineChart/useLinePlotData.d.ts +13 -1
- package/LineChart/useLinePlotData.js +90 -33
- package/LineChart/useLinePlotData.mjs +92 -34
- package/PieChart/FocusedPieArc.d.mts +1 -1
- package/PieChart/FocusedPieArc.d.ts +1 -1
- package/PieChart/PieArcLabelPlot.d.mts +1 -1
- package/PieChart/PieArcLabelPlot.d.ts +1 -1
- package/PieChart/PieArcPlot.d.mts +1 -1
- package/PieChart/PieArcPlot.d.ts +1 -1
- package/PieChart/PiePlot.d.mts +1 -1
- package/PieChart/PiePlot.d.ts +1 -1
- package/PieChart/seriesConfig/index.js +2 -2
- package/PieChart/seriesConfig/index.mjs +2 -2
- package/PieChart/seriesConfig/tooltipPosition.d.mts +2 -3
- package/PieChart/seriesConfig/tooltipPosition.d.ts +2 -3
- package/PieChart/seriesConfig/tooltipPosition.js +7 -11
- package/PieChart/seriesConfig/tooltipPosition.mjs +6 -10
- package/RadarChart/FocusedRadarMark.d.mts +1 -1
- package/RadarChart/FocusedRadarMark.d.ts +1 -1
- package/RadarChart/RadarAxis/RadarAxis.d.mts +1 -1
- package/RadarChart/RadarAxis/RadarAxis.d.ts +1 -1
- package/RadarChart/RadarAxisHighlight/RadarAxisHighlight.d.mts +1 -1
- package/RadarChart/RadarAxisHighlight/RadarAxisHighlight.d.ts +1 -1
- package/RadarChart/RadarDataProvider/RadarDataProvider.d.mts +2 -1
- package/RadarChart/RadarDataProvider/RadarDataProvider.d.ts +2 -1
- package/RadarChart/RadarGrid/CircularRadarGrid.d.mts +2 -1
- package/RadarChart/RadarGrid/CircularRadarGrid.d.ts +2 -1
- package/RadarChart/RadarGrid/CircularRadarStripes.d.mts +2 -1
- package/RadarChart/RadarGrid/CircularRadarStripes.d.ts +2 -1
- package/RadarChart/RadarGrid/RadarGrid.d.mts +2 -1
- package/RadarChart/RadarGrid/RadarGrid.d.ts +2 -1
- package/RadarChart/RadarGrid/SharpRadarGrid.d.mts +2 -1
- package/RadarChart/RadarGrid/SharpRadarGrid.d.ts +2 -1
- package/RadarChart/RadarGrid/SharpRadarStripes.d.mts +2 -1
- package/RadarChart/RadarGrid/SharpRadarStripes.d.ts +2 -1
- package/RadarChart/RadarMetricLabels/RadarMetricLabels.d.mts +2 -1
- package/RadarChart/RadarMetricLabels/RadarMetricLabels.d.ts +2 -1
- package/RadarChart/RadarSeriesPlot/RadarSeriesArea.d.mts +2 -1
- package/RadarChart/RadarSeriesPlot/RadarSeriesArea.d.ts +2 -1
- package/RadarChart/RadarSeriesPlot/RadarSeriesMarks.d.mts +2 -1
- package/RadarChart/RadarSeriesPlot/RadarSeriesMarks.d.ts +2 -1
- package/RadarChart/RadarSeriesPlot/RadarSeriesPlot.d.mts +1 -1
- package/RadarChart/RadarSeriesPlot/RadarSeriesPlot.d.ts +1 -1
- package/RadarChart/seriesConfig/index.js +2 -2
- package/RadarChart/seriesConfig/index.mjs +2 -2
- package/RadarChart/seriesConfig/tooltipPosition.d.mts +2 -3
- package/RadarChart/seriesConfig/tooltipPosition.d.ts +2 -3
- package/RadarChart/seriesConfig/tooltipPosition.js +9 -16
- package/RadarChart/seriesConfig/tooltipPosition.mjs +8 -15
- package/ScatterChart/BatchScatter.d.mts +2 -1
- package/ScatterChart/BatchScatter.d.ts +2 -1
- package/ScatterChart/FocusedScatterMark.d.mts +1 -1
- package/ScatterChart/FocusedScatterMark.d.ts +1 -1
- package/ScatterChart/HighlightedScatterMark.d.mts +1 -1
- package/ScatterChart/HighlightedScatterMark.d.ts +1 -1
- package/ScatterChart/Scatter.d.mts +1 -1
- package/ScatterChart/Scatter.d.ts +1 -1
- package/ScatterChart/ScatterMarker.d.mts +1 -1
- package/ScatterChart/ScatterMarker.d.ts +1 -1
- package/ScatterChart/ScatterPlot.d.mts +1 -1
- package/ScatterChart/ScatterPlot.d.ts +1 -1
- package/ScatterChart/async/ScatterAsync.d.mts +2 -1
- package/ScatterChart/async/ScatterAsync.d.ts +2 -1
- package/ScatterChart/async/ScatterAsyncBatch.d.mts +1 -1
- package/ScatterChart/async/ScatterAsyncBatch.d.ts +1 -1
- package/ScatterChart/seriesConfig/index.js +2 -2
- package/ScatterChart/seriesConfig/index.mjs +2 -2
- package/ScatterChart/seriesConfig/tooltipPosition.d.mts +2 -3
- package/ScatterChart/seriesConfig/tooltipPosition.d.ts +2 -3
- package/ScatterChart/seriesConfig/tooltipPosition.js +13 -13
- package/ScatterChart/seriesConfig/tooltipPosition.mjs +12 -12
- package/context/ChartsProvider/ChartsProvider.d.mts +1 -1
- package/context/ChartsProvider/ChartsProvider.d.ts +1 -1
- package/context/ChartsSlotsContext.d.mts +1 -1
- package/context/ChartsSlotsContext.d.ts +1 -1
- package/hooks/index.d.mts +2 -1
- package/hooks/index.d.ts +2 -1
- package/hooks/index.js +10 -2
- package/hooks/index.mjs +2 -1
- package/hooks/usePolarGeometry.d.mts +51 -0
- package/hooks/usePolarGeometry.d.ts +51 -0
- package/hooks/usePolarGeometry.js +47 -0
- package/hooks/usePolarGeometry.mjs +41 -0
- package/index.js +1 -1
- package/index.mjs +1 -1
- package/internals/animation/animation.d.mts +1 -1
- package/internals/animation/animation.d.ts +1 -1
- package/internals/commonNextFocusItem.d.mts +15 -5
- package/internals/commonNextFocusItem.d.ts +15 -5
- package/internals/commonNextFocusItem.js +6 -0
- package/internals/commonNextFocusItem.mjs +7 -0
- package/internals/components/ChartsAccessibilityProxy/ChartsAccessibilityProxy.d.mts +2 -1
- package/internals/components/ChartsAccessibilityProxy/ChartsAccessibilityProxy.d.ts +2 -1
- package/internals/components/ChartsAxesGradients/ChartsAxesGradients.d.mts +2 -1
- package/internals/components/ChartsAxesGradients/ChartsAxesGradients.d.ts +2 -1
- package/internals/components/ChartsAxesGradients/ChartsContinuousGradient.d.mts +1 -1
- package/internals/components/ChartsAxesGradients/ChartsContinuousGradient.d.ts +1 -1
- package/internals/components/ChartsAxesGradients/ChartsContinuousGradientObjectBound.d.mts +1 -1
- package/internals/components/ChartsAxesGradients/ChartsContinuousGradientObjectBound.d.ts +1 -1
- package/internals/components/ChartsAxesGradients/ChartsPiecewiseGradient.d.mts +2 -1
- package/internals/components/ChartsAxesGradients/ChartsPiecewiseGradient.d.ts +2 -1
- package/internals/createCommonKeyboardFocusHandler.d.mts +5 -1
- package/internals/createCommonKeyboardFocusHandler.d.ts +5 -1
- package/internals/createGetBarDimensions.d.mts +14 -1
- package/internals/createGetBarDimensions.d.ts +14 -1
- package/internals/createGetBarDimensions.js +45 -0
- package/internals/createGetBarDimensions.mjs +45 -0
- package/internals/geometry.js +1 -1
- package/internals/geometry.mjs +1 -1
- package/internals/getGroupingConfig.d.mts +6 -0
- package/internals/getGroupingConfig.d.ts +6 -0
- package/internals/getGroupingConfig.js +20 -0
- package/internals/getGroupingConfig.mjs +12 -0
- package/internals/index.d.mts +1 -2
- package/internals/index.d.ts +1 -2
- package/internals/index.js +12 -8
- package/internals/index.mjs +1 -2
- package/internals/plugins/corePlugins/useChartSeries/useChartSeries.selectors.d.mts +2 -1
- package/internals/plugins/corePlugins/useChartSeries/useChartSeries.selectors.d.ts +2 -1
- package/internals/plugins/corePlugins/useChartSeriesConfig/types/colorProcessor.types.d.mts +1 -1
- package/internals/plugins/corePlugins/useChartSeriesConfig/types/colorProcessor.types.d.ts +1 -1
- package/internals/plugins/corePlugins/useChartSeriesConfig/types/index.d.mts +1 -1
- package/internals/plugins/corePlugins/useChartSeriesConfig/types/index.d.ts +1 -1
- package/internals/plugins/corePlugins/useChartSeriesConfig/types/index.js +4 -4
- package/internals/plugins/corePlugins/useChartSeriesConfig/types/index.mjs +1 -1
- package/internals/plugins/corePlugins/useChartSeriesConfig/types/seriesConfig.types.d.mts +13 -2
- package/internals/plugins/corePlugins/useChartSeriesConfig/types/seriesConfig.types.d.ts +13 -2
- package/internals/plugins/corePlugins/useChartSeriesConfig/types/tooltipItemPositionSelector.types.d.mts +18 -0
- package/internals/plugins/corePlugins/useChartSeriesConfig/types/tooltipItemPositionSelector.types.d.ts +18 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/index.d.mts +2 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/index.d.ts +2 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/index.js +12 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/index.mjs +1 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/sampling.selectors.d.mts +26 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/sampling.selectors.d.ts +26 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/sampling.selectors.js +89 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/sampling.selectors.mjs +81 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/sampling.types.d.mts +93 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/sampling.types.d.ts +93 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.types.d.mts +5 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.types.d.ts +5 -0
- package/internals/plugins/featurePlugins/useChartHighlight/createIsFaded.d.mts +1 -1
- package/internals/plugins/featurePlugins/useChartHighlight/createIsFaded.d.ts +1 -1
- package/internals/plugins/featurePlugins/useChartHighlight/createIsHighlighted.d.mts +1 -1
- package/internals/plugins/featurePlugins/useChartHighlight/createIsHighlighted.d.ts +1 -1
- package/internals/plugins/featurePlugins/useChartTooltip/useChartTooltip.selectors.d.mts +3 -8
- package/internals/plugins/featurePlugins/useChartTooltip/useChartTooltip.selectors.d.ts +3 -8
- package/internals/plugins/featurePlugins/useChartTooltip/useChartTooltip.selectors.js +2 -57
- package/internals/plugins/featurePlugins/useChartTooltip/useChartTooltip.selectors.mjs +2 -57
- package/internals/shallowEqual.d.mts +1 -1
- package/internals/shallowEqual.d.ts +1 -1
- package/internals/shallowEqual.js +1 -1
- package/internals/shallowEqual.mjs +1 -1
- package/models/seriesType/config.d.mts +6 -2
- package/models/seriesType/config.d.ts +6 -2
- package/package.json +6 -6
- package/internals/plugins/corePlugins/useChartSeriesConfig/types/tooltipItemPositionGetter.types.d.mts +0 -34
- package/internals/plugins/corePlugins/useChartSeriesConfig/types/tooltipItemPositionGetter.types.d.ts +0 -34
- package/internals/plugins/featurePlugins/useGeoProjection/useGeoProjection.selectors.d.mts +0 -49
- package/internals/plugins/featurePlugins/useGeoProjection/useGeoProjection.selectors.d.ts +0 -49
- package/internals/plugins/featurePlugins/useGeoProjection/useGeoProjection.selectors.js +0 -124
- package/internals/plugins/featurePlugins/useGeoProjection/useGeoProjection.selectors.mjs +0 -117
- package/internals/plugins/featurePlugins/useGeoProjection/useGeoProjection.types.d.mts +0 -64
- package/internals/plugins/featurePlugins/useGeoProjection/useGeoProjection.types.d.ts +0 -64
- /package/internals/plugins/corePlugins/useChartSeriesConfig/types/{tooltipItemPositionGetter.types.js → tooltipItemPositionSelector.types.js} +0 -0
- /package/internals/plugins/corePlugins/useChartSeriesConfig/types/{tooltipItemPositionGetter.types.mjs → tooltipItemPositionSelector.types.mjs} +0 -0
- /package/internals/plugins/featurePlugins/{useGeoProjection/useGeoProjection.types.js → useChartCartesianAxis/sampling.types.js} +0 -0
- /package/internals/plugins/featurePlugins/{useGeoProjection/useGeoProjection.types.mjs → useChartCartesianAxis/sampling.types.mjs} +0 -0
|
@@ -3,6 +3,6 @@
|
|
|
3
3
|
* when any key has values which are not strictly equal between the arguments.
|
|
4
4
|
* Returns true when the values of all keys are strictly equal.
|
|
5
5
|
*
|
|
6
|
-
* Source: https://github.com/
|
|
6
|
+
* Source: https://github.com/react/react/blob/c2a196174763e0b4f16ed1c512ed4442b062395e/packages/shared/shallowEqual.js#L18
|
|
7
7
|
*/
|
|
8
8
|
export declare function shallowEqual(objA: unknown, objB: unknown): boolean;
|
|
@@ -9,7 +9,7 @@ exports.shallowEqual = shallowEqual;
|
|
|
9
9
|
* when any key has values which are not strictly equal between the arguments.
|
|
10
10
|
* Returns true when the values of all keys are strictly equal.
|
|
11
11
|
*
|
|
12
|
-
* Source: https://github.com/
|
|
12
|
+
* Source: https://github.com/react/react/blob/c2a196174763e0b4f16ed1c512ed4442b062395e/packages/shared/shallowEqual.js#L18
|
|
13
13
|
*/
|
|
14
14
|
function shallowEqual(objA, objB) {
|
|
15
15
|
if (Object.is(objA, objB)) {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* when any key has values which are not strictly equal between the arguments.
|
|
4
4
|
* Returns true when the values of all keys are strictly equal.
|
|
5
5
|
*
|
|
6
|
-
* Source: https://github.com/
|
|
6
|
+
* Source: https://github.com/react/react/blob/c2a196174763e0b4f16ed1c512ed4442b062395e/packages/shared/shallowEqual.js#L18
|
|
7
7
|
*/
|
|
8
8
|
export function shallowEqual(objA, objB) {
|
|
9
9
|
if (Object.is(objA, objB)) {
|
|
@@ -7,6 +7,10 @@ import type { DefaultizedRadarSeriesType, RadarItemIdentifier, RadarSeriesType }
|
|
|
7
7
|
import type { SeriesColor, SeriesId } from "./common.mjs";
|
|
8
8
|
import type { ChartsRadiusAxisProps, ChartsRotationAxisProps, ComputedXAxis, ComputedYAxis, PolarAxisDefaultized } from "../axis.mjs";
|
|
9
9
|
import type { CommonHighlightScope } from "../../internals/plugins/featurePlugins/useChartHighlight/highlightConfig.types.mjs";
|
|
10
|
+
/** Bar series-config extension point. Empty in community; pro augments it. */
|
|
11
|
+
export interface BarSeriesExtension {}
|
|
12
|
+
/** Line series-config extension point. Empty in community; pro augments it. */
|
|
13
|
+
export interface LineSeriesExtension {}
|
|
10
14
|
export interface ChartsSeriesConfig {
|
|
11
15
|
bar: {
|
|
12
16
|
/**
|
|
@@ -49,7 +53,7 @@ export interface ChartsSeriesConfig {
|
|
|
49
53
|
seriesId: SeriesId;
|
|
50
54
|
dataIndex?: number | undefined;
|
|
51
55
|
};
|
|
52
|
-
};
|
|
56
|
+
} & BarSeriesExtension;
|
|
53
57
|
line: {
|
|
54
58
|
seriesInput: DefaultizedProps<LineSeriesType, 'id'> & MakeRequired<SeriesColor<number | null>, 'color'>;
|
|
55
59
|
series: DefaultizedLineSeriesType;
|
|
@@ -72,7 +76,7 @@ export interface ChartsSeriesConfig {
|
|
|
72
76
|
seriesId: SeriesId;
|
|
73
77
|
dataIndex?: number;
|
|
74
78
|
};
|
|
75
|
-
};
|
|
79
|
+
} & LineSeriesExtension;
|
|
76
80
|
scatter: {
|
|
77
81
|
seriesInput: DefaultizedProps<ScatterSeriesType, 'id'> & MakeRequired<SeriesColor<ScatterValueType>, 'color'>;
|
|
78
82
|
series: DefaultizedScatterSeriesType;
|
|
@@ -7,6 +7,10 @@ import type { DefaultizedRadarSeriesType, RadarItemIdentifier, RadarSeriesType }
|
|
|
7
7
|
import type { SeriesColor, SeriesId } from "./common.js";
|
|
8
8
|
import type { ChartsRadiusAxisProps, ChartsRotationAxisProps, ComputedXAxis, ComputedYAxis, PolarAxisDefaultized } from "../axis.js";
|
|
9
9
|
import type { CommonHighlightScope } from "../../internals/plugins/featurePlugins/useChartHighlight/highlightConfig.types.js";
|
|
10
|
+
/** Bar series-config extension point. Empty in community; pro augments it. */
|
|
11
|
+
export interface BarSeriesExtension {}
|
|
12
|
+
/** Line series-config extension point. Empty in community; pro augments it. */
|
|
13
|
+
export interface LineSeriesExtension {}
|
|
10
14
|
export interface ChartsSeriesConfig {
|
|
11
15
|
bar: {
|
|
12
16
|
/**
|
|
@@ -49,7 +53,7 @@ export interface ChartsSeriesConfig {
|
|
|
49
53
|
seriesId: SeriesId;
|
|
50
54
|
dataIndex?: number | undefined;
|
|
51
55
|
};
|
|
52
|
-
};
|
|
56
|
+
} & BarSeriesExtension;
|
|
53
57
|
line: {
|
|
54
58
|
seriesInput: DefaultizedProps<LineSeriesType, 'id'> & MakeRequired<SeriesColor<number | null>, 'color'>;
|
|
55
59
|
series: DefaultizedLineSeriesType;
|
|
@@ -72,7 +76,7 @@ export interface ChartsSeriesConfig {
|
|
|
72
76
|
seriesId: SeriesId;
|
|
73
77
|
dataIndex?: number;
|
|
74
78
|
};
|
|
75
|
-
};
|
|
79
|
+
} & LineSeriesExtension;
|
|
76
80
|
scatter: {
|
|
77
81
|
seriesInput: DefaultizedProps<ScatterSeriesType, 'id'> & MakeRequired<SeriesColor<ScatterValueType>, 'color'>;
|
|
78
82
|
series: DefaultizedScatterSeriesType;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mui/x-charts",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.9.0",
|
|
4
4
|
"author": "MUI Team",
|
|
5
5
|
"description": "The community edition of MUI X Charts components.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -28,15 +28,15 @@
|
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"@babel/runtime": "^7.29.7",
|
|
31
|
-
"@mui/utils": "^9.
|
|
32
|
-
"bezier-easing": "^3.0.
|
|
31
|
+
"@mui/utils": "^9.2.0",
|
|
32
|
+
"bezier-easing": "^3.0.1",
|
|
33
33
|
"clsx": "^2.1.1",
|
|
34
34
|
"prop-types": "^15.8.1",
|
|
35
35
|
"reselect": "^5.2.0",
|
|
36
36
|
"use-sync-external-store": "^1.6.0",
|
|
37
|
-
"@mui/x-
|
|
38
|
-
"@mui/x-
|
|
39
|
-
"@mui/x-
|
|
37
|
+
"@mui/x-internal-gestures": "^9.9.0",
|
|
38
|
+
"@mui/x-internals": "^9.9.0",
|
|
39
|
+
"@mui/x-charts-vendor": "^9.4.0"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
42
42
|
"@emotion/react": "^11.9.0",
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import type { ExtendedFeatureCollection, GeoProjection } from '@mui/x-charts-vendor/d3-geo';
|
|
2
|
-
import type { SeriesItemIdentifierWithType } from "../../../../../models/seriesType/index.mjs";
|
|
3
|
-
import type { ChartSeriesType } from "../../../../../models/seriesType/config.mjs";
|
|
4
|
-
import type { ChartsRotationAxisProps, ChartsRadiusAxisProps, ComputedXAxis, ComputedYAxis } from "../../../../../models/axis.mjs";
|
|
5
|
-
import type { ChartDrawingArea } from "../../../../../hooks/useDrawingArea.mjs";
|
|
6
|
-
import type { ProcessedSeries, SeriesLayout } from "../../useChartSeries/index.mjs";
|
|
7
|
-
import type { ComputeResult } from "../../../featurePlugins/useChartPolarAxis/computeAxisValue.mjs";
|
|
8
|
-
export type GeoTooltipPosition = {
|
|
9
|
-
geoData: ExtendedFeatureCollection | null;
|
|
10
|
-
projection: GeoProjection | null;
|
|
11
|
-
featureIndexesByName: ReadonlyMap<string, number[]>;
|
|
12
|
-
};
|
|
13
|
-
export interface TooltipPositionGetterAxesConfig {
|
|
14
|
-
x?: ComputedXAxis;
|
|
15
|
-
y?: ComputedYAxis;
|
|
16
|
-
rotationAxes?: ComputeResult<ChartsRotationAxisProps>;
|
|
17
|
-
radiusAxes?: ComputeResult<ChartsRadiusAxisProps>;
|
|
18
|
-
geo?: GeoTooltipPosition;
|
|
19
|
-
}
|
|
20
|
-
export type TooltipItemPositionGetter<SeriesType extends ChartSeriesType> = (params: {
|
|
21
|
-
series: ProcessedSeries<SeriesType>;
|
|
22
|
-
axesConfig: TooltipPositionGetterAxesConfig;
|
|
23
|
-
drawingArea: ChartDrawingArea;
|
|
24
|
-
identifier: SeriesItemIdentifierWithType<SeriesType> | null;
|
|
25
|
-
seriesLayout: SeriesLayout<SeriesType>;
|
|
26
|
-
/**
|
|
27
|
-
* The preferred placement of the tooltip related to the element.
|
|
28
|
-
* @default 'top'
|
|
29
|
-
*/
|
|
30
|
-
placement: 'top' | 'bottom' | 'left' | 'right';
|
|
31
|
-
}) => {
|
|
32
|
-
x: number;
|
|
33
|
-
y: number;
|
|
34
|
-
} | null;
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import type { ExtendedFeatureCollection, GeoProjection } from '@mui/x-charts-vendor/d3-geo';
|
|
2
|
-
import type { SeriesItemIdentifierWithType } from "../../../../../models/seriesType/index.js";
|
|
3
|
-
import type { ChartSeriesType } from "../../../../../models/seriesType/config.js";
|
|
4
|
-
import type { ChartsRotationAxisProps, ChartsRadiusAxisProps, ComputedXAxis, ComputedYAxis } from "../../../../../models/axis.js";
|
|
5
|
-
import type { ChartDrawingArea } from "../../../../../hooks/useDrawingArea.js";
|
|
6
|
-
import type { ProcessedSeries, SeriesLayout } from "../../useChartSeries/index.js";
|
|
7
|
-
import type { ComputeResult } from "../../../featurePlugins/useChartPolarAxis/computeAxisValue.js";
|
|
8
|
-
export type GeoTooltipPosition = {
|
|
9
|
-
geoData: ExtendedFeatureCollection | null;
|
|
10
|
-
projection: GeoProjection | null;
|
|
11
|
-
featureIndexesByName: ReadonlyMap<string, number[]>;
|
|
12
|
-
};
|
|
13
|
-
export interface TooltipPositionGetterAxesConfig {
|
|
14
|
-
x?: ComputedXAxis;
|
|
15
|
-
y?: ComputedYAxis;
|
|
16
|
-
rotationAxes?: ComputeResult<ChartsRotationAxisProps>;
|
|
17
|
-
radiusAxes?: ComputeResult<ChartsRadiusAxisProps>;
|
|
18
|
-
geo?: GeoTooltipPosition;
|
|
19
|
-
}
|
|
20
|
-
export type TooltipItemPositionGetter<SeriesType extends ChartSeriesType> = (params: {
|
|
21
|
-
series: ProcessedSeries<SeriesType>;
|
|
22
|
-
axesConfig: TooltipPositionGetterAxesConfig;
|
|
23
|
-
drawingArea: ChartDrawingArea;
|
|
24
|
-
identifier: SeriesItemIdentifierWithType<SeriesType> | null;
|
|
25
|
-
seriesLayout: SeriesLayout<SeriesType>;
|
|
26
|
-
/**
|
|
27
|
-
* The preferred placement of the tooltip related to the element.
|
|
28
|
-
* @default 'top'
|
|
29
|
-
*/
|
|
30
|
-
placement: 'top' | 'bottom' | 'left' | 'right';
|
|
31
|
-
}) => {
|
|
32
|
-
x: number;
|
|
33
|
-
y: number;
|
|
34
|
-
} | null;
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import type { ExtendedFeatureCollection, GeoProjection, GeoPath } from '@mui/x-charts-vendor/d3-geo';
|
|
2
|
-
import type { D3NamedProjection, GeoProjectionInput, UseGeoProjectionSignature, UseGeoProjectionState } from "./useGeoProjection.types.mjs";
|
|
3
|
-
import type { ChartState } from "../../models/chart.mjs";
|
|
4
|
-
import type { GeoTooltipPosition } from "../../corePlugins/useChartSeriesConfig/index.mjs";
|
|
5
|
-
export declare const selectorChartGeoProjectionState: (state: ChartState<[], [UseGeoProjectionSignature]>) => UseGeoProjectionState["geoProjection"] | undefined;
|
|
6
|
-
export declare const selectorChartGeoData: (state: ChartState<[], [UseGeoProjectionSignature]>) => ExtendedFeatureCollection | null;
|
|
7
|
-
export declare const selectorChartGeoFeatureKey: (args_0: import("../../corePlugins/useChartId/useChartId.types.mjs").UseChartIdState & import("../../corePlugins/useChartSeriesConfig/useChartSeriesConfig.types.mjs").UseChartSeriesConfigState<keyof import("../../../index.mjs").ChartsSeriesConfig> & import("../../corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types.mjs").UseChartExperimentalFeaturesState & import("../../corePlugins/useChartDimensions/useChartDimensions.types.mjs").UseChartDimensionsState & import("../../corePlugins/useChartSeries/useChartSeries.types.mjs").UseChartSeriesState<keyof import("../../../index.mjs").ChartsSeriesConfig> & import("../../corePlugins/useChartAnimation/useChartAnimation.types.mjs").UseChartAnimationState & import("../../../index.mjs").UseChartInteractionListenerState & Partial<UseGeoProjectionState> & {
|
|
8
|
-
cacheKey: import("../../models/index.mjs").ChartStateCacheKey;
|
|
9
|
-
}) => string | ((feature: ExtendedFeatureCollection["features"][number]) => string | null);
|
|
10
|
-
export declare const selectorChartRawProjection: (args_0: import("../../corePlugins/useChartId/useChartId.types.mjs").UseChartIdState & import("../../corePlugins/useChartSeriesConfig/useChartSeriesConfig.types.mjs").UseChartSeriesConfigState<keyof import("../../../index.mjs").ChartsSeriesConfig> & import("../../corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types.mjs").UseChartExperimentalFeaturesState & import("../../corePlugins/useChartDimensions/useChartDimensions.types.mjs").UseChartDimensionsState & import("../../corePlugins/useChartSeries/useChartSeries.types.mjs").UseChartSeriesState<keyof import("../../../index.mjs").ChartsSeriesConfig> & import("../../corePlugins/useChartAnimation/useChartAnimation.types.mjs").UseChartAnimationState & import("../../../index.mjs").UseChartInteractionListenerState & Partial<UseGeoProjectionState> & {
|
|
11
|
-
cacheKey: import("../../models/index.mjs").ChartStateCacheKey;
|
|
12
|
-
}) => GeoProjectionInput | null;
|
|
13
|
-
export declare const selectorChartProjectionFactory: (args_0: import("../../corePlugins/useChartId/useChartId.types.mjs").UseChartIdState & import("../../corePlugins/useChartSeriesConfig/useChartSeriesConfig.types.mjs").UseChartSeriesConfigState<keyof import("../../../index.mjs").ChartsSeriesConfig> & import("../../corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types.mjs").UseChartExperimentalFeaturesState & import("../../corePlugins/useChartDimensions/useChartDimensions.types.mjs").UseChartDimensionsState & import("../../corePlugins/useChartSeries/useChartSeries.types.mjs").UseChartSeriesState<keyof import("../../../index.mjs").ChartsSeriesConfig> & import("../../corePlugins/useChartAnimation/useChartAnimation.types.mjs").UseChartAnimationState & import("../../../index.mjs").UseChartInteractionListenerState & Partial<UseGeoProjectionState> & {
|
|
14
|
-
cacheKey: import("../../models/index.mjs").ChartStateCacheKey;
|
|
15
|
-
}) => Record<D3NamedProjection, (() => GeoProjection) | undefined> | null;
|
|
16
|
-
export declare const selectorChartRawScale: (args_0: import("../../corePlugins/useChartId/useChartId.types.mjs").UseChartIdState & import("../../corePlugins/useChartSeriesConfig/useChartSeriesConfig.types.mjs").UseChartSeriesConfigState<keyof import("../../../index.mjs").ChartsSeriesConfig> & import("../../corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types.mjs").UseChartExperimentalFeaturesState & import("../../corePlugins/useChartDimensions/useChartDimensions.types.mjs").UseChartDimensionsState & import("../../corePlugins/useChartSeries/useChartSeries.types.mjs").UseChartSeriesState<keyof import("../../../index.mjs").ChartsSeriesConfig> & import("../../corePlugins/useChartAnimation/useChartAnimation.types.mjs").UseChartAnimationState & import("../../../index.mjs").UseChartInteractionListenerState & Partial<UseGeoProjectionState> & {
|
|
17
|
-
cacheKey: import("../../models/index.mjs").ChartStateCacheKey;
|
|
18
|
-
}) => number | null;
|
|
19
|
-
/**
|
|
20
|
-
* Map a feature's `properties.name` to its index in `geoData.features`,
|
|
21
|
-
* for fast lookup by name when joining series rows to features.
|
|
22
|
-
*
|
|
23
|
-
* Features without a string `properties.name` are skipped; on duplicates,
|
|
24
|
-
* the first occurrence wins.
|
|
25
|
-
*/
|
|
26
|
-
export declare const selectorChartGeoFeatureIndexesByName: (args_0: import("../../corePlugins/useChartId/useChartId.types.mjs").UseChartIdState & import("../../corePlugins/useChartSeriesConfig/useChartSeriesConfig.types.mjs").UseChartSeriesConfigState<keyof import("../../../index.mjs").ChartsSeriesConfig> & import("../../corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types.mjs").UseChartExperimentalFeaturesState & import("../../corePlugins/useChartDimensions/useChartDimensions.types.mjs").UseChartDimensionsState & import("../../corePlugins/useChartSeries/useChartSeries.types.mjs").UseChartSeriesState<keyof import("../../../index.mjs").ChartsSeriesConfig> & import("../../corePlugins/useChartAnimation/useChartAnimation.types.mjs").UseChartAnimationState & import("../../../index.mjs").UseChartInteractionListenerState & Partial<UseGeoProjectionState> & {
|
|
27
|
-
cacheKey: import("../../models/index.mjs").ChartStateCacheKey;
|
|
28
|
-
}) => ReadonlyMap<string, number[]>;
|
|
29
|
-
/**
|
|
30
|
-
* Resolves the raw `projection` input into a ready-to-use `GeoProjection` instance
|
|
31
|
-
* fitted to the chart's drawing area.
|
|
32
|
-
*
|
|
33
|
-
* - String inputs (e.g. `'mercator'`) are mapped to the matching d3-geo factory.
|
|
34
|
-
* - `GeoProjection` instances are used as-is, then fitted.
|
|
35
|
-
* - Returns `null` when no projection is registered or the name is unknown.
|
|
36
|
-
*/
|
|
37
|
-
export declare const selectorChartProjection: (args_0: import("../../corePlugins/useChartId/useChartId.types.mjs").UseChartIdState & import("../../corePlugins/useChartSeriesConfig/useChartSeriesConfig.types.mjs").UseChartSeriesConfigState<keyof import("../../../index.mjs").ChartsSeriesConfig> & import("../../corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types.mjs").UseChartExperimentalFeaturesState & import("../../corePlugins/useChartDimensions/useChartDimensions.types.mjs").UseChartDimensionsState & import("../../corePlugins/useChartSeries/useChartSeries.types.mjs").UseChartSeriesState<keyof import("../../../index.mjs").ChartsSeriesConfig> & import("../../corePlugins/useChartAnimation/useChartAnimation.types.mjs").UseChartAnimationState & import("../../../index.mjs").UseChartInteractionListenerState & Partial<UseGeoProjectionState> & {
|
|
38
|
-
cacheKey: import("../../models/index.mjs").ChartStateCacheKey;
|
|
39
|
-
}) => GeoProjection | null;
|
|
40
|
-
/**
|
|
41
|
-
* Resolves the raw `projection` input into a ready-to-use `GeoPath` instance
|
|
42
|
-
* fitted to the chart's drawing area.
|
|
43
|
-
*/
|
|
44
|
-
export declare const selectorChartGeoPath: (args_0: import("../../corePlugins/useChartId/useChartId.types.mjs").UseChartIdState & import("../../corePlugins/useChartSeriesConfig/useChartSeriesConfig.types.mjs").UseChartSeriesConfigState<keyof import("../../../index.mjs").ChartsSeriesConfig> & import("../../corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types.mjs").UseChartExperimentalFeaturesState & import("../../corePlugins/useChartDimensions/useChartDimensions.types.mjs").UseChartDimensionsState & import("../../corePlugins/useChartSeries/useChartSeries.types.mjs").UseChartSeriesState<keyof import("../../../index.mjs").ChartsSeriesConfig> & import("../../corePlugins/useChartAnimation/useChartAnimation.types.mjs").UseChartAnimationState & import("../../../index.mjs").UseChartInteractionListenerState & Partial<UseGeoProjectionState> & {
|
|
45
|
-
cacheKey: import("../../models/index.mjs").ChartStateCacheKey;
|
|
46
|
-
}) => GeoPath<any, import("@mui/x-charts-vendor/d3-geo").GeoPermissibleObjects> | null;
|
|
47
|
-
export declare const selectorGeoTooltipPosition: (args_0: import("../../corePlugins/useChartId/useChartId.types.mjs").UseChartIdState & import("../../corePlugins/useChartSeriesConfig/useChartSeriesConfig.types.mjs").UseChartSeriesConfigState<keyof import("../../../index.mjs").ChartsSeriesConfig> & import("../../corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types.mjs").UseChartExperimentalFeaturesState & import("../../corePlugins/useChartDimensions/useChartDimensions.types.mjs").UseChartDimensionsState & import("../../corePlugins/useChartSeries/useChartSeries.types.mjs").UseChartSeriesState<keyof import("../../../index.mjs").ChartsSeriesConfig> & import("../../corePlugins/useChartAnimation/useChartAnimation.types.mjs").UseChartAnimationState & import("../../../index.mjs").UseChartInteractionListenerState & Partial<UseGeoProjectionState> & {
|
|
48
|
-
cacheKey: import("../../models/index.mjs").ChartStateCacheKey;
|
|
49
|
-
}) => GeoTooltipPosition;
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import type { ExtendedFeatureCollection, GeoProjection, GeoPath } from '@mui/x-charts-vendor/d3-geo';
|
|
2
|
-
import type { D3NamedProjection, GeoProjectionInput, UseGeoProjectionSignature, UseGeoProjectionState } from "./useGeoProjection.types.js";
|
|
3
|
-
import type { ChartState } from "../../models/chart.js";
|
|
4
|
-
import type { GeoTooltipPosition } from "../../corePlugins/useChartSeriesConfig/index.js";
|
|
5
|
-
export declare const selectorChartGeoProjectionState: (state: ChartState<[], [UseGeoProjectionSignature]>) => UseGeoProjectionState["geoProjection"] | undefined;
|
|
6
|
-
export declare const selectorChartGeoData: (state: ChartState<[], [UseGeoProjectionSignature]>) => ExtendedFeatureCollection | null;
|
|
7
|
-
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> & {
|
|
8
|
-
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
9
|
-
}) => string | ((feature: ExtendedFeatureCollection["features"][number]) => string | null);
|
|
10
|
-
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> & {
|
|
11
|
-
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
12
|
-
}) => GeoProjectionInput | null;
|
|
13
|
-
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> & {
|
|
14
|
-
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
15
|
-
}) => Record<D3NamedProjection, (() => GeoProjection) | undefined> | null;
|
|
16
|
-
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> & {
|
|
17
|
-
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
18
|
-
}) => number | null;
|
|
19
|
-
/**
|
|
20
|
-
* Map a feature's `properties.name` to its index in `geoData.features`,
|
|
21
|
-
* for fast lookup by name when joining series rows to features.
|
|
22
|
-
*
|
|
23
|
-
* Features without a string `properties.name` are skipped; on duplicates,
|
|
24
|
-
* the first occurrence wins.
|
|
25
|
-
*/
|
|
26
|
-
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> & {
|
|
27
|
-
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
28
|
-
}) => ReadonlyMap<string, number[]>;
|
|
29
|
-
/**
|
|
30
|
-
* Resolves the raw `projection` input into a ready-to-use `GeoProjection` instance
|
|
31
|
-
* fitted to the chart's drawing area.
|
|
32
|
-
*
|
|
33
|
-
* - String inputs (e.g. `'mercator'`) are mapped to the matching d3-geo factory.
|
|
34
|
-
* - `GeoProjection` instances are used as-is, then fitted.
|
|
35
|
-
* - Returns `null` when no projection is registered or the name is unknown.
|
|
36
|
-
*/
|
|
37
|
-
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> & {
|
|
38
|
-
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
39
|
-
}) => GeoProjection | null;
|
|
40
|
-
/**
|
|
41
|
-
* Resolves the raw `projection` input into a ready-to-use `GeoPath` instance
|
|
42
|
-
* fitted to the chart's drawing area.
|
|
43
|
-
*/
|
|
44
|
-
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> & {
|
|
45
|
-
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
46
|
-
}) => GeoPath<any, import("@mui/x-charts-vendor/d3-geo").GeoPermissibleObjects> | null;
|
|
47
|
-
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> & {
|
|
48
|
-
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
49
|
-
}) => 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,64 +0,0 @@
|
|
|
1
|
-
import type { GeoProjection, ExtendedFeatureCollection } from '@mui/x-charts-vendor/d3-geo';
|
|
2
|
-
import type { ChartPluginSignature } from "../../models/plugin.mjs";
|
|
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 key, or value getter, used to identify each feature in `geoData`.
|
|
18
|
-
* - If a string is provided, `feature.properties[geoFeatureKey]` will be used.
|
|
19
|
-
* - If a function is provided, it will be called with each feature and should return a key for that feature.
|
|
20
|
-
* @default 'name'
|
|
21
|
-
*/
|
|
22
|
-
geoFeatureKey?: string | ((feature: ExtendedFeatureCollection['features'][number]) => string | null);
|
|
23
|
-
/**
|
|
24
|
-
* The d3-geo projection used to map geographic coordinates to SVG coordinates.
|
|
25
|
-
* Accepts a d3-geo projection name (e.g. `'mercator'`, `'naturalEarth1'`)
|
|
26
|
-
* or a custom `GeoProjection` instance.
|
|
27
|
-
*/
|
|
28
|
-
projection?: GeoProjectionInput;
|
|
29
|
-
/**
|
|
30
|
-
* The center of the projection, specified as a `[longitude, latitude]` pair in degrees.
|
|
31
|
-
*/
|
|
32
|
-
translate?: [number, number];
|
|
33
|
-
/**
|
|
34
|
-
* The rotation of the projection, specified as a `[longitude, latitude]` pair in degrees.
|
|
35
|
-
*/
|
|
36
|
-
rotate?: [number, number];
|
|
37
|
-
/**
|
|
38
|
-
* The scale of the projection.
|
|
39
|
-
* If not provided, the scale will default to fit the entire geoData in the drawing area.
|
|
40
|
-
*/
|
|
41
|
-
scale?: number;
|
|
42
|
-
}
|
|
43
|
-
export type UseGeoProjectionDefaultizedParameters = UseGeoProjectionParameters;
|
|
44
|
-
export interface UseGeoProjectionState {
|
|
45
|
-
geoProjection: {
|
|
46
|
-
geoData: ExtendedFeatureCollection | null;
|
|
47
|
-
geoFeatureKey: string | ((feature: ExtendedFeatureCollection['features'][number]) => string | null);
|
|
48
|
-
projection: GeoProjectionInput | null;
|
|
49
|
-
translate: [number, number] | null;
|
|
50
|
-
rotate: [number, number] | null;
|
|
51
|
-
scale: number | null;
|
|
52
|
-
factories: Record<D3NamedProjection, (() => GeoProjection) | undefined>;
|
|
53
|
-
/**
|
|
54
|
-
* The two standard parallels used by conic projections, if applicable.
|
|
55
|
-
* Used for projection 'conicConformal', 'conicEqualArea', 'conicEquidistant'.
|
|
56
|
-
*/
|
|
57
|
-
parallels?: [number, number] | null;
|
|
58
|
-
};
|
|
59
|
-
}
|
|
60
|
-
export type UseGeoProjectionSignature = ChartPluginSignature<{
|
|
61
|
-
params: UseGeoProjectionParameters;
|
|
62
|
-
defaultizedParams: UseGeoProjectionDefaultizedParameters;
|
|
63
|
-
state: UseGeoProjectionState;
|
|
64
|
-
}>;
|