@mui/x-charts-premium 9.3.0 → 9.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (212) hide show
  1. package/BarChartPremium/BarChartPremium.js +35 -5
  2. package/BarChartPremium/BarChartPremium.mjs +35 -5
  3. package/BarChartPremium/RangeBar/RangeBarPlot.d.mts +10 -0
  4. package/BarChartPremium/RangeBar/RangeBarPlot.d.ts +10 -0
  5. package/BarChartPremium/RangeBar/RangeBarPlot.js +59 -2
  6. package/BarChartPremium/RangeBar/RangeBarPlot.mjs +59 -2
  7. package/BarChartPremium/RangeBar/RangeBarWebGLPlot.d.mts +10 -0
  8. package/BarChartPremium/RangeBar/RangeBarWebGLPlot.d.ts +10 -0
  9. package/BarChartPremium/RangeBar/RangeBarWebGLPlot.js +82 -0
  10. package/BarChartPremium/RangeBar/RangeBarWebGLPlot.mjs +76 -0
  11. package/BarChartPremium/RangeBar/seriesConfig/extrema.js +3 -0
  12. package/BarChartPremium/RangeBar/seriesConfig/extrema.mjs +3 -0
  13. package/BarChartPremium/RangeBar/seriesConfig/seriesProcessor.js +2 -2
  14. package/BarChartPremium/RangeBar/seriesConfig/seriesProcessor.mjs +2 -2
  15. package/BarChartPremium/useBarChartPremiumProps.js +2 -1
  16. package/BarChartPremium/useBarChartPremiumProps.mjs +2 -1
  17. package/BarChartPremium/webgl/useBarWebGLPlotData.d.mts +2 -7
  18. package/BarChartPremium/webgl/useBarWebGLPlotData.d.ts +2 -7
  19. package/BarChartPremium/webgl/useBarWebGLPlotData.js +4 -151
  20. package/BarChartPremium/webgl/useBarWebGLPlotData.mjs +4 -150
  21. package/BarChartPremium/webgl/useWebGLBarLikePlotData.d.mts +40 -0
  22. package/BarChartPremium/webgl/useWebGLBarLikePlotData.d.ts +40 -0
  23. package/BarChartPremium/webgl/useWebGLBarLikePlotData.js +228 -0
  24. package/BarChartPremium/webgl/useWebGLBarLikePlotData.mjs +222 -0
  25. package/CHANGELOG.md +296 -0
  26. package/CandlestickChart/CandlestickChart.js +11 -2
  27. package/CandlestickChart/CandlestickChart.mjs +11 -2
  28. package/CandlestickChart/index.d.mts +11 -2
  29. package/CandlestickChart/index.d.ts +11 -2
  30. package/CandlestickChart/index.js +15 -3
  31. package/CandlestickChart/index.mjs +16 -2
  32. package/CandlestickChart/seriesConfig/extrema.js +3 -0
  33. package/CandlestickChart/seriesConfig/extrema.mjs +3 -0
  34. package/CandlestickChart/seriesConfig/seriesProcessor.js +2 -2
  35. package/CandlestickChart/seriesConfig/seriesProcessor.mjs +2 -2
  36. package/ChartsDataProviderPremium/ChartsDataProviderPremium.js +2 -2
  37. package/ChartsDataProviderPremium/ChartsDataProviderPremium.mjs +2 -2
  38. package/ChartsGeoDataProviderPremium/ChartsGeoDataProviderPremium.d.mts +35 -0
  39. package/ChartsGeoDataProviderPremium/ChartsGeoDataProviderPremium.d.ts +35 -0
  40. package/ChartsGeoDataProviderPremium/ChartsGeoDataProviderPremium.js +125 -0
  41. package/ChartsGeoDataProviderPremium/ChartsGeoDataProviderPremium.mjs +119 -0
  42. package/ChartsGeoDataProviderPremium/ChartsGeoDataProviderPremium.plugins.d.mts +5 -0
  43. package/ChartsGeoDataProviderPremium/ChartsGeoDataProviderPremium.plugins.d.ts +5 -0
  44. package/ChartsGeoDataProviderPremium/ChartsGeoDataProviderPremium.plugins.js +10 -0
  45. package/ChartsGeoDataProviderPremium/ChartsGeoDataProviderPremium.plugins.mjs +4 -0
  46. package/ChartsGeoDataProviderPremium/index.d.mts +3 -0
  47. package/ChartsGeoDataProviderPremium/index.d.ts +3 -0
  48. package/ChartsGeoDataProviderPremium/index.js +20 -0
  49. package/ChartsGeoDataProviderPremium/index.mjs +3 -0
  50. package/ChartsGeoDataProviderPremium/useChartsGeoDataProviderPremiumProps.d.mts +10 -0
  51. package/ChartsGeoDataProviderPremium/useChartsGeoDataProviderPremiumProps.d.ts +10 -0
  52. package/ChartsGeoDataProviderPremium/useChartsGeoDataProviderPremiumProps.js +49 -0
  53. package/ChartsGeoDataProviderPremium/useChartsGeoDataProviderPremiumProps.mjs +42 -0
  54. package/ChartsRadialDataProviderPremium/ChartsRadialDataProviderPremium.js +2 -2
  55. package/ChartsRadialDataProviderPremium/ChartsRadialDataProviderPremium.mjs +2 -2
  56. package/HeatmapPremium/HeatmapPremium.js +32 -2
  57. package/HeatmapPremium/HeatmapPremium.mjs +32 -2
  58. package/Map/FocusedMapShape.d.mts +4 -0
  59. package/Map/FocusedMapShape.d.ts +4 -0
  60. package/Map/FocusedMapShape.js +66 -0
  61. package/Map/FocusedMapShape.mjs +60 -0
  62. package/Map/GeoDataPlot.d.mts +26 -0
  63. package/Map/GeoDataPlot.d.ts +26 -0
  64. package/Map/GeoDataPlot.js +65 -0
  65. package/Map/GeoDataPlot.mjs +60 -0
  66. package/Map/Graticule.d.mts +1 -0
  67. package/Map/Graticule.d.ts +1 -0
  68. package/Map/Graticule.js +30 -0
  69. package/Map/Graticule.mjs +24 -0
  70. package/Map/MapShape.d.mts +10 -0
  71. package/Map/MapShape.d.ts +10 -0
  72. package/Map/MapShape.js +55 -0
  73. package/Map/MapShape.mjs +49 -0
  74. package/Map/MapShapePlot.d.mts +21 -0
  75. package/Map/MapShapePlot.d.ts +21 -0
  76. package/Map/MapShapePlot.js +86 -0
  77. package/Map/MapShapePlot.mjs +80 -0
  78. package/Map/index.d.mts +7 -0
  79. package/Map/index.d.ts +7 -0
  80. package/Map/index.js +60 -0
  81. package/Map/index.mjs +8 -0
  82. package/Map/seriesConfig/descriptionGetter.d.mts +3 -0
  83. package/Map/seriesConfig/descriptionGetter.d.ts +3 -0
  84. package/Map/seriesConfig/descriptionGetter.js +19 -0
  85. package/Map/seriesConfig/descriptionGetter.mjs +13 -0
  86. package/Map/seriesConfig/getColor.d.mts +3 -0
  87. package/Map/seriesConfig/getColor.d.ts +3 -0
  88. package/Map/seriesConfig/getColor.js +35 -0
  89. package/Map/seriesConfig/getColor.mjs +29 -0
  90. package/Map/seriesConfig/getSeriesWithDefaultValues.d.mts +3 -0
  91. package/Map/seriesConfig/getSeriesWithDefaultValues.d.ts +3 -0
  92. package/Map/seriesConfig/getSeriesWithDefaultValues.js +15 -0
  93. package/Map/seriesConfig/getSeriesWithDefaultValues.mjs +8 -0
  94. package/Map/seriesConfig/index.d.mts +2 -0
  95. package/Map/seriesConfig/index.d.ts +2 -0
  96. package/Map/seriesConfig/index.js +28 -0
  97. package/Map/seriesConfig/index.mjs +21 -0
  98. package/Map/seriesConfig/keyboardFocusHandler.d.mts +9 -0
  99. package/Map/seriesConfig/keyboardFocusHandler.d.ts +9 -0
  100. package/Map/seriesConfig/keyboardFocusHandler.js +19 -0
  101. package/Map/seriesConfig/keyboardFocusHandler.mjs +13 -0
  102. package/Map/seriesConfig/legend.d.mts +3 -0
  103. package/Map/seriesConfig/legend.d.ts +3 -0
  104. package/Map/seriesConfig/legend.js +28 -0
  105. package/Map/seriesConfig/legend.mjs +22 -0
  106. package/Map/seriesConfig/seriesProcessor.d.mts +3 -0
  107. package/Map/seriesConfig/seriesProcessor.d.ts +3 -0
  108. package/Map/seriesConfig/seriesProcessor.js +66 -0
  109. package/Map/seriesConfig/seriesProcessor.mjs +59 -0
  110. package/Map/seriesConfig/tooltip.d.mts +3 -0
  111. package/Map/seriesConfig/tooltip.d.ts +3 -0
  112. package/Map/seriesConfig/tooltip.js +33 -0
  113. package/Map/seriesConfig/tooltip.mjs +27 -0
  114. package/RadialBarChart/RadialBarChart.d.mts +1 -1
  115. package/RadialBarChart/RadialBarChart.d.ts +1 -1
  116. package/RadialBarChart/RadialBarChart.js +2 -2
  117. package/RadialBarChart/RadialBarChart.mjs +1 -1
  118. package/RadialBarChart/index.d.mts +4 -0
  119. package/RadialBarChart/index.d.ts +4 -0
  120. package/RadialBarChart/index.js +8 -1
  121. package/RadialBarChart/index.mjs +6 -0
  122. package/RadialLineChart/RadialLineChart.d.mts +1 -1
  123. package/RadialLineChart/RadialLineChart.d.ts +1 -1
  124. package/RadialLineChart/RadialLineChart.js +4 -4
  125. package/RadialLineChart/RadialLineChart.mjs +5 -5
  126. package/RadialLineChart/RadialLineHighlightPlot.d.mts +3 -2
  127. package/RadialLineChart/RadialLineHighlightPlot.d.ts +3 -2
  128. package/RadialLineChart/index.d.mts +4 -0
  129. package/RadialLineChart/index.d.ts +4 -0
  130. package/RadialLineChart/index.js +16 -1
  131. package/RadialLineChart/index.mjs +6 -0
  132. package/ScatterChartPremium/ScatterChartPremium.d.mts +2 -1
  133. package/ScatterChartPremium/ScatterChartPremium.d.ts +2 -1
  134. package/ScatterChartPremium/ScatterChartPremium.js +36 -4
  135. package/ScatterChartPremium/ScatterChartPremium.mjs +37 -5
  136. package/ScatterChartPremium/ScatterChartPremium.plugins.d.mts +1 -1
  137. package/ScatterChartPremium/ScatterChartPremium.plugins.d.ts +1 -1
  138. package/ScatterChartPremium/ScatterPlotPremium.d.mts +2 -2
  139. package/ScatterChartPremium/ScatterPlotPremium.d.ts +2 -2
  140. package/hooks/index.d.mts +4 -1
  141. package/hooks/index.d.ts +4 -1
  142. package/hooks/index.js +33 -0
  143. package/hooks/index.mjs +4 -1
  144. package/hooks/useGeoData.d.mts +6 -0
  145. package/hooks/useGeoData.d.ts +6 -0
  146. package/hooks/useGeoData.js +17 -0
  147. package/hooks/useGeoData.mjs +13 -0
  148. package/hooks/useGeoFeatureIndexesByName.d.mts +7 -0
  149. package/hooks/useGeoFeatureIndexesByName.d.ts +7 -0
  150. package/hooks/useGeoFeatureIndexesByName.js +19 -0
  151. package/hooks/useGeoFeatureIndexesByName.mjs +15 -0
  152. package/hooks/useGeoPath.d.mts +6 -0
  153. package/hooks/useGeoPath.d.ts +6 -0
  154. package/hooks/useGeoPath.js +17 -0
  155. package/hooks/useGeoPath.mjs +13 -0
  156. package/hooks/useMapShapeSeries.d.mts +34 -0
  157. package/hooks/useMapShapeSeries.d.ts +34 -0
  158. package/hooks/useMapShapeSeries.js +45 -0
  159. package/hooks/useMapShapeSeries.mjs +40 -0
  160. package/index.d.mts +3 -1
  161. package/index.d.ts +3 -1
  162. package/index.js +32 -1
  163. package/index.mjs +4 -2
  164. package/internals/plugins/allPlugins.d.mts +5 -5
  165. package/internals/plugins/allPlugins.d.ts +5 -5
  166. package/internals/plugins/allPlugins.js +2 -2
  167. package/internals/plugins/allPlugins.mjs +3 -3
  168. package/internals/plugins/useGeoProjection/index.d.mts +3 -0
  169. package/internals/plugins/useGeoProjection/index.d.ts +3 -0
  170. package/internals/plugins/useGeoProjection/index.js +38 -0
  171. package/internals/plugins/useGeoProjection/index.mjs +3 -0
  172. package/internals/plugins/useGeoProjection/useGeoProjection.d.mts +3 -0
  173. package/internals/plugins/useGeoProjection/useGeoProjection.d.ts +3 -0
  174. package/internals/plugins/useGeoProjection/useGeoProjection.js +58 -0
  175. package/internals/plugins/useGeoProjection/useGeoProjection.mjs +50 -0
  176. package/internals/plugins/useGeoProjection/useGeoProjection.selectors.d.mts +39 -0
  177. package/internals/plugins/useGeoProjection/useGeoProjection.selectors.d.ts +39 -0
  178. package/internals/plugins/useGeoProjection/useGeoProjection.selectors.js +135 -0
  179. package/internals/plugins/useGeoProjection/useGeoProjection.selectors.mjs +128 -0
  180. package/internals/plugins/useGeoProjection/useGeoProjection.types.d.mts +55 -0
  181. package/internals/plugins/useGeoProjection/useGeoProjection.types.d.ts +55 -0
  182. package/internals/plugins/useGeoProjection/useGeoProjection.types.js +5 -0
  183. package/internals/plugins/useGeoProjection/useGeoProjection.types.mjs +1 -0
  184. package/models/chartsSlotsComponentsPropsPremium.d.mts +1 -0
  185. package/models/chartsSlotsComponentsPropsPremium.d.ts +1 -0
  186. package/models/chartsSlotsComponentsPropsPremium.js +5 -0
  187. package/models/chartsSlotsComponentsPropsPremium.mjs +1 -0
  188. package/models/index.d.mts +2 -1
  189. package/models/index.d.ts +2 -1
  190. package/models/index.js +11 -0
  191. package/models/index.mjs +2 -1
  192. package/models/seriesType/index.d.mts +2 -1
  193. package/models/seriesType/index.d.ts +2 -1
  194. package/models/seriesType/index.js +11 -0
  195. package/models/seriesType/index.mjs +2 -1
  196. package/models/seriesType/mapShape.d.mts +105 -0
  197. package/models/seriesType/mapShape.d.ts +105 -0
  198. package/models/seriesType/mapShape.js +5 -0
  199. package/models/seriesType/mapShape.mjs +1 -0
  200. package/models/seriesType/ohlc.d.mts +1 -1
  201. package/models/seriesType/ohlc.d.ts +1 -1
  202. package/models/seriesType/radialBar.d.mts +1 -1
  203. package/models/seriesType/radialBar.d.ts +1 -1
  204. package/models/seriesType/radialLine.d.mts +1 -1
  205. package/models/seriesType/radialLine.d.ts +1 -1
  206. package/models/seriesType/rangeBar.d.mts +1 -1
  207. package/models/seriesType/rangeBar.d.ts +1 -1
  208. package/package.json +34 -6
  209. package/typeOverloads/modules.d.mts +16 -1
  210. package/typeOverloads/modules.d.ts +16 -1
  211. package/utils/webgl/useWebGLResizeObserver.js +3 -3
  212. package/utils/webgl/useWebGLResizeObserver.mjs +2 -2
