@mui/x-charts-premium 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.
Files changed (98) hide show
  1. package/BarChartPremium/BarChartPremium.js +5 -3
  2. package/BarChartPremium/BarChartPremium.mjs +5 -3
  3. package/BarChartPremium/BarPlotPremium.js +1 -1
  4. package/BarChartPremium/BarPlotPremium.mjs +1 -1
  5. package/BarChartPremium/RangeBar/RangeBarPlot.js +2 -2
  6. package/BarChartPremium/RangeBar/RangeBarPlot.mjs +2 -2
  7. package/BarChartPremium/RangeBar/seriesConfig/getColor.js +2 -5
  8. package/BarChartPremium/RangeBar/seriesConfig/getColor.mjs +2 -5
  9. package/CHANGELOG.md +151 -0
  10. package/CandlestickChart/CandlestickChart.js +1 -1
  11. package/CandlestickChart/CandlestickChart.mjs +1 -1
  12. package/CandlestickChart/seriesConfig/getColor.js +2 -5
  13. package/CandlestickChart/seriesConfig/getColor.mjs +2 -5
  14. package/ChartsDataProviderPremium/ChartsDataProviderPremium.js +7 -3
  15. package/ChartsDataProviderPremium/ChartsDataProviderPremium.mjs +7 -3
  16. package/ChartsGeoDataProviderPremium/ChartsGeoDataProviderPremium.js +11 -3
  17. package/ChartsGeoDataProviderPremium/ChartsGeoDataProviderPremium.mjs +11 -3
  18. package/ChartsGeoDataProviderPremium/ChartsGeoDataProviderPremium.plugins.d.mts +1 -1
  19. package/ChartsGeoDataProviderPremium/ChartsGeoDataProviderPremium.plugins.d.ts +1 -1
  20. package/ChartsRadialDataProviderPremium/ChartsRadialDataProviderPremium.js +11 -3
  21. package/ChartsRadialDataProviderPremium/ChartsRadialDataProviderPremium.mjs +11 -3
  22. package/ChartsRenderer/ChartsRenderer.js +1 -1
  23. package/ChartsRenderer/ChartsRenderer.mjs +1 -1
  24. package/HeatmapPremium/HeatmapPremium.js +5 -3
  25. package/HeatmapPremium/HeatmapPremium.mjs +5 -3
  26. package/Map/GeoDataPlot.js +1 -1
  27. package/Map/GeoDataPlot.mjs +1 -1
  28. package/Map/MapShape.d.mts +3 -0
  29. package/Map/MapShape.d.ts +3 -0
  30. package/Map/MapShape.js +10 -1
  31. package/Map/MapShape.mjs +9 -0
  32. package/Map/MapShapePlot.d.mts +5 -1
  33. package/Map/MapShapePlot.d.ts +5 -1
  34. package/Map/MapShapePlot.js +27 -3
  35. package/Map/MapShapePlot.mjs +28 -4
  36. package/Map/index.d.mts +3 -1
  37. package/Map/index.d.ts +3 -1
  38. package/Map/seriesConfig/getColor.js +4 -9
  39. package/Map/seriesConfig/getColor.mjs +4 -9
  40. package/Map/seriesConfig/index.js +2 -0
  41. package/Map/seriesConfig/index.mjs +2 -0
  42. package/Map/seriesConfig/tooltip.js +5 -1
  43. package/Map/seriesConfig/tooltip.mjs +5 -1
  44. package/Map/seriesConfig/tooltipPosition.d.mts +3 -0
  45. package/Map/seriesConfig/tooltipPosition.d.ts +3 -0
  46. package/Map/seriesConfig/tooltipPosition.js +64 -0
  47. package/Map/seriesConfig/tooltipPosition.mjs +58 -0
  48. package/RadialBarChart/RadialBarChart.js +1 -1
  49. package/RadialBarChart/RadialBarChart.mjs +1 -1
  50. package/RadialBarChart/RadialBarPlot.js +1 -1
  51. package/RadialBarChart/RadialBarPlot.mjs +1 -1
  52. package/RadialLineChart/RadialAreaPlot.d.mts +5 -1
  53. package/RadialLineChart/RadialAreaPlot.d.ts +5 -1
  54. package/RadialLineChart/RadialAreaPlot.js +10 -1
  55. package/RadialLineChart/RadialAreaPlot.mjs +11 -2
  56. package/RadialLineChart/RadialLineChart.js +1 -1
  57. package/RadialLineChart/RadialLineChart.mjs +1 -1
  58. package/RadialLineChart/RadialLineHighlightElement.d.mts +3 -0
  59. package/RadialLineChart/RadialLineHighlightElement.d.ts +3 -0
  60. package/RadialLineChart/RadialLineHighlightElement.js +10 -1
  61. package/RadialLineChart/RadialLineHighlightElement.mjs +9 -0
  62. package/RadialLineChart/RadialLineHighlightPlot.d.mts +3 -0
  63. package/RadialLineChart/RadialLineHighlightPlot.d.ts +3 -0
  64. package/RadialLineChart/RadialLineHighlightPlot.js +18 -1
  65. package/RadialLineChart/RadialLineHighlightPlot.mjs +17 -0
  66. package/RadialLineChart/RadialLinePlot.d.mts +5 -1
  67. package/RadialLineChart/RadialLinePlot.d.ts +5 -1
  68. package/RadialLineChart/RadialLinePlot.js +10 -1
  69. package/RadialLineChart/RadialLinePlot.mjs +11 -2
  70. package/RadialLineChart/RadialMarkPlot.d.mts +5 -1
  71. package/RadialLineChart/RadialMarkPlot.d.ts +5 -1
  72. package/RadialLineChart/RadialMarkPlot.js +10 -1
  73. package/RadialLineChart/RadialMarkPlot.mjs +11 -2
  74. package/ScatterChartPremium/ScatterChartPremium.js +5 -3
  75. package/ScatterChartPremium/ScatterChartPremium.mjs +5 -3
  76. package/ScatterChartPremium/ScatterPlotPremium.d.mts +19 -3
  77. package/ScatterChartPremium/ScatterPlotPremium.d.ts +19 -3
  78. package/ScatterChartPremium/ScatterPlotPremium.js +34 -1
  79. package/ScatterChartPremium/ScatterPlotPremium.mjs +36 -2
  80. package/ScatterChartPremium/index.d.mts +1 -1
  81. package/ScatterChartPremium/index.d.ts +1 -1
  82. package/context/ChartPremiumApi.d.mts +4 -1
  83. package/context/ChartPremiumApi.d.ts +4 -1
  84. package/hooks/useGeoData.js +1 -1
  85. package/hooks/useGeoData.mjs +2 -2
  86. package/index.js +1 -1
  87. package/index.mjs +1 -1
  88. package/internals/plugins/useGeoProjection/useGeoProjection.d.mts +1 -1
  89. package/internals/plugins/useGeoProjection/useGeoProjection.d.ts +1 -1
  90. package/internals/plugins/useGeoProjection/useGeoProjection.js +32 -3
  91. package/internals/plugins/useGeoProjection/useGeoProjection.mjs +32 -3
  92. package/internals/plugins/useGeoProjection/useGeoProjection.selectors.d.mts +12 -34
  93. package/internals/plugins/useGeoProjection/useGeoProjection.selectors.d.ts +12 -34
  94. package/internals/plugins/useGeoProjection/useGeoProjection.selectors.js +8 -129
  95. package/internals/plugins/useGeoProjection/useGeoProjection.selectors.mjs +8 -128
  96. package/internals/plugins/useGeoProjection/useGeoProjection.types.d.mts +2 -55
  97. package/internals/plugins/useGeoProjection/useGeoProjection.types.d.ts +2 -55
  98. package/package.json +9 -6
