@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.
Files changed (230) hide show
  1. package/BarChartPremium/BarChartPremium.d.mts +1 -1
  2. package/BarChartPremium/BarChartPremium.d.ts +1 -1
  3. package/BarChartPremium/BarChartPremium.js +14 -3
  4. package/BarChartPremium/BarChartPremium.mjs +14 -3
  5. package/BarChartPremium/RangeBar/AnimatedRangeBarElement.d.mts +2 -1
  6. package/BarChartPremium/RangeBar/AnimatedRangeBarElement.d.ts +2 -1
  7. package/BarChartPremium/RangeBar/FocusedRangeBar.d.mts +1 -1
  8. package/BarChartPremium/RangeBar/FocusedRangeBar.d.ts +1 -1
  9. package/BarChartPremium/RangeBar/seriesConfig/index.js +2 -2
  10. package/BarChartPremium/RangeBar/seriesConfig/index.mjs +2 -2
  11. package/BarChartPremium/RangeBar/seriesConfig/tooltipPosition.d.mts +2 -3
  12. package/BarChartPremium/RangeBar/seriesConfig/tooltipPosition.d.ts +2 -3
  13. package/BarChartPremium/RangeBar/seriesConfig/tooltipPosition.js +12 -15
  14. package/BarChartPremium/RangeBar/seriesConfig/tooltipPosition.mjs +11 -14
  15. package/BarChartPremium/webgl/BarWebGLProgram.d.mts +4 -5
  16. package/BarChartPremium/webgl/BarWebGLProgram.d.ts +4 -5
  17. package/BarChartPremium/webgl/BarWebGLProgram.js +24 -65
  18. package/BarChartPremium/webgl/BarWebGLProgram.mjs +24 -65
  19. package/BarChartPremium/webgl/shaders.d.mts +1 -1
  20. package/BarChartPremium/webgl/shaders.d.ts +1 -1
  21. package/BarChartPremium/webgl/shaders.js +2 -15
  22. package/BarChartPremium/webgl/shaders.mjs +3 -15
  23. package/CHANGELOG.md +249 -1
  24. package/CandlestickChart/CandlestickPlot.d.mts +2 -1
  25. package/CandlestickChart/CandlestickPlot.d.ts +2 -1
  26. package/CandlestickChart/seriesConfig/OHLCTooltipContent.d.mts +2 -1
  27. package/CandlestickChart/seriesConfig/OHLCTooltipContent.d.ts +2 -1
  28. package/CandlestickChart/seriesConfig/index.js +2 -2
  29. package/CandlestickChart/seriesConfig/index.mjs +2 -2
  30. package/CandlestickChart/seriesConfig/tooltipPosition.d.mts +2 -3
  31. package/CandlestickChart/seriesConfig/tooltipPosition.d.ts +2 -3
  32. package/CandlestickChart/seriesConfig/tooltipPosition.js +10 -14
  33. package/CandlestickChart/seriesConfig/tooltipPosition.mjs +10 -14
  34. package/ChartsDataProviderPremium/ChartsDataProviderPremium.d.mts +1 -1
  35. package/ChartsDataProviderPremium/ChartsDataProviderPremium.d.ts +1 -1
  36. package/ChartsDataProviderPremium/ChartsDataProviderPremium.js +2 -2
  37. package/ChartsDataProviderPremium/ChartsDataProviderPremium.mjs +2 -2
  38. package/ChartsGeoDataProviderPremium/ChartsGeoDataProviderPremium.d.mts +1 -1
  39. package/ChartsGeoDataProviderPremium/ChartsGeoDataProviderPremium.d.ts +1 -1
  40. package/ChartsGeoDataProviderPremium/ChartsGeoDataProviderPremium.js +2 -2
  41. package/ChartsGeoDataProviderPremium/ChartsGeoDataProviderPremium.mjs +2 -2
  42. package/ChartsGeoDataProviderPremium/ChartsGeoDataProviderPremium.plugins.d.mts +4 -3
  43. package/ChartsGeoDataProviderPremium/ChartsGeoDataProviderPremium.plugins.d.ts +4 -3
  44. package/ChartsGeoDataProviderPremium/ChartsGeoDataProviderPremium.plugins.js +2 -1
  45. package/ChartsGeoDataProviderPremium/ChartsGeoDataProviderPremium.plugins.mjs +2 -1
  46. package/ChartsGeoDataProviderPremium/index.d.mts +2 -1
  47. package/ChartsGeoDataProviderPremium/index.d.ts +2 -1
  48. package/ChartsRadialDataProviderPremium/ChartsRadialDataProviderPremium.d.mts +2 -1
  49. package/ChartsRadialDataProviderPremium/ChartsRadialDataProviderPremium.d.ts +2 -1
  50. package/ChartsRadialDataProviderPremium/ChartsRadialDataProviderPremium.js +2 -2
  51. package/ChartsRadialDataProviderPremium/ChartsRadialDataProviderPremium.mjs +2 -2
  52. package/ChartsRenderer/components/PaletteOption.d.mts +1 -1
  53. package/ChartsRenderer/components/PaletteOption.d.ts +1 -1
  54. package/ChartsZoomSlider/internals/previews/CandlestickPreviewPlot.d.mts +2 -1
  55. package/ChartsZoomSlider/internals/previews/CandlestickPreviewPlot.d.ts +2 -1
  56. package/ChartsZoomSlider/internals/previews/RangeBarPreviewPlot.d.mts +1 -1
  57. package/ChartsZoomSlider/internals/previews/RangeBarPreviewPlot.d.ts +1 -1
  58. package/HeatmapPremium/HeatmapPlotPremium.d.mts +1 -1
  59. package/HeatmapPremium/HeatmapPlotPremium.d.ts +1 -1
  60. package/HeatmapPremium/webgl/HeatmapWebGLProgram.js +12 -37
  61. package/HeatmapPremium/webgl/HeatmapWebGLProgram.mjs +12 -37
  62. package/HeatmapPremium/webgl/shaders.d.mts +3 -3
  63. package/HeatmapPremium/webgl/shaders.d.ts +3 -3
  64. package/HeatmapPremium/webgl/shaders.js +12 -15
  65. package/HeatmapPremium/webgl/shaders.mjs +13 -15
  66. package/HeatmapPremium/webgl/useHeatmapPlotData.js +3 -8
  67. package/HeatmapPremium/webgl/useHeatmapPlotData.mjs +3 -8
  68. package/Map/FocusedMapShape.d.mts +2 -1
  69. package/Map/FocusedMapShape.d.ts +2 -1
  70. package/Map/FocusedMapShape.js +5 -1
  71. package/Map/FocusedMapShape.mjs +5 -1
  72. package/Map/GeoDataPlot.d.mts +1 -1
  73. package/Map/GeoDataPlot.d.ts +1 -1
  74. package/Map/Graticule.d.mts +1 -1
  75. package/Map/Graticule.d.ts +1 -1
  76. package/Map/MapImagePlot.d.mts +39 -0
  77. package/Map/MapImagePlot.d.ts +39 -0
  78. package/Map/MapImagePlot.js +138 -0
  79. package/Map/MapImagePlot.mjs +132 -0
  80. package/Map/MapShape.d.mts +2 -2
  81. package/Map/MapShape.d.ts +2 -2
  82. package/Map/MapShape.js +6 -6
  83. package/Map/MapShape.mjs +6 -6
  84. package/Map/MapShapePlot.d.mts +9 -1
  85. package/Map/MapShapePlot.d.ts +9 -1
  86. package/Map/MapShapePlot.js +17 -5
  87. package/Map/MapShapePlot.mjs +17 -5
  88. package/Map/index.d.mts +2 -3
  89. package/Map/index.d.ts +2 -3
  90. package/Map/index.js +11 -0
  91. package/Map/index.mjs +1 -0
  92. package/Map/reprojectEquirectangularImage.d.mts +60 -0
  93. package/Map/reprojectEquirectangularImage.d.ts +60 -0
  94. package/Map/reprojectEquirectangularImage.js +116 -0
  95. package/Map/reprojectEquirectangularImage.mjs +110 -0
  96. package/Map/seriesConfig/descriptionGetter.js +5 -1
  97. package/Map/seriesConfig/descriptionGetter.mjs +5 -1
  98. package/Map/seriesConfig/getColor.js +18 -6
  99. package/Map/seriesConfig/getColor.mjs +18 -6
  100. package/Map/seriesConfig/highlight.d.mts +10 -0
  101. package/Map/seriesConfig/highlight.d.ts +10 -0
  102. package/Map/seriesConfig/highlight.js +52 -0
  103. package/Map/seriesConfig/highlight.mjs +45 -0
  104. package/Map/seriesConfig/identifierCleaner.d.mts +3 -0
  105. package/Map/seriesConfig/identifierCleaner.d.ts +3 -0
  106. package/Map/seriesConfig/identifierCleaner.js +14 -0
  107. package/Map/seriesConfig/identifierCleaner.mjs +8 -0
  108. package/Map/seriesConfig/identifierSerializer.d.mts +3 -0
  109. package/Map/seriesConfig/identifierSerializer.d.ts +3 -0
  110. package/Map/seriesConfig/identifierSerializer.js +12 -0
  111. package/Map/seriesConfig/identifierSerializer.mjs +6 -0
  112. package/Map/seriesConfig/index.js +8 -6
  113. package/Map/seriesConfig/index.mjs +7 -5
  114. package/Map/seriesConfig/keyboardFocusHandler.d.mts +0 -6
  115. package/Map/seriesConfig/keyboardFocusHandler.d.ts +0 -6
  116. package/Map/seriesConfig/keyboardFocusHandler.js +40 -7
  117. package/Map/seriesConfig/keyboardFocusHandler.mjs +41 -8
  118. package/Map/seriesConfig/seriesProcessor.js +11 -2
  119. package/Map/seriesConfig/seriesProcessor.mjs +11 -2
  120. package/Map/seriesConfig/tooltip.js +8 -4
  121. package/Map/seriesConfig/tooltip.mjs +8 -4
  122. package/Map/seriesConfig/tooltipPosition.d.mts +8 -3
  123. package/Map/seriesConfig/tooltipPosition.d.ts +8 -3
  124. package/Map/seriesConfig/tooltipPosition.js +15 -27
  125. package/Map/seriesConfig/tooltipPosition.mjs +16 -27
  126. package/RadialBarChart/RadialBarElement.d.mts +1 -1
  127. package/RadialBarChart/RadialBarElement.d.ts +1 -1
  128. package/RadialBarChart/seriesConfig/index.js +2 -2
  129. package/RadialBarChart/seriesConfig/index.mjs +2 -2
  130. package/RadialBarChart/seriesConfig/tooltipPosition.d.mts +2 -3
  131. package/RadialBarChart/seriesConfig/tooltipPosition.d.ts +2 -3
  132. package/RadialBarChart/seriesConfig/tooltipPosition.js +4 -6
  133. package/RadialBarChart/seriesConfig/tooltipPosition.mjs +2 -5
  134. package/RadialLineChart/RadialArea.d.mts +2 -1
  135. package/RadialLineChart/RadialArea.d.ts +2 -1
  136. package/RadialLineChart/RadialAreaPlot.d.mts +1 -1
  137. package/RadialLineChart/RadialAreaPlot.d.ts +1 -1
  138. package/RadialLineChart/RadialLine.d.mts +1 -1
  139. package/RadialLineChart/RadialLine.d.ts +1 -1
  140. package/RadialLineChart/RadialLineHighlightElement.d.mts +1 -1
  141. package/RadialLineChart/RadialLineHighlightElement.d.ts +1 -1
  142. package/RadialLineChart/RadialLineHighlightPlot.d.mts +1 -1
  143. package/RadialLineChart/RadialLineHighlightPlot.d.ts +1 -1
  144. package/RadialLineChart/RadialLinePlot.d.mts +1 -1
  145. package/RadialLineChart/RadialLinePlot.d.ts +1 -1
  146. package/RadialLineChart/RadialMarkPlot.d.mts +1 -1
  147. package/RadialLineChart/RadialMarkPlot.d.ts +1 -1
  148. package/RadialLineChart/seriesConfig/index.js +2 -2
  149. package/RadialLineChart/seriesConfig/index.mjs +2 -2
  150. package/RadialLineChart/seriesConfig/tooltipPosition.d.mts +2 -3
  151. package/RadialLineChart/seriesConfig/tooltipPosition.d.ts +2 -3
  152. package/RadialLineChart/seriesConfig/tooltipPosition.js +4 -6
  153. package/RadialLineChart/seriesConfig/tooltipPosition.mjs +2 -5
  154. package/ScatterChartPremium/ScatterPlotPremium.d.mts +2 -1
  155. package/ScatterChartPremium/ScatterPlotPremium.d.ts +2 -1
  156. package/ScatterChartPremium/webgl/ScatterWebGLPlot.d.mts +2 -1
  157. package/ScatterChartPremium/webgl/ScatterWebGLPlot.d.ts +2 -1
  158. package/ScatterChartPremium/webgl/ScatterWebGLProgram.d.mts +0 -2
  159. package/ScatterChartPremium/webgl/ScatterWebGLProgram.d.ts +0 -2
  160. package/ScatterChartPremium/webgl/ScatterWebGLProgram.js +23 -81
  161. package/ScatterChartPremium/webgl/ScatterWebGLProgram.mjs +23 -81
  162. package/index.js +1 -1
  163. package/index.mjs +1 -1
  164. package/internals/createGetVisibleCoordinate.d.mts +14 -0
  165. package/internals/createGetVisibleCoordinate.d.ts +14 -0
  166. package/internals/createGetVisibleCoordinate.js +66 -0
  167. package/internals/createGetVisibleCoordinate.mjs +60 -0
  168. package/internals/plugins/useGeoProjection/factories.d.mts +3 -0
  169. package/internals/plugins/useGeoProjection/factories.d.ts +3 -0
  170. package/internals/plugins/useGeoProjection/factories.js +29 -0
  171. package/internals/plugins/useGeoProjection/factories.mjs +23 -0
  172. package/internals/plugins/useGeoProjection/projection.utils.d.mts +17 -0
  173. package/internals/plugins/useGeoProjection/projection.utils.d.ts +17 -0
  174. package/internals/plugins/useGeoProjection/projection.utils.js +67 -0
  175. package/internals/plugins/useGeoProjection/projection.utils.mjs +59 -0
  176. package/internals/plugins/useGeoProjection/useGeoProjection.js +7 -40
  177. package/internals/plugins/useGeoProjection/useGeoProjection.mjs +7 -40
  178. package/internals/plugins/useGeoProjection/useGeoProjection.selectors.d.mts +47 -11
  179. package/internals/plugins/useGeoProjection/useGeoProjection.selectors.d.ts +47 -11
  180. package/internals/plugins/useGeoProjection/useGeoProjection.selectors.js +118 -8
  181. package/internals/plugins/useGeoProjection/useGeoProjection.selectors.mjs +117 -8
  182. package/internals/plugins/useGeoProjection/useGeoProjection.types.d.mts +63 -2
  183. package/internals/plugins/useGeoProjection/useGeoProjection.types.d.ts +63 -2
  184. package/internals/plugins/useGeoProjectionZoom/gestureHooks/usePanOnDrag.d.mts +11 -0
  185. package/internals/plugins/useGeoProjectionZoom/gestureHooks/usePanOnDrag.d.ts +11 -0
  186. package/internals/plugins/useGeoProjectionZoom/gestureHooks/usePanOnDrag.js +65 -0
  187. package/internals/plugins/useGeoProjectionZoom/gestureHooks/usePanOnDrag.mjs +58 -0
  188. package/internals/plugins/useGeoProjectionZoom/gestureHooks/useZoomOnPinch.d.mts +13 -0
  189. package/internals/plugins/useGeoProjectionZoom/gestureHooks/useZoomOnPinch.d.ts +13 -0
  190. package/internals/plugins/useGeoProjectionZoom/gestureHooks/useZoomOnPinch.js +62 -0
  191. package/internals/plugins/useGeoProjectionZoom/gestureHooks/useZoomOnPinch.mjs +56 -0
  192. package/internals/plugins/useGeoProjectionZoom/gestureHooks/useZoomOnWheel.d.mts +13 -0
  193. package/internals/plugins/useGeoProjectionZoom/gestureHooks/useZoomOnWheel.d.ts +13 -0
  194. package/internals/plugins/useGeoProjectionZoom/gestureHooks/useZoomOnWheel.js +64 -0
  195. package/internals/plugins/useGeoProjectionZoom/gestureHooks/useZoomOnWheel.mjs +58 -0
  196. package/internals/plugins/useGeoProjectionZoom/index.d.mts +2 -0
  197. package/internals/plugins/useGeoProjectionZoom/index.d.ts +2 -0
  198. package/internals/plugins/useGeoProjectionZoom/index.js +12 -0
  199. package/internals/plugins/useGeoProjectionZoom/index.mjs +1 -0
  200. package/internals/plugins/useGeoProjectionZoom/mapZoom.utils.d.mts +31 -0
  201. package/internals/plugins/useGeoProjectionZoom/mapZoom.utils.d.ts +31 -0
  202. package/internals/plugins/useGeoProjectionZoom/mapZoom.utils.js +187 -0
  203. package/internals/plugins/useGeoProjectionZoom/mapZoom.utils.mjs +177 -0
  204. package/internals/plugins/useGeoProjectionZoom/rotationMath.d.mts +23 -0
  205. package/internals/plugins/useGeoProjectionZoom/rotationMath.d.ts +23 -0
  206. package/internals/plugins/useGeoProjectionZoom/rotationMath.js +190 -0
  207. package/internals/plugins/useGeoProjectionZoom/rotationMath.mjs +182 -0
  208. package/internals/plugins/useGeoProjectionZoom/useGeoProjectionZoom.d.mts +3 -0
  209. package/internals/plugins/useGeoProjectionZoom/useGeoProjectionZoom.d.ts +3 -0
  210. package/internals/plugins/useGeoProjectionZoom/useGeoProjectionZoom.js +174 -0
  211. package/internals/plugins/useGeoProjectionZoom/useGeoProjectionZoom.mjs +166 -0
  212. package/internals/plugins/useGeoProjectionZoom/useGeoProjectionZoom.types.d.mts +152 -0
  213. package/internals/plugins/useGeoProjectionZoom/useGeoProjectionZoom.types.d.ts +152 -0
  214. package/internals/plugins/useGeoProjectionZoom/useGeoProjectionZoom.types.js +5 -0
  215. package/internals/plugins/useGeoProjectionZoom/useGeoProjectionZoom.types.mjs +1 -0
  216. package/models/seriesType/mapShape.d.mts +2 -1
  217. package/models/seriesType/mapShape.d.ts +2 -1
  218. package/package.json +6 -6
  219. package/utils/webgl/glsl.d.mts +15 -0
  220. package/utils/webgl/glsl.d.ts +15 -0
  221. package/utils/webgl/glsl.js +34 -0
  222. package/utils/webgl/glsl.mjs +28 -0
  223. package/utils/webgl/instancedAttribute.d.mts +28 -0
  224. package/utils/webgl/instancedAttribute.d.ts +28 -0
  225. package/utils/webgl/instancedAttribute.js +57 -0
  226. package/utils/webgl/instancedAttribute.mjs +50 -0
  227. package/utils/webgl/utils.d.mts +21 -2
  228. package/utils/webgl/utils.d.ts +21 -2
  229. package/utils/webgl/utils.js +44 -8
  230. package/utils/webgl/utils.mjs +41 -7
