@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
@@ -0,0 +1,166 @@
1
+ 'use client';
2
+
3
+ import _extends from "@babel/runtime/helpers/esm/extends";
4
+ import * as React from 'react';
5
+ import { useEffectAfterFirstRender } from '@mui/x-internals/useEffectAfterFirstRender';
6
+ import { useRegisterZoomGestures } from '@mui/x-charts-pro/internals';
7
+ import { selectorChartRawProjection } from "../useGeoProjection/useGeoProjection.selectors.mjs";
8
+ import { BUTTON_ZOOM_STEP, getDefaultMapInteraction } from "./mapZoom.utils.mjs";
9
+ import { usePanOnDrag } from "./gestureHooks/usePanOnDrag.mjs";
10
+ import { useZoomOnWheel } from "./gestureHooks/useZoomOnWheel.mjs";
11
+ import { useZoomOnPinch } from "./gestureHooks/useZoomOnPinch.mjs";
12
+ import { getDefaultTranslation } from "../useGeoProjection/projection.utils.mjs";
13
+ export const useGeoProjectionZoom = ({
14
+ store,
15
+ instance,
16
+ params
17
+ }) => {
18
+ const {
19
+ zoom,
20
+ onViewChange,
21
+ view
22
+ } = params;
23
+ const interactionDefaults = getDefaultMapInteraction(selectorChartRawProjection(store.state));
24
+ const {
25
+ minZoomLevel = 0.5,
26
+ maxZoomLevel = 8,
27
+ maxEmptySpace = 0,
28
+ rotationAllowed = interactionDefaults.rotationAllowed,
29
+ translationAllowed = interactionDefaults.translationAllowed
30
+ } = typeof zoom === 'object' ? zoom : {};
31
+
32
+ // `zoom` is either a boolean or a config object; an object always enables the interaction.
33
+ const enabled = zoom !== false;
34
+ const isControlled = view !== undefined;
35
+ const clampZoomLevel = React.useCallback(zoomLevel => Math.max(minZoomLevel, Math.min(maxZoomLevel, zoomLevel)), [minZoomLevel, maxZoomLevel]);
36
+
37
+ // The view is the source of truth, stored directly: no pixel <-> view conversion on write/read.
38
+ // Callers are responsible for clamping `zoomLevel`.
39
+ const applyView = React.useCallback(newView => {
40
+ if (!isControlled) {
41
+ store.set('geoProjectionZoom', _extends({}, store.state.geoProjectionZoom, {
42
+ zoomLevel: newView.zoomLevel,
43
+ center: newView.center,
44
+ translation: newView.translation,
45
+ roll: newView.roll
46
+ }));
47
+ }
48
+ onViewChange?.(newView);
49
+ }, [store, isControlled, onViewChange]);
50
+
51
+ // In controlled mode, keep the store in sync with the `view` prop. The initial view is seeded in
52
+ // `getInitialState`, so this only reacts to subsequent updates.
53
+ useEffectAfterFirstRender(() => {
54
+ if (!view) {
55
+ return;
56
+ }
57
+ store.set('geoProjectionZoom', _extends({}, store.state.geoProjectionZoom, {
58
+ zoomLevel: view.zoomLevel,
59
+ center: view.center,
60
+ translation: view.translation,
61
+ roll: view.roll
62
+ }));
63
+ }, [store, view]);
64
+ useRegisterZoomGestures({
65
+ instance
66
+ });
67
+
68
+ // --- gestures: reuse the generic primitives from x-charts-pro -------------
69
+ usePanOnDrag({
70
+ store,
71
+ instance
72
+ }, applyView, {
73
+ enabled,
74
+ rotationAllowed,
75
+ translationAllowed,
76
+ maxEmptySpace
77
+ });
78
+ useZoomOnWheel({
79
+ store,
80
+ instance
81
+ }, applyView, {
82
+ enabled,
83
+ rotationAllowed,
84
+ translationAllowed,
85
+ maxEmptySpace,
86
+ minZoomLevel,
87
+ maxZoomLevel
88
+ });
89
+ useZoomOnPinch({
90
+ store,
91
+ instance
92
+ }, applyView, {
93
+ enabled,
94
+ rotationAllowed,
95
+ translationAllowed,
96
+ maxEmptySpace,
97
+ minZoomLevel,
98
+ maxZoomLevel
99
+ });
100
+
101
+ // Shared by both buttons: clamp through `applyView` (which also handles controlled mode and
102
+ // `onViewChange`), keeping the current center/translation. Bail out when already at a bound so a
103
+ // click at the limit stays a no-op.
104
+ const zoomBy = React.useCallback(factor => {
105
+ const current = store.state.geoProjectionZoom;
106
+ const currentZoom = current.zoomLevel ?? 1;
107
+ const nextZoom = clampZoomLevel(currentZoom * factor);
108
+ if (nextZoom === currentZoom) {
109
+ return;
110
+ }
111
+ applyView({
112
+ zoomLevel: nextZoom,
113
+ center: current.center ?? [0, 0],
114
+ translation: current.translation ?? [0, 0],
115
+ roll: current.roll ?? 0
116
+ });
117
+ }, [store, clampZoomLevel, applyView]);
118
+ const zoomIn = React.useCallback(() => zoomBy(BUTTON_ZOOM_STEP), [zoomBy]);
119
+ const zoomOut = React.useCallback(() => zoomBy(1 / BUTTON_ZOOM_STEP), [zoomBy]);
120
+ const resetZoom = React.useCallback(() => {
121
+ applyView({
122
+ zoomLevel: store.state.geoProjectionZoom.initialZoomLevel,
123
+ center: store.state.geoProjectionZoom.initialCenter,
124
+ translation: store.state.geoProjectionZoom.initialTranslation,
125
+ roll: store.state.geoProjectionZoom.initialRoll
126
+ });
127
+ }, [applyView, store]);
128
+ const publicAPI = {
129
+ zoomIn,
130
+ zoomOut,
131
+ resetZoom
132
+ };
133
+ return {
134
+ publicAPI,
135
+ instance: publicAPI
136
+ };
137
+ };
138
+ useGeoProjectionZoom.params = {
139
+ zoom: true,
140
+ initialView: true,
141
+ view: true,
142
+ onViewChange: true
143
+ };
144
+ useGeoProjectionZoom.getDefaultizedParams = ({
145
+ params
146
+ }) => _extends({}, params, {
147
+ zoom: params.zoom ?? false
148
+ });
149
+ useGeoProjectionZoom.getInitialState = params => {
150
+ const zoomLevel = params.view?.zoomLevel ?? params.initialView?.zoomLevel ?? 1;
151
+ const center = params.view?.center ?? params.initialView?.center ?? [0, 0];
152
+ const roll = params.view?.roll ?? params.initialView?.roll ?? 0;
153
+ const translation = params.view?.translation ?? params.initialView?.translation ?? getDefaultTranslation(params.projection, params.geoData, params.parallels, center) ?? [0, 0];
154
+ return {
155
+ geoProjectionZoom: {
156
+ zoomLevel,
157
+ center,
158
+ translation,
159
+ roll,
160
+ initialZoomLevel: zoomLevel,
161
+ initialCenter: center,
162
+ initialTranslation: translation,
163
+ initialRoll: roll
164
+ }
165
+ };
166
+ };
@@ -0,0 +1,152 @@
1
+ import type { ChartPluginSignature } from '@mui/x-charts/internals';
2
+ import type { UseGeoProjectionSignature } from "../useGeoProjection/useGeoProjection.types.mjs";
3
+ /**
4
+ * Which rotation axes a pan/zoom gesture may move:
5
+ * - `'both'`: rotate freely along longitude and latitude, keeping the roll fixed.
6
+ * - `'longitude'`: rotate along longitude only (lock the north–south tilt).
7
+ * - `'none'`: lock every axis.
8
+ * - `'both+roll'`: rotate freely along longitude and latitude, and allow rolling the map around the center.
9
+ */
10
+ export type MapRotationAxis = 'both' | 'longitude' | 'none' | 'both+roll';
11
+ export type MapTranslationAxis = 'both' | 'x' | 'y' | 'none';
12
+ /**
13
+ * Public, resolution-independent representation of the map view.
14
+ *
15
+ * Unlike the raw projection `scale`/`translate` (both in SVG pixels, tied to the drawing-area
16
+ * size), a view survives a resize: `zoomLevel` is a ratio and `center` is a geographic coordinate.
17
+ */
18
+ export interface MapZoomView {
19
+ /**
20
+ * The zoom level, as a multiple of the scale that fits the data in the drawing area.
21
+ * `1` means the whole dataset fits the drawing area; `2` means twice as close.
22
+ */
23
+ zoomLevel: number;
24
+ /**
25
+ * The geographic coordinate `[longitude, latitude]` displayed at the center of the drawing area.
26
+ */
27
+ center: [number, number];
28
+ /**
29
+ * The map translation in percentage of the drawing area.
30
+ */
31
+ translation: [number, number];
32
+ /**
33
+ * The roll of the map, in degrees.
34
+ * This spins the map around the point displayed at the center of the drawing area, independently
35
+ * of the `center` (which controls longitude/latitude).
36
+ */
37
+ roll: number;
38
+ }
39
+ /**
40
+ * Fine-grained configuration for the map zoom/pan interaction, passed as the `zoom` parameter
41
+ * instead of a plain `true`.
42
+ */
43
+ export interface MapZoomOptions {
44
+ /**
45
+ * Which axes the map can be rotated along while panning or zooming.
46
+ * For example, `'longitude'` lets the map rotate east–west but locks the north–south tilt.
47
+ */
48
+ rotationAllowed?: MapRotationAxis;
49
+ /**
50
+ * Which axes the map can be translated along while panning or zooming.
51
+ * For example, `'y'` lets the map translate vertically but locks the horizontal movement.
52
+ */
53
+ translationAllowed?: MapTranslationAxis;
54
+ /**
55
+ * The minimum zoom level, as a multiple of the scale that fits the data in the drawing area.
56
+ * @default 1
57
+ */
58
+ minZoomLevel?: number;
59
+ /**
60
+ * The maximum zoom level, as a multiple of the scale that fits the data in the drawing area.
61
+ * @default 8
62
+ */
63
+ maxZoomLevel?: number;
64
+ /**
65
+ * The maximal space left empty while panning, expressed as a ratio of the drawing area size.
66
+ * For example:
67
+ * - `0` keeps the map's bounding box flush with (or covering) the drawing area.
68
+ * - `0.5` lets the user pan until at most half of the drawing area is empty on a given side.
69
+ * @default 0
70
+ */
71
+ maxEmptySpace?: number;
72
+ }
73
+ interface UseGeoProjectionZoomParameters {
74
+ /**
75
+ * If `true`, the map can be panned (drag) and zoomed (wheel / pinch).
76
+ * Pass a {@link MapZoomOptions} object to fine-tune the interaction, e.g. restrict rotation axes.
77
+ * @default false
78
+ */
79
+ zoom?: boolean | MapZoomOptions;
80
+ /**
81
+ * The view to apply on mount, when the zoom is not controlled.
82
+ * Use this to seed the map at a specific zoom level and center without controlling it.
83
+ */
84
+ initialView?: Omit<MapZoomView, 'translation' | 'roll'> & Partial<Pick<MapZoomView, 'translation' | 'roll'>>;
85
+ /**
86
+ * The view to display, in controlled mode.
87
+ * When set, the component does not update the view on its own — drive it from `onViewChange`.
88
+ */
89
+ view?: MapZoomView;
90
+ /**
91
+ * Callback fired when the map zoom or pan changes (including programmatic reset).
92
+ * @param {MapZoomView} view The new zoom level and geographic center.
93
+ */
94
+ onViewChange?: (view: MapZoomView) => void;
95
+ }
96
+ interface UseGeoProjectionZoomDefaultizedParameters extends UseGeoProjectionZoomParameters {
97
+ zoom: boolean | MapZoomOptions;
98
+ }
99
+ /**
100
+ * Imperative methods shared by the plugin `instance` and the public `apiRef`.
101
+ */
102
+ interface UseGeoProjectionZoomPublicApi {
103
+ /**
104
+ * Zoom the map in by a fixed step, centered on the drawing area.
105
+ */
106
+ zoomIn: () => void;
107
+ /**
108
+ * Zoom the map out by a fixed step, centered on the drawing area.
109
+ */
110
+ zoomOut: () => void;
111
+ /**
112
+ * Reset the map to the default scale and translation that fit the data in the drawing area.
113
+ */
114
+ resetZoom: () => void;
115
+ }
116
+ interface UseGeoProjectionZoomInstance extends UseGeoProjectionZoomPublicApi {}
117
+ export interface UseGeoProjectionZoomState {
118
+ geoProjectionZoom: {
119
+ /**
120
+ * The zoom level, as a multiple of the scale that fits the data in the drawing area.
121
+ * `null` (the default) and `1` both mean fit-to-data. The absolute projection scale is
122
+ * derived as `fitScale * zoomLevel`, so this stays valid across resizes.
123
+ */
124
+ zoomLevel: number;
125
+ /**
126
+ * The geographic coordinate `[longitude, latitude]` displayed at the center of the drawing area.
127
+ * `null` keeps the data centered (the fit center).
128
+ */
129
+ center: [number, number];
130
+ /**
131
+ * The map translation in percentage of the drawing area.
132
+ */
133
+ translation: [number, number] | null;
134
+ /**
135
+ * The roll of the map, in degrees. `null` keeps the map upright (no roll).
136
+ */
137
+ roll: number;
138
+ initialTranslation: [number, number];
139
+ initialCenter: [number, number];
140
+ initialZoomLevel: number;
141
+ initialRoll: number;
142
+ };
143
+ }
144
+ export type UseGeoProjectionZoomSignature = ChartPluginSignature<{
145
+ params: UseGeoProjectionZoomParameters;
146
+ defaultizedParams: UseGeoProjectionZoomDefaultizedParameters;
147
+ publicAPI: UseGeoProjectionZoomPublicApi;
148
+ instance: UseGeoProjectionZoomInstance;
149
+ state: UseGeoProjectionZoomState;
150
+ dependencies: [UseGeoProjectionSignature];
151
+ }>;
152
+ export {};
@@ -0,0 +1,152 @@
1
+ import type { ChartPluginSignature } from '@mui/x-charts/internals';
2
+ import type { UseGeoProjectionSignature } from "../useGeoProjection/useGeoProjection.types.js";
3
+ /**
4
+ * Which rotation axes a pan/zoom gesture may move:
5
+ * - `'both'`: rotate freely along longitude and latitude, keeping the roll fixed.
6
+ * - `'longitude'`: rotate along longitude only (lock the north–south tilt).
7
+ * - `'none'`: lock every axis.
8
+ * - `'both+roll'`: rotate freely along longitude and latitude, and allow rolling the map around the center.
9
+ */
10
+ export type MapRotationAxis = 'both' | 'longitude' | 'none' | 'both+roll';
11
+ export type MapTranslationAxis = 'both' | 'x' | 'y' | 'none';
12
+ /**
13
+ * Public, resolution-independent representation of the map view.
14
+ *
15
+ * Unlike the raw projection `scale`/`translate` (both in SVG pixels, tied to the drawing-area
16
+ * size), a view survives a resize: `zoomLevel` is a ratio and `center` is a geographic coordinate.
17
+ */
18
+ export interface MapZoomView {
19
+ /**
20
+ * The zoom level, as a multiple of the scale that fits the data in the drawing area.
21
+ * `1` means the whole dataset fits the drawing area; `2` means twice as close.
22
+ */
23
+ zoomLevel: number;
24
+ /**
25
+ * The geographic coordinate `[longitude, latitude]` displayed at the center of the drawing area.
26
+ */
27
+ center: [number, number];
28
+ /**
29
+ * The map translation in percentage of the drawing area.
30
+ */
31
+ translation: [number, number];
32
+ /**
33
+ * The roll of the map, in degrees.
34
+ * This spins the map around the point displayed at the center of the drawing area, independently
35
+ * of the `center` (which controls longitude/latitude).
36
+ */
37
+ roll: number;
38
+ }
39
+ /**
40
+ * Fine-grained configuration for the map zoom/pan interaction, passed as the `zoom` parameter
41
+ * instead of a plain `true`.
42
+ */
43
+ export interface MapZoomOptions {
44
+ /**
45
+ * Which axes the map can be rotated along while panning or zooming.
46
+ * For example, `'longitude'` lets the map rotate east–west but locks the north–south tilt.
47
+ */
48
+ rotationAllowed?: MapRotationAxis;
49
+ /**
50
+ * Which axes the map can be translated along while panning or zooming.
51
+ * For example, `'y'` lets the map translate vertically but locks the horizontal movement.
52
+ */
53
+ translationAllowed?: MapTranslationAxis;
54
+ /**
55
+ * The minimum zoom level, as a multiple of the scale that fits the data in the drawing area.
56
+ * @default 1
57
+ */
58
+ minZoomLevel?: number;
59
+ /**
60
+ * The maximum zoom level, as a multiple of the scale that fits the data in the drawing area.
61
+ * @default 8
62
+ */
63
+ maxZoomLevel?: number;
64
+ /**
65
+ * The maximal space left empty while panning, expressed as a ratio of the drawing area size.
66
+ * For example:
67
+ * - `0` keeps the map's bounding box flush with (or covering) the drawing area.
68
+ * - `0.5` lets the user pan until at most half of the drawing area is empty on a given side.
69
+ * @default 0
70
+ */
71
+ maxEmptySpace?: number;
72
+ }
73
+ interface UseGeoProjectionZoomParameters {
74
+ /**
75
+ * If `true`, the map can be panned (drag) and zoomed (wheel / pinch).
76
+ * Pass a {@link MapZoomOptions} object to fine-tune the interaction, e.g. restrict rotation axes.
77
+ * @default false
78
+ */
79
+ zoom?: boolean | MapZoomOptions;
80
+ /**
81
+ * The view to apply on mount, when the zoom is not controlled.
82
+ * Use this to seed the map at a specific zoom level and center without controlling it.
83
+ */
84
+ initialView?: Omit<MapZoomView, 'translation' | 'roll'> & Partial<Pick<MapZoomView, 'translation' | 'roll'>>;
85
+ /**
86
+ * The view to display, in controlled mode.
87
+ * When set, the component does not update the view on its own — drive it from `onViewChange`.
88
+ */
89
+ view?: MapZoomView;
90
+ /**
91
+ * Callback fired when the map zoom or pan changes (including programmatic reset).
92
+ * @param {MapZoomView} view The new zoom level and geographic center.
93
+ */
94
+ onViewChange?: (view: MapZoomView) => void;
95
+ }
96
+ interface UseGeoProjectionZoomDefaultizedParameters extends UseGeoProjectionZoomParameters {
97
+ zoom: boolean | MapZoomOptions;
98
+ }
99
+ /**
100
+ * Imperative methods shared by the plugin `instance` and the public `apiRef`.
101
+ */
102
+ interface UseGeoProjectionZoomPublicApi {
103
+ /**
104
+ * Zoom the map in by a fixed step, centered on the drawing area.
105
+ */
106
+ zoomIn: () => void;
107
+ /**
108
+ * Zoom the map out by a fixed step, centered on the drawing area.
109
+ */
110
+ zoomOut: () => void;
111
+ /**
112
+ * Reset the map to the default scale and translation that fit the data in the drawing area.
113
+ */
114
+ resetZoom: () => void;
115
+ }
116
+ interface UseGeoProjectionZoomInstance extends UseGeoProjectionZoomPublicApi {}
117
+ export interface UseGeoProjectionZoomState {
118
+ geoProjectionZoom: {
119
+ /**
120
+ * The zoom level, as a multiple of the scale that fits the data in the drawing area.
121
+ * `null` (the default) and `1` both mean fit-to-data. The absolute projection scale is
122
+ * derived as `fitScale * zoomLevel`, so this stays valid across resizes.
123
+ */
124
+ zoomLevel: number;
125
+ /**
126
+ * The geographic coordinate `[longitude, latitude]` displayed at the center of the drawing area.
127
+ * `null` keeps the data centered (the fit center).
128
+ */
129
+ center: [number, number];
130
+ /**
131
+ * The map translation in percentage of the drawing area.
132
+ */
133
+ translation: [number, number] | null;
134
+ /**
135
+ * The roll of the map, in degrees. `null` keeps the map upright (no roll).
136
+ */
137
+ roll: number;
138
+ initialTranslation: [number, number];
139
+ initialCenter: [number, number];
140
+ initialZoomLevel: number;
141
+ initialRoll: number;
142
+ };
143
+ }
144
+ export type UseGeoProjectionZoomSignature = ChartPluginSignature<{
145
+ params: UseGeoProjectionZoomParameters;
146
+ defaultizedParams: UseGeoProjectionZoomDefaultizedParameters;
147
+ publicAPI: UseGeoProjectionZoomPublicApi;
148
+ instance: UseGeoProjectionZoomInstance;
149
+ state: UseGeoProjectionZoomState;
150
+ dependencies: [UseGeoProjectionSignature];
151
+ }>;
152
+ export {};
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
@@ -94,7 +94,7 @@ export interface MapShapeSeriesType extends Omit<CommonSeriesType<'mapShape'>, '
94
94
  export type MapShapeItemIdentifier = {
95
95
  type: 'mapShape';
96
96
  seriesId: SeriesId;
97
- dataIndex: number;
97
+ name: string;
98
98
  };