@@ -63,7 +63,7 @@ const HeatmapPremium = /*#__PURE__*/React.forwardRef(function HeatmapPremium(inP
63
63
  }));
64
64
  });
65
65
  if (process.env.NODE_ENV !== "production") HeatmapPremium.displayName = "HeatmapPremium";
66
- process.env.NODE_ENV !== "production" ? HeatmapPremium.propTypes = {
66
+ process.env.NODE_ENV !== "production" ? HeatmapPremium.propTypes /* remove-proptypes */ = {
67
67
  // ----------------------------- Warning --------------------------------
68
68
  // | These PropTypes are generated from the TypeScript type definitions |
69
69
  // | To update them edit the TypeScript types and run "pnpm proptypes" |
@@ -301,11 +301,13 @@ process.env.NODE_ENV !== "production" ? HeatmapPremium.propTypes = {
301
301
  color: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.string.isRequired), PropTypes.func]).isRequired,
302
302
  max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
303
303
  min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
304
- type: PropTypes.oneOf(['continuous']).isRequired
304
+ type: PropTypes.oneOf(['continuous']).isRequired,
305
+ unknownColor: PropTypes.string
305
306
  }), PropTypes.shape({
306
307
  colors: PropTypes.arrayOf(PropTypes.string).isRequired,
307
308
  thresholds: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]).isRequired).isRequired,
308
- type: PropTypes.oneOf(['piecewise']).isRequired
309
+ type: PropTypes.oneOf(['piecewise']).isRequired,
310
+ unknownColor: PropTypes.string
309
311
  }), PropTypes.shape({
310
312
  colors: PropTypes.arrayOf(PropTypes.string).isRequired,
311
313
  type: PropTypes.oneOf(['ordinal']).isRequired,
@@ -41,7 +41,7 @@ function GeoDataPlot(props) {
41
41
  })
42
42
  });