@@ -20,7 +20,7 @@ export interface RadialLineHighlightPlotProps extends React.SVGAttributes<SVGGEl
20
20
  */
21
21
  slotProps?: RadialLineHighlightPlotSlotProps;
22
22
  }
23
- declare function RadialLineHighlightPlot(props: RadialLineHighlightPlotProps): import("react/jsx-runtime").JSX.Element | null;
23
+ declare function RadialLineHighlightPlot(props: RadialLineHighlightPlotProps): React.JSX.Element | null;
24
24
  declare namespace RadialLineHighlightPlot {
25
25
  var propTypes: any;
26
26
  }
@@ -20,7 +20,7 @@ export interface RadialLineHighlightPlotProps extends React.SVGAttributes<SVGGEl
20
20
  */
21
21
  slotProps?: RadialLineHighlightPlotSlotProps;
22
22
  }
23
- declare function RadialLineHighlightPlot(props: RadialLineHighlightPlotProps): import("react/jsx-runtime").JSX.Element | null;
23
+ declare function RadialLineHighlightPlot(props: RadialLineHighlightPlotProps): React.JSX.Element | null;
24
24
  declare namespace RadialLineHighlightPlot {
25
25
  var propTypes: any;
26
26
  }
@@ -2,7 +2,7 @@ import type { RadialLineClasses } from "./radialLineClasses.mjs";
2
2
  export interface RadialLinePlotProps {
3
3
  classes?: Partial<Pick<RadialLineClasses, 'line' | 'linePlot'>>;
4
4
  }
