@mui/x-charts 9.5.0 → 9.6.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/BarChart.js +1 -1
- package/BarChart/BarChart.mjs +1 -1
- package/BarChart/BarElement.js +2 -1
- package/BarChart/BarElement.mjs +2 -1
- package/BarChart/BarLabel/BarLabel.js +1 -1
- package/BarChart/BarLabel/BarLabel.mjs +1 -1
- package/BarChart/BarPlot.js +1 -1
- package/BarChart/BarPlot.mjs +1 -1
- package/CHANGELOG.md +151 -0
- package/ChartsAxis/ChartsAxis.js +1 -1
- package/ChartsAxis/ChartsAxis.mjs +1 -1
- package/ChartsAxisHighlight/ChartsAxisHighlight.js +1 -1
- package/ChartsAxisHighlight/ChartsAxisHighlight.mjs +1 -1
- package/ChartsAxisHighlightValue/ChartsAxisHighlightValue.js +2 -2
- package/ChartsAxisHighlightValue/ChartsAxisHighlightValue.mjs +2 -2
- package/ChartsBrushOverlay/ChartsBrushOverlay.d.mts +5 -1
- package/ChartsBrushOverlay/ChartsBrushOverlay.d.ts +5 -1
- package/ChartsBrushOverlay/ChartsBrushOverlay.js +12 -1
- package/ChartsBrushOverlay/ChartsBrushOverlay.mjs +14 -2
- package/ChartsClipPath/ChartsClipPath.js +1 -1
- package/ChartsClipPath/ChartsClipPath.mjs +1 -1
- package/ChartsContainer/ChartsContainer.js +5 -3
- package/ChartsContainer/ChartsContainer.mjs +5 -3
- package/ChartsDataProvider/ChartsDataProvider.js +5 -1
- package/ChartsDataProvider/ChartsDataProvider.mjs +5 -1
- package/ChartsGrid/ChartsGrid.js +5 -1
- package/ChartsGrid/ChartsGrid.mjs +5 -1
- package/ChartsLayerContainer/ChartsLayerContainer.js +1 -1
- package/ChartsLayerContainer/ChartsLayerContainer.mjs +1 -1
- package/ChartsLocalizationProvider/ChartsLocalizationProvider.js +1 -1
- package/ChartsLocalizationProvider/ChartsLocalizationProvider.mjs +1 -1
- package/ChartsRadialAxisHighlight/ChartsRadialAxisHighlight.js +2 -2
- package/ChartsRadialAxisHighlight/ChartsRadialAxisHighlight.mjs +2 -2
- package/ChartsRadialDataProvider/ChartsRadialDataProvider.js +9 -1
- package/ChartsRadialDataProvider/ChartsRadialDataProvider.mjs +9 -1
- package/ChartsRadialGrid/ChartsRadialGrid.js +5 -1
- package/ChartsRadialGrid/ChartsRadialGrid.mjs +5 -1
- package/ChartsRadiusAxis/ChartsRadiusAxis.d.mts +8 -2
- package/ChartsRadiusAxis/ChartsRadiusAxis.d.ts +8 -2
- package/ChartsRadiusAxis/ChartsRadiusAxis.js +143 -3
- package/ChartsRadiusAxis/ChartsRadiusAxis.mjs +144 -5
- package/ChartsReferenceLine/ChartsReferenceLine.js +1 -1
- package/ChartsReferenceLine/ChartsReferenceLine.mjs +1 -1
- package/ChartsRotationAxis/ChartsRotationAxis.d.mts +8 -2
- package/ChartsRotationAxis/ChartsRotationAxis.d.ts +8 -2
- package/ChartsRotationAxis/ChartsRotationAxis.js +140 -3
- package/ChartsRotationAxis/ChartsRotationAxis.mjs +141 -5
- package/ChartsRotationAxis/index.d.mts +1 -1
- package/ChartsRotationAxis/index.d.ts +1 -1
- package/ChartsSurface/ChartsSurface.js +1 -1
- package/ChartsSurface/ChartsSurface.mjs +1 -1
- package/ChartsSvgLayer/ChartsSvgLayer.js +1 -1
- package/ChartsSvgLayer/ChartsSvgLayer.mjs +1 -1
- package/ChartsText/ChartsText.js +2 -2
- package/ChartsText/ChartsText.mjs +2 -2
- package/ChartsTooltip/ChartsAxisTooltipContent.js +22 -3
- package/ChartsTooltip/ChartsAxisTooltipContent.mjs +22 -3
- package/ChartsTooltip/ChartsItemTooltipContent.js +52 -1
- package/ChartsTooltip/ChartsItemTooltipContent.mjs +52 -1
- package/ChartsTooltip/ChartsTooltip.js +13 -33
- package/ChartsTooltip/ChartsTooltip.mjs +13 -33
- package/ChartsTooltip/ChartsTooltipContainer.js +6 -26
- package/ChartsTooltip/ChartsTooltipContainer.mjs +6 -26
- package/ChartsWrapper/ChartsWrapper.js +1 -1
- package/ChartsWrapper/ChartsWrapper.mjs +1 -1
- package/ChartsXAxis/ChartsSingleXAxisTicks.js +1 -1
- package/ChartsXAxis/ChartsSingleXAxisTicks.mjs +1 -1
- package/ChartsXAxis/ChartsXAxis.js +11 -2
- package/ChartsXAxis/ChartsXAxis.mjs +11 -2
- package/ChartsYAxis/ChartsSingleYAxisTicks.js +1 -1
- package/ChartsYAxis/ChartsSingleYAxisTicks.mjs +1 -1
- package/ChartsYAxis/ChartsYAxis.js +11 -2
- package/ChartsYAxis/ChartsYAxis.mjs +11 -2
- package/ChartsYAxis/ChartsYAxisImpl.js +1 -1
- package/ChartsYAxis/ChartsYAxisImpl.mjs +1 -1
- package/Gauge/Gauge.js +1 -1
- package/Gauge/Gauge.mjs +1 -1
- package/Gauge/GaugeContainer.js +1 -1
- package/Gauge/GaugeContainer.mjs +1 -1
- package/Gauge/GaugeValueArc.js +2 -2
- package/Gauge/GaugeValueArc.mjs +2 -2
- package/Gauge/GaugeValueText.js +1 -1
- package/Gauge/GaugeValueText.mjs +1 -1
- package/LineChart/AnimatedArea.js +3 -3
- package/LineChart/AnimatedArea.mjs +3 -3
- package/LineChart/AnimatedLine.js +1 -1
- package/LineChart/AnimatedLine.mjs +1 -1
- package/LineChart/AreaElement.js +1 -1
- package/LineChart/AreaElement.mjs +1 -1
- package/LineChart/AreaPlot.js +1 -1
- package/LineChart/AreaPlot.mjs +1 -1
- package/LineChart/LineChart.js +1 -1
- package/LineChart/LineChart.mjs +1 -1
- package/LineChart/LineElement.js +4 -2
- package/LineChart/LineElement.mjs +4 -2
- package/LineChart/LineHighlightElement.js +1 -2
- package/LineChart/LineHighlightElement.mjs +1 -2
- package/LineChart/LineHighlightPlot.js +1 -1
- package/LineChart/LineHighlightPlot.mjs +1 -1
- package/LineChart/LinePlot.js +1 -1
- package/LineChart/LinePlot.mjs +1 -1
- package/LineChart/MarkElement.js +3 -2
- package/LineChart/MarkElement.mjs +3 -2
- package/LineChart/MarkPlot.js +2 -1
- package/LineChart/MarkPlot.mjs +2 -1
- package/PieChart/FocusedPieArc.d.mts +5 -1
- package/PieChart/FocusedPieArc.d.ts +5 -1
- package/PieChart/FocusedPieArc.js +22 -1
- package/PieChart/FocusedPieArc.mjs +24 -2
- package/PieChart/PieArc.js +1 -1
- package/PieChart/PieArc.mjs +1 -1
- package/PieChart/PieArcLabel.js +1 -1
- package/PieChart/PieArcLabel.mjs +1 -1
- package/PieChart/PieArcLabelPlot.js +7 -6
- package/PieChart/PieArcLabelPlot.mjs +7 -6
- package/PieChart/PieArcPlot.js +7 -6
- package/PieChart/PieArcPlot.mjs +7 -6
- package/PieChart/PieChart.js +1 -1
- package/PieChart/PieChart.mjs +1 -1
- package/PieChart/PiePlot.js +2 -1
- package/PieChart/PiePlot.mjs +2 -1
- package/RadarChart/RadarAxis/RadarAxis.js +5 -1
- package/RadarChart/RadarAxis/RadarAxis.mjs +5 -1
- package/RadarChart/RadarAxisHighlight/RadarAxisHighlight.js +6 -2
- package/RadarChart/RadarAxisHighlight/RadarAxisHighlight.mjs +6 -2
- package/RadarChart/RadarChart.js +1 -1
- package/RadarChart/RadarChart.mjs +1 -1
- package/RadarChart/RadarGrid/RadarGrid.js +1 -5
- package/RadarChart/RadarGrid/RadarGrid.mjs +1 -5
- package/RadarChart/RadarSeriesPlot/RadarSeriesArea.js +5 -1
- package/RadarChart/RadarSeriesPlot/RadarSeriesArea.mjs +5 -1
- package/RadarChart/RadarSeriesPlot/RadarSeriesMarks.js +5 -1
- package/RadarChart/RadarSeriesPlot/RadarSeriesMarks.mjs +5 -1
- package/RadarChart/RadarSeriesPlot/RadarSeriesPlot.js +5 -1
- package/RadarChart/RadarSeriesPlot/RadarSeriesPlot.mjs +5 -1
- package/ScatterChart/Scatter.js +1 -1
- package/ScatterChart/Scatter.mjs +1 -1
- package/ScatterChart/ScatterChart.js +5 -3
- package/ScatterChart/ScatterChart.mjs +5 -3
- package/ScatterChart/ScatterMarker.js +2 -2
- package/ScatterChart/ScatterMarker.mjs +2 -2
- package/ScatterChart/ScatterPlot.d.mts +8 -1
- package/ScatterChart/ScatterPlot.d.ts +8 -1
- package/ScatterChart/ScatterPlot.js +5 -2
- package/ScatterChart/ScatterPlot.mjs +5 -2
- package/ScatterChart/seriesConfig/getColor.js +6 -15
- package/ScatterChart/seriesConfig/getColor.mjs +6 -15
- package/SparkLineChart/SparkLineChart.js +1 -1
- package/SparkLineChart/SparkLineChart.mjs +1 -1
- package/Toolbar/Toolbar.js +1 -1
- package/Toolbar/Toolbar.mjs +1 -1
- package/Toolbar/ToolbarButton.js +1 -1
- package/Toolbar/ToolbarButton.mjs +1 -1
- package/index.d.mts +1 -1
- package/index.d.ts +1 -1
- package/index.js +1 -1
- package/index.mjs +1 -1
- package/internals/colorScale.d.mts +2 -2
- package/internals/colorScale.d.ts +2 -2
- package/internals/colorScale.js +2 -2
- package/internals/colorScale.mjs +2 -2
- package/internals/index.d.mts +2 -0
- package/internals/index.d.ts +2 -0
- package/internals/index.js +8 -0
- package/internals/index.mjs +2 -0
- package/internals/plugins/corePlugins/useChartInteractionListener/useChartInteractionListener.js +16 -30
- package/internals/plugins/corePlugins/useChartInteractionListener/useChartInteractionListener.mjs +17 -31
- package/internals/plugins/corePlugins/useChartInteractionListener/useChartInteractionListener.types.d.mts +8 -1
- package/internals/plugins/corePlugins/useChartInteractionListener/useChartInteractionListener.types.d.ts +8 -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/tooltipItemPositionGetter.types.d.mts +7 -0
- package/internals/plugins/corePlugins/useChartSeriesConfig/types/tooltipItemPositionGetter.types.d.ts +7 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/domain.d.mts +0 -8
- package/internals/plugins/featurePlugins/useChartCartesianAxis/domain.d.ts +0 -8
- package/internals/plugins/featurePlugins/useChartCartesianAxis/domain.js +1 -2
- package/internals/plugins/featurePlugins/useChartCartesianAxis/domain.mjs +2 -2
- package/internals/plugins/featurePlugins/useChartPolarAxis/computeAxisValue.js +6 -1
- package/internals/plugins/featurePlugins/useChartPolarAxis/computeAxisValue.mjs +6 -1
- package/internals/plugins/featurePlugins/useChartTooltip/useChartTooltip.selectors.js +6 -2
- package/internals/plugins/featurePlugins/useChartTooltip/useChartTooltip.selectors.mjs +6 -2
- package/internals/plugins/featurePlugins/useGeoProjection/useGeoProjection.selectors.d.mts +49 -0
- package/internals/plugins/featurePlugins/useGeoProjection/useGeoProjection.selectors.d.ts +49 -0
- package/internals/plugins/featurePlugins/useGeoProjection/useGeoProjection.selectors.js +124 -0
- package/internals/plugins/featurePlugins/useGeoProjection/useGeoProjection.selectors.mjs +117 -0
- package/internals/plugins/featurePlugins/useGeoProjection/useGeoProjection.types.d.mts +64 -0
- package/internals/plugins/featurePlugins/useGeoProjection/useGeoProjection.types.d.ts +64 -0
- package/internals/plugins/featurePlugins/useGeoProjection/useGeoProjection.types.js +5 -0
- package/internals/plugins/featurePlugins/useGeoProjection/useGeoProjection.types.mjs +1 -0
- package/internals/resolveColorProcessor.js +4 -7
- package/internals/resolveColorProcessor.mjs +4 -7
- package/models/axis.d.mts +20 -4
- package/models/axis.d.ts +20 -4
- package/models/colorMapping.d.mts +8 -0
- package/models/colorMapping.d.ts +8 -0
- package/package.json +7 -4
- package/hooks/useIsHydrated.d.mts +0 -4
- package/hooks/useIsHydrated.d.ts +0 -4
- package/hooks/useIsHydrated.js +0 -19
- package/hooks/useIsHydrated.mjs +0 -14
|
@@ -10,7 +10,7 @@ function niceDomain(scaleType, domain, tickNumber) {
|
|
|
10
10
|
* Calculates the initial domain and tick number for a given axis.
|
|
11
11
|
* The domain should still run through the zoom filterMode after this step.
|
|
12
12
|
*/
|
|
13
|
-
|
|
13
|
+
function calculateInitialDomainAndTickNumber(axis, axisDirection, axisIndex, formattedSeries, [minData, maxData], defaultTickNumber) {
|
|
14
14
|
const domainLimit = getAxisDomainLimit(axis, axisDirection, axisIndex, formattedSeries);
|
|
15
15
|
let axisExtrema = getActualAxisExtrema(axis, minData, maxData);
|
|
16
16
|
if (typeof domainLimit === 'function') {
|
|
@@ -65,7 +65,7 @@ function getActualAxisExtrema(axisExtrema, minData, maxData) {
|
|
|
65
65
|
if ('max' in axisExtrema && axisExtrema.max != null && axisExtrema.max < minData) {
|
|
66
66
|
min = axisExtrema.max;
|
|
67
67
|
}
|
|
68
|
-
if ('min' in axisExtrema && axisExtrema.min != null && axisExtrema.min >
|
|
68
|
+
if ('min' in axisExtrema && axisExtrema.min != null && axisExtrema.min > maxData) {
|
|
69
69
|
max = axisExtrema.min;
|
|
70
70
|
}
|
|
71
71
|
if (!('min' in axisExtrema) && !('max' in axisExtrema)) {
|
|
@@ -15,6 +15,7 @@ var _getAxisExtremum = require("./getAxisExtremum");
|
|
|
15
15
|
var _angleConversion = require("../../../angleConversion");
|
|
16
16
|
var _getAxisTriggerTooltip = require("./getAxisTriggerTooltip");
|
|
17
17
|
var _scales = require("../../../scales");
|
|
18
|
+
var _getPercentageValue = require("../../../getPercentageValue");
|
|
18
19
|
var _epsilon = require("../../../../utils/epsilon");
|
|
19
20
|
function getRange(drawingArea, axisDirection, axis) {
|
|
20
21
|
if (axisDirection === 'rotation') {
|
|
@@ -31,8 +32,12 @@ function getRange(drawingArea, axisDirection, axis) {
|
|
|
31
32
|
};
|
|
32
33
|
}
|
|
33
34
|
const availableRadius = Math.min(drawingArea.height, drawingArea.width) / 2;
|
|
35
|
+
const {
|
|
36
|
+
minRadius,
|
|
37
|
+
maxRadius
|
|
38
|
+
} = axis;
|
|
34
39
|
return {
|
|
35
|
-
range: [
|
|
40
|
+
range: [minRadius === undefined ? 0 : (0, _getPercentageValue.getPercentageValue)(minRadius, availableRadius), maxRadius === undefined ? availableRadius : (0, _getPercentageValue.getPercentageValue)(maxRadius, availableRadius)],
|
|
36
41
|
isFullCircle: false
|
|
37
42
|
};
|
|
38
43
|
}
|
|
@@ -8,6 +8,7 @@ import { getAxisExtremum } from "./getAxisExtremum.mjs";
|
|
|
8
8
|
import { deg2rad } from "../../../angleConversion.mjs";
|
|
9
9
|
import { getAxisTriggerTooltip } from "./getAxisTriggerTooltip.mjs";
|
|
10
10
|
import { scaleBand, scalePoint } from "../../../scales/index.mjs";
|
|
11
|
+
import { getPercentageValue } from "../../../getPercentageValue.mjs";
|
|
11
12
|
import { EPSILON } from "../../../../utils/epsilon.mjs";
|
|
12
13
|
function getRange(drawingArea, axisDirection, axis) {
|
|
13
14
|
if (axisDirection === 'rotation') {
|
|
@@ -24,8 +25,12 @@ function getRange(drawingArea, axisDirection, axis) {
|
|
|
24
25
|
};
|
|
25
26
|
}
|
|
26
27
|
const availableRadius = Math.min(drawingArea.height, drawingArea.width) / 2;
|
|
28
|
+
const {
|
|
29
|
+
minRadius,
|
|
30
|
+
maxRadius
|
|
31
|
+
} = axis;
|
|
27
32
|
return {
|
|
28
|
-
range: [
|
|
33
|
+
range: [minRadius === undefined ? 0 : getPercentageValue(minRadius, availableRadius), maxRadius === undefined ? availableRadius : getPercentageValue(maxRadius, availableRadius)],
|
|
29
34
|
isFullCircle: false
|
|
30
35
|
};
|
|
31
36
|
}
|
|
@@ -13,18 +13,19 @@ var _useChartInteraction = require("../useChartInteraction/useChartInteraction.s
|
|
|
13
13
|
var _useChartDimensions = require("../../corePlugins/useChartDimensions/useChartDimensions.selectors");
|
|
14
14
|
var _isCartesian = require("../../../isCartesian");
|
|
15
15
|
var _useChartPolarAxis = require("../useChartPolarAxis/useChartPolarAxis.selectors");
|
|
16
|
+
var _useGeoProjection = require("../useGeoProjection/useGeoProjection.selectors");
|
|
16
17
|
const selectTooltip = state => state.tooltip;
|
|
17
18
|
const selectorChartsTooltipPointerItem = exports.selectorChartsTooltipPointerItem = (0, _store.createSelector)(selectTooltip, tooltip => tooltip?.item ?? null);
|
|
18
19
|
const selectorChartsTooltipPointerItemIsDefined = exports.selectorChartsTooltipPointerItemIsDefined = (0, _store.createSelector)(selectorChartsTooltipPointerItem, item => item !== null);
|
|
19
20
|
const selectorChartsTooltipItem = exports.selectorChartsTooltipItem = (0, _store.createSelector)(_useChartInteraction.selectorChartsLastInteraction, selectorChartsTooltipPointerItem, _useChartKeyboardNavigation.selectorChartsKeyboardItem, (lastInteraction, pointerItem, keyboardItem) => lastInteraction === 'keyboard' ? keyboardItem : pointerItem ?? null);
|
|
20
21
|
const selectorChartsTooltipItemIsDefined = exports.selectorChartsTooltipItemIsDefined = (0, _store.createSelector)(_useChartInteraction.selectorChartsLastInteraction, selectorChartsTooltipPointerItemIsDefined, _useChartKeyboardNavigation.selectorChartsHasFocusedItem, (lastInteraction, pointerItemIsDefined, keyboardItemIsDefined) => lastInteraction === 'keyboard' ? keyboardItemIsDefined : pointerItemIsDefined);
|
|
21
|
-
const selectorChartsTooltipAxisConfig = (0, _store.createSelectorMemoized)(selectorChartsTooltipItem, _useChartCartesianAxisRendering.selectorChartXAxis, _useChartCartesianAxisRendering.selectorChartYAxis, _useChartPolarAxis.selectorChartRotationAxis, _useChartPolarAxis.selectorChartRadiusAxis, _useChartSeries.selectorChartSeriesProcessed, function selectorChartsTooltipAxisConfig(identifier, {
|
|
22
|
+
const selectorChartsTooltipAxisConfig = (0, _store.createSelectorMemoized)(selectorChartsTooltipItem, _useChartCartesianAxisRendering.selectorChartXAxis, _useChartCartesianAxisRendering.selectorChartYAxis, _useChartPolarAxis.selectorChartRotationAxis, _useChartPolarAxis.selectorChartRadiusAxis, _useChartSeries.selectorChartSeriesProcessed, _useGeoProjection.selectorGeoTooltipPosition, function selectorChartsTooltipAxisConfig(identifier, {
|
|
22
23
|
axis: xAxis,
|
|
23
24
|
axisIds: xAxisIds
|
|
24
25
|
}, {
|
|
25
26
|
axis: yAxis,
|
|
26
27
|
axisIds: yAxisIds
|
|
27
|
-
}, rotationAxes, radiusAxes, series) {
|
|
28
|
+
}, rotationAxes, radiusAxes, series, geo) {
|
|
28
29
|
if (!identifier) {
|
|
29
30
|
return {};
|
|
30
31
|
}
|
|
@@ -44,6 +45,9 @@ const selectorChartsTooltipAxisConfig = (0, _store.createSelectorMemoized)(selec
|
|
|
44
45
|
if (yAxisId !== undefined) {
|
|
45
46
|
axesConfig.y = yAxis[yAxisId];
|
|
46
47
|
}
|
|
48
|
+
if (geo) {
|
|
49
|
+
axesConfig.geo = geo;
|
|
50
|
+
}
|
|
47
51
|
return axesConfig;
|
|
48
52
|
});
|
|
49
53
|
const selectorChartsTooltipItemPosition = exports.selectorChartsTooltipItemPosition = (0, _store.createSelectorMemoized)(selectorChartsTooltipItem, _useChartDimensions.selectorChartDrawingArea, _useChartSeriesConfig.selectorChartSeriesConfig, _useChartSeries.selectorChartSeriesProcessed, _useChartSeries.selectorChartSeriesLayout, selectorChartsTooltipAxisConfig, function selectorChartsTooltipItemPosition(identifier, drawingArea, seriesConfig, series, seriesLayout, axesConfig, placement) {
|
|
@@ -7,18 +7,19 @@ import { selectorChartsLastInteraction } from "../useChartInteraction/useChartIn
|
|
|
7
7
|
import { selectorChartDrawingArea } from "../../corePlugins/useChartDimensions/useChartDimensions.selectors.mjs";
|
|
8
8
|
import { isCartesianSeries } from "../../../isCartesian.mjs";
|
|
9
9
|
import { selectorChartRadiusAxis, selectorChartRotationAxis } from "../useChartPolarAxis/useChartPolarAxis.selectors.mjs";
|
|
10
|
+
import { selectorGeoTooltipPosition } from "../useGeoProjection/useGeoProjection.selectors.mjs";
|
|
10
11
|
const selectTooltip = state => state.tooltip;
|
|
11
12
|
export const selectorChartsTooltipPointerItem = createSelector(selectTooltip, tooltip => tooltip?.item ?? null);
|
|
12
13
|
export const selectorChartsTooltipPointerItemIsDefined = createSelector(selectorChartsTooltipPointerItem, item => item !== null);
|
|
13
14
|
export const selectorChartsTooltipItem = createSelector(selectorChartsLastInteraction, selectorChartsTooltipPointerItem, selectorChartsKeyboardItem, (lastInteraction, pointerItem, keyboardItem) => lastInteraction === 'keyboard' ? keyboardItem : pointerItem ?? null);
|
|
14
15
|
export const selectorChartsTooltipItemIsDefined = createSelector(selectorChartsLastInteraction, selectorChartsTooltipPointerItemIsDefined, selectorChartsHasFocusedItem, (lastInteraction, pointerItemIsDefined, keyboardItemIsDefined) => lastInteraction === 'keyboard' ? keyboardItemIsDefined : pointerItemIsDefined);
|
|
15
|
-
const selectorChartsTooltipAxisConfig = createSelectorMemoized(selectorChartsTooltipItem, selectorChartXAxis, selectorChartYAxis, selectorChartRotationAxis, selectorChartRadiusAxis, selectorChartSeriesProcessed, function selectorChartsTooltipAxisConfig(identifier, {
|
|
16
|
+
const selectorChartsTooltipAxisConfig = createSelectorMemoized(selectorChartsTooltipItem, selectorChartXAxis, selectorChartYAxis, selectorChartRotationAxis, selectorChartRadiusAxis, selectorChartSeriesProcessed, selectorGeoTooltipPosition, function selectorChartsTooltipAxisConfig(identifier, {
|
|
16
17
|
axis: xAxis,
|
|
17
18
|
axisIds: xAxisIds
|
|
18
19
|
}, {
|
|
19
20
|
axis: yAxis,
|
|
20
21
|
axisIds: yAxisIds
|
|
21
|
-
}, rotationAxes, radiusAxes, series) {
|
|
22
|
+
}, rotationAxes, radiusAxes, series, geo) {
|
|
22
23
|
if (!identifier) {
|
|
23
24
|
return {};
|
|
24
25
|
}
|
|
@@ -38,6 +39,9 @@ const selectorChartsTooltipAxisConfig = createSelectorMemoized(selectorChartsToo
|
|
|
38
39
|
if (yAxisId !== undefined) {
|
|
39
40
|
axesConfig.y = yAxis[yAxisId];
|
|
40
41
|
}
|
|
42
|
+
if (geo) {
|
|
43
|
+
axesConfig.geo = geo;
|
|
44
|
+
}
|
|
41
45
|
return axesConfig;
|
|
42
46
|
});
|
|
43
47
|
export const selectorChartsTooltipItemPosition = createSelectorMemoized(selectorChartsTooltipItem, selectorChartDrawingArea, selectorChartSeriesConfig, selectorChartSeriesProcessed, selectorChartSeriesLayout, selectorChartsTooltipAxisConfig, function selectorChartsTooltipItemPosition(identifier, drawingArea, seriesConfig, series, seriesLayout, axesConfig, placement) {
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { type ExtendedFeatureCollection, type GeoProjection, type 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;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { type ExtendedFeatureCollection, type GeoProjection, type 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;
|
|
@@ -0,0 +1,124 @@
|
|
|
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
|
+
});
|
|
@@ -0,0 +1,117 @@
|
|
|
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
|
+
});
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { type GeoProjection, type 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
|
+
}>;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { type GeoProjection, type ExtendedFeatureCollection } from '@mui/x-charts-vendor/d3-geo';
|
|
2
|
+
import { type ChartPluginSignature } from "../../models/plugin.js";
|
|
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
|
+
}>;
|