43
43
  }
44
- process.env.NODE_ENV !== "production" ? GeoDataPlot.propTypes = {
44
+ process.env.NODE_ENV !== "production" ? GeoDataPlot.propTypes /* remove-proptypes */ = {
45
45
  // ----------------------------- Warning --------------------------------
46
46
  // | These PropTypes are generated from the TypeScript type definitions |
47
47
  // | To update them edit the TypeScript types and run "pnpm proptypes" |
@@ -35,7 +35,7 @@ function GeoDataPlot(props) {
35
35
  })
36
36
  });
37
37
  }
38
- process.env.NODE_ENV !== "production" ? GeoDataPlot.propTypes = {
38
+ process.env.NODE_ENV !== "production" ? GeoDataPlot.propTypes /* remove-proptypes */ = {
39
39
  // ----------------------------- Warning --------------------------------
40
40
  // | These PropTypes are generated from the TypeScript type definitions |
41
41
  // | To update them edit the TypeScript types and run "pnpm proptypes" |
@@ -7,4 +7,7 @@ export type MapShapeProps = Omit<React.SVGProps<SVGPathElement>, 'ref'> & {
7
7
  color: string;
8
8
  };
9
9
  declare function MapShape(props: MapShapeProps): import("react/jsx-runtime").JSX.Element;
10
+ declare namespace MapShape {
11
+ var propTypes: any;
12
+ }
10
13
  export { MapShape };
package/Map/MapShape.d.ts CHANGED
@@ -7,4 +7,7 @@ export type MapShapeProps = Omit<React.SVGProps<SVGPathElement>, 'ref'> & {
7
7
  color: string;
8
8
  };
9
9
  declare function MapShape(props: MapShapeProps): import("react/jsx-runtime").JSX.Element;
10
+ declare namespace MapShape {
11
+ var propTypes: any;
12
+ }
10
13
  export { MapShape };
package/Map/MapShape.js CHANGED
@@ -10,6 +10,7 @@ exports.MapShape = MapShape;
10
10
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
11
11
  var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
12
12
  var React = _interopRequireWildcard(require("react"));
13
+ var _propTypes = _interopRequireDefault(require("prop-types"));
13
14
  var _styles = require("@mui/material/styles");
14
15
  var _internals = require("@mui/x-charts/internals");
15
16
  var _hooks = require("../hooks");
@@ -52,4 +53,12 @@ function MapShape(props) {
52
53
  filter: isHighlighted ? 'brightness(120%)' : undefined,
53
54
  opacity: isFaded ? 0.3 : 1
54
55
  }, other, interactionProps));
55
- }
56
+ }
57
+ process.env.NODE_ENV !== "production" ? MapShape.propTypes /* remove-proptypes */ = {
58
+ // ----------------------------- Warning --------------------------------
59
+ // | These PropTypes are generated from the TypeScript type definitions |
60
+ // | To update them edit the TypeScript types and run "pnpm proptypes" |
61
+ // ----------------------------------------------------------------------
62
+ dataIndex: _propTypes.default.number.isRequired,
63
+ seriesId: _propTypes.default.string.isRequired
64
+ } : void 0;
package/Map/MapShape.mjs CHANGED
@@ -4,6 +4,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";
4
4
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
5
5
  const _excluded = ["seriesId", "dataIndex", "d", "color", "onClick"];
6
6
  import * as React from 'react';
7
+ import PropTypes from 'prop-types';
7
8
  import { styled } from '@mui/material/styles';
8
9
  import { useInteractionItemProps } from '@mui/x-charts/internals';
9
10
  import { useItemHighlightState } from "../hooks/index.mjs";
@@ -46,4 +47,12 @@ function MapShape(props) {
46
47
  opacity: isFaded ? 0.3 : 1
47
48
  }, other, interactionProps));
48
49
  }
50
+ process.env.NODE_ENV !== "production" ? MapShape.propTypes /* remove-proptypes */ = {
51
+ // ----------------------------- Warning --------------------------------
52
+ // | These PropTypes are generated from the TypeScript type definitions |
53
+ // | To update them edit the TypeScript types and run "pnpm proptypes" |
54
+ // ----------------------------------------------------------------------
55
+ dataIndex: PropTypes.number.isRequired,
56
+ seriesId: PropTypes.string.isRequired
57
+ } : void 0;
49
58
  export { MapShape };