5
- declare function RadialLinePlot(props: RadialLinePlotProps): import("react/jsx-runtime").JSX.Element;
5
+ declare function RadialLinePlot(props: RadialLinePlotProps): import("react").JSX.Element;
6
6
  declare namespace RadialLinePlot {
7
7
  var propTypes: any;
8
8
  }
@@ -2,7 +2,7 @@ import type { RadialLineClasses } from "./radialLineClasses.js";
2
2
  export interface RadialLinePlotProps {
3
3
  classes?: Partial<Pick<RadialLineClasses, 'line' | 'linePlot'>>;
4
4
  }
5
- declare function RadialLinePlot(props: RadialLinePlotProps): import("react/jsx-runtime").JSX.Element;
5
+ declare function RadialLinePlot(props: RadialLinePlotProps): import("react").JSX.Element;
6
6
  declare namespace RadialLinePlot {
7
7
  var propTypes: any;
8
8
  }
@@ -2,7 +2,7 @@ import type { RadialLineClasses } from "./radialLineClasses.mjs";
2
2
  export interface RadialMarkPlotProps {
3
3
  classes?: Partial<Pick<RadialLineClasses, 'mark' | 'markPlot'>>;
4
4
  }
5
- declare function RadialMarkPlot(props: RadialMarkPlotProps): import("react/jsx-runtime").JSX.Element;
5
+ declare function RadialMarkPlot(props: RadialMarkPlotProps): import("react").JSX.Element;
6
6
  declare namespace RadialMarkPlot {
7
7
  var propTypes: any;
8
8
  }
