@mui/x-charts-premium 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/BarChartPremium/BarChartPremium.d.mts +1 -1
- package/BarChartPremium/BarChartPremium.d.ts +1 -1
- package/BarChartPremium/BarChartPremium.js +14 -3
- package/BarChartPremium/BarChartPremium.mjs +14 -3
- package/BarChartPremium/RangeBar/AnimatedRangeBarElement.d.mts +2 -1
- package/BarChartPremium/RangeBar/AnimatedRangeBarElement.d.ts +2 -1
- package/BarChartPremium/RangeBar/FocusedRangeBar.d.mts +1 -1
- package/BarChartPremium/RangeBar/FocusedRangeBar.d.ts +1 -1
- package/BarChartPremium/RangeBar/seriesConfig/index.js +2 -2
- package/BarChartPremium/RangeBar/seriesConfig/index.mjs +2 -2
- package/BarChartPremium/RangeBar/seriesConfig/tooltipPosition.d.mts +2 -3
- package/BarChartPremium/RangeBar/seriesConfig/tooltipPosition.d.ts +2 -3
- package/BarChartPremium/RangeBar/seriesConfig/tooltipPosition.js +12 -15
- package/BarChartPremium/RangeBar/seriesConfig/tooltipPosition.mjs +11 -14
- package/BarChartPremium/webgl/BarWebGLProgram.d.mts +4 -5
- package/BarChartPremium/webgl/BarWebGLProgram.d.ts +4 -5
- package/BarChartPremium/webgl/BarWebGLProgram.js +24 -65
- package/BarChartPremium/webgl/BarWebGLProgram.mjs +24 -65
- package/BarChartPremium/webgl/shaders.d.mts +1 -1
- package/BarChartPremium/webgl/shaders.d.ts +1 -1
- package/BarChartPremium/webgl/shaders.js +2 -15
- package/BarChartPremium/webgl/shaders.mjs +3 -15
- package/CHANGELOG.md +249 -1
- package/CandlestickChart/CandlestickPlot.d.mts +2 -1
- package/CandlestickChart/CandlestickPlot.d.ts +2 -1
- package/CandlestickChart/seriesConfig/OHLCTooltipContent.d.mts +2 -1
- package/CandlestickChart/seriesConfig/OHLCTooltipContent.d.ts +2 -1
- package/CandlestickChart/seriesConfig/index.js +2 -2
- package/CandlestickChart/seriesConfig/index.mjs +2 -2
- package/CandlestickChart/seriesConfig/tooltipPosition.d.mts +2 -3
- package/CandlestickChart/seriesConfig/tooltipPosition.d.ts +2 -3
- package/CandlestickChart/seriesConfig/tooltipPosition.js +10 -14
- package/CandlestickChart/seriesConfig/tooltipPosition.mjs +10 -14
- package/ChartsDataProviderPremium/ChartsDataProviderPremium.d.mts +1 -1
- package/ChartsDataProviderPremium/ChartsDataProviderPremium.d.ts +1 -1
- package/ChartsDataProviderPremium/ChartsDataProviderPremium.js +2 -2
- package/ChartsDataProviderPremium/ChartsDataProviderPremium.mjs +2 -2
- package/ChartsGeoDataProviderPremium/ChartsGeoDataProviderPremium.d.mts +1 -1
- package/ChartsGeoDataProviderPremium/ChartsGeoDataProviderPremium.d.ts +1 -1
- package/ChartsGeoDataProviderPremium/ChartsGeoDataProviderPremium.js +2 -2
- package/ChartsGeoDataProviderPremium/ChartsGeoDataProviderPremium.mjs +2 -2
- package/ChartsGeoDataProviderPremium/ChartsGeoDataProviderPremium.plugins.d.mts +4 -3
- package/ChartsGeoDataProviderPremium/ChartsGeoDataProviderPremium.plugins.d.ts +4 -3
- package/ChartsGeoDataProviderPremium/ChartsGeoDataProviderPremium.plugins.js +2 -1
- package/ChartsGeoDataProviderPremium/ChartsGeoDataProviderPremium.plugins.mjs +2 -1
- package/ChartsGeoDataProviderPremium/index.d.mts +2 -1
- package/ChartsGeoDataProviderPremium/index.d.ts +2 -1
- package/ChartsRadialDataProviderPremium/ChartsRadialDataProviderPremium.d.mts +2 -1
- package/ChartsRadialDataProviderPremium/ChartsRadialDataProviderPremium.d.ts +2 -1
- package/ChartsRadialDataProviderPremium/ChartsRadialDataProviderPremium.js +2 -2
- package/ChartsRadialDataProviderPremium/ChartsRadialDataProviderPremium.mjs +2 -2
- package/ChartsRenderer/components/PaletteOption.d.mts +1 -1
- package/ChartsRenderer/components/PaletteOption.d.ts +1 -1
- package/ChartsZoomSlider/internals/previews/CandlestickPreviewPlot.d.mts +2 -1
- package/ChartsZoomSlider/internals/previews/CandlestickPreviewPlot.d.ts +2 -1
- package/ChartsZoomSlider/internals/previews/RangeBarPreviewPlot.d.mts +1 -1
- package/ChartsZoomSlider/internals/previews/RangeBarPreviewPlot.d.ts +1 -1
- package/HeatmapPremium/HeatmapPlotPremium.d.mts +1 -1
- package/HeatmapPremium/HeatmapPlotPremium.d.ts +1 -1
- package/HeatmapPremium/webgl/HeatmapWebGLProgram.js +12 -37
- package/HeatmapPremium/webgl/HeatmapWebGLProgram.mjs +12 -37
- package/HeatmapPremium/webgl/shaders.d.mts +3 -3
- package/HeatmapPremium/webgl/shaders.d.ts +3 -3
- package/HeatmapPremium/webgl/shaders.js +12 -15
- package/HeatmapPremium/webgl/shaders.mjs +13 -15
- package/HeatmapPremium/webgl/useHeatmapPlotData.js +3 -8
- package/HeatmapPremium/webgl/useHeatmapPlotData.mjs +3 -8
- package/Map/FocusedMapShape.d.mts +2 -1
- package/Map/FocusedMapShape.d.ts +2 -1
- package/Map/FocusedMapShape.js +5 -1
- package/Map/FocusedMapShape.mjs +5 -1
- package/Map/GeoDataPlot.d.mts +1 -1
- package/Map/GeoDataPlot.d.ts +1 -1
- package/Map/Graticule.d.mts +1 -1
- package/Map/Graticule.d.ts +1 -1
- package/Map/MapImagePlot.d.mts +39 -0
- package/Map/MapImagePlot.d.ts +39 -0
- package/Map/MapImagePlot.js +138 -0
- package/Map/MapImagePlot.mjs +132 -0
- package/Map/MapShape.d.mts +2 -2
- package/Map/MapShape.d.ts +2 -2
- package/Map/MapShape.js +6 -6
- package/Map/MapShape.mjs +6 -6
- package/Map/MapShapePlot.d.mts +9 -1
- package/Map/MapShapePlot.d.ts +9 -1
- package/Map/MapShapePlot.js +17 -5
- package/Map/MapShapePlot.mjs +17 -5
- package/Map/index.d.mts +2 -3
- package/Map/index.d.ts +2 -3
- package/Map/index.js +11 -0
- package/Map/index.mjs +1 -0
- package/Map/reprojectEquirectangularImage.d.mts +60 -0
- package/Map/reprojectEquirectangularImage.d.ts +60 -0
- package/Map/reprojectEquirectangularImage.js +116 -0
- package/Map/reprojectEquirectangularImage.mjs +110 -0
- package/Map/seriesConfig/descriptionGetter.js +5 -1
- package/Map/seriesConfig/descriptionGetter.mjs +5 -1
- package/Map/seriesConfig/getColor.js +18 -6
- package/Map/seriesConfig/getColor.mjs +18 -6
- package/Map/seriesConfig/highlight.d.mts +10 -0
- package/Map/seriesConfig/highlight.d.ts +10 -0
- package/Map/seriesConfig/highlight.js +52 -0
- package/Map/seriesConfig/highlight.mjs +45 -0
- package/Map/seriesConfig/identifierCleaner.d.mts +3 -0
- package/Map/seriesConfig/identifierCleaner.d.ts +3 -0
- package/Map/seriesConfig/identifierCleaner.js +14 -0
- package/Map/seriesConfig/identifierCleaner.mjs +8 -0
- package/Map/seriesConfig/identifierSerializer.d.mts +3 -0
- package/Map/seriesConfig/identifierSerializer.d.ts +3 -0
- package/Map/seriesConfig/identifierSerializer.js +12 -0
- package/Map/seriesConfig/identifierSerializer.mjs +6 -0
- package/Map/seriesConfig/index.js +8 -6
- package/Map/seriesConfig/index.mjs +7 -5
- package/Map/seriesConfig/keyboardFocusHandler.d.mts +0 -6
- package/Map/seriesConfig/keyboardFocusHandler.d.ts +0 -6
- package/Map/seriesConfig/keyboardFocusHandler.js +40 -7
- package/Map/seriesConfig/keyboardFocusHandler.mjs +41 -8
- package/Map/seriesConfig/seriesProcessor.js +11 -2
- package/Map/seriesConfig/seriesProcessor.mjs +11 -2
- package/Map/seriesConfig/tooltip.js +8 -4
- package/Map/seriesConfig/tooltip.mjs +8 -4
- package/Map/seriesConfig/tooltipPosition.d.mts +8 -3
- package/Map/seriesConfig/tooltipPosition.d.ts +8 -3
- package/Map/seriesConfig/tooltipPosition.js +15 -27
- package/Map/seriesConfig/tooltipPosition.mjs +16 -27
- package/RadialBarChart/RadialBarElement.d.mts +1 -1
- package/RadialBarChart/RadialBarElement.d.ts +1 -1
- package/RadialBarChart/seriesConfig/index.js +2 -2
- package/RadialBarChart/seriesConfig/index.mjs +2 -2
- package/RadialBarChart/seriesConfig/tooltipPosition.d.mts +2 -3
- package/RadialBarChart/seriesConfig/tooltipPosition.d.ts +2 -3
- package/RadialBarChart/seriesConfig/tooltipPosition.js +4 -6
- package/RadialBarChart/seriesConfig/tooltipPosition.mjs +2 -5
- package/RadialLineChart/RadialArea.d.mts +2 -1
- package/RadialLineChart/RadialArea.d.ts +2 -1
- package/RadialLineChart/RadialAreaPlot.d.mts +1 -1
- package/RadialLineChart/RadialAreaPlot.d.ts +1 -1
- package/RadialLineChart/RadialLine.d.mts +1 -1
- package/RadialLineChart/RadialLine.d.ts +1 -1
- package/RadialLineChart/RadialLineHighlightElement.d.mts +1 -1
- package/RadialLineChart/RadialLineHighlightElement.d.ts +1 -1
- package/RadialLineChart/RadialLineHighlightPlot.d.mts +1 -1
- package/RadialLineChart/RadialLineHighlightPlot.d.ts +1 -1
- package/RadialLineChart/RadialLinePlot.d.mts +1 -1
- package/RadialLineChart/RadialLinePlot.d.ts +1 -1
- package/RadialLineChart/RadialMarkPlot.d.mts +1 -1
- package/RadialLineChart/RadialMarkPlot.d.ts +1 -1
- package/RadialLineChart/seriesConfig/index.js +2 -2
- package/RadialLineChart/seriesConfig/index.mjs +2 -2
- package/RadialLineChart/seriesConfig/tooltipPosition.d.mts +2 -3
- package/RadialLineChart/seriesConfig/tooltipPosition.d.ts +2 -3
- package/RadialLineChart/seriesConfig/tooltipPosition.js +4 -6
- package/RadialLineChart/seriesConfig/tooltipPosition.mjs +2 -5
- package/ScatterChartPremium/ScatterPlotPremium.d.mts +2 -1
- package/ScatterChartPremium/ScatterPlotPremium.d.ts +2 -1
- package/ScatterChartPremium/webgl/ScatterWebGLPlot.d.mts +2 -1
- package/ScatterChartPremium/webgl/ScatterWebGLPlot.d.ts +2 -1
- package/ScatterChartPremium/webgl/ScatterWebGLProgram.d.mts +0 -2
- package/ScatterChartPremium/webgl/ScatterWebGLProgram.d.ts +0 -2
- package/ScatterChartPremium/webgl/ScatterWebGLProgram.js +23 -81
- package/ScatterChartPremium/webgl/ScatterWebGLProgram.mjs +23 -81
- package/index.js +1 -1
- package/index.mjs +1 -1
- package/internals/createGetVisibleCoordinate.d.mts +14 -0
- package/internals/createGetVisibleCoordinate.d.ts +14 -0
- package/internals/createGetVisibleCoordinate.js +66 -0
- package/internals/createGetVisibleCoordinate.mjs +60 -0
- package/internals/plugins/useGeoProjection/factories.d.mts +3 -0
- package/internals/plugins/useGeoProjection/factories.d.ts +3 -0
- package/internals/plugins/useGeoProjection/factories.js +29 -0
- package/internals/plugins/useGeoProjection/factories.mjs +23 -0
- package/internals/plugins/useGeoProjection/projection.utils.d.mts +17 -0
- package/internals/plugins/useGeoProjection/projection.utils.d.ts +17 -0
- package/internals/plugins/useGeoProjection/projection.utils.js +67 -0
- package/internals/plugins/useGeoProjection/projection.utils.mjs +59 -0
- package/internals/plugins/useGeoProjection/useGeoProjection.js +7 -40
- package/internals/plugins/useGeoProjection/useGeoProjection.mjs +7 -40
- package/internals/plugins/useGeoProjection/useGeoProjection.selectors.d.mts +47 -11
- package/internals/plugins/useGeoProjection/useGeoProjection.selectors.d.ts +47 -11
- package/internals/plugins/useGeoProjection/useGeoProjection.selectors.js +118 -8
- package/internals/plugins/useGeoProjection/useGeoProjection.selectors.mjs +117 -8
- package/internals/plugins/useGeoProjection/useGeoProjection.types.d.mts +63 -2
- package/internals/plugins/useGeoProjection/useGeoProjection.types.d.ts +63 -2
- package/internals/plugins/useGeoProjectionZoom/gestureHooks/usePanOnDrag.d.mts +11 -0
- package/internals/plugins/useGeoProjectionZoom/gestureHooks/usePanOnDrag.d.ts +11 -0
- package/internals/plugins/useGeoProjectionZoom/gestureHooks/usePanOnDrag.js +65 -0
- package/internals/plugins/useGeoProjectionZoom/gestureHooks/usePanOnDrag.mjs +58 -0
- package/internals/plugins/useGeoProjectionZoom/gestureHooks/useZoomOnPinch.d.mts +13 -0
- package/internals/plugins/useGeoProjectionZoom/gestureHooks/useZoomOnPinch.d.ts +13 -0
- package/internals/plugins/useGeoProjectionZoom/gestureHooks/useZoomOnPinch.js +62 -0
- package/internals/plugins/useGeoProjectionZoom/gestureHooks/useZoomOnPinch.mjs +56 -0
- package/internals/plugins/useGeoProjectionZoom/gestureHooks/useZoomOnWheel.d.mts +13 -0
- package/internals/plugins/useGeoProjectionZoom/gestureHooks/useZoomOnWheel.d.ts +13 -0
- package/internals/plugins/useGeoProjectionZoom/gestureHooks/useZoomOnWheel.js +64 -0
- package/internals/plugins/useGeoProjectionZoom/gestureHooks/useZoomOnWheel.mjs +58 -0
- package/internals/plugins/useGeoProjectionZoom/index.d.mts +2 -0
- package/internals/plugins/useGeoProjectionZoom/index.d.ts +2 -0
- package/internals/plugins/useGeoProjectionZoom/index.js +12 -0
- package/internals/plugins/useGeoProjectionZoom/index.mjs +1 -0
- package/internals/plugins/useGeoProjectionZoom/mapZoom.utils.d.mts +31 -0
- package/internals/plugins/useGeoProjectionZoom/mapZoom.utils.d.ts +31 -0
- package/internals/plugins/useGeoProjectionZoom/mapZoom.utils.js +187 -0
- package/internals/plugins/useGeoProjectionZoom/mapZoom.utils.mjs +177 -0
- package/internals/plugins/useGeoProjectionZoom/rotationMath.d.mts +23 -0
- package/internals/plugins/useGeoProjectionZoom/rotationMath.d.ts +23 -0
- package/internals/plugins/useGeoProjectionZoom/rotationMath.js +190 -0
- package/internals/plugins/useGeoProjectionZoom/rotationMath.mjs +182 -0
- package/internals/plugins/useGeoProjectionZoom/useGeoProjectionZoom.d.mts +3 -0
- package/internals/plugins/useGeoProjectionZoom/useGeoProjectionZoom.d.ts +3 -0
- package/internals/plugins/useGeoProjectionZoom/useGeoProjectionZoom.js +174 -0
- package/internals/plugins/useGeoProjectionZoom/useGeoProjectionZoom.mjs +166 -0
- package/internals/plugins/useGeoProjectionZoom/useGeoProjectionZoom.types.d.mts +152 -0
- package/internals/plugins/useGeoProjectionZoom/useGeoProjectionZoom.types.d.ts +152 -0
- package/internals/plugins/useGeoProjectionZoom/useGeoProjectionZoom.types.js +5 -0
- package/internals/plugins/useGeoProjectionZoom/useGeoProjectionZoom.types.mjs +1 -0
- package/models/seriesType/mapShape.d.mts +2 -1
- package/models/seriesType/mapShape.d.ts +2 -1
- package/package.json +6 -6
- package/utils/webgl/glsl.d.mts +15 -0
- package/utils/webgl/glsl.d.ts +15 -0
- package/utils/webgl/glsl.js +34 -0
- package/utils/webgl/glsl.mjs +28 -0
- package/utils/webgl/instancedAttribute.d.mts +28 -0
- package/utils/webgl/instancedAttribute.d.ts +28 -0
- package/utils/webgl/instancedAttribute.js +57 -0
- package/utils/webgl/instancedAttribute.mjs +50 -0
- package/utils/webgl/utils.d.mts +21 -2
- package/utils/webgl/utils.d.ts +21 -2
- package/utils/webgl/utils.js +44 -8
- package/utils/webgl/utils.mjs +41 -7
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.PROJECTION_FACTORIES = void 0;
|
|
7
|
+
var _d3Geo = require("@mui/x-charts-vendor/d3-geo");
|
|
8
|
+
const PROJECTION_FACTORIES = exports.PROJECTION_FACTORIES = {
|
|
9
|
+
// Azimuthal projections (https://d3js.org/d3-geo/azimuthal)
|
|
10
|
+
azimuthalEqualArea: _d3Geo.geoAzimuthalEqualArea,
|
|
11
|
+
azimuthalEquidistant: _d3Geo.geoAzimuthalEquidistant,
|
|
12
|
+
gnomonic: _d3Geo.geoGnomonic,
|
|
13
|
+
orthographic: _d3Geo.geoOrthographic,
|
|
14
|
+
stereographic: _d3Geo.geoStereographic,
|
|
15
|
+
// Conic projections (https://d3js.org/d3-geo/conic)
|
|
16
|
+
conicConformal: _d3Geo.geoConicConformal,
|
|
17
|
+
conicEqualArea: _d3Geo.geoConicEqualArea,
|
|
18
|
+
conicEquidistant: _d3Geo.geoConicEquidistant,
|
|
19
|
+
albers: _d3Geo.geoAlbers,
|
|
20
|
+
albersUsa: _d3Geo.geoAlbersUsa,
|
|
21
|
+
// Special composition for the USA with an edge case for Alaska and Hawaii.
|
|
22
|
+
|
|
23
|
+
// Cylindrical projections (https://d3js.org/d3-geo/cylindrical)
|
|
24
|
+
equirectangular: _d3Geo.geoEquirectangular,
|
|
25
|
+
mercator: _d3Geo.geoMercator,
|
|
26
|
+
transverseMercator: _d3Geo.geoTransverseMercator,
|
|
27
|
+
equalEarth: _d3Geo.geoEqualEarth,
|
|
28
|
+
naturalEarth1: _d3Geo.geoNaturalEarth1
|
|
29
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { geoAlbers, geoAlbersUsa, geoAzimuthalEqualArea, geoAzimuthalEquidistant, geoConicConformal, geoConicEqualArea, geoConicEquidistant, geoEqualEarth, geoEquirectangular, geoGnomonic, geoMercator, geoNaturalEarth1, geoOrthographic, geoStereographic, geoTransverseMercator } from '@mui/x-charts-vendor/d3-geo';
|
|
2
|
+
export const PROJECTION_FACTORIES = {
|
|
3
|
+
// Azimuthal projections (https://d3js.org/d3-geo/azimuthal)
|
|
4
|
+
azimuthalEqualArea: geoAzimuthalEqualArea,
|
|
5
|
+
azimuthalEquidistant: geoAzimuthalEquidistant,
|
|
6
|
+
gnomonic: geoGnomonic,
|
|
7
|
+
orthographic: geoOrthographic,
|
|
8
|
+
stereographic: geoStereographic,
|
|
9
|
+
// Conic projections (https://d3js.org/d3-geo/conic)
|
|
10
|
+
conicConformal: geoConicConformal,
|
|
11
|
+
conicEqualArea: geoConicEqualArea,
|
|
12
|
+
conicEquidistant: geoConicEquidistant,
|
|
13
|
+
albers: geoAlbers,
|
|
14
|
+
albersUsa: geoAlbersUsa,
|
|
15
|
+
// Special composition for the USA with an edge case for Alaska and Hawaii.
|
|
16
|
+
|
|
17
|
+
// Cylindrical projections (https://d3js.org/d3-geo/cylindrical)
|
|
18
|
+
equirectangular: geoEquirectangular,
|
|
19
|
+
mercator: geoMercator,
|
|
20
|
+
transverseMercator: geoTransverseMercator,
|
|
21
|
+
equalEarth: geoEqualEarth,
|
|
22
|
+
naturalEarth1: geoNaturalEarth1
|
|
23
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ExtendedFeatureCollection, GeoProjection } from '@mui/x-charts-vendor/d3-geo';
|
|
2
|
+
import type { GeoProjectionInput } from "./useGeoProjection.types.mjs";
|
|
3
|
+
export declare function getParallels(parallels: [number, number] | null | undefined): [number, number];
|
|
4
|
+
/**
|
|
5
|
+
* Builds a *fresh* `GeoProjection` instance from the raw projection input.
|
|
6
|
+
*
|
|
7
|
+
* This is intentionally not a memoized selector: callers mutate the returned projection (to fit,
|
|
8
|
+
* scale, translate, rotate it). Returning a shared instance would mean mutations leak between
|
|
9
|
+
* consumers and, worse, that a recomputed view keeps the same object reference — so store
|
|
10
|
+
* subscribers comparing with `Object.is` would not detect the change and the map would render one
|
|
11
|
+
* update behind.
|
|
12
|
+
*/
|
|
13
|
+
export declare function resolveProjectionInstance(projectionInput: GeoProjectionInput | null, parallels: [number, number]): GeoProjection | null;
|
|
14
|
+
/**
|
|
15
|
+
* Helper function to compute the translation needed to fit the map in the drawing area at zoomLevel=1
|
|
16
|
+
*/
|
|
17
|
+
export declare function getDefaultTranslation(projectionInput: GeoProjectionInput | null | undefined, geoData: ExtendedFeatureCollection | null | undefined, parallels: [number, number] | null | undefined, center: [number, number]): [number, number] | null;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ExtendedFeatureCollection, GeoProjection } from '@mui/x-charts-vendor/d3-geo';
|
|
2
|
+
import type { GeoProjectionInput } from "./useGeoProjection.types.js";
|
|
3
|
+
export declare function getParallels(parallels: [number, number] | null | undefined): [number, number];
|
|
4
|
+
/**
|
|
5
|
+
* Builds a *fresh* `GeoProjection` instance from the raw projection input.
|
|
6
|
+
*
|
|
7
|
+
* This is intentionally not a memoized selector: callers mutate the returned projection (to fit,
|
|
8
|
+
* scale, translate, rotate it). Returning a shared instance would mean mutations leak between
|
|
9
|
+
* consumers and, worse, that a recomputed view keeps the same object reference — so store
|
|
10
|
+
* subscribers comparing with `Object.is` would not detect the change and the map would render one
|
|
11
|
+
* update behind.
|
|
12
|
+
*/
|
|
13
|
+
export declare function resolveProjectionInstance(projectionInput: GeoProjectionInput | null, parallels: [number, number]): GeoProjection | null;
|
|
14
|
+
/**
|
|
15
|
+
* Helper function to compute the translation needed to fit the map in the drawing area at zoomLevel=1
|
|
16
|
+
*/
|
|
17
|
+
export declare function getDefaultTranslation(projectionInput: GeoProjectionInput | null | undefined, geoData: ExtendedFeatureCollection | null | undefined, parallels: [number, number] | null | undefined, center: [number, number]): [number, number] | null;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getDefaultTranslation = getDefaultTranslation;
|
|
7
|
+
exports.getParallels = getParallels;
|
|
8
|
+
exports.resolveProjectionInstance = resolveProjectionInstance;
|
|
9
|
+
var _d3Geo = require("@mui/x-charts-vendor/d3-geo");
|
|
10
|
+
var _factories = require("./factories");
|
|
11
|
+
const isConicProjection = projection => {
|
|
12
|
+
return 'parallels' in projection && typeof projection.parallels === 'function';
|
|
13
|
+
};
|
|
14
|
+
const DEFAULT_PARALLELS = [30, 30];
|
|
15
|
+
function getParallels(parallels) {
|
|
16
|
+
return parallels ?? DEFAULT_PARALLELS;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Builds a *fresh* `GeoProjection` instance from the raw projection input.
|
|
21
|
+
*
|
|
22
|
+
* This is intentionally not a memoized selector: callers mutate the returned projection (to fit,
|
|
23
|
+
* scale, translate, rotate it). Returning a shared instance would mean mutations leak between
|
|
24
|
+
* consumers and, worse, that a recomputed view keeps the same object reference — so store
|
|
25
|
+
* subscribers comparing with `Object.is` would not detect the change and the map would render one
|
|
26
|
+
* update behind.
|
|
27
|
+
*/
|
|
28
|
+
function resolveProjectionInstance(projectionInput, parallels) {
|
|
29
|
+
if (projectionInput === null) {
|
|
30
|
+
return null;
|
|
31
|
+
}
|
|
32
|
+
if (typeof projectionInput !== 'string') {
|
|
33
|
+
return projectionInput;
|
|
34
|
+
}
|
|
35
|
+
const factory = _factories.PROJECTION_FACTORIES?.[projectionInput];
|
|
36
|
+
if (!factory) {
|
|
37
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
38
|
+
console.error(`MUI X Charts: Unknown projection name '${projectionInput}'. ` + `Expected one of: ${Object.keys(_factories.PROJECTION_FACTORIES ?? {}).join(', ')}.`);
|
|
39
|
+
}
|
|
40
|
+
return null;
|
|
41
|
+
}
|
|
42
|
+
const projection = factory();
|
|
43
|
+
if (isConicProjection(projection)) {
|
|
44
|
+
projection.parallels(parallels);
|
|
45
|
+
}
|
|
46
|
+
return projection;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Helper function to compute the translation needed to fit the map in the drawing area at zoomLevel=1
|
|
51
|
+
*/
|
|
52
|
+
function getDefaultTranslation(projectionInput, geoData, parallels, center) {
|
|
53
|
+
if (!projectionInput || !geoData) {
|
|
54
|
+
return null;
|
|
55
|
+
}
|
|
56
|
+
const projection = resolveProjectionInstance(projectionInput, getParallels(parallels));
|
|
57
|
+
if (!projection) {
|
|
58
|
+
return null;
|
|
59
|
+
}
|
|
60
|
+
projection.rotate([-center[0], -center[1]]);
|
|
61
|
+
const [[ux0, uy0], [ux1, uy1]] = (0, _d3Geo.geoPath)(projection).bounds(geoData);
|
|
62
|
+
const centerPoint = projection(center);
|
|
63
|
+
if (!centerPoint) {
|
|
64
|
+
return null;
|
|
65
|
+
}
|
|
66
|
+
return [(centerPoint[0] - (ux0 + ux1) / 2) / (ux1 - ux0), (centerPoint[1] - (uy0 + uy1) / 2) / (uy1 - uy0)];
|
|
67
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { geoPath } from '@mui/x-charts-vendor/d3-geo';
|
|
2
|
+
import { PROJECTION_FACTORIES } from "./factories.mjs";
|
|
3
|
+
const isConicProjection = projection => {
|
|
4
|
+
return 'parallels' in projection && typeof projection.parallels === 'function';
|
|
5
|
+
};
|
|
6
|
+
const DEFAULT_PARALLELS = [30, 30];
|
|
7
|
+
export function getParallels(parallels) {
|
|
8
|
+
return parallels ?? DEFAULT_PARALLELS;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Builds a *fresh* `GeoProjection` instance from the raw projection input.
|
|
13
|
+
*
|
|
14
|
+
* This is intentionally not a memoized selector: callers mutate the returned projection (to fit,
|
|
15
|
+
* scale, translate, rotate it). Returning a shared instance would mean mutations leak between
|
|
16
|
+
* consumers and, worse, that a recomputed view keeps the same object reference — so store
|
|
17
|
+
* subscribers comparing with `Object.is` would not detect the change and the map would render one
|
|
18
|
+
* update behind.
|
|
19
|
+
*/
|
|
20
|
+
export function resolveProjectionInstance(projectionInput, parallels) {
|
|
21
|
+
if (projectionInput === null) {
|
|
22
|
+
return null;
|
|
23
|
+
}
|
|
24
|
+
if (typeof projectionInput !== 'string') {
|
|
25
|
+
return projectionInput;
|
|
26
|
+
}
|
|
27
|
+
const factory = PROJECTION_FACTORIES?.[projectionInput];
|
|
28
|
+
if (!factory) {
|
|
29
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
30
|
+
console.error(`MUI X Charts: Unknown projection name '${projectionInput}'. ` + `Expected one of: ${Object.keys(PROJECTION_FACTORIES ?? {}).join(', ')}.`);
|
|
31
|
+
}
|
|
32
|
+
return null;
|
|
33
|
+
}
|
|
34
|
+
const projection = factory();
|
|
35
|
+
if (isConicProjection(projection)) {
|
|
36
|
+
projection.parallels(parallels);
|
|
37
|
+
}
|
|
38
|
+
return projection;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Helper function to compute the translation needed to fit the map in the drawing area at zoomLevel=1
|
|
43
|
+
*/
|
|
44
|
+
export function getDefaultTranslation(projectionInput, geoData, parallels, center) {
|
|
45
|
+
if (!projectionInput || !geoData) {
|
|
46
|
+
return null;
|
|
47
|
+
}
|
|
48
|
+
const projection = resolveProjectionInstance(projectionInput, getParallels(parallels));
|
|
49
|
+
if (!projection) {
|
|
50
|
+
return null;
|
|
51
|
+
}
|
|
52
|
+
projection.rotate([-center[0], -center[1]]);
|
|
53
|
+
const [[ux0, uy0], [ux1, uy1]] = geoPath(projection).bounds(geoData);
|
|
54
|
+
const centerPoint = projection(center);
|
|
55
|
+
if (!centerPoint) {
|
|
56
|
+
return null;
|
|
57
|
+
}
|
|
58
|
+
return [(centerPoint[0] - (ux0 + ux1) / 2) / (ux1 - ux0), (centerPoint[1] - (uy0 + uy1) / 2) / (uy1 - uy0)];
|
|
59
|
+
}
|
|
@@ -9,29 +9,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
9
9
|
exports.useGeoProjection = void 0;
|
|
10
10
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
11
|
var React = _interopRequireWildcard(require("react"));
|
|
12
|
-
var _d3Geo = require("@mui/x-charts-vendor/d3-geo");
|
|
13
|
-
const PROJECTION_FACTORIES = {
|
|
14
|
-
// Azimuthal projections (https://d3js.org/d3-geo/azimuthal)
|
|
15
|
-
azimuthalEqualArea: _d3Geo.geoAzimuthalEqualArea,
|
|
16
|
-
azimuthalEquidistant: _d3Geo.geoAzimuthalEquidistant,
|
|
17
|
-
gnomonic: _d3Geo.geoGnomonic,
|
|
18
|
-
orthographic: _d3Geo.geoOrthographic,
|
|
19
|
-
stereographic: _d3Geo.geoStereographic,
|
|
20
|
-
// Conic projections (https://d3js.org/d3-geo/conic)
|
|
21
|
-
conicConformal: _d3Geo.geoConicConformal,
|
|
22
|
-
conicEqualArea: _d3Geo.geoConicEqualArea,
|
|
23
|
-
conicEquidistant: _d3Geo.geoConicEquidistant,
|
|
24
|
-
albers: _d3Geo.geoAlbers,
|
|
25
|
-
albersUsa: _d3Geo.geoAlbersUsa,
|
|
26
|
-
// Special composition for the USA with an edge case for Alaska and Hawaii.
|
|
27
|
-
|
|
28
|
-
// Cylindrical projections (https://d3js.org/d3-geo/cylindrical)
|
|
29
|
-
equirectangular: _d3Geo.geoEquirectangular,
|
|
30
|
-
mercator: _d3Geo.geoMercator,
|
|
31
|
-
transverseMercator: _d3Geo.geoTransverseMercator,
|
|
32
|
-
equalEarth: _d3Geo.geoEqualEarth,
|
|
33
|
-
naturalEarth1: _d3Geo.geoNaturalEarth1
|
|
34
|
-
};
|
|
35
12
|
const useGeoProjection = ({
|
|
36
13
|
params,
|
|
37
14
|
store
|
|
@@ -40,9 +17,7 @@ const useGeoProjection = ({
|
|
|
40
17
|
geoData,
|
|
41
18
|
geoFeatureKey,
|
|
42
19
|
projection,
|
|
43
|
-
|
|
44
|
-
rotate,
|
|
45
|
-
scale
|
|
20
|
+
parallels
|
|
46
21
|
} = params;
|
|
47
22
|
const isFirstRender = React.useRef(true);
|
|
48
23
|
React.useEffect(() => {
|
|
@@ -50,16 +25,13 @@ const useGeoProjection = ({
|
|
|
50
25
|
isFirstRender.current = false;
|
|
51
26
|
return;
|
|
52
27
|
}
|
|
53
|
-
store.set('geoProjection', {
|
|
28
|
+
store.set('geoProjection', (0, _extends2.default)({}, store.state.geoProjection, {
|
|
54
29
|
geoData: geoData ?? null,
|
|
55
30
|
geoFeatureKey: geoFeatureKey ?? 'name',
|
|
56
31
|
projection: projection ?? null,
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
factories: PROJECTION_FACTORIES
|
|
61
|
-
});
|
|
62
|
-
}, [geoData, geoFeatureKey, projection, translate, rotate, scale, store]);
|
|
32
|
+
parallels: parallels ?? null
|
|
33
|
+
}));
|
|
34
|
+
}, [geoData, geoFeatureKey, projection, parallels, store]);
|
|
63
35
|
return {};
|
|
64
36
|
};
|
|
65
37
|
exports.useGeoProjection = useGeoProjection;
|
|
@@ -67,9 +39,7 @@ useGeoProjection.params = {
|
|
|
67
39
|
geoData: true,
|
|
68
40
|
geoFeatureKey: true,
|
|
69
41
|
projection: true,
|
|
70
|
-
|
|
71
|
-
rotate: true,
|
|
72
|
-
scale: true
|
|
42
|
+
parallels: true
|
|
73
43
|
};
|
|
74
44
|
useGeoProjection.getDefaultizedParams = ({
|
|
75
45
|
params
|
|
@@ -79,9 +49,6 @@ useGeoProjection.getInitialState = params => ({
|
|
|
79
49
|
geoData: params.geoData ?? null,
|
|
80
50
|
geoFeatureKey: params.geoFeatureKey ?? 'name',
|
|
81
51
|
projection: params.projection ?? null,
|
|
82
|
-
|
|
83
|
-
rotate: params.rotate ?? null,
|
|
84
|
-
scale: params.scale ?? null,
|
|
85
|
-
factories: PROJECTION_FACTORIES
|
|
52
|
+
parallels: params.parallels ?? null
|
|
86
53
|
}
|
|
87
54
|
});
|
|
@@ -2,29 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
4
|
import * as React from 'react';
|
|
5
|
-
import { geoAlbers, geoAlbersUsa, geoAzimuthalEqualArea, geoAzimuthalEquidistant, geoConicConformal, geoConicEqualArea, geoConicEquidistant, geoEqualEarth, geoEquirectangular, geoGnomonic, geoMercator, geoNaturalEarth1, geoOrthographic, geoStereographic, geoTransverseMercator } from '@mui/x-charts-vendor/d3-geo';
|
|
6
|
-
const PROJECTION_FACTORIES = {
|
|
7
|
-
// Azimuthal projections (https://d3js.org/d3-geo/azimuthal)
|
|
8
|
-
azimuthalEqualArea: geoAzimuthalEqualArea,
|
|
9
|
-
azimuthalEquidistant: geoAzimuthalEquidistant,
|
|
10
|
-
gnomonic: geoGnomonic,
|
|
11
|
-
orthographic: geoOrthographic,
|
|
12
|
-
stereographic: geoStereographic,
|
|
13
|
-
// Conic projections (https://d3js.org/d3-geo/conic)
|
|
14
|
-
conicConformal: geoConicConformal,
|
|
15
|
-
conicEqualArea: geoConicEqualArea,
|
|
16
|
-
conicEquidistant: geoConicEquidistant,
|
|
17
|
-
albers: geoAlbers,
|
|
18
|
-
albersUsa: geoAlbersUsa,
|
|
19
|
-
// Special composition for the USA with an edge case for Alaska and Hawaii.
|
|
20
|
-
|
|
21
|
-
// Cylindrical projections (https://d3js.org/d3-geo/cylindrical)
|
|
22
|
-
equirectangular: geoEquirectangular,
|
|
23
|
-
mercator: geoMercator,
|
|
24
|
-
transverseMercator: geoTransverseMercator,
|
|
25
|
-
equalEarth: geoEqualEarth,
|
|
26
|
-
naturalEarth1: geoNaturalEarth1
|
|
27
|
-
};
|
|
28
5
|
export const useGeoProjection = ({
|
|
29
6
|
params,
|
|
30
7
|
store
|
|
@@ -33,9 +10,7 @@ export const useGeoProjection = ({
|
|
|
33
10
|
geoData,
|
|
34
11
|
geoFeatureKey,
|
|
35
12
|
projection,
|
|
36
|
-
|
|
37
|
-
rotate,
|
|
38
|
-
scale
|
|
13
|
+
parallels
|
|
39
14
|
} = params;
|
|
40
15
|
const isFirstRender = React.useRef(true);
|
|
41
16
|
React.useEffect(() => {
|
|
@@ -43,25 +18,20 @@ export const useGeoProjection = ({
|
|
|
43
18
|
isFirstRender.current = false;
|
|
44
19
|
return;
|
|
45
20
|
}
|
|
46
|
-
store.set('geoProjection', {
|
|
21
|
+
store.set('geoProjection', _extends({}, store.state.geoProjection, {
|
|
47
22
|
geoData: geoData ?? null,
|
|
48
23
|
geoFeatureKey: geoFeatureKey ?? 'name',
|
|
49
24
|
projection: projection ?? null,
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
factories: PROJECTION_FACTORIES
|
|
54
|
-
});
|
|
55
|
-
}, [geoData, geoFeatureKey, projection, translate, rotate, scale, store]);
|
|
25
|
+
parallels: parallels ?? null
|
|
26
|
+
}));
|
|
27
|
+
}, [geoData, geoFeatureKey, projection, parallels, store]);
|
|
56
28
|
return {};
|
|
57
29
|
};
|
|
58
30
|
useGeoProjection.params = {
|
|
59
31
|
geoData: true,
|
|
60
32
|
geoFeatureKey: true,
|
|
61
33
|
projection: true,
|
|
62
|
-
|
|
63
|
-
rotate: true,
|
|
64
|
-
scale: true
|
|
34
|
+
parallels: true
|
|
65
35
|
};
|
|
66
36
|
useGeoProjection.getDefaultizedParams = ({
|
|
67
37
|
params
|
|
@@ -71,9 +41,6 @@ useGeoProjection.getInitialState = params => ({
|
|
|
71
41
|
geoData: params.geoData ?? null,
|
|
72
42
|
geoFeatureKey: params.geoFeatureKey ?? 'name',
|
|
73
43
|
projection: params.projection ?? null,
|
|
74
|
-
|
|
75
|
-
rotate: params.rotate ?? null,
|
|
76
|
-
scale: params.scale ?? null,
|
|
77
|
-
factories: PROJECTION_FACTORIES
|
|
44
|
+
parallels: params.parallels ?? null
|
|
78
45
|
}
|
|
79
46
|
});
|
|
@@ -1,17 +1,53 @@
|
|
|
1
|
-
|
|
1
|
+
import type { ExtendedFeatureCollection, GeoProjection, GeoPath } from '@mui/x-charts-vendor/d3-geo';
|
|
2
|
+
import type { ChartState } from '@mui/x-charts/internals';
|
|
3
|
+
import type { GeoProjectionInput, GeoTooltipPosition, UseGeoProjectionSignature, UseGeoProjectionState } from "./useGeoProjection.types.mjs";
|
|
4
|
+
import type { UseGeoProjectionZoomState } from "../useGeoProjectionZoom/useGeoProjectionZoom.types.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("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeriesConfig/useChartSeriesConfig.types").UseChartSeriesConfigState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types").UseChartExperimentalFeaturesState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.types").UseChartAnimationState & import("@mui/x-charts/internals").UseChartInteractionListenerState & Partial<UseGeoProjectionState> & {
|
|
2
8
|
cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
|
|
3
|
-
}) =>
|
|
4
|
-
export declare const
|
|
5
|
-
|
|
6
|
-
|
|
9
|
+
}) => string | ((feature: ExtendedFeatureCollection["features"][number]) => string | null);
|
|
10
|
+
export declare const selectorChartRawProjection: (args_0: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeriesConfig/useChartSeriesConfig.types").UseChartSeriesConfigState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types").UseChartExperimentalFeaturesState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.types").UseChartAnimationState & import("@mui/x-charts/internals").UseChartInteractionListenerState & Partial<UseGeoProjectionState> & {
|
|
11
|
+
cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
|
|
12
|
+
}) => GeoProjectionInput | null;
|
|
13
|
+
export declare const selectorChartZoomLevel: (args_0: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeriesConfig/useChartSeriesConfig.types").UseChartSeriesConfigState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types").UseChartExperimentalFeaturesState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.types").UseChartAnimationState & import("@mui/x-charts/internals").UseChartInteractionListenerState & Partial<UseGeoProjectionZoomState> & {
|
|
7
14
|
cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
|
|
8
|
-
}) =>
|
|
9
|
-
|
|
15
|
+
}) => number;
|
|
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 declare const selectorChartGeoFeatureIndexesByName: (args_0: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeriesConfig/useChartSeriesConfig.types").UseChartSeriesConfigState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types").UseChartExperimentalFeaturesState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.types").UseChartAnimationState & import("@mui/x-charts/internals").UseChartInteractionListenerState & Partial<UseGeoProjectionState> & {
|
|
24
|
+
cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
|
|
25
|
+
}) => ReadonlyMap<string, number[]>;
|
|
26
|
+
export declare const selectorFitScale: (args_0: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeriesConfig/useChartSeriesConfig.types").UseChartSeriesConfigState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types").UseChartExperimentalFeaturesState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.types").UseChartAnimationState & import("@mui/x-charts/internals").UseChartInteractionListenerState & Partial<UseGeoProjectionState> & {
|
|
10
27
|
cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
|
|
11
28
|
}) => number | null;
|
|
12
|
-
|
|
29
|
+
/**
|
|
30
|
+
* Resolves the raw `projection` input into a ready-to-use `GeoProjection` instance,
|
|
31
|
+
* fitted to the chart's drawing area then zoomed/panned according to the current view.
|
|
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
|
+
* - The projection is first fitted to the data (the `zoomLevel === 1` baseline), then its
|
|
36
|
+
* scale is multiplied by `zoomLevel` and its translation is offset so `center` lands at the
|
|
37
|
+
* center of the drawing area. Keeping the view as `{ zoomLevel, center }` means the absolute
|
|
38
|
+
* scale/translation are derived here, never stored — so they stay correct across resizes.
|
|
39
|
+
* - Returns `null` when no projection is registered or the name is unknown.
|
|
40
|
+
*/
|
|
41
|
+
export declare const selectorChartProjection: (args_0: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeriesConfig/useChartSeriesConfig.types").UseChartSeriesConfigState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types").UseChartExperimentalFeaturesState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.types").UseChartAnimationState & import("@mui/x-charts/internals").UseChartInteractionListenerState & Partial<UseGeoProjectionState> & {
|
|
42
|
+
cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
|
|
43
|
+
}) => GeoProjection | null;
|
|
44
|
+
/**
|
|
45
|
+
* Resolves the raw `projection` input into a ready-to-use `GeoPath` instance
|
|
46
|
+
* fitted to the chart's drawing area.
|
|
47
|
+
*/
|
|
48
|
+
export declare const selectorChartGeoPath: (args_0: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeriesConfig/useChartSeriesConfig.types").UseChartSeriesConfigState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types").UseChartExperimentalFeaturesState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.types").UseChartAnimationState & import("@mui/x-charts/internals").UseChartInteractionListenerState & Partial<UseGeoProjectionState> & {
|
|
13
49
|
cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
|
|
14
|
-
}) => import("@mui/x-charts-vendor/d3-geo").
|
|
15
|
-
export declare const
|
|
50
|
+
}) => GeoPath<any, import("@mui/x-charts-vendor/d3-geo").GeoPermissibleObjects> | null;
|
|
51
|
+
export declare const selectorGeoTooltipPosition: (args_0: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeriesConfig/useChartSeriesConfig.types").UseChartSeriesConfigState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types").UseChartExperimentalFeaturesState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.types").UseChartAnimationState & import("@mui/x-charts/internals").UseChartInteractionListenerState & Partial<UseGeoProjectionState> & {
|
|
16
52
|
cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
|
|
17
|
-
}) =>
|
|
53
|
+
}) => GeoTooltipPosition;
|
|
@@ -1,17 +1,53 @@
|
|
|
1
|
-
|
|
1
|
+
import type { ExtendedFeatureCollection, GeoProjection, GeoPath } from '@mui/x-charts-vendor/d3-geo';
|
|
2
|
+
import type { ChartState } from '@mui/x-charts/internals';
|
|
3
|
+
import type { GeoProjectionInput, GeoTooltipPosition, UseGeoProjectionSignature, UseGeoProjectionState } from "./useGeoProjection.types.js";
|
|
4
|
+
import type { UseGeoProjectionZoomState } from "../useGeoProjectionZoom/useGeoProjectionZoom.types.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("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeriesConfig/useChartSeriesConfig.types").UseChartSeriesConfigState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types").UseChartExperimentalFeaturesState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.types").UseChartAnimationState & import("@mui/x-charts/internals").UseChartInteractionListenerState & Partial<UseGeoProjectionState> & {
|
|
2
8
|
cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
|
|
3
|
-
}) =>
|
|
4
|
-
export declare const
|
|
5
|
-
|
|
6
|
-
|
|
9
|
+
}) => string | ((feature: ExtendedFeatureCollection["features"][number]) => string | null);
|
|
10
|
+
export declare const selectorChartRawProjection: (args_0: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeriesConfig/useChartSeriesConfig.types").UseChartSeriesConfigState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types").UseChartExperimentalFeaturesState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.types").UseChartAnimationState & import("@mui/x-charts/internals").UseChartInteractionListenerState & Partial<UseGeoProjectionState> & {
|
|
11
|
+
cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
|
|
12
|
+
}) => GeoProjectionInput | null;
|
|
13
|
+
export declare const selectorChartZoomLevel: (args_0: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeriesConfig/useChartSeriesConfig.types").UseChartSeriesConfigState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types").UseChartExperimentalFeaturesState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.types").UseChartAnimationState & import("@mui/x-charts/internals").UseChartInteractionListenerState & Partial<UseGeoProjectionZoomState> & {
|
|
7
14
|
cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
|
|
8
|
-
}) =>
|
|
9
|
-
|
|
15
|
+
}) => number;
|
|
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 declare const selectorChartGeoFeatureIndexesByName: (args_0: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeriesConfig/useChartSeriesConfig.types").UseChartSeriesConfigState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types").UseChartExperimentalFeaturesState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.types").UseChartAnimationState & import("@mui/x-charts/internals").UseChartInteractionListenerState & Partial<UseGeoProjectionState> & {
|
|
24
|
+
cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
|
|
25
|
+
}) => ReadonlyMap<string, number[]>;
|
|
26
|
+
export declare const selectorFitScale: (args_0: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeriesConfig/useChartSeriesConfig.types").UseChartSeriesConfigState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types").UseChartExperimentalFeaturesState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.types").UseChartAnimationState & import("@mui/x-charts/internals").UseChartInteractionListenerState & Partial<UseGeoProjectionState> & {
|
|
10
27
|
cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
|
|
11
28
|
}) => number | null;
|
|
12
|
-
|
|
29
|
+
/**
|
|
30
|
+
* Resolves the raw `projection` input into a ready-to-use `GeoProjection` instance,
|
|
31
|
+
* fitted to the chart's drawing area then zoomed/panned according to the current view.
|
|
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
|
+
* - The projection is first fitted to the data (the `zoomLevel === 1` baseline), then its
|
|
36
|
+
* scale is multiplied by `zoomLevel` and its translation is offset so `center` lands at the
|
|
37
|
+
* center of the drawing area. Keeping the view as `{ zoomLevel, center }` means the absolute
|
|
38
|
+
* scale/translation are derived here, never stored — so they stay correct across resizes.
|
|
39
|
+
* - Returns `null` when no projection is registered or the name is unknown.
|
|
40
|
+
*/
|
|
41
|
+
export declare const selectorChartProjection: (args_0: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeriesConfig/useChartSeriesConfig.types").UseChartSeriesConfigState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types").UseChartExperimentalFeaturesState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.types").UseChartAnimationState & import("@mui/x-charts/internals").UseChartInteractionListenerState & Partial<UseGeoProjectionState> & {
|
|
42
|
+
cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
|
|
43
|
+
}) => GeoProjection | null;
|
|
44
|
+
/**
|
|
45
|
+
* Resolves the raw `projection` input into a ready-to-use `GeoPath` instance
|
|
46
|
+
* fitted to the chart's drawing area.
|
|
47
|
+
*/
|
|
48
|
+
export declare const selectorChartGeoPath: (args_0: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeriesConfig/useChartSeriesConfig.types").UseChartSeriesConfigState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types").UseChartExperimentalFeaturesState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.types").UseChartAnimationState & import("@mui/x-charts/internals").UseChartInteractionListenerState & Partial<UseGeoProjectionState> & {
|
|
13
49
|
cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
|
|
14
|
-
}) => import("@mui/x-charts-vendor/d3-geo").
|
|
15
|
-
export declare const
|
|
50
|
+
}) => GeoPath<any, import("@mui/x-charts-vendor/d3-geo").GeoPermissibleObjects> | null;
|
|
51
|
+
export declare const selectorGeoTooltipPosition: (args_0: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeriesConfig/useChartSeriesConfig.types").UseChartSeriesConfigState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types").UseChartExperimentalFeaturesState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.types").UseChartAnimationState & import("@mui/x-charts/internals").UseChartInteractionListenerState & Partial<UseGeoProjectionState> & {
|
|
16
52
|
cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
|
|
17
|
-
}) =>
|
|
53
|
+
}) => GeoTooltipPosition;
|