@@ -18,4 +18,8 @@ export interface MapShapePlotProps {
18
18
  /**
19
19
  * Renders series mapShape items.
20
20
  */
21
- export declare function MapShapePlot(props: MapShapePlotProps): import("react/jsx-runtime").JSX.Element | null;
21
+ declare function MapShapePlot(props: MapShapePlotProps): import("react/jsx-runtime").JSX.Element | null;
22
+ declare namespace MapShapePlot {
23
+ var propTypes: any;
24
+ }
25
+ export { MapShapePlot };
@@ -18,4 +18,8 @@ export interface MapShapePlotProps {
18
18
  /**
19
19
  * Renders series mapShape items.
20
20
  */
21
- export declare function MapShapePlot(props: MapShapePlotProps): import("react/jsx-runtime").JSX.Element | null;
21
+ declare function MapShapePlot(props: MapShapePlotProps): import("react/jsx-runtime").JSX.Element | null;
22
+ declare namespace MapShapePlot {
23
+ var propTypes: any;
24
+ }
25
+ export { MapShapePlot };
@@ -1,12 +1,14 @@
1
1
  "use strict";
2
2
  'use client';
3
3
 
4
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
5
  var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
5
6
  Object.defineProperty(exports, "__esModule", {
6
7
  value: true
7
8
  });
8
9
  exports.MapShapePlot = MapShapePlot;
9
10
  var React = _interopRequireWildcard(require("react"));
11
+ var _propTypes = _interopRequireDefault(require("prop-types"));
10
12
  var _hooks = require("@mui/x-charts/hooks");
11
13
  var _useGeoData = require("../hooks/useGeoData");
12
14
  var _useGeoPath = require("../hooks/useGeoPath");
@@ -66,14 +68,15 @@ function MapShapePlot(props) {
66
68
  children: featureIndexes.map(featureIndex => {
67
69
  const feature = geoData.features[featureIndex];
68
70
  const d = path(feature);
69
- if (!d) {
71
+ const color = fill ?? colorGetter(dataIndex);
72
+ if (!d || color === null) {
70
73
  return null;
71
74
  }
72
75
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_MapShape.MapShape, {
73
76
  seriesId: id,
74
77
  dataIndex: dataIndex,
75
78
  d: d,
76
- color: fill ?? colorGetter(dataIndex),
79
+ color: color,
77
80
  stroke: stroke,
78
81
  strokeWidth: strokeWidth
79
82
  }, featureIndex);
@@ -83,4 +86,25 @@ function MapShapePlot(props) {
83
86
  }, id);
84
87
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_FocusedMapShape.FocusedMapShape, {})]
85
88
  });
86
- }
89
+ }
90
+ process.env.NODE_ENV !== "production" ? MapShapePlot.propTypes /* remove-proptypes */ = {
91
+ // ----------------------------- Warning --------------------------------
92
+ // | These PropTypes are generated from the TypeScript type definitions |
93
+ // | To update them edit the TypeScript types and run "pnpm proptypes" |
94
+ // ----------------------------------------------------------------------
95
+ className: _propTypes.default.string,
96
+ /**
97
+ * Fill color applied to every feature path. Overrides item and series colors.
98
+ */
99
+ fill: _propTypes.default.string,
100
+ /**
101
+ * Stroke color applied to every feature path.
102
+ * @default 'none'
103
+ */
104
+ stroke: _propTypes.default.string,
105
+ /**
106
+ * Stroke width applied to every feature path.
107
+ * @default 1
108
+ */
109
+ strokeWidth: _propTypes.default.number
110
+ } : void 0;
@@ -1,6 +1,7 @@
1
1
  'use client';
2
2
 
3
3
  import * as React from 'react';
4
+ import PropTypes from 'prop-types';
4
5
  import { useZAxes } from '@mui/x-charts/hooks';
5
6
  import { useGeoData } from "../hooks/useGeoData.mjs";
6
7
  import { useGeoPath } from "../hooks/useGeoPath.mjs";
@@ -13,7 +14,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
14
  /**
14
15
  * Renders series mapShape items.
15
16
  */
16
- export function MapShapePlot(props) {
17
+ function MapShapePlot(props) {
17
18
  const {
18
19
  className,
19
20
  fill,
@@ -60,14 +61,15 @@ export function MapShapePlot(props) {
60
61
  children: featureIndexes.map(featureIndex => {
61
62
  const feature = geoData.features[featureIndex];
62
63
  const d = path(feature);
63
- if (!d) {
64
+ const color = fill ?? colorGetter(dataIndex);
65
+ if (!d || color === null) {
64
66
  return null;
65
67
  }
66
68
  return /*#__PURE__*/_jsx(MapShape, {
67
69
  seriesId: id,
68
70
  dataIndex: dataIndex,
69
71
  d: d,
70
- color: fill ?? colorGetter(dataIndex),
72
+ color: color,
71
73
  stroke: stroke,
72
74
  strokeWidth: strokeWidth
73
75
  }, featureIndex);
@@ -77,4 +79,26 @@ export function MapShapePlot(props) {
77
79
  }, id);
78
80
  }), /*#__PURE__*/_jsx(FocusedMapShape, {})]
79
81
  });
80
- }
82
+ }
83
+ process.env.NODE_ENV !== "production" ? MapShapePlot.propTypes /* remove-proptypes */ = {
84
+ // ----------------------------- Warning --------------------------------
85
+ // | These PropTypes are generated from the TypeScript type definitions |
86
+ // | To update them edit the TypeScript types and run "pnpm proptypes" |
87
+ // ----------------------------------------------------------------------
88
+ className: PropTypes.string,
89
+ /**
90
+ * Fill color applied to every feature path. Overrides item and series colors.
91
+ */
92
+ fill: PropTypes.string,
93
+ /**
94
+ * Stroke color applied to every feature path.
95
+ * @default 'none'
96
+ */
97
+ stroke: PropTypes.string,
98
+ /**
99
+ * Stroke width applied to every feature path.
100
+ * @default 1
101
+ */
102
+ strokeWidth: PropTypes.number
103
+ } : void 0;
104
+ export { MapShapePlot };
package/Map/index.d.mts CHANGED
@@ -1,7 +1,9 @@
1
+ import { type useGeoProjectionTypes } from '@mui/x-charts/internals';
1
2
  export * from "./GeoDataPlot.mjs";