@@ -2,7 +2,7 @@ import type { RadialLineClasses } from "./radialLineClasses.js";
2
2
  export interface RadialMarkPlotProps {
3
3
  classes?: Partial<Pick<RadialLineClasses, 'mark' | 'markPlot'>>;
4
4
  }
5
- declare function RadialMarkPlot(props: RadialMarkPlotProps): import("react/jsx-runtime").JSX.Element;
5
+ declare function RadialMarkPlot(props: RadialMarkPlotProps): import("react").JSX.Element;
6
6
  declare namespace RadialMarkPlot {
7
7
  var propTypes: any;
8
8
  }
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports.radialLineSeriesConfig = void 0;
8
8
  var _internals = require("@mui/x-charts/internals");
9
9
  var _legend = _interopRequireDefault(require("./legend"));
10
- var _tooltipPosition = _interopRequireDefault(require("./tooltipPosition"));
10
+ var _tooltipPosition = require("./tooltipPosition");
11
11
  var _keyboardFocusHandler = _interopRequireDefault(require("./keyboardFocusHandler"));
12
12
  var _axisTooltipGetter = require("./axisTooltipGetter");
13
13
  var _getColor = _interopRequireDefault(require("./getColor"));
@@ -23,7 +23,7 @@ const radialLineSeriesConfig = exports.radialLineSeriesConfig = {
23
23
  seriesProcessor: _seriesProcessor.default,
24
24
  legendGetter: _legend.default,
25
25
  tooltipGetter: _tooltip.default,
26
- tooltipItemPositionGetter: _tooltipPosition.default,
26
+ selectorTooltipItemPosition: _tooltipPosition.selectorTooltipItemPosition,
27
27
  axisTooltipGetter: _axisTooltipGetter.axisTooltipGetter,
28
28
  rotationExtremumGetter: _extremums.rotationExtremumGetter,
29
29
  radiusExtremumGetter: _extremums.radiusExtremumGetter,
@@ -1,6 +1,6 @@
1
1
  import { identifierSerializerSeriesIdDataIndex, identifierCleanerSeriesIdDataIndex, createIsHighlighted, createIsFaded, polarSeriesTypes } from '@mui/x-charts/internals';
2
2
  import legendGetter from "./legend.mjs";
3
- import tooltipItemPositionGetter from "./tooltipPosition.mjs";
3
+ import { selectorTooltipItemPosition } from "./tooltipPosition.mjs";
4
4
  import keyboardFocusHandler from "./keyboardFocusHandler.mjs";
5
5
  import { axisTooltipGetter } from "./axisTooltipGetter.mjs";
6
6
  import colorProcessor from "./getColor.mjs";
@@ -16,7 +16,7 @@ export const radialLineSeriesConfig = {
16
16
  seriesProcessor,
17
17
  legendGetter,
18
18
  tooltipGetter,
19
- tooltipItemPositionGetter,
19
+ selectorTooltipItemPosition,
20
20
  axisTooltipGetter,
21
21
  rotationExtremumGetter,
22
22
  radiusExtremumGetter,
@@ -1,3 +1,2 @@
1
- import type { TooltipItemPositionGetter } from '@mui/x-charts/internals';
2
- declare const tooltipItemPositionGetter: TooltipItemPositionGetter<'radialLine'>;
3
- export default tooltipItemPositionGetter;
1
+ import type { TooltipItemPositionSelector } from '@mui/x-charts/internals';
2
+ export declare const selectorTooltipItemPosition: TooltipItemPositionSelector<'radialLine'>;
@@ -1,3 +1,2 @@
1
- import type { TooltipItemPositionGetter } from '@mui/x-charts/internals';
2
- declare const tooltipItemPositionGetter: TooltipItemPositionGetter<'radialLine'>;
3
- export default tooltipItemPositionGetter;
1
+ import type { TooltipItemPositionSelector } from '@mui/x-charts/internals';
2
+ export declare const selectorTooltipItemPosition: TooltipItemPositionSelector<'radialLine'>;
@@ -3,9 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.default = void 0;
7
- const tooltipItemPositionGetter = () => {
8
- // Todo: to implement
9
- return null;
10
- };
11
- var _default = exports.default = tooltipItemPositionGetter;
6
+ exports.selectorTooltipItemPosition = void 0;
7
+ // Todo: to implement
8
+ const selectorTooltipItemPosition = () => null;
9
+ exports.selectorTooltipItemPosition = selectorTooltipItemPosition;
@@ -1,5 +1,2 @@
1
- const tooltipItemPositionGetter = () => {
2
- // Todo: to implement
3
- return null;
4
- };
5
- export default tooltipItemPositionGetter;
1
+ // Todo: to implement
2
+ export const selectorTooltipItemPosition = () => null;
@@ -1,3 +1,4 @@
1
+ import * as React from 'react';
1
2
  import type { RendererType, ScatterPlotProps, ScatterPlotSlots, ScatterPlotSlotProps } from '@mui/x-charts/ScatterChart';
2
3
  export interface ScatterPlotPremiumSlots extends ScatterPlotSlots {}
3
4
  export interface ScatterPlotPremiumSlotProps extends ScatterPlotSlotProps {}
@@ -23,7 +24,7 @@ export interface ScatterPlotPremiumProps extends Omit<ScatterPlotProps, 'rendere
23
24
  declare function ScatterPlotPremium({
24
25
  renderer,
25
26
  ...props
26
- }: ScatterPlotPremiumProps): import("react/jsx-runtime").JSX.Element;
27
+ }: ScatterPlotPremiumProps): React.JSX.Element;
27
28
  declare namespace ScatterPlotPremium {
28
29
  var propTypes: any;
29
30
  }