@@ -147,12 +147,21 @@ process.env.NODE_ENV !== "production" ? HeatmapPremium.propTypes = {
147
147
  /**
148
148
  * The list of zoom data related to each axis.
149
149
  * Used to initialize the zoom in a specific configuration without controlling it.
150
+ *
151
+ * Each entry is either explicit zoom percentages (`{ axisId, start, end }`) or a
152
+ * range value (`{ axisId, value }`) resolved against the axis domain.
150
153
  */
151
- initialZoom: PropTypes.arrayOf(PropTypes.shape({
154
+ initialZoom: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.shape({
152
155
  axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
153
156
  end: PropTypes.number.isRequired,
154
157
  start: PropTypes.number.isRequired
155
- })),
158
+ }), PropTypes.shape({
159
+ axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
160
+ value: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.instanceOf(Date).isRequired), PropTypes.arrayOf(PropTypes.string.isRequired), PropTypes.func, PropTypes.shape({
161
+ step: PropTypes.number,
162
+ unit: PropTypes.oneOf(['day', 'hour', 'microsecond', 'millisecond', 'minute', 'month', 'second', 'week', 'year']).isRequired
163
+ })])
164
+ })]).isRequired),
156
165
  /**
157
166
  * If `true`, a loading overlay is displayed.
158
167
  * @default false
@@ -308,6 +317,27 @@ process.env.NODE_ENV !== "production" ? HeatmapPremium.propTypes = {
308
317
  id: PropTypes.string,
309
318
  max: PropTypes.number,
310
319
  min: PropTypes.number,
320
+ sizeMap: PropTypes.oneOfType([PropTypes.shape({
321
+ interpolator: PropTypes.oneOf(['linear', 'log', 'sqrt']),
322
+ max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
323
+ min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
324
+ size: PropTypes.arrayOf(PropTypes.number.isRequired).isRequired,
325
+ type: PropTypes.oneOf(['continuous']).isRequired
326
+ }), PropTypes.shape({
327
+ max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
328
+ min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
329
+ size: PropTypes.func.isRequired,
330
+ type: PropTypes.oneOf(['continuous']).isRequired
331
+ }), PropTypes.shape({
332
+ sizes: PropTypes.arrayOf(PropTypes.number).isRequired,
333
+ thresholds: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]).isRequired).isRequired,
334
+ type: PropTypes.oneOf(['piecewise']).isRequired
335
+ }), PropTypes.shape({
336
+ sizes: PropTypes.arrayOf(PropTypes.number).isRequired,
337
+ type: PropTypes.oneOf(['ordinal']).isRequired,
338
+ unknownSize: PropTypes.number,
339
+ values: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number, PropTypes.string]).isRequired)
340
+ })]),
311
341
  valueGetter: PropTypes.func
312
342
  })),
313
343
  /**
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Renders an outline around the map shape currently focused through keyboard navigation.
3
+ */
4
+ export declare function FocusedMapShape(): import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Renders an outline around the map shape currently focused through keyboard navigation.
3
+ */
4
+ export declare function FocusedMapShape(): import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,66 @@
1
+ "use strict";
2
+ 'use client';
3
+
4
+ var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.FocusedMapShape = FocusedMapShape;
9
+ var React = _interopRequireWildcard(require("react"));
10
+ var _styles = require("@mui/material/styles");
11
+ var _hooks = require("../hooks");
12
+ var _useGeoData = require("../hooks/useGeoData");
13
+ var _useGeoPath = require("../hooks/useGeoPath");
14
+ var _useGeoFeatureIndexesByName = require("../hooks/useGeoFeatureIndexesByName");
15
+ var _useMapShapeSeries = require("../hooks/useMapShapeSeries");
16
+ var _jsxRuntime = require("react/jsx-runtime");
17
+ const FocusedMapShapeRoot = (0, _styles.styled)('path', {
18
+ name: 'MuiMapShape',
19
+ slot: 'Focused'
20
+ })(({
21
+ theme
22
+ }) => ({
23
+ fill: 'none',
24
+ stroke: (theme.vars ?? theme).palette.text.primary,
25
+ strokeWidth: 2,
26
+ pointerEvents: 'none'
27
+ }));
28
+
29
+ /**
30
+ * Renders an outline around the map shape currently focused through keyboard navigation.
31
+ */
32
+ function FocusedMapShape() {
33
+ const focusedItem = (0, _hooks.useFocusedItem)();
34
+ const geoData = (0, _useGeoData.useGeoData)();
35
+ const path = (0, _useGeoPath.useGeoPath)();
36
+ const featureIndexesByName = (0, _useGeoFeatureIndexesByName.useGeoFeatureIndexesByName)();
37
+ const series = (0, _useMapShapeSeries.useMapShapeSeries)();
38
+ if (focusedItem?.type !== 'mapShape' || !geoData || !path) {
39
+ return null;
40
+ }
41
+ const seriesItem = series.find(item => item.id === focusedItem.seriesId);
42
+ if (!seriesItem || seriesItem.hidden) {
43
+ return null;
44
+ }
45
+ const dataItem = seriesItem.data[focusedItem.dataIndex];
46
+ if (!dataItem || dataItem.hidden) {
47
+ return null;
48
+ }
49
+ const featureIndexes = featureIndexesByName.get(dataItem.name);
50
+ if (featureIndexes === undefined || featureIndexes.length === 0) {
51
+ return null;
52
+ }
53
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)("g", {
54
+ "aria-hidden": true,
55
+ children: featureIndexes.map(featureIndex => {
56
+ const feature = geoData.features[featureIndex];
57
+ const d = path(feature);
58
+ if (!d) {
59
+ return null;
60
+ }
61
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(FocusedMapShapeRoot, {
62
+ d: d
63
+ }, featureIndex);
64
+ })
65
+ });
66
+ }
@@ -0,0 +1,60 @@
1
+ 'use client';
2
+
3
+ import * as React from 'react';
4
+ import { styled } from '@mui/material/styles';
5
+ import { useFocusedItem } from "../hooks/index.mjs";
6
+ import { useGeoData } from "../hooks/useGeoData.mjs";
7
+ import { useGeoPath } from "../hooks/useGeoPath.mjs";
8
+ import { useGeoFeatureIndexesByName } from "../hooks/useGeoFeatureIndexesByName.mjs";
9
+ import { useMapShapeSeries } from "../hooks/useMapShapeSeries.mjs";
10
+ import { jsx as _jsx } from "react/jsx-runtime";
11
+ const FocusedMapShapeRoot = styled('path', {
12
+ name: 'MuiMapShape',
13
+ slot: 'Focused'
14
+ })(({
15
+ theme
16
+ }) => ({
17
+ fill: 'none',
18
+ stroke: (theme.vars ?? theme).palette.text.primary,
19
+ strokeWidth: 2,
20
+ pointerEvents: 'none'
21
+ }));
22
+
23
+ /**
24
+ * Renders an outline around the map shape currently focused through keyboard navigation.
25
+ */
26
+ export function FocusedMapShape() {
27
+ const focusedItem = useFocusedItem();
28
+ const geoData = useGeoData();
29
+ const path = useGeoPath();
30
+ const featureIndexesByName = useGeoFeatureIndexesByName();
31
+ const series = useMapShapeSeries();
32
+ if (focusedItem?.type !== 'mapShape' || !geoData || !path) {
33
+ return null;
34
+ }
35
+ const seriesItem = series.find(item => item.id === focusedItem.seriesId);
36
+ if (!seriesItem || seriesItem.hidden) {
37
+ return null;
38
+ }
39
+ const dataItem = seriesItem.data[focusedItem.dataIndex];
40
+ if (!dataItem || dataItem.hidden) {
41
+ return null;
42
+ }
43
+ const featureIndexes = featureIndexesByName.get(dataItem.name);
44
+ if (featureIndexes === undefined || featureIndexes.length === 0) {
45
+ return null;
46
+ }
47
+ return /*#__PURE__*/_jsx("g", {
48
+ "aria-hidden": true,
49
+ children: featureIndexes.map(featureIndex => {
50
+ const feature = geoData.features[featureIndex];
51
+ const d = path(feature);
52
+ if (!d) {
53
+ return null;
54
+ }
55
+ return /*#__PURE__*/_jsx(FocusedMapShapeRoot, {
56
+ d: d
57
+ }, featureIndex);
58
+ })
59
+ });
60
+ }
@@ -0,0 +1,26 @@
1
+ export interface GeoDataPlotProps {
2
+ className?: string;
3
+ /**
4
+ * Fill color applied to every feature path.
5
+ * @default 'currentColor'
6
+ */
7
+ fill?: string;
8
+ /**
9
+ * Stroke color applied to every feature path.
10
+ * @default 'none'
11
+ */
12
+ stroke?: string;
13
+ /**
14
+ * Stroke width applied to every feature path.
15
+ * @default 1
16
+ */
17
+ strokeWidth?: number;
18
+ }
19
+ /**
20
+ * Renders the registered `geoData` as SVG paths, using the registered `projection`
21
+ */
22
+ declare function GeoDataPlot(props: GeoDataPlotProps): import("react/jsx-runtime").JSX.Element | null;
23
+ declare namespace GeoDataPlot {
24
+ var propTypes: any;
25
+ }
26
+ export { GeoDataPlot };
@@ -0,0 +1,26 @@
1
+ export interface GeoDataPlotProps {
2
+ className?: string;
3
+ /**
4
+ * Fill color applied to every feature path.
5
+ * @default 'currentColor'
6
+ */
7
+ fill?: string;
8
+ /**
9
+ * Stroke color applied to every feature path.
10
+ * @default 'none'
11
+ */
12
+ stroke?: string;
13
+ /**
14
+ * Stroke width applied to every feature path.
15
+ * @default 1
16
+ */
17
+ strokeWidth?: number;
18
+ }
19
+ /**
20
+ * Renders the registered `geoData` as SVG paths, using the registered `projection`
21
+ */
22
+ declare function GeoDataPlot(props: GeoDataPlotProps): import("react/jsx-runtime").JSX.Element | null;
23
+ declare namespace GeoDataPlot {
24
+ var propTypes: any;
25
+ }
26
+ export { GeoDataPlot };
@@ -0,0 +1,65 @@
1
+ "use strict";
2
+ 'use client';
3
+
4
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.GeoDataPlot = GeoDataPlot;
9
+ var _propTypes = _interopRequireDefault(require("prop-types"));
10
+ var _useGeoData = require("../hooks/useGeoData");
11
+ var _useGeoPath = require("../hooks/useGeoPath");
12
+ var _jsxRuntime = require("react/jsx-runtime");
13
+ /**
14
+ * Renders the registered `geoData` as SVG paths, using the registered `projection`
15
+ */
16
+ function GeoDataPlot(props) {
17
+ const {
18
+ className,
19
+ fill = 'currentColor',
20
+ stroke = 'none',
21
+ strokeWidth = 1
22
+ } = props;
23
+ const geoData = (0, _useGeoData.useGeoData)();
24
+ const path = (0, _useGeoPath.useGeoPath)();
25
+ if (!geoData || !path) {
26
+ return null;
27
+ }
28
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)("g", {
29
+ className: className,
30
+ children: geoData.features.map((feature, index) => {
31
+ const d = path(feature);
32
+ if (!d) {
33
+ return null;
34
+ }
35
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
36
+ d: d,
37
+ fill: fill,
38
+ stroke: stroke,
39
+ strokeWidth: strokeWidth
40
+ }, feature.id ?? index);
41
+ })
42
+ });
43
+ }
44
+ process.env.NODE_ENV !== "production" ? GeoDataPlot.propTypes = {
45
+ // ----------------------------- Warning --------------------------------
46
+ // | These PropTypes are generated from the TypeScript type definitions |
47
+ // | To update them edit the TypeScript types and run "pnpm proptypes" |
48
+ // ----------------------------------------------------------------------
49
+ className: _propTypes.default.string,
50
+ /**
51
+ * Fill color applied to every feature path.
52
+ * @default 'currentColor'
53
+ */
54
+ fill: _propTypes.default.string,
55
+ /**
56
+ * Stroke color applied to every feature path.
57
+ * @default 'none'
58
+ */
59
+ stroke: _propTypes.default.string,
60
+ /**
61
+ * Stroke width applied to every feature path.
62
+ * @default 1
63
+ */
64
+ strokeWidth: _propTypes.default.number
65
+ } : void 0;
@@ -0,0 +1,60 @@
1
+ 'use client';
2
+
3
+ import PropTypes from 'prop-types';
4
+ import { useGeoData } from "../hooks/useGeoData.mjs";
5
+ import { useGeoPath } from "../hooks/useGeoPath.mjs";
6
+ import { jsx as _jsx } from "react/jsx-runtime";
7
+ /**
8
+ * Renders the registered `geoData` as SVG paths, using the registered `projection`
9
+ */
10
+ function GeoDataPlot(props) {
11
+ const {
12
+ className,
13
+ fill = 'currentColor',
14
+ stroke = 'none',
15
+ strokeWidth = 1
16
+ } = props;
17
+ const geoData = useGeoData();
18
+ const path = useGeoPath();
19
+ if (!geoData || !path) {
20
+ return null;
21
+ }
22
+ return /*#__PURE__*/_jsx("g", {
23
+ className: className,
24
+ children: geoData.features.map((feature, index) => {
25
+ const d = path(feature);
26
+ if (!d) {
27
+ return null;
28
+ }
29
+ return /*#__PURE__*/_jsx("path", {
30
+ d: d,
31
+ fill: fill,
32
+ stroke: stroke,
33
+ strokeWidth: strokeWidth
34
+ }, feature.id ?? index);
35
+ })
36
+ });
37
+ }
38
+ process.env.NODE_ENV !== "production" ? GeoDataPlot.propTypes = {
39
+ // ----------------------------- Warning --------------------------------
40
+ // | These PropTypes are generated from the TypeScript type definitions |
41
+ // | To update them edit the TypeScript types and run "pnpm proptypes" |
42
+ // ----------------------------------------------------------------------
43
+ className: PropTypes.string,
44
+ /**
45
+ * Fill color applied to every feature path.
46
+ * @default 'currentColor'
47
+ */
48
+ fill: PropTypes.string,
49
+ /**
50
+ * Stroke color applied to every feature path.
51
+ * @default 'none'
52
+ */
53
+ stroke: PropTypes.string,
54
+ /**
55
+ * Stroke width applied to every feature path.
56
+ * @default 1
57
+ */
58
+ strokeWidth: PropTypes.number
59
+ } : void 0;
60
+ export { GeoDataPlot };
@@ -0,0 +1 @@
1
+ export declare function Graticule(props: Omit<React.SVGProps<SVGPathElement>, 'd'>): import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1 @@
1
+ export declare function Graticule(props: Omit<React.SVGProps<SVGPathElement>, 'd'>): import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ 'use client';
3
+
4
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.Graticule = Graticule;
9
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
10
+ var _d3Geo = require("@mui/x-charts-vendor/d3-geo");
11
+ var _useGeoData = require("../hooks/useGeoData");
12
+ var _useGeoPath = require("../hooks/useGeoPath");
13
+ var _jsxRuntime = require("react/jsx-runtime");
14
+ function Graticule(props) {
15
+ const geoData = (0, _useGeoData.useGeoData)();
16
+ const path = (0, _useGeoPath.useGeoPath)();
17
+ if (!geoData || !path) {
18
+ return null;
19
+ }
20
+ const d = path((0, _d3Geo.geoGraticule10)());
21
+ if (!d) {
22
+ return null;
23
+ }
24
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)("path", (0, _extends2.default)({
25
+ d: d,
26
+ fill: "none",
27
+ stroke: "black",
28
+ strokeWidth: 0.5
29
+ }, props));
30
+ }
@@ -0,0 +1,24 @@
1
+ 'use client';
2
+
3
+ import _extends from "@babel/runtime/helpers/esm/extends";
4
+ import { geoGraticule10 } from '@mui/x-charts-vendor/d3-geo';
5
+ import { useGeoData } from "../hooks/useGeoData.mjs";
6
+ import { useGeoPath } from "../hooks/useGeoPath.mjs";
7
+ import { jsx as _jsx } from "react/jsx-runtime";
8
+ export function Graticule(props) {
9
+ const geoData = useGeoData();
10
+ const path = useGeoPath();
11
+ if (!geoData || !path) {
12
+ return null;
13
+ }
14
+ const d = path(geoGraticule10());
15
+ if (!d) {
16
+ return null;
17
+ }
18
+ return /*#__PURE__*/_jsx("path", _extends({
19
+ d: d,
20
+ fill: "none",
21
+ stroke: "black",
22
+ strokeWidth: 0.5
23
+ }, props));
24
+ }
@@ -0,0 +1,10 @@
1
+ import * as React from 'react';
2
+ import { type SeriesId } from '@mui/x-charts/internals';
3
+ export type MapShapeProps = Omit<React.SVGProps<SVGPathElement>, 'ref'> & {
4
+ seriesId: SeriesId;
5
+ dataIndex: number;
6
+ d: string;
7
+ color: string;
8
+ };
9
+ declare function MapShape(props: MapShapeProps): import("react/jsx-runtime").JSX.Element;
10
+ export { MapShape };
@@ -0,0 +1,10 @@
1
+ import * as React from 'react';
2
+ import { type SeriesId } from '@mui/x-charts/internals';
3
+ export type MapShapeProps = Omit<React.SVGProps<SVGPathElement>, 'ref'> & {
4
+ seriesId: SeriesId;
5
+ dataIndex: number;
6
+ d: string;
7
+ color: string;
8
+ };
9
+ declare function MapShape(props: MapShapeProps): import("react/jsx-runtime").JSX.Element;
10
+ export { MapShape };
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+ 'use client';
3
+
4
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
5
+ var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
6
+ Object.defineProperty(exports, "__esModule", {
7
+ value: true
8
+ });
9
+ exports.MapShape = MapShape;
10
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
11
+ var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
12
+ var React = _interopRequireWildcard(require("react"));
13
+ var _styles = require("@mui/material/styles");
14
+ var _internals = require("@mui/x-charts/internals");
15
+ var _hooks = require("../hooks");
16
+ var _jsxRuntime = require("react/jsx-runtime");
17
+ const _excluded = ["seriesId", "dataIndex", "d", "color", "onClick"];
18
+ const MapShapeRoot = (0, _styles.styled)('path', {
19
+ name: 'MuiMapShape',
20
+ slot: 'Root'
21
+ })({
22
+ transitionProperty: 'opacity, fill, filter',
23
+ transitionDuration: '50ms',
24
+ transitionTimingFunction: 'ease-in'
25
+ });
26
+ function MapShape(props) {
27
+ const {
28
+ seriesId,
29
+ dataIndex,
30
+ d,
31
+ color,
32
+ onClick
33
+ } = props,
34
+ other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
35
+ const identifier = React.useMemo(() => ({
36
+ type: 'mapShape',
37
+ seriesId,
38
+ dataIndex
39
+ }), [seriesId, dataIndex]);
40
+ const interactionProps = (0, _internals.useInteractionItemProps)(identifier);
41
+ const highlightState = (0, _hooks.useItemHighlightState)(identifier);
42
+ const isHighlighted = highlightState === 'highlighted';
43
+ const isFaded = highlightState === 'faded';
44
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(MapShapeRoot, (0, _extends2.default)({
45
+ d: d,
46
+ fill: color,
47
+ onClick: onClick,
48
+ cursor: onClick ? 'pointer' : 'unset',
49
+ "data-index": dataIndex,
50
+ "data-highlighted": isHighlighted || undefined,
51
+ "data-faded": isFaded || undefined,
52
+ filter: isHighlighted ? 'brightness(120%)' : undefined,
53
+ opacity: isFaded ? 0.3 : 1
54
+ }, other, interactionProps));
55
+ }
@@ -0,0 +1,49 @@
1
+ 'use client';
2
+
3
+ import _extends from "@babel/runtime/helpers/esm/extends";
4
+ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
5
+ const _excluded = ["seriesId", "dataIndex", "d", "color", "onClick"];
6
+ import * as React from 'react';
7
+ import { styled } from '@mui/material/styles';
8
+ import { useInteractionItemProps } from '@mui/x-charts/internals';
9
+ import { useItemHighlightState } from "../hooks/index.mjs";
10
+ import { jsx as _jsx } from "react/jsx-runtime";
11
+ const MapShapeRoot = styled('path', {
12
+ name: 'MuiMapShape',
13
+ slot: 'Root'
14
+ })({
15
+ transitionProperty: 'opacity, fill, filter',
16
+ transitionDuration: '50ms',
17
+ transitionTimingFunction: 'ease-in'
18
+ });
19
+ function MapShape(props) {
20
+ const {
21
+ seriesId,
22
+ dataIndex,
23
+ d,
24
+ color,
25
+ onClick
26
+ } = props,
27
+ other = _objectWithoutPropertiesLoose(props, _excluded);
28
+ const identifier = React.useMemo(() => ({
29
+ type: 'mapShape',
30
+ seriesId,
31
+ dataIndex
32
+ }), [seriesId, dataIndex]);
33
+ const interactionProps = useInteractionItemProps(identifier);
34
+ const highlightState = useItemHighlightState(identifier);
35
+ const isHighlighted = highlightState === 'highlighted';
36
+ const isFaded = highlightState === 'faded';
37
+ return /*#__PURE__*/_jsx(MapShapeRoot, _extends({
38
+ d: d,
39
+ fill: color,
40
+ onClick: onClick,
41
+ cursor: onClick ? 'pointer' : 'unset',
42
+ "data-index": dataIndex,
43
+ "data-highlighted": isHighlighted || undefined,
44
+ "data-faded": isFaded || undefined,
45
+ filter: isHighlighted ? 'brightness(120%)' : undefined,
46
+ opacity: isFaded ? 0.3 : 1
47
+ }, other, interactionProps));
48
+ }
49
+ export { MapShape };
@@ -0,0 +1,21 @@
1
+ export interface MapShapePlotProps {
2
+ className?: string;
3
+ /**
4
+ * Fill color applied to every feature path. Overrides item and series colors.
5
+ */
6
+ fill?: string;
7
+ /**
8
+ * Stroke color applied to every feature path.
9
+ * @default 'none'
10
+ */
11
+ stroke?: string;
12
+ /**
13
+ * Stroke width applied to every feature path.
14
+ * @default 1
15
+ */
16
+ strokeWidth?: number;
17
+ }
18
+ /**
19
+ * Renders series mapShape items.
20
+ */
21
+ export declare function MapShapePlot(props: MapShapePlotProps): import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,21 @@
1
+ export interface MapShapePlotProps {
2
+ className?: string;
3
+ /**
4
+ * Fill color applied to every feature path. Overrides item and series colors.
5
+ */
6
+ fill?: string;
7
+ /**
8
+ * Stroke color applied to every feature path.
9
+ * @default 'none'
10
+ */
11
+ stroke?: string;
12
+ /**
13
+ * Stroke width applied to every feature path.
14
+ * @default 1
15
+ */
16
+ strokeWidth?: number;
17
+ }
18
+ /**
19
+ * Renders series mapShape items.
20
+ */
21
+ export declare function MapShapePlot(props: MapShapePlotProps): import("react/jsx-runtime").JSX.Element | null;