2
3
  export * from "./MapShapePlot.mjs";
3
4
  export * from "./MapShape.mjs";
4
5
  export * from "./FocusedMapShape.mjs";
5
6
  export * from "./Graticule.mjs";
6
- export type { D3NamedProjection, GeoProjectionInput } from "../internals/plugins/useGeoProjection/useGeoProjection.types.mjs";
7
+ export type D3NamedProjection = useGeoProjectionTypes.D3NamedProjection;
8
+ export type GeoProjectionInput = useGeoProjectionTypes.GeoProjectionInput;
7
9
  export type { GeoProjection, ExtendedFeatureCollection } from '@mui/x-charts-vendor/d3-geo';
package/Map/index.d.ts CHANGED
@@ -1,7 +1,9 @@
1
+ import { type useGeoProjectionTypes } from '@mui/x-charts/internals';
1
2
  export * from "./GeoDataPlot.js";
2
3
  export * from "./MapShapePlot.js";
3
4
  export * from "./MapShape.js";
4
5
  export * from "./FocusedMapShape.js";
5
6
  export * from "./Graticule.js";
6
- export type { D3NamedProjection, GeoProjectionInput } from "../internals/plugins/useGeoProjection/useGeoProjection.types.js";
7
+ export type D3NamedProjection = useGeoProjectionTypes.D3NamedProjection;
8
+ export type GeoProjectionInput = useGeoProjectionTypes.GeoProjectionInput;
7
9
  export type { GeoProjection, ExtendedFeatureCollection } from '@mui/x-charts-vendor/d3-geo';
@@ -12,17 +12,12 @@ const getColor = (series, _mainAxis, _secondaryAxis, zAxis) => {
12
12
  return series.color;
13
13
  }
14
14
  const item = series.data[dataIndex];
15
- if (item === undefined) {
16
- return series.color;
15
+ if (item.color !== undefined) {
16
+ return item.color;
17
17
  }
18
18
  const scaleInput = item.colorValue ?? item.value;
19
- if (scaleInput != null) {
20
- const color = colorScale(scaleInput);
21
- if (color !== null) {
22
- return color;
23
- }
24
- }
25
- return item.color ?? series.color;
19
+ const color = colorScale(scaleInput);
20
+ return color;
26
21
  };
27
22
  }
28
23
  return dataIndex => {
@@ -6,17 +6,12 @@ const getColor = (series, _mainAxis, _secondaryAxis, zAxis) => {
6
6
  return series.color;
7
7
  }
8
8
  const item = series.data[dataIndex];
9
- if (item === undefined) {
10
- return series.color;
9
+ if (item.color !== undefined) {
10
+ return item.color;
11
11
  }
12
12
  const scaleInput = item.colorValue ?? item.value;
13
- if (scaleInput != null) {
14
- const color = colorScale(scaleInput);
15
- if (color !== null) {
16
- return color;
17
- }
18
- }
19
- return item.color ?? series.color;
13
+ const color = colorScale(scaleInput);
14
+ return color;
20
15
  };
21
16
  }