@@ -1,3 +1,4 @@
1
+ import * as React from 'react';
1
2
  import type { RendererType, ScatterPlotProps, ScatterPlotSlots, ScatterPlotSlotProps } from '@mui/x-charts/ScatterChart';
2
3
  export interface ScatterPlotPremiumSlots extends ScatterPlotSlots {}
3
4
  export interface ScatterPlotPremiumSlotProps extends ScatterPlotSlotProps {}
@@ -23,7 +24,7 @@ export interface ScatterPlotPremiumProps extends Omit<ScatterPlotProps, 'rendere
23
24
  declare function ScatterPlotPremium({
24
25
  renderer,
25
26
  ...props
26
- }: ScatterPlotPremiumProps): import("react/jsx-runtime").JSX.Element;
27
+ }: ScatterPlotPremiumProps): React.JSX.Element;
27
28
  declare namespace ScatterPlotPremium {
28
29
  var propTypes: any;
29
30
  }
@@ -1,4 +1,5 @@
1
+ import * as React from 'react';
1
2
  /**
2
3
  * @ignore - Internal component used for rendering the scatter plot using WebGL. Not exported from the package.
3
4
  */
4
- export declare function ScatterWebGLPlot(): import("react/jsx-runtime").JSX.Element | null;
5
+ export declare function ScatterWebGLPlot(): React.JSX.Element | null;
@@ -1,4 +1,5 @@
1
+ import * as React from 'react';
1
2
  /**
2
3
  * @ignore - Internal component used for rendering the scatter plot using WebGL. Not exported from the package.
3
4
  */
4
- export declare function ScatterWebGLPlot(): import("react/jsx-runtime").JSX.Element | null;
5
+ export declare function ScatterWebGLPlot(): React.JSX.Element | null;
@@ -13,6 +13,4 @@ export declare class ScatterWebGLProgram {
13
13
  plot(plotData: ScatterWebGLPlotData): void;
14
14
  render(plotData: ScatterWebGLPlotData): void;
15
15
  dispose(): void;
16
- private setupInstancedAttribute;
17
- private uploadBuffer;
18
16
  }
@@ -13,6 +13,4 @@ export declare class ScatterWebGLProgram {
13
13
  plot(plotData: ScatterWebGLPlotData): void;
14
14
  render(plotData: ScatterWebGLPlotData): void;
15
15
  dispose(): void;
16
- private setupInstancedAttribute;
17
- private uploadBuffer;
18
16
  }
@@ -5,32 +5,26 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.ScatterWebGLProgram = void 0;
7
7
  var _utils = require("../../utils/webgl/utils");
8
+ var _instancedAttribute = require("../../utils/webgl/instancedAttribute");
8
9
  var _shaders = require("./shaders");