99
99
  export type DefaultizedMapShapeValueType = MapShapeValueType & {
100
100
  hidden: boolean;
@@ -102,4 +102,5 @@ export type DefaultizedMapShapeValueType = MapShapeValueType & {
102
102
  export interface DefaultizedMapShapeSeriesType extends Omit<DefaultizedProps<MapShapeSeriesType, CommonDefaultizedProps | 'color'>, 'data'> {
103
103
  hidden: boolean;
104
104
  data: ReadonlyArray<DefaultizedMapShapeValueType>;
105
+ lookupByName: ReadonlyMap<string, number>;
105
106
  }
@@ -94,7 +94,7 @@ export interface MapShapeSeriesType extends Omit<CommonSeriesType<'mapShape'>, '
94
94
  export type MapShapeItemIdentifier = {
95
95
  type: 'mapShape';
96
96
  seriesId: SeriesId;
97
- dataIndex: number;
97
+ name: string;
98
98
  };
99
99
  export type DefaultizedMapShapeValueType = MapShapeValueType & {
100
100
  hidden: boolean;
@@ -102,4 +102,5 @@ export type DefaultizedMapShapeValueType = MapShapeValueType & {
102
102
  export interface DefaultizedMapShapeSeriesType extends Omit<DefaultizedProps<MapShapeSeriesType, CommonDefaultizedProps | 'color'>, 'data'> {
103
103
  hidden: boolean;
104
104
  data: ReadonlyArray<DefaultizedMapShapeValueType>;
105
+ lookupByName: ReadonlyMap<string, number>;
105
106
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui/x-charts-premium",
3
- "version": "9.7.0",
3
+ "version": "9.9.0",
4
4
  "author": "MUI Team",
5
5
  "description": "The Premium plan edition of the MUI X Charts components.",
6
6
  "license": "SEE LICENSE IN LICENSE",
@@ -28,14 +28,14 @@
28
28
  },
29
29
  "dependencies": {
30
30
  "@babel/runtime": "^7.29.7",
31
- "@mui/utils": "^9.1.1",
31
+ "@mui/utils": "^9.2.0",
32
32
  "clsx": "^2.1.1",
33
33
  "prop-types": "^15.8.1",
34
- "@mui/x-charts": "^9.7.0",
35
- "@mui/x-charts-pro": "^9.7.0",
34
+ "@mui/x-charts": "^9.9.0",
35
+ "@mui/x-license": "^9.9.0",
36
+ "@mui/x-charts-pro": "^9.9.0",
36
37
  "@mui/x-charts-vendor": "^9.4.0",
37
- "@mui/x-license": "^9.7.0",
38
- "@mui/x-internals": "^9.7.0"
38
+ "@mui/x-internals": "^9.9.0"
39
39
  },
40
40
  "peerDependencies": {
41
41
  "@emotion/react": "^11.9.0",
@@ -0,0 +1,15 @@
1
+ /**
2
+ * GLSL snippet: signed distance field for a rounded box with per-corner radii.
3
+ *
4
+ * Convention:
5
+ * - `pos` and `halfSize` are in the same pixel-space coordinates.
6
+ * - `r` carries corner radii in CSS order: top-left, top-right, bottom-right, bottom-left.
7
+ * - For uniform-radius use cases pass `vec4(scalar)`.
8
+ *
9
+ * Screen-space conventions (after the y-flip in the vertex stage):
10
+ * pos.y < 0 -> top, pos.y > 0 -> bottom
11
+ * pos.x < 0 -> left, pos.x > 0 -> right
12
+ *
13
+ * Reference: Inigo Quilez, "Distance to a rounded box".
14
+ */
15
+ export declare const ROUNDED_BOX_SDF_GLSL = "\n float roundedBoxSDF(vec2 pos, vec2 halfSize, vec4 r) {\n float radius;\n if (pos.x < 0.0) {\n radius = pos.y < 0.0 ? r.x : r.w;\n } else {\n radius = pos.y < 0.0 ? r.y : r.z;\n }\n\n vec2 q = abs(pos) - halfSize + radius;\n return min(max(q.x, q.y), 0.0) + length(max(q, 0.0)) - radius;\n }\n ";
@@ -0,0 +1,15 @@
1
+ /**
2
+ * GLSL snippet: signed distance field for a rounded box with per-corner radii.
3
+ *
4
+ * Convention:
5
+ * - `pos` and `halfSize` are in the same pixel-space coordinates.
6
+ * - `r` carries corner radii in CSS order: top-left, top-right, bottom-right, bottom-left.
7
+ * - For uniform-radius use cases pass `vec4(scalar)`.
8
+ *
9
+ * Screen-space conventions (after the y-flip in the vertex stage):
10
+ * pos.y < 0 -> top, pos.y > 0 -> bottom
11
+ * pos.x < 0 -> left, pos.x > 0 -> right
12
+ *
13
+ * Reference: Inigo Quilez, "Distance to a rounded box".
14
+ */
15
+ export declare const ROUNDED_BOX_SDF_GLSL = "\n float roundedBoxSDF(vec2 pos, vec2 halfSize, vec4 r) {\n float radius;\n if (pos.x < 0.0) {\n radius = pos.y < 0.0 ? r.x : r.w;\n } else {\n radius = pos.y < 0.0 ? r.y : r.z;\n }\n\n vec2 q = abs(pos) - halfSize + radius;\n return min(max(q.x, q.y), 0.0) + length(max(q, 0.0)) - radius;\n }\n ";
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.ROUNDED_BOX_SDF_GLSL = void 0;
7
+ /**
8
+ * GLSL snippet: signed distance field for a rounded box with per-corner radii.
9
+ *
10
+ * Convention:
11
+ * - `pos` and `halfSize` are in the same pixel-space coordinates.
12
+ * - `r` carries corner radii in CSS order: top-left, top-right, bottom-right, bottom-left.
13
+ * - For uniform-radius use cases pass `vec4(scalar)`.
14
+ *
15
+ * Screen-space conventions (after the y-flip in the vertex stage):
16
+ * pos.y < 0 -> top, pos.y > 0 -> bottom
17
+ * pos.x < 0 -> left, pos.x > 0 -> right
18
+ *
19
+ * Reference: Inigo Quilez, "Distance to a rounded box".
20
+ */
21
+ // language=Glsl
22
+ const ROUNDED_BOX_SDF_GLSL = exports.ROUNDED_BOX_SDF_GLSL = /* glsl */`
23
+ float roundedBoxSDF(vec2 pos, vec2 halfSize, vec4 r) {
24
+ float radius;
25
+ if (pos.x < 0.0) {
26
+ radius = pos.y < 0.0 ? r.x : r.w;
27
+ } else {
28
+ radius = pos.y < 0.0 ? r.y : r.z;
29
+ }
30
+
31
+ vec2 q = abs(pos) - halfSize + radius;
32
+ return min(max(q.x, q.y), 0.0) + length(max(q, 0.0)) - radius;
33
+ }
34
+ `;
@@ -0,0 +1,28 @@
1
+ /**
2
+ * GLSL snippet: signed distance field for a rounded box with per-corner radii.
3
+ *
4
+ * Convention:
5
+ * - `pos` and `halfSize` are in the same pixel-space coordinates.
6
+ * - `r` carries corner radii in CSS order: top-left, top-right, bottom-right, bottom-left.
7
+ * - For uniform-radius use cases pass `vec4(scalar)`.
8
+ *
9
+ * Screen-space conventions (after the y-flip in the vertex stage):
10
+ * pos.y < 0 -> top, pos.y > 0 -> bottom
11
+ * pos.x < 0 -> left, pos.x > 0 -> right
12
+ *
13
+ * Reference: Inigo Quilez, "Distance to a rounded box".
14
+ */
15
+ // language=Glsl
16
+ export const ROUNDED_BOX_SDF_GLSL = /* glsl */`
17
+ float roundedBoxSDF(vec2 pos, vec2 halfSize, vec4 r) {
18
+ float radius;
19
+ if (pos.x < 0.0) {
20
+ radius = pos.y < 0.0 ? r.x : r.w;
21
+ } else {
22
+ radius = pos.y < 0.0 ? r.y : r.z;
23
+ }
24
+
25
+ vec2 q = abs(pos) - halfSize + radius;
26
+ return min(max(q.x, q.y), 0.0) + length(max(q, 0.0)) - radius;
27
+ }
28
+ `;
@@ -0,0 +1,28 @@
1
+ import type { GrowableBuffer } from "./utils.mjs";
2
+ export interface InstancedAttribute {
3
+ buffer: GrowableBuffer;
4
+ location: number;
5
+ size: number;
6
+ glType: GLenum;
7
+ normalized: boolean;
8
+ }
9
+ /**
10
+ * Creates a per-instance vertex attribute backed by a fresh grow-only GPU buffer.
11
+ *
12
+ * The caller MUST have the owning VAO bound when calling this — the
13
+ * vertexAttribPointer + vertexAttribDivisor calls register the binding into
14
+ * that VAO and the program then references it on each draw.
15
+ */
16
+ export declare function createInstancedAttribute(gl: WebGL2RenderingContext, program: WebGLProgram, name: string, size: number, glType?: GLenum, normalized?: boolean): InstancedAttribute;
17
+ /**
18
+ * Wires up a per-instance vertex attribute that reads from an existing GrowableBuffer.
19
+ * Use this when the same buffer must back the same-named attribute in multiple
20
+ * VAOs (e.g. two shader-program variants over the same data).
21
+ *
22
+ * The caller MUST have the owning VAO bound when calling this.
23
+ *
24
+ * If the attribute is missing from the program (typo, or optimized out by the
25
+ * compiler), `getAttribLocation` returns -1. We skip the GL setup in that case to
26
+ * avoid `INVALID_VALUE` errors from `enableVertexAttribArray(-1)` and warn in dev.
27
+ */
28
+ export declare function bindInstancedAttribute(gl: WebGL2RenderingContext, program: WebGLProgram, name: string, buffer: GrowableBuffer, size: number, glType?: GLenum, normalized?: boolean): InstancedAttribute;