22
17
  return dataIndex => {
@@ -13,11 +13,13 @@ var _tooltip = _interopRequireDefault(require("./tooltip"));
13
13
  var _getSeriesWithDefaultValues = _interopRequireDefault(require("./getSeriesWithDefaultValues"));
14
14
  var _descriptionGetter = _interopRequireDefault(require("./descriptionGetter"));
15
15
  var _keyboardFocusHandler = _interopRequireDefault(require("./keyboardFocusHandler"));
16
+ var _tooltipPosition = _interopRequireDefault(require("./tooltipPosition"));
16
17
  const mapShapeSeriesConfig = exports.mapShapeSeriesConfig = {
17
18
  seriesProcessor: _seriesProcessor.default,
18
19
  colorProcessor: _getColor.default,
19
20
  legendGetter: _legend.default,
20
21
  tooltipGetter: _tooltip.default,
22
+ tooltipItemPositionGetter: _tooltipPosition.default,
21
23
  getSeriesWithDefaultValues: _getSeriesWithDefaultValues.default,
22
24
  keyboardFocusHandler: _keyboardFocusHandler.default,
23
25
  identifierSerializer: _internals.identifierSerializerSeriesIdDataIndex,
@@ -6,11 +6,13 @@ import tooltipGetter from "./tooltip.mjs";
6
6
  import getSeriesWithDefaultValues from "./getSeriesWithDefaultValues.mjs";
7
7
  import descriptionGetter from "./descriptionGetter.mjs";
8
8
  import keyboardFocusHandler from "./keyboardFocusHandler.mjs";
9
+ import tooltipItemPositionGetter from "./tooltipPosition.mjs";
9
10
  export const mapShapeSeriesConfig = {
10
11
  seriesProcessor,
11
12
  colorProcessor: getColor,
12
13
  legendGetter,
13
14
  tooltipGetter,
15
+ tooltipItemPositionGetter,
14
16
  getSeriesWithDefaultValues,
15
17
  keyboardFocusHandler,
16
18
  identifierSerializer: identifierSerializerSeriesIdDataIndex,
@@ -17,13 +17,17 @@ const tooltipGetter = ({
17
17
  if (point == null) {
18
18
  return null;
19
19
  }
20
+ const color = getColor(identifier.dataIndex);
21
+ if (color === null) {
22
+ return null;
23
+ }
20
24
  const label = (0, _internals.getLabel)(point.label ?? point.name, 'tooltip');
21
25
  const formattedValue = series.valueFormatter(point, {
22
26
  dataIndex: identifier.dataIndex
23
27
  });
24
28
  return {
25
29
  identifier,
26
- color: getColor(identifier.dataIndex),
30
+ color,
27
31
  label,
28
32
  value: point,
29
33
  formattedValue,
@@ -11,13 +11,17 @@ const tooltipGetter = ({
11
11
  if (point == null) {
12
12
  return null;
13
13
  }
14
+ const color = getColor(identifier.dataIndex);
15
+ if (color === null) {
16
+ return null;
17
+ }
14
18
  const label = getLabel(point.label ?? point.name, 'tooltip');
15
19
  const formattedValue = series.valueFormatter(point, {
16
20
  dataIndex: identifier.dataIndex
17
21
  });
18
22
  return {
19
23
  identifier,
20
- color: getColor(identifier.dataIndex),
24
+ color,
21
25
  label,
22
26
  value: point,
23
27
  formattedValue,
@@ -0,0 +1,3 @@
1
+ import type { TooltipItemPositionGetter } from '@mui/x-charts/internals';
2
+ declare const tooltipItemPositionGetter: TooltipItemPositionGetter<'mapShape'>;
3
+ export default tooltipItemPositionGetter;
@@ -0,0 +1,3 @@
1
+ import type { TooltipItemPositionGetter } from '@mui/x-charts/internals';
2
+ declare const tooltipItemPositionGetter: TooltipItemPositionGetter<'mapShape'>;
3
+ export default tooltipItemPositionGetter;
@@ -0,0 +1,64 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _d3Geo = require("@mui/x-charts-vendor/d3-geo");
8
+ const tooltipItemPositionGetter = params => {
9
+ const {
10
+ series,
11
+ identifier,
12
+ axesConfig,
13
+ placement
14
+ } = params;
15
+ if (!identifier || identifier.dataIndex === undefined) {
16
+ return null;
17
+ }
18
+ const itemSeries = series.mapShape?.series[identifier.seriesId];
19
+ if (itemSeries == null) {
20
+ return null;
21
+ }
22
+ if (axesConfig.geo === undefined) {
23
+ return null;
24
+ }
25
+ const {
26
+ projection,
27
+ geoData,
28
+ featureIndexesByName
29
+ } = axesConfig.geo;
30
+ if (projection == null || geoData == null) {
31
+ return null;
32
+ }
33
+ const featureIndex = featureIndexesByName.get(itemSeries.data[identifier.dataIndex].name)?.[0];
34
+ if (featureIndex === undefined) {
35
+ return null;
36
+ }
37
+ const feature = geoData.features[featureIndex];
38
+ const path = (0, _d3Geo.geoPath)(projection);
39
+ const [[x0, y0], [x1, y1]] = path.bounds(feature);
40
+ switch (placement) {
41
+ case 'right':
42
+ return {
43
+ x: x1,
44
+ y: (y0 + y1) / 2
45
+ };
46
+ case 'bottom':
47
+ return {
48
+ x: (x0 + x1) / 2,
49
+ y: y1
50
+ };
51
+ case 'left':
52
+ return {
53
+ x: x0,
54
+ y: (y0 + y1) / 2
55
+ };
56
+ case 'top':
57
+ default:
58
+ return {
59
+ x: (x0 + x1) / 2,
60
+ y: y0
61
+ };
62
+ }
63
+ };
64
+ var _default = exports.default = tooltipItemPositionGetter;
@@ -0,0 +1,58 @@
1
+ import { geoPath } from '@mui/x-charts-vendor/d3-geo';
2
+ const tooltipItemPositionGetter = params => {
3
+ const {
4
+ series,
5
+ identifier,
6
+ axesConfig,
7
+ placement
8
+ } = params;
9
+ if (!identifier || identifier.dataIndex === undefined) {
10
+ return null;
11
+ }
12
+ const itemSeries = series.mapShape?.series[identifier.seriesId];
13
+ if (itemSeries == null) {
14
+ return null;
15
+ }
16
+ if (axesConfig.geo === undefined) {
17
+ return null;
18
+ }
19
+ const {
20
+ projection,
21
+ geoData,
22
+ featureIndexesByName
23
+ } = axesConfig.geo;
24
+ if (projection == null || geoData == null) {
25
+ return null;
26
+ }
27
+ const featureIndex = featureIndexesByName.get(itemSeries.data[identifier.dataIndex].name)?.[0];
28
+ if (featureIndex === undefined) {
29
+ return null;
30
+ }
31
+ const feature = geoData.features[featureIndex];
32
+ const path = geoPath(projection);
33
+ const [[x0, y0], [x1, y1]] = path.bounds(feature);
34
+ switch (placement) {
35
+ case 'right':
36
+ return {
37
+ x: x1,
38
+ y: (y0 + y1) / 2
39
+ };
40
+ case 'bottom':
41
+ return {
42
+ x: (x0 + x1) / 2,
43
+ y: y1
44
+ };
45
+ case 'left':
46
+ return {
47
+ x: x0,
48
+ y: (y0 + y1) / 2
49
+ };
50
+ case 'top':
51
+ default:
52
+ return {
53
+ x: (x0 + x1) / 2,
54
+ y: y0
55
+ };
56
+ }
57
+ };
58
+ export default tooltipItemPositionGetter;
@@ -75,7 +75,7 @@ const RadialBarChart = exports.RadialBarChart = /*#__PURE__*/React.forwardRef(fu
75
75
  }));
76
76
  });
77
77
  if (process.env.NODE_ENV !== "production") RadialBarChart.displayName = "RadialBarChart";
78
- process.env.NODE_ENV !== "production" ? RadialBarChart.propTypes = {
78
+ process.env.NODE_ENV !== "production" ? RadialBarChart.propTypes /* remove-proptypes */ = {
79
79
  // ----------------------------- Warning --------------------------------
80
80
  // | These PropTypes are generated from the TypeScript type definitions |
81
81
  // | To update them edit the TypeScript types and run "pnpm proptypes" |
@@ -68,7 +68,7 @@ const RadialBarChart = /*#__PURE__*/React.forwardRef(function RadialBarChart(inP
68
68
  }));
69
69
  });
70
70
  if (process.env.NODE_ENV !== "production") RadialBarChart.displayName = "RadialBarChart";
71
- process.env.NODE_ENV !== "production" ? RadialBarChart.propTypes = {
71
+ process.env.NODE_ENV !== "production" ? RadialBarChart.propTypes /* remove-proptypes */ = {
72
72
  // ----------------------------- Warning --------------------------------
73
73
  // | These PropTypes are generated from the TypeScript type definitions |
74
74
  // | To update them edit the TypeScript types and run "pnpm proptypes" |
@@ -73,7 +73,7 @@ function RadialBarPlot(props) {
73
73
  }, seriesId))
74
74
  });
75
75
  }
76
- process.env.NODE_ENV !== "production" ? RadialBarPlot.propTypes = {
76
+ process.env.NODE_ENV !== "production" ? RadialBarPlot.propTypes /* remove-proptypes */ = {
77
77
  // ----------------------------- Warning --------------------------------
78
78
  // | These PropTypes are generated from the TypeScript type definitions |
79
79
  // | To update them edit the TypeScript types and run "pnpm proptypes" |
@@ -66,7 +66,7 @@ function RadialBarPlot(props) {
66
66
  }, seriesId))
67
67
  });