9
- const QUAD_VERTICES = new Float32Array([-1, -1, 1, -1, -1, 1, 1, 1]);
10
10
  class ScatterWebGLProgram {
11
11
  shaders = [];
12
+
13
+ /* Colors come in as Uint8 [0, 255]; normalized=true makes the GPU read them back as vec4 in [0, 1]. */
14
+
12
15
  constructor(gl) {
13
16
  this.gl = gl;
14
- gl.enable(gl.BLEND);
15
- gl.blendFunc(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA);
16
- this.quadBuffer = gl.createBuffer();
17
- gl.bindBuffer(gl.ARRAY_BUFFER, this.quadBuffer);
18
- gl.bufferData(gl.ARRAY_BUFFER, QUAD_VERTICES, gl.STATIC_DRAW);
19
- const prog = initializeProgram(gl, _shaders.scatterVertexShader, _shaders.scatterFragmentShader);
20
- this.program = prog.program;
21
- this.shaders.push(prog.vertexShader, prog.fragmentShader);
17
+ (0, _utils.setupStandardBlending)(gl);
18
+ const linked = (0, _utils.linkProgram)(gl, _shaders.scatterVertexShader, _shaders.scatterFragmentShader);
19
+ this.program = linked.program;
20
+ this.shaders.push(...linked.shaders);
21
+ this.quadBuffer = (0, _utils.uploadQuadBuffer)(gl);
22
22
  this.vao = gl.createVertexArray();
23
23
  gl.bindVertexArray(this.vao);
24
-
25
- // a_position references the shared quad; bind it once while the VAO is active.
26
- gl.bindBuffer(gl.ARRAY_BUFFER, this.quadBuffer);
27
- const aPosition = gl.getAttribLocation(this.program, 'a_position');
28
- gl.enableVertexAttribArray(aPosition);
29
- gl.vertexAttribPointer(aPosition, 2, gl.FLOAT, false, 0, 0);
30
- this.centers = this.setupInstancedAttribute('a_center', 2, gl.FLOAT, false);
31
- this.sizes = this.setupInstancedAttribute('a_size', 1, gl.FLOAT, false);
32
- // Colors come in as Uint8 [0, 255]; normalized=true makes the GPU read them back as vec4 in [0, 1].
33
- this.colors = this.setupInstancedAttribute('a_color', 4, gl.UNSIGNED_BYTE, true);
24
+ (0, _utils.bindQuadBuffer)(gl, this.program, this.quadBuffer);
25
+ this.centers = (0, _instancedAttribute.createInstancedAttribute)(gl, this.program, 'a_center', 2);
26
+ this.sizes = (0, _instancedAttribute.createInstancedAttribute)(gl, this.program, 'a_size', 1);
27
+ this.colors = (0, _instancedAttribute.createInstancedAttribute)(gl, this.program, 'a_color', 4, gl.UNSIGNED_BYTE, true);
34
28
  gl.bindVertexArray(null);
35
29
  }
36
30
  setResolution(width, height) {
@@ -41,9 +35,12 @@ class ScatterWebGLProgram {
41
35
  gl.uniform2f(gl.getUniformLocation(this.program, 'u_resolution'), width, height);
42
36
  }
43
37
  plot(plotData) {
44
- this.uploadBuffer(this.centers, plotData.centers);
45
- this.uploadBuffer(this.sizes, plotData.sizes);
46
- this.uploadBuffer(this.colors, plotData.colors);
38
+ const {
39
+ gl
40
+ } = this;
41
+ (0, _utils.uploadGrowableBuffer)(gl, this.centers.buffer, plotData.centers);
42
+ (0, _utils.uploadGrowableBuffer)(gl, this.sizes.buffer, plotData.sizes);
43
+ (0, _utils.uploadGrowableBuffer)(gl, this.colors.buffer, plotData.colors);
47
44
  }
48
45
  render(plotData) {
49
46
  if (plotData.pointCount === 0) {
@@ -64,66 +61,11 @@ class ScatterWebGLProgram {
64
61
  } = this;
65
62
  gl.deleteProgram(this.program);
66
63
  gl.deleteVertexArray(this.vao);
67
- gl.deleteBuffer(this.centers.buffer);
68
- gl.deleteBuffer(this.sizes.buffer);
69
- gl.deleteBuffer(this.colors.buffer);
64
+ gl.deleteBuffer(this.centers.buffer.buffer);
65
+ gl.deleteBuffer(this.sizes.buffer.buffer);
66
+ gl.deleteBuffer(this.colors.buffer.buffer);
70
67
  gl.deleteBuffer(this.quadBuffer);
71
68
  this.shaders.forEach(shader => gl.deleteShader(shader));
72
69
  }
73
-
74
- // Assumes the owning VAO (Vertex Array Object) is already bound.
75
- setupInstancedAttribute(name, size, glType, normalized) {
76
- const {
77
- gl,
78
- program
79
- } = this;
80
- const buffer = gl.createBuffer();
81
- gl.bindBuffer(gl.ARRAY_BUFFER, buffer);
82
- const location = gl.getAttribLocation(program, name);
83
- gl.enableVertexAttribArray(location);
84
- gl.vertexAttribPointer(location, size, glType, normalized, 0, 0);
85
- gl.vertexAttribDivisor(location, 1);
86
- return {
87
- buffer,
88
- size,
89
- glType,
90
- capacityBytes: 0,
91
- lastUploaded: null
92
- };
93
- }
94
- uploadBuffer(target, data) {
95
- if (target.lastUploaded === data) {
96
- return;
97
- }
98
- const {
99
- gl
100
- } = this;
101
- gl.bindBuffer(gl.ARRAY_BUFFER, target.buffer);
102
- if (data.byteLength <= target.capacityBytes) {
103
- gl.bufferSubData(gl.ARRAY_BUFFER, 0, data);
104
- } else {
105
- gl.bufferData(gl.ARRAY_BUFFER, data, gl.DYNAMIC_DRAW);
106
- target.capacityBytes = data.byteLength;
107
- }
108
- target.lastUploaded = data;
109
- }
110
70
  }
111
- exports.ScatterWebGLProgram = ScatterWebGLProgram;
112
- function initializeProgram(gl, vertexShaderSource, fragmentShaderSource) {
113
- const program = gl.createProgram();
114
- const vertexShader = (0, _utils.compileShader)(gl, vertexShaderSource, gl.VERTEX_SHADER);
115
- const fragmentShader = (0, _utils.compileShader)(gl, fragmentShaderSource, gl.FRAGMENT_SHADER);
116
- gl.attachShader(program, vertexShader);
117
- gl.attachShader(program, fragmentShader);
118
- gl.linkProgram(program);
119
- if (!gl.getProgramParameter(program, gl.LINK_STATUS)) {
120
- console.error(`Program linking failed: ${gl.getProgramInfoLog(program)}`);
121
- console.error(`Vertex shader info-log: ${gl.getShaderInfoLog(vertexShader)}`);
122
- console.error(`Fragment shader info-log: ${gl.getShaderInfoLog(fragmentShader)}`);
123
- }
124
- return {
125
- program,
126
- vertexShader,
127
- fragmentShader
128
- };
129
- }
71
+ exports.ScatterWebGLProgram = ScatterWebGLProgram;
@@ -1,30 +1,24 @@
1
- import { compileShader, logWebGLErrors } from "../../utils/webgl/utils.mjs";
1
+ import { bindQuadBuffer, linkProgram, logWebGLErrors, setupStandardBlending, uploadGrowableBuffer, uploadQuadBuffer } from "../../utils/webgl/utils.mjs";
2
+ import { createInstancedAttribute } from "../../utils/webgl/instancedAttribute.mjs";
2
3
  import { scatterVertexShader, scatterFragmentShader } from "./shaders.mjs";
3
- const QUAD_VERTICES = new Float32Array([-1, -1, 1, -1, -1, 1, 1, 1]);
4
4
  export class ScatterWebGLProgram {
5
5
  shaders = [];
6
+
7
+ /* Colors come in as Uint8 [0, 255]; normalized=true makes the GPU read them back as vec4 in [0, 1]. */
8
+
6
9
  constructor(gl) {
7
10
  this.gl = gl;
8
- gl.enable(gl.BLEND);
9
- gl.blendFunc(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA);
10
- this.quadBuffer = gl.createBuffer();
11
- gl.bindBuffer(gl.ARRAY_BUFFER, this.quadBuffer);
12
- gl.bufferData(gl.ARRAY_BUFFER, QUAD_VERTICES, gl.STATIC_DRAW);
13
- const prog = initializeProgram(gl, scatterVertexShader, scatterFragmentShader);
14
- this.program = prog.program;
15
- this.shaders.push(prog.vertexShader, prog.fragmentShader);
11
+ setupStandardBlending(gl);
12
+ const linked = linkProgram(gl, scatterVertexShader, scatterFragmentShader);
13
+ this.program = linked.program;
14
+ this.shaders.push(...linked.shaders);
15
+ this.quadBuffer = uploadQuadBuffer(gl);
16
16
  this.vao = gl.createVertexArray();
17
17
  gl.bindVertexArray(this.vao);
18
-
19
- // a_position references the shared quad; bind it once while the VAO is active.
20
- gl.bindBuffer(gl.ARRAY_BUFFER, this.quadBuffer);
21
- const aPosition = gl.getAttribLocation(this.program, 'a_position');
22
- gl.enableVertexAttribArray(aPosition);
23
- gl.vertexAttribPointer(aPosition, 2, gl.FLOAT, false, 0, 0);
24
- this.centers = this.setupInstancedAttribute('a_center', 2, gl.FLOAT, false);
25
- this.sizes = this.setupInstancedAttribute('a_size', 1, gl.FLOAT, false);
26
- // Colors come in as Uint8 [0, 255]; normalized=true makes the GPU read them back as vec4 in [0, 1].
27
- this.colors = this.setupInstancedAttribute('a_color', 4, gl.UNSIGNED_BYTE, true);
18
+ bindQuadBuffer(gl, this.program, this.quadBuffer);
19
+ this.centers = createInstancedAttribute(gl, this.program, 'a_center', 2);
20
+ this.sizes = createInstancedAttribute(gl, this.program, 'a_size', 1);
21
+ this.colors = createInstancedAttribute(gl, this.program, 'a_color', 4, gl.UNSIGNED_BYTE, true);
28
22
  gl.bindVertexArray(null);
29
23
  }
30
24
  setResolution(width, height) {
@@ -35,9 +29,12 @@ export class ScatterWebGLProgram {
35
29
  gl.uniform2f(gl.getUniformLocation(this.program, 'u_resolution'), width, height);
36
30
  }
37
31
  plot(plotData) {
38
- this.uploadBuffer(this.centers, plotData.centers);
39
- this.uploadBuffer(this.sizes, plotData.sizes);
40
- this.uploadBuffer(this.colors, plotData.colors);
32
+ const {
33
+ gl
34
+ } = this;
35
+ uploadGrowableBuffer(gl, this.centers.buffer, plotData.centers);
36
+ uploadGrowableBuffer(gl, this.sizes.buffer, plotData.sizes);
37
+ uploadGrowableBuffer(gl, this.colors.buffer, plotData.colors);
41
38
  }
42
39
  render(plotData) {
43
40
  if (plotData.pointCount === 0) {
@@ -58,65 +55,10 @@ export class ScatterWebGLProgram {
58
55
  } = this;
59
56
  gl.deleteProgram(this.program);
60
57
  gl.deleteVertexArray(this.vao);
61
- gl.deleteBuffer(this.centers.buffer);
62
- gl.deleteBuffer(this.sizes.buffer);
63
- gl.deleteBuffer(this.colors.buffer);
58
+ gl.deleteBuffer(this.centers.buffer.buffer);
59
+ gl.deleteBuffer(this.sizes.buffer.buffer);
60
+ gl.deleteBuffer(this.colors.buffer.buffer);
64
61
  gl.deleteBuffer(this.quadBuffer);
65
62
  this.shaders.forEach(shader => gl.deleteShader(shader));
66
63
  }
67
-
68
- // Assumes the owning VAO (Vertex Array Object) is already bound.
69
- setupInstancedAttribute(name, size, glType, normalized) {
70
- const {
71
- gl,
72
- program
73
- } = this;
74
- const buffer = gl.createBuffer();
75
- gl.bindBuffer(gl.ARRAY_BUFFER, buffer);
76
- const location = gl.getAttribLocation(program, name);
77
- gl.enableVertexAttribArray(location);
78
- gl.vertexAttribPointer(location, size, glType, normalized, 0, 0);
79
- gl.vertexAttribDivisor(location, 1);
80
- return {
81
- buffer,
82
- size,
83
- glType,
84
- capacityBytes: 0,
85
- lastUploaded: null
86
- };
87
- }
88
- uploadBuffer(target, data) {
89
- if (target.lastUploaded === data) {
90
- return;
91
- }
92
- const {
93
- gl
94
- } = this;
95
- gl.bindBuffer(gl.ARRAY_BUFFER, target.buffer);
96
- if (data.byteLength <= target.capacityBytes) {
97
- gl.bufferSubData(gl.ARRAY_BUFFER, 0, data);
98
- } else {
99
- gl.bufferData(gl.ARRAY_BUFFER, data, gl.DYNAMIC_DRAW);
100
- target.capacityBytes = data.byteLength;
101
- }
102
- target.lastUploaded = data;
103
- }
104
- }
105
- function initializeProgram(gl, vertexShaderSource, fragmentShaderSource) {
106
- const program = gl.createProgram();
107
- const vertexShader = compileShader(gl, vertexShaderSource, gl.VERTEX_SHADER);
108
- const fragmentShader = compileShader(gl, fragmentShaderSource, gl.FRAGMENT_SHADER);
109
- gl.attachShader(program, vertexShader);
110
- gl.attachShader(program, fragmentShader);
111
- gl.linkProgram(program);
112
- if (!gl.getProgramParameter(program, gl.LINK_STATUS)) {
113
- console.error(`Program linking failed: ${gl.getProgramInfoLog(program)}`);
114
- console.error(`Vertex shader info-log: ${gl.getShaderInfoLog(vertexShader)}`);
115
- console.error(`Fragment shader info-log: ${gl.getShaderInfoLog(fragmentShader)}`);
116
- }
117
- return {
118
- program,
119
- vertexShader,
120
- fragmentShader
121
- };
122
64
  }
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-charts-premium v9.7.0
2
+ * @mui/x-charts-premium v9.9.0
3
3
  *
4
4
  * @license SEE LICENSE IN LICENSE
5
5
  * This source code is licensed under the SEE LICENSE IN LICENSE license found in the
package/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-charts-premium v9.7.0
2
+ * @mui/x-charts-premium v9.9.0
3
3
  *
4
4
  * @license SEE LICENSE IN LICENSE
5
5
  * This source code is licensed under the SEE LICENSE IN LICENSE license found in the
@@ -0,0 +1,14 @@
1
+ import type { GeoProjection } from '@mui/x-charts-vendor/d3-geo';
2
+ /**
3
+ * Builds a test that maps a device pixel to its `[lon, lat]`, or `null` when the
4
+ * pixel is not part of the visible map. It combines two clips that `projection.invert`
5
+ * alone misses:
6
+ *
7
+ * - the **post-clip** (cartesian) stream rejects device pixels outside the clip
8
+ * rectangle — relevant once the map is panned/zoomed with a `clipExtent`;
9
+ * - streaming the inverted coordinate **back** through the projection applies the
10
+ * pre-clip (spherical) boundary and checks the round trip: azimuthal projections
11
+ * clamp `invert` outside the visible disk to the limb, and those clamped points do
12
+ * not project back to the pixel they came from.
13
+ */
14
+ export declare function createGetVisibleCoordinate(projection: GeoProjection): ([deviceX, deviceY]: [number, number]) => [number, number] | null;
@@ -0,0 +1,14 @@
1
+ import type { GeoProjection } from '@mui/x-charts-vendor/d3-geo';
2
+ /**
3
+ * Builds a test that maps a device pixel to its `[lon, lat]`, or `null` when the
4
+ * pixel is not part of the visible map. It combines two clips that `projection.invert`
5
+ * alone misses:
6
+ *
7
+ * - the **post-clip** (cartesian) stream rejects device pixels outside the clip
8
+ * rectangle — relevant once the map is panned/zoomed with a `clipExtent`;
9
+ * - streaming the inverted coordinate **back** through the projection applies the
10
+ * pre-clip (spherical) boundary and checks the round trip: azimuthal projections
11
+ * clamp `invert` outside the visible disk to the limb, and those clamped points do
12
+ * not project back to the pixel they came from.
13
+ */
14
+ export declare function createGetVisibleCoordinate(projection: GeoProjection): ([deviceX, deviceY]: [number, number]) => [number, number] | null;
@@ -0,0 +1,66 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.createGetVisibleCoordinate = createGetVisibleCoordinate;
7
+ // A `GeoStream` sink that only records whether a point passed through (and where),
8
+ // so a projection/clip pipeline can be probed one point at a time.
9
+
10
+ function createPointSink() {
11
+ const sink = {
12
+ hit: false,
13
+ x: 0,
14
+ y: 0,
15
+ point(x, y) {
16
+ sink.hit = true;
17
+ sink.x = x;
18
+ sink.y = y;
19
+ },
20
+ lineStart() {},
21
+ lineEnd() {},
22
+ polygonStart() {},
23
+ polygonEnd() {}
24
+ };
25
+ return sink;
26
+ }
27
+
28
+ /**
29
+ * Builds a test that maps a device pixel to its `[lon, lat]`, or `null` when the
30
+ * pixel is not part of the visible map. It combines two clips that `projection.invert`
31
+ * alone misses:
32
+ *
33
+ * - the **post-clip** (cartesian) stream rejects device pixels outside the clip
34
+ * rectangle — relevant once the map is panned/zoomed with a `clipExtent`;
35
+ * - streaming the inverted coordinate **back** through the projection applies the
36
+ * pre-clip (spherical) boundary and checks the round trip: azimuthal projections
37
+ * clamp `invert` outside the visible disk to the limb, and those clamped points do
38
+ * not project back to the pixel they came from.
39
+ */
40
+ function createGetVisibleCoordinate(projection) {
41
+ const invert = projection.invert;
42
+ const forwardSink = createPointSink();
43
+ const forwardStream = projection.stream(forwardSink);
44
+ const postClip = projection.postclip?.();
45
+ const clipSink = createPointSink();
46
+ const clipStream = postClip?.(clipSink);
47
+ return ([deviceX, deviceY]) => {
48
+ if (clipStream) {
49
+ clipSink.hit = false;
50
+ clipStream.point(deviceX, deviceY);
51
+ if (!clipSink.hit) {
52
+ return null;
53
+ }
54
+ }
55
+ const coordinates = invert([deviceX, deviceY]);
56
+ if (!coordinates) {
57
+ return null;
58
+ }
59
+ forwardSink.hit = false;
60
+ forwardStream.point(coordinates[0], coordinates[1]);
61
+ if (!forwardSink.hit || Math.abs(forwardSink.x - deviceX) > 0.5 || Math.abs(forwardSink.y - deviceY) > 0.5) {
62
+ return null;
63
+ }
64
+ return coordinates;
65
+ };
66
+ }
@@ -0,0 +1,60 @@
1
+ // A `GeoStream` sink that only records whether a point passed through (and where),
2
+ // so a projection/clip pipeline can be probed one point at a time.
3
+
4
+ function createPointSink() {
5
+ const sink = {
6
+ hit: false,
7
+ x: 0,
8
+ y: 0,
9
+ point(x, y) {
10
+ sink.hit = true;
11
+ sink.x = x;
12
+ sink.y = y;
13
+ },
14
+ lineStart() {},
15
+ lineEnd() {},
16
+ polygonStart() {},
17
+ polygonEnd() {}
18
+ };
19
+ return sink;
20
+ }
21
+
22
+ /**
23
+ * Builds a test that maps a device pixel to its `[lon, lat]`, or `null` when the
24
+ * pixel is not part of the visible map. It combines two clips that `projection.invert`
25
+ * alone misses:
26
+ *
27
+ * - the **post-clip** (cartesian) stream rejects device pixels outside the clip
28
+ * rectangle — relevant once the map is panned/zoomed with a `clipExtent`;
29
+ * - streaming the inverted coordinate **back** through the projection applies the
30
+ * pre-clip (spherical) boundary and checks the round trip: azimuthal projections
31
+ * clamp `invert` outside the visible disk to the limb, and those clamped points do
32
+ * not project back to the pixel they came from.
33
+ */
34
+ export function createGetVisibleCoordinate(projection) {
35
+ const invert = projection.invert;
36
+ const forwardSink = createPointSink();
37
+ const forwardStream = projection.stream(forwardSink);
38
+ const postClip = projection.postclip?.();
39
+ const clipSink = createPointSink();
40
+ const clipStream = postClip?.(clipSink);
41
+ return ([deviceX, deviceY]) => {
42
+ if (clipStream) {
43
+ clipSink.hit = false;
44
+ clipStream.point(deviceX, deviceY);
45
+ if (!clipSink.hit) {
46
+ return null;
47
+ }
48
+ }
49
+ const coordinates = invert([deviceX, deviceY]);
50
+ if (!coordinates) {
51
+ return null;
52
+ }
53
+ forwardSink.hit = false;
54
+ forwardStream.point(coordinates[0], coordinates[1]);
55
+ if (!forwardSink.hit || Math.abs(forwardSink.x - deviceX) > 0.5 || Math.abs(forwardSink.y - deviceY) > 0.5) {
56
+ return null;
57
+ }
58
+ return coordinates;
59
+ };
60
+ }
@@ -0,0 +1,3 @@
1
+ import type { GeoProjection } from '@mui/x-charts-vendor/d3-geo';
2
+ import type { D3NamedProjection } from "./useGeoProjection.types.mjs";
3
+ export declare const PROJECTION_FACTORIES: Record<D3NamedProjection, (() => GeoProjection) | undefined>;
@@ -0,0 +1,3 @@
1
+ import type { GeoProjection } from '@mui/x-charts-vendor/d3-geo';
2
+ import type { D3NamedProjection } from "./useGeoProjection.types.js";
3
+ export declare const PROJECTION_FACTORIES: Record<D3NamedProjection, (() => GeoProjection) | undefined>;