68
68
  }
69
- process.env.NODE_ENV !== "production" ? RadialBarPlot.propTypes = {
69
+ process.env.NODE_ENV !== "production" ? RadialBarPlot.propTypes /* remove-proptypes */ = {
70
70
  // ----------------------------- Warning --------------------------------
71
71
  // | These PropTypes are generated from the TypeScript type definitions |
72
72
  // | To update them edit the TypeScript types and run "pnpm proptypes" |
@@ -2,4 +2,8 @@ import { type RadialLineClasses } from "./radialLineClasses.mjs";
2
2
  export interface RadialAreaPlotProps {
3
3
  classes?: Partial<Pick<RadialLineClasses, 'area' | 'areaPlot'>>;
4
4
  }
5
- export declare function RadialAreaPlot(props: RadialAreaPlotProps): import("react/jsx-runtime").JSX.Element;
5
+ declare function RadialAreaPlot(props: RadialAreaPlotProps): import("react/jsx-runtime").JSX.Element;
6
+ declare namespace RadialAreaPlot {
7
+ var propTypes: any;
8
+ }
9
+ export { RadialAreaPlot };
@@ -2,4 +2,8 @@ import { type RadialLineClasses } from "./radialLineClasses.js";
2
2
  export interface RadialAreaPlotProps {
3
3
  classes?: Partial<Pick<RadialLineClasses, 'area' | 'areaPlot'>>;
4
4
  }
5
- export declare function RadialAreaPlot(props: RadialAreaPlotProps): import("react/jsx-runtime").JSX.Element;
5
+ declare function RadialAreaPlot(props: RadialAreaPlotProps): import("react/jsx-runtime").JSX.Element;
6
+ declare namespace RadialAreaPlot {
7
+ var propTypes: any;
8
+ }
9
+ export { RadialAreaPlot };
@@ -1,10 +1,12 @@
1
1
  "use strict";
2
2
 
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
3
4
  Object.defineProperty(exports, "__esModule", {
4
5
  value: true
5
6
  });
6
7
  exports.RadialAreaPlot = RadialAreaPlot;
7
8
  var _styles = require("@mui/material/styles");
9
+ var _propTypes = _interopRequireDefault(require("prop-types"));
8
10
  var _internals = require("@mui/x-charts/internals");
9
11
  var _useRadialLinePlotData = require("./useRadialLinePlotData");
10
12
  var _radialLineClasses = require("./radialLineClasses");
@@ -50,4 +52,11 @@ function RadialAreaPlot(props) {
50
52
  className: classes.area
51
53
  }, seriesId))
52
54
  });
53
- }
55
+ }
56
+ process.env.NODE_ENV !== "production" ? RadialAreaPlot.propTypes /* remove-proptypes */ = {
57
+ // ----------------------------- Warning --------------------------------
58
+ // | These PropTypes are generated from the TypeScript type definitions |
59
+ // | To update them edit the TypeScript types and run "pnpm proptypes" |
60
+ // ----------------------------------------------------------------------
61
+ classes: _propTypes.default.object
62
+ } : void 0;
@@ -1,4 +1,5 @@
1
1
  import { styled } from '@mui/material/styles';
2
+ import PropTypes from 'prop-types';
2
3
  import { selectorChartPolarCenter, useChartsContext } from '@mui/x-charts/internals';
3
4
  import { useRadialLinePlotData } from "./useRadialLinePlotData.mjs";
4
5
  import { useUtilityClasses } from "./radialLineClasses.mjs";
@@ -8,7 +9,7 @@ const RadialAreaPlotRoot = styled('g', {
8
9
  name: 'MuiRadialAreaPlot',
9
10
  slot: 'Root'
10
11
  })();
11
- export function RadialAreaPlot(props) {
12
+ function RadialAreaPlot(props) {
12
13
  const {
13
14
  classes: inClasses
14
15
  } = props;
@@ -44,4 +45,12 @@ export function RadialAreaPlot(props) {
44
45
  className: classes.area
45
46
  }, seriesId))
46
47
  });
47
- }
48
+ }
49
+ process.env.NODE_ENV !== "production" ? RadialAreaPlot.propTypes /* remove-proptypes */ = {
50
+ // ----------------------------- Warning --------------------------------
51
+ // | These PropTypes are generated from the TypeScript type definitions |
52
+ // | To update them edit the TypeScript types and run "pnpm proptypes" |
53
+ // ----------------------------------------------------------------------
54
+ classes: PropTypes.object
55
+ } : void 0;
56
+ export { RadialAreaPlot };
@@ -80,7 +80,7 @@ const RadialLineChart = exports.RadialLineChart = /*#__PURE__*/React.forwardRef(
80
80
  }));
81
81
  });
82
82
  if (process.env.NODE_ENV !== "production") RadialLineChart.displayName = "RadialLineChart";
83
- process.env.NODE_ENV !== "production" ? RadialLineChart.propTypes = {
83
+ process.env.NODE_ENV !== "production" ? RadialLineChart.propTypes /* remove-proptypes */ = {
84
84
  // ----------------------------- Warning --------------------------------
85
85
  // | These PropTypes are generated from the TypeScript type definitions |
86
86
  // | To update them edit the TypeScript types and run "pnpm proptypes" |