@mui/x-charts-premium 9.6.0 → 9.8.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 (329) hide show
  1. package/BarChartPremium/BarChartPremium.d.mts +4 -4
  2. package/BarChartPremium/BarChartPremium.d.ts +4 -4
  3. package/BarChartPremium/BarChartPremium.plugins.d.mts +2 -2
  4. package/BarChartPremium/BarChartPremium.plugins.d.ts +2 -2
  5. package/BarChartPremium/BarPlotPremium.d.mts +1 -1
  6. package/BarChartPremium/BarPlotPremium.d.ts +1 -1
  7. package/BarChartPremium/RangeBar/AnimatedRangeBarElement.d.mts +1 -1
  8. package/BarChartPremium/RangeBar/AnimatedRangeBarElement.d.ts +1 -1
  9. package/BarChartPremium/RangeBar/RangeBarPlot.d.mts +2 -2
  10. package/BarChartPremium/RangeBar/RangeBarPlot.d.ts +2 -2
  11. package/BarChartPremium/RangeBar/createGetRangeBarDimensions.d.mts +1 -1
  12. package/BarChartPremium/RangeBar/createGetRangeBarDimensions.d.ts +1 -1
  13. package/BarChartPremium/RangeBar/seriesConfig/descriptionGetter.d.mts +1 -1
  14. package/BarChartPremium/RangeBar/seriesConfig/descriptionGetter.d.ts +1 -1
  15. package/BarChartPremium/RangeBar/seriesConfig/extrema.d.mts +1 -1
  16. package/BarChartPremium/RangeBar/seriesConfig/extrema.d.ts +1 -1
  17. package/BarChartPremium/RangeBar/seriesConfig/getColor.d.mts +1 -1
  18. package/BarChartPremium/RangeBar/seriesConfig/getColor.d.ts +1 -1
  19. package/BarChartPremium/RangeBar/seriesConfig/getSeriesWithDefaultValues.d.mts +1 -1
  20. package/BarChartPremium/RangeBar/seriesConfig/getSeriesWithDefaultValues.d.ts +1 -1
  21. package/BarChartPremium/RangeBar/seriesConfig/index.d.mts +1 -1
  22. package/BarChartPremium/RangeBar/seriesConfig/index.d.ts +1 -1
  23. package/BarChartPremium/RangeBar/seriesConfig/keyboardFocusHandler.d.mts +1 -1
  24. package/BarChartPremium/RangeBar/seriesConfig/keyboardFocusHandler.d.ts +1 -1
  25. package/BarChartPremium/RangeBar/seriesConfig/legend.d.mts +1 -1
  26. package/BarChartPremium/RangeBar/seriesConfig/legend.d.ts +1 -1
  27. package/BarChartPremium/RangeBar/seriesConfig/seriesProcessor.d.mts +1 -1
  28. package/BarChartPremium/RangeBar/seriesConfig/seriesProcessor.d.ts +1 -1
  29. package/BarChartPremium/RangeBar/seriesConfig/tooltip.d.mts +1 -1
  30. package/BarChartPremium/RangeBar/seriesConfig/tooltip.d.ts +1 -1
  31. package/BarChartPremium/RangeBar/seriesConfig/tooltipPosition.d.mts +1 -1
  32. package/BarChartPremium/RangeBar/seriesConfig/tooltipPosition.d.ts +1 -1
  33. package/BarChartPremium/RangeBar/useRangeBarPlotData.d.mts +4 -4
  34. package/BarChartPremium/RangeBar/useRangeBarPlotData.d.ts +4 -4
  35. package/BarChartPremium/useBarChartPremiumProps.d.mts +5 -5
  36. package/BarChartPremium/useBarChartPremiumProps.d.ts +5 -5
  37. package/BarChartPremium/webgl/BarWebGLProgram.d.mts +5 -6
  38. package/BarChartPremium/webgl/BarWebGLProgram.d.ts +5 -6
  39. package/BarChartPremium/webgl/BarWebGLProgram.js +24 -65
  40. package/BarChartPremium/webgl/BarWebGLProgram.mjs +24 -65
  41. package/BarChartPremium/webgl/shaders.d.mts +1 -1
  42. package/BarChartPremium/webgl/shaders.d.ts +1 -1
  43. package/BarChartPremium/webgl/shaders.js +2 -15
  44. package/BarChartPremium/webgl/shaders.mjs +3 -15
  45. package/BarChartPremium/webgl/useBarWebGLPlotData.d.mts +3 -3
  46. package/BarChartPremium/webgl/useBarWebGLPlotData.d.ts +3 -3
  47. package/BarChartPremium/webgl/useWebGLBarLikePlotData.d.mts +3 -3
  48. package/BarChartPremium/webgl/useWebGLBarLikePlotData.d.ts +3 -3
  49. package/CHANGELOG.md +241 -2
  50. package/CandlestickChart/CandlestickChart.d.mts +12 -12
  51. package/CandlestickChart/CandlestickChart.d.ts +12 -12
  52. package/CandlestickChart/CandlestickChart.plugins.d.mts +2 -2
  53. package/CandlestickChart/CandlestickChart.plugins.d.ts +2 -2
  54. package/CandlestickChart/CandlestickWebGLProgram.d.mts +1 -1
  55. package/CandlestickChart/CandlestickWebGLProgram.d.ts +1 -1
  56. package/CandlestickChart/checkCandlestickScaleErrors.d.mts +2 -2
  57. package/CandlestickChart/checkCandlestickScaleErrors.d.ts +2 -2
  58. package/CandlestickChart/seriesConfig/OHLCTooltipContent.d.mts +1 -1
  59. package/CandlestickChart/seriesConfig/OHLCTooltipContent.d.ts +1 -1
  60. package/CandlestickChart/seriesConfig/descriptionGetter.d.mts +1 -1
  61. package/CandlestickChart/seriesConfig/descriptionGetter.d.ts +1 -1
  62. package/CandlestickChart/seriesConfig/extrema.d.mts +1 -1
  63. package/CandlestickChart/seriesConfig/extrema.d.ts +1 -1
  64. package/CandlestickChart/seriesConfig/getColor.d.mts +1 -1
  65. package/CandlestickChart/seriesConfig/getColor.d.ts +1 -1
  66. package/CandlestickChart/seriesConfig/getSeriesWithDefaultValues.d.mts +1 -1
  67. package/CandlestickChart/seriesConfig/getSeriesWithDefaultValues.d.ts +1 -1
  68. package/CandlestickChart/seriesConfig/index.d.mts +1 -1
  69. package/CandlestickChart/seriesConfig/index.d.ts +1 -1
  70. package/CandlestickChart/seriesConfig/legend.d.mts +1 -1
  71. package/CandlestickChart/seriesConfig/legend.d.ts +1 -1
  72. package/CandlestickChart/seriesConfig/seriesProcessor.d.mts +1 -1
  73. package/CandlestickChart/seriesConfig/seriesProcessor.d.ts +1 -1
  74. package/CandlestickChart/seriesConfig/tooltip.d.mts +1 -1
  75. package/CandlestickChart/seriesConfig/tooltip.d.ts +1 -1
  76. package/CandlestickChart/seriesConfig/tooltipPosition.d.mts +1 -1
  77. package/CandlestickChart/seriesConfig/tooltipPosition.d.ts +1 -1
  78. package/CandlestickChart/useCandlestickChartProps.d.mts +9 -9
  79. package/CandlestickChart/useCandlestickChartProps.d.ts +9 -9
  80. package/CandlestickChart/useCandlestickChartProps.mjs +0 -1
  81. package/CandlestickChart/useCandlestickPlotData.d.mts +3 -3
  82. package/CandlestickChart/useCandlestickPlotData.d.ts +3 -3
  83. package/ChartsContainerPremium/ChartsContainerPremium.d.mts +4 -4
  84. package/ChartsContainerPremium/ChartsContainerPremium.d.ts +4 -4
  85. package/ChartsContainerPremium/useChartsContainerPremiumProps.d.mts +2 -2
  86. package/ChartsContainerPremium/useChartsContainerPremiumProps.d.ts +2 -2
  87. package/ChartsDataProviderPremium/ChartsDataProviderPremium.d.mts +4 -4
  88. package/ChartsDataProviderPremium/ChartsDataProviderPremium.d.ts +4 -4
  89. package/ChartsDataProviderPremium/ChartsDataProviderPremium.js +2 -2
  90. package/ChartsDataProviderPremium/ChartsDataProviderPremium.mjs +3 -4
  91. package/ChartsDataProviderPremium/useChartsDataProviderPremiumProps.d.mts +1 -1
  92. package/ChartsDataProviderPremium/useChartsDataProviderPremiumProps.d.ts +1 -1
  93. package/ChartsGeoDataProviderPremium/ChartsGeoDataProviderPremium.d.mts +4 -4
  94. package/ChartsGeoDataProviderPremium/ChartsGeoDataProviderPremium.d.ts +4 -4
  95. package/ChartsGeoDataProviderPremium/ChartsGeoDataProviderPremium.js +2 -2
  96. package/ChartsGeoDataProviderPremium/ChartsGeoDataProviderPremium.mjs +2 -2
  97. package/ChartsGeoDataProviderPremium/ChartsGeoDataProviderPremium.plugins.d.mts +3 -3
  98. package/ChartsGeoDataProviderPremium/ChartsGeoDataProviderPremium.plugins.d.ts +3 -3
  99. package/ChartsGeoDataProviderPremium/useChartsGeoDataProviderPremiumProps.d.mts +2 -2
  100. package/ChartsGeoDataProviderPremium/useChartsGeoDataProviderPremiumProps.d.ts +2 -2
  101. package/ChartsRadialDataProviderPremium/ChartsRadialDataProviderPremium.d.mts +4 -4
  102. package/ChartsRadialDataProviderPremium/ChartsRadialDataProviderPremium.d.ts +4 -4
  103. package/ChartsRadialDataProviderPremium/ChartsRadialDataProviderPremium.js +2 -2
  104. package/ChartsRadialDataProviderPremium/ChartsRadialDataProviderPremium.mjs +2 -2
  105. package/ChartsRadialDataProviderPremium/ChartsRadialDataProviderPremium.plugins.d.mts +3 -3
  106. package/ChartsRadialDataProviderPremium/ChartsRadialDataProviderPremium.plugins.d.ts +3 -3
  107. package/ChartsRadialDataProviderPremium/useChartsRadialDataProviderPremiumProps.d.mts +1 -1
  108. package/ChartsRadialDataProviderPremium/useChartsRadialDataProviderPremiumProps.d.ts +1 -1
  109. package/ChartsRenderer/colors.d.mts +1 -1
  110. package/ChartsRenderer/colors.d.ts +1 -1
  111. package/ChartsRenderer/configuration.d.mts +1 -1
  112. package/ChartsRenderer/configuration.d.ts +1 -1
  113. package/ChartsZoomSlider/internals/previews/CandlestickPreviewPlot.d.mts +1 -1
  114. package/ChartsZoomSlider/internals/previews/CandlestickPreviewPlot.d.ts +1 -1
  115. package/ChartsZoomSlider/internals/previews/RangeBarPreviewPlot.d.mts +1 -1
  116. package/ChartsZoomSlider/internals/previews/RangeBarPreviewPlot.d.ts +1 -1
  117. package/HeatmapPremium/HeatmapPlotPremium.d.mts +1 -1
  118. package/HeatmapPremium/HeatmapPlotPremium.d.ts +1 -1
  119. package/HeatmapPremium/HeatmapPremium.d.mts +1 -1
  120. package/HeatmapPremium/HeatmapPremium.d.ts +1 -1
  121. package/HeatmapPremium/HeatmapPremium.plugins.d.mts +2 -2
  122. package/HeatmapPremium/HeatmapPremium.plugins.d.ts +2 -2
  123. package/HeatmapPremium/useHeatmapPremiumProps.d.mts +2 -2
  124. package/HeatmapPremium/useHeatmapPremiumProps.d.ts +2 -2
  125. package/HeatmapPremium/webgl/HeatmapWebGLProgram.js +12 -37
  126. package/HeatmapPremium/webgl/HeatmapWebGLProgram.mjs +12 -37
  127. package/HeatmapPremium/webgl/shaders.d.mts +3 -3
  128. package/HeatmapPremium/webgl/shaders.d.ts +3 -3
  129. package/HeatmapPremium/webgl/shaders.js +12 -15
  130. package/HeatmapPremium/webgl/shaders.mjs +13 -15
  131. package/HeatmapPremium/webgl/useHeatmapPlotData.d.mts +3 -3
  132. package/HeatmapPremium/webgl/useHeatmapPlotData.d.ts +3 -3
  133. package/HeatmapPremium/webgl/useHeatmapPlotData.js +3 -8
  134. package/HeatmapPremium/webgl/useHeatmapPlotData.mjs +3 -8
  135. package/Map/FocusedMapShape.js +5 -1
  136. package/Map/FocusedMapShape.mjs +5 -1
  137. package/Map/MapImagePlot.d.mts +39 -0
  138. package/Map/MapImagePlot.d.ts +39 -0
  139. package/Map/MapImagePlot.js +138 -0
  140. package/Map/MapImagePlot.mjs +132 -0
  141. package/Map/MapShape.d.mts +2 -2
  142. package/Map/MapShape.d.ts +2 -2
  143. package/Map/MapShape.js +6 -6
  144. package/Map/MapShape.mjs +6 -6
  145. package/Map/MapShapePlot.d.mts +8 -0
  146. package/Map/MapShapePlot.d.ts +8 -0
  147. package/Map/MapShapePlot.js +17 -5
  148. package/Map/MapShapePlot.mjs +17 -5
  149. package/Map/index.d.mts +2 -1
  150. package/Map/index.d.ts +2 -1
  151. package/Map/index.js +11 -0
  152. package/Map/index.mjs +1 -0
  153. package/Map/reprojectEquirectangularImage.d.mts +60 -0
  154. package/Map/reprojectEquirectangularImage.d.ts +60 -0
  155. package/Map/reprojectEquirectangularImage.js +116 -0
  156. package/Map/reprojectEquirectangularImage.mjs +110 -0
  157. package/Map/seriesConfig/descriptionGetter.d.mts +1 -1
  158. package/Map/seriesConfig/descriptionGetter.d.ts +1 -1
  159. package/Map/seriesConfig/descriptionGetter.js +5 -1
  160. package/Map/seriesConfig/descriptionGetter.mjs +5 -1
  161. package/Map/seriesConfig/getColor.js +18 -6
  162. package/Map/seriesConfig/getColor.mjs +18 -6
  163. package/Map/seriesConfig/highlight.d.mts +10 -0
  164. package/Map/seriesConfig/highlight.d.ts +10 -0
  165. package/Map/seriesConfig/highlight.js +52 -0
  166. package/Map/seriesConfig/highlight.mjs +45 -0
  167. package/Map/seriesConfig/identifierCleaner.d.mts +3 -0
  168. package/Map/seriesConfig/identifierCleaner.d.ts +3 -0
  169. package/Map/seriesConfig/identifierCleaner.js +14 -0
  170. package/Map/seriesConfig/identifierCleaner.mjs +8 -0
  171. package/Map/seriesConfig/identifierSerializer.d.mts +3 -0
  172. package/Map/seriesConfig/identifierSerializer.d.ts +3 -0
  173. package/Map/seriesConfig/identifierSerializer.js +12 -0
  174. package/Map/seriesConfig/identifierSerializer.mjs +6 -0
  175. package/Map/seriesConfig/index.d.mts +1 -1
  176. package/Map/seriesConfig/index.d.ts +1 -1
  177. package/Map/seriesConfig/index.js +8 -6
  178. package/Map/seriesConfig/index.mjs +7 -5
  179. package/Map/seriesConfig/keyboardFocusHandler.d.mts +1 -7
  180. package/Map/seriesConfig/keyboardFocusHandler.d.ts +1 -7
  181. package/Map/seriesConfig/keyboardFocusHandler.js +40 -7
  182. package/Map/seriesConfig/keyboardFocusHandler.mjs +41 -8
  183. package/Map/seriesConfig/legend.d.mts +1 -1
  184. package/Map/seriesConfig/legend.d.ts +1 -1
  185. package/Map/seriesConfig/seriesProcessor.d.mts +1 -1
  186. package/Map/seriesConfig/seriesProcessor.d.ts +1 -1
  187. package/Map/seriesConfig/seriesProcessor.js +11 -2
  188. package/Map/seriesConfig/seriesProcessor.mjs +11 -2
  189. package/Map/seriesConfig/tooltip.d.mts +1 -1
  190. package/Map/seriesConfig/tooltip.d.ts +1 -1
  191. package/Map/seriesConfig/tooltip.js +8 -4
  192. package/Map/seriesConfig/tooltip.mjs +8 -4
  193. package/Map/seriesConfig/tooltipPosition.d.mts +8 -3
  194. package/Map/seriesConfig/tooltipPosition.d.ts +8 -3
  195. package/Map/seriesConfig/tooltipPosition.js +21 -27
  196. package/Map/seriesConfig/tooltipPosition.mjs +22 -27
  197. package/RadialBarChart/RadialBarChart.d.mts +10 -10
  198. package/RadialBarChart/RadialBarChart.d.ts +10 -10
  199. package/RadialBarChart/RadialBarChart.plugins.d.mts +2 -2
  200. package/RadialBarChart/RadialBarChart.plugins.d.ts +2 -2
  201. package/RadialBarChart/RadialBarElement.d.mts +2 -2
  202. package/RadialBarChart/RadialBarElement.d.ts +2 -2
  203. package/RadialBarChart/seriesConfig/descriptionGetter.d.mts +1 -1
  204. package/RadialBarChart/seriesConfig/descriptionGetter.d.ts +1 -1
  205. package/RadialBarChart/seriesConfig/extremums.d.mts +1 -1
  206. package/RadialBarChart/seriesConfig/extremums.d.ts +1 -1
  207. package/RadialBarChart/seriesConfig/getColor.d.mts +1 -1
  208. package/RadialBarChart/seriesConfig/getColor.d.ts +1 -1
  209. package/RadialBarChart/seriesConfig/getItemAtPosition.d.mts +1 -1
  210. package/RadialBarChart/seriesConfig/getItemAtPosition.d.ts +1 -1
  211. package/RadialBarChart/seriesConfig/index.d.mts +1 -1
  212. package/RadialBarChart/seriesConfig/index.d.ts +1 -1
  213. package/RadialBarChart/seriesConfig/keyboardFocusHandler.d.mts +1 -1
  214. package/RadialBarChart/seriesConfig/keyboardFocusHandler.d.ts +1 -1
  215. package/RadialBarChart/seriesConfig/tooltip.d.mts +1 -1
  216. package/RadialBarChart/seriesConfig/tooltip.d.ts +1 -1
  217. package/RadialBarChart/useRadialBarChartProps.d.mts +6 -6
  218. package/RadialBarChart/useRadialBarChartProps.d.ts +6 -6
  219. package/RadialBarChart/useRadialBarPlotData.d.mts +1 -1
  220. package/RadialBarChart/useRadialBarPlotData.d.ts +1 -1
  221. package/RadialBarChart/useRadialBarPlotData.js +4 -1
  222. package/RadialBarChart/useRadialBarPlotData.mjs +3 -1
  223. package/RadialLineChart/RadialArea.d.mts +1 -1
  224. package/RadialLineChart/RadialArea.d.ts +1 -1
  225. package/RadialLineChart/RadialAreaPlot.d.mts +1 -1
  226. package/RadialLineChart/RadialAreaPlot.d.ts +1 -1
  227. package/RadialLineChart/RadialLine.d.mts +2 -2
  228. package/RadialLineChart/RadialLine.d.ts +2 -2
  229. package/RadialLineChart/RadialLineChart.d.mts +10 -10
  230. package/RadialLineChart/RadialLineChart.d.ts +10 -10
  231. package/RadialLineChart/RadialLineChart.plugins.d.mts +2 -2
  232. package/RadialLineChart/RadialLineChart.plugins.d.ts +2 -2
  233. package/RadialLineChart/RadialLineHighlightElement.d.mts +1 -1
  234. package/RadialLineChart/RadialLineHighlightElement.d.ts +1 -1
  235. package/RadialLineChart/RadialLineHighlightPlot.d.mts +2 -2
  236. package/RadialLineChart/RadialLineHighlightPlot.d.ts +2 -2
  237. package/RadialLineChart/RadialLinePlot.d.mts +1 -1
  238. package/RadialLineChart/RadialLinePlot.d.ts +1 -1
  239. package/RadialLineChart/RadialMarkPlot.d.mts +1 -1
  240. package/RadialLineChart/RadialMarkPlot.d.ts +1 -1
  241. package/RadialLineChart/seriesConfig/descriptionGetter.d.mts +1 -1
  242. package/RadialLineChart/seriesConfig/descriptionGetter.d.ts +1 -1
  243. package/RadialLineChart/seriesConfig/extremums.d.mts +1 -1
  244. package/RadialLineChart/seriesConfig/extremums.d.ts +1 -1
  245. package/RadialLineChart/seriesConfig/getColor.d.mts +1 -1
  246. package/RadialLineChart/seriesConfig/getColor.d.ts +1 -1
  247. package/RadialLineChart/seriesConfig/getItemAtPosition.d.mts +1 -1
  248. package/RadialLineChart/seriesConfig/getItemAtPosition.d.ts +1 -1
  249. package/RadialLineChart/seriesConfig/getItemAtPosition.mjs +1 -2
  250. package/RadialLineChart/seriesConfig/index.d.mts +1 -1
  251. package/RadialLineChart/seriesConfig/index.d.ts +1 -1
  252. package/RadialLineChart/seriesConfig/keyboardFocusHandler.d.mts +1 -1
  253. package/RadialLineChart/seriesConfig/keyboardFocusHandler.d.ts +1 -1
  254. package/RadialLineChart/seriesConfig/legend.d.mts +1 -1
  255. package/RadialLineChart/seriesConfig/legend.d.ts +1 -1
  256. package/RadialLineChart/seriesConfig/seriesProcessor.d.mts +1 -1
  257. package/RadialLineChart/seriesConfig/seriesProcessor.d.ts +1 -1
  258. package/RadialLineChart/seriesConfig/tooltip.d.mts +1 -1
  259. package/RadialLineChart/seriesConfig/tooltip.d.ts +1 -1
  260. package/RadialLineChart/useRadialLineChartProps.d.mts +7 -7
  261. package/RadialLineChart/useRadialLineChartProps.d.ts +7 -7
  262. package/RadialLineChart/useRadialLinePlotData.d.mts +1 -1
  263. package/RadialLineChart/useRadialLinePlotData.d.ts +1 -1
  264. package/ScatterChartPremium/ScatterChartPremium.d.mts +6 -6
  265. package/ScatterChartPremium/ScatterChartPremium.d.ts +6 -6
  266. package/ScatterChartPremium/ScatterChartPremium.plugins.d.mts +1 -1
  267. package/ScatterChartPremium/ScatterChartPremium.plugins.d.ts +1 -1
  268. package/ScatterChartPremium/ScatterPlotPremium.d.mts +1 -1
  269. package/ScatterChartPremium/ScatterPlotPremium.d.ts +1 -1
  270. package/ScatterChartPremium/webgl/ScatterWebGLProgram.d.mts +1 -3
  271. package/ScatterChartPremium/webgl/ScatterWebGLProgram.d.ts +1 -3
  272. package/ScatterChartPremium/webgl/ScatterWebGLProgram.js +23 -81
  273. package/ScatterChartPremium/webgl/ScatterWebGLProgram.mjs +23 -81
  274. package/context/useChartPremiumApiContext.d.mts +1 -1
  275. package/context/useChartPremiumApiContext.d.ts +1 -1
  276. package/hooks/animation/useAnimateRangeBar.d.mts +1 -1
  277. package/hooks/animation/useAnimateRangeBar.d.ts +1 -1
  278. package/hooks/useChartPremiumApiRef.d.mts +4 -4
  279. package/hooks/useChartPremiumApiRef.d.ts +4 -4
  280. package/hooks/useGeoData.d.mts +1 -1
  281. package/hooks/useGeoData.d.ts +1 -1
  282. package/hooks/useGeoData.mjs +0 -1
  283. package/hooks/useGeoFeatureIndexesByName.mjs +0 -1
  284. package/hooks/useGeoPath.d.mts +1 -1
  285. package/hooks/useGeoPath.d.ts +1 -1
  286. package/hooks/useGeoPath.mjs +0 -1
  287. package/hooks/useMapShapeSeries.d.mts +2 -2
  288. package/hooks/useMapShapeSeries.d.ts +2 -2
  289. package/hooks/useOHLCSeries.d.mts +2 -2
  290. package/hooks/useOHLCSeries.d.ts +2 -2
  291. package/hooks/useRadialLineSeries.d.mts +2 -2
  292. package/hooks/useRadialLineSeries.d.ts +2 -2
  293. package/hooks/useRangeBarSeries.d.mts +2 -2
  294. package/hooks/useRangeBarSeries.d.ts +2 -2
  295. package/index.js +1 -1
  296. package/index.mjs +1 -1
  297. package/internals/createGetVisibleCoordinate.d.mts +14 -0
  298. package/internals/createGetVisibleCoordinate.d.ts +14 -0
  299. package/internals/createGetVisibleCoordinate.js +66 -0
  300. package/internals/createGetVisibleCoordinate.mjs +60 -0
  301. package/internals/plugins/allPlugins.d.mts +2 -2
  302. package/internals/plugins/allPlugins.d.ts +2 -2
  303. package/internals/plugins/useGeoProjection/useGeoProjection.d.mts +1 -1
  304. package/internals/plugins/useGeoProjection/useGeoProjection.d.ts +1 -1
  305. package/internals/plugins/useGeoProjection/useGeoProjection.types.d.mts +1 -1
  306. package/internals/plugins/useGeoProjection/useGeoProjection.types.d.ts +1 -1
  307. package/models/seriesType/mapShape.d.mts +2 -1
  308. package/models/seriesType/mapShape.d.ts +2 -1
  309. package/models/seriesType/ohlc.d.mts +2 -2
  310. package/models/seriesType/ohlc.d.ts +2 -2
  311. package/models/seriesType/rangeBar.d.mts +2 -2
  312. package/models/seriesType/rangeBar.d.ts +2 -2
  313. package/moduleAugmentation/rangeBarOnClick.d.mts +1 -1
  314. package/moduleAugmentation/rangeBarOnClick.d.ts +1 -1
  315. package/package.json +6 -6
  316. package/plugins/selectors/useChartCandlestickPosition.selectors.d.mts +1 -1
  317. package/plugins/selectors/useChartCandlestickPosition.selectors.d.ts +1 -1
  318. package/utils/webgl/glsl.d.mts +15 -0
  319. package/utils/webgl/glsl.d.ts +15 -0
  320. package/utils/webgl/glsl.js +34 -0
  321. package/utils/webgl/glsl.mjs +28 -0
  322. package/utils/webgl/instancedAttribute.d.mts +28 -0
  323. package/utils/webgl/instancedAttribute.d.ts +28 -0
  324. package/utils/webgl/instancedAttribute.js +57 -0
  325. package/utils/webgl/instancedAttribute.mjs +50 -0
  326. package/utils/webgl/utils.d.mts +21 -2
  327. package/utils/webgl/utils.d.ts +21 -2
  328. package/utils/webgl/utils.js +44 -8
  329. package/utils/webgl/utils.mjs +41 -7
@@ -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
+ }
@@ -1,5 +1,5 @@
1
- import { type ChartSeriesType, type ConvertSignaturesIntoPlugins, type UseChartCartesianAxisSignature, type UseChartTooltipSignature, type UseChartInteractionSignature, type UseChartZAxisSignature, type UseChartHighlightSignature, type UseChartPolarAxisSignature, type UseChartBrushSignature, type UseChartVisibilityManagerSignature, type UseProgressiveRenderingSignature } from '@mui/x-charts/internals';
2
- import { type UseChartProExportSignature, type UseChartProZoomSignature } from '@mui/x-charts-pro/plugins';
1
+ import type { ChartSeriesType, ConvertSignaturesIntoPlugins, UseChartCartesianAxisSignature, UseChartTooltipSignature, UseChartInteractionSignature, UseChartZAxisSignature, UseChartHighlightSignature, UseChartPolarAxisSignature, UseChartBrushSignature, UseChartVisibilityManagerSignature, UseProgressiveRenderingSignature } from '@mui/x-charts/internals';
2
+ import type { UseChartProExportSignature, UseChartProZoomSignature } from '@mui/x-charts-pro/plugins';
3
3
  export type AllPluginSignatures<SeriesType extends ChartSeriesType = ChartSeriesType> = [UseChartZAxisSignature, UseChartBrushSignature, UseChartTooltipSignature<SeriesType>, UseChartInteractionSignature, UseChartCartesianAxisSignature<SeriesType>, UseChartPolarAxisSignature<SeriesType>, UseChartHighlightSignature<SeriesType>, UseChartVisibilityManagerSignature<SeriesType>, UseChartProZoomSignature, UseChartProExportSignature, UseProgressiveRenderingSignature];
4
4
  export type AllPluginsType<SeriesType extends ChartSeriesType = ChartSeriesType> = ConvertSignaturesIntoPlugins<AllPluginSignatures<SeriesType>>;
5
5
  export declare const ALL_PLUGINS: (import("@mui/x-charts/internals").ChartPlugin<UseChartZAxisSignature> | import("@mui/x-charts/internals").ChartPlugin<UseChartBrushSignature> | import("@mui/x-charts/internals").ChartPlugin<UseChartInteractionSignature> | import("@mui/x-charts/internals").ChartPlugin<UseChartProZoomSignature> | import("@mui/x-charts/internals").ChartPlugin<UseChartProExportSignature> | import("@mui/x-charts/internals").ChartPlugin<UseProgressiveRenderingSignature> | import("@mui/x-charts/internals").ChartPlugin<UseChartTooltipSignature<any>> | import("@mui/x-charts/internals").ChartPlugin<UseChartCartesianAxisSignature<any>> | import("@mui/x-charts/internals").ChartPlugin<UseChartPolarAxisSignature<any>> | import("@mui/x-charts/internals").ChartPlugin<UseChartHighlightSignature<any>> | import("@mui/x-charts/internals").ChartPlugin<UseChartVisibilityManagerSignature<any>>)[];
@@ -1,5 +1,5 @@
1
- import { type ChartSeriesType, type ConvertSignaturesIntoPlugins, type UseChartCartesianAxisSignature, type UseChartTooltipSignature, type UseChartInteractionSignature, type UseChartZAxisSignature, type UseChartHighlightSignature, type UseChartPolarAxisSignature, type UseChartBrushSignature, type UseChartVisibilityManagerSignature, type UseProgressiveRenderingSignature } from '@mui/x-charts/internals';
2
- import { type UseChartProExportSignature, type UseChartProZoomSignature } from '@mui/x-charts-pro/plugins';
1
+ import type { ChartSeriesType, ConvertSignaturesIntoPlugins, UseChartCartesianAxisSignature, UseChartTooltipSignature, UseChartInteractionSignature, UseChartZAxisSignature, UseChartHighlightSignature, UseChartPolarAxisSignature, UseChartBrushSignature, UseChartVisibilityManagerSignature, UseProgressiveRenderingSignature } from '@mui/x-charts/internals';
2
+ import type { UseChartProExportSignature, UseChartProZoomSignature } from '@mui/x-charts-pro/plugins';
3
3
  export type AllPluginSignatures<SeriesType extends ChartSeriesType = ChartSeriesType> = [UseChartZAxisSignature, UseChartBrushSignature, UseChartTooltipSignature<SeriesType>, UseChartInteractionSignature, UseChartCartesianAxisSignature<SeriesType>, UseChartPolarAxisSignature<SeriesType>, UseChartHighlightSignature<SeriesType>, UseChartVisibilityManagerSignature<SeriesType>, UseChartProZoomSignature, UseChartProExportSignature, UseProgressiveRenderingSignature];
4
4
  export type AllPluginsType<SeriesType extends ChartSeriesType = ChartSeriesType> = ConvertSignaturesIntoPlugins<AllPluginSignatures<SeriesType>>;
5
5
  export declare const ALL_PLUGINS: (import("@mui/x-charts/internals").ChartPlugin<UseChartZAxisSignature> | import("@mui/x-charts/internals").ChartPlugin<UseChartBrushSignature> | import("@mui/x-charts/internals").ChartPlugin<UseChartInteractionSignature> | import("@mui/x-charts/internals").ChartPlugin<UseChartProZoomSignature> | import("@mui/x-charts/internals").ChartPlugin<UseChartProExportSignature> | import("@mui/x-charts/internals").ChartPlugin<UseProgressiveRenderingSignature> | import("@mui/x-charts/internals").ChartPlugin<UseChartTooltipSignature<any>> | import("@mui/x-charts/internals").ChartPlugin<UseChartCartesianAxisSignature<any>> | import("@mui/x-charts/internals").ChartPlugin<UseChartPolarAxisSignature<any>> | import("@mui/x-charts/internals").ChartPlugin<UseChartHighlightSignature<any>> | import("@mui/x-charts/internals").ChartPlugin<UseChartVisibilityManagerSignature<any>>)[];
@@ -1,3 +1,3 @@
1
1
  import type { ChartPlugin } from '@mui/x-charts/internals';
2
- import { type UseGeoProjectionSignature } from "./useGeoProjection.types.mjs";
2
+ import type { UseGeoProjectionSignature } from "./useGeoProjection.types.mjs";
3
3
  export declare const useGeoProjection: ChartPlugin<UseGeoProjectionSignature>;
@@ -1,3 +1,3 @@
1
1
  import type { ChartPlugin } from '@mui/x-charts/internals';
2
- import { type UseGeoProjectionSignature } from "./useGeoProjection.types.js";
2
+ import type { UseGeoProjectionSignature } from "./useGeoProjection.types.js";
3
3
  export declare const useGeoProjection: ChartPlugin<UseGeoProjectionSignature>;
@@ -1,2 +1,2 @@
1
- import { type useGeoProjectionTypes } from '@mui/x-charts/internals';
1
+ import type { useGeoProjectionTypes } from '@mui/x-charts/internals';
2
2
  export type UseGeoProjectionSignature = useGeoProjectionTypes.UseGeoProjectionSignature;
@@ -1,2 +1,2 @@
1
- import { type useGeoProjectionTypes } from '@mui/x-charts/internals';
1
+ import type { useGeoProjectionTypes } from '@mui/x-charts/internals';
2
2
  export type UseGeoProjectionSignature = useGeoProjectionTypes.UseGeoProjectionSignature;
@@ -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
  }
@@ -1,6 +1,6 @@
1
1
  import type { ChartsColor } from '@mui/x-charts/colorPalettes';
2
- import { type CommonSeriesType, type CartesianSeriesType, type SeriesId, type CommonDefaultizedProps, type DatasetElementType } from '@mui/x-charts/internals';
3
- import { type DefaultizedProps } from '@mui/x-internals/types';
2
+ import type { CommonSeriesType, CartesianSeriesType, SeriesId, CommonDefaultizedProps, DatasetElementType } from '@mui/x-charts/internals';
3
+ import type { DefaultizedProps } from '@mui/x-internals/types';
4
4
  /**
5
5
  * Type representing the values of a single OHLC element.
6
6
  * The array contains four numbers in the following order:
@@ -1,6 +1,6 @@
1
1
  import type { ChartsColor } from '@mui/x-charts/colorPalettes';
2
- import { type CommonSeriesType, type CartesianSeriesType, type SeriesId, type CommonDefaultizedProps, type DatasetElementType } from '@mui/x-charts/internals';
3
- import { type DefaultizedProps } from '@mui/x-internals/types';
2
+ import type { CommonSeriesType, CartesianSeriesType, SeriesId, CommonDefaultizedProps, DatasetElementType } from '@mui/x-charts/internals';
3
+ import type { DefaultizedProps } from '@mui/x-internals/types';
4
4
  /**
5
5
  * Type representing the values of a single OHLC element.
6
6
  * The array contains four numbers in the following order:
@@ -1,5 +1,5 @@
1
- import { type CartesianSeriesType, type CommonDefaultizedProps, type CommonSeriesType, type SeriesId, type DatasetElementType } from '@mui/x-charts/internals';
2
- import { type DefaultizedProps } from '@mui/x-internals/types';
1
+ import type { CartesianSeriesType, CommonDefaultizedProps, CommonSeriesType, SeriesId, DatasetElementType } from '@mui/x-charts/internals';
2
+ import type { DefaultizedProps } from '@mui/x-internals/types';
3
3
  /** [start, end] */
4
4
  export type RangeBarValueType = [number, number];
5
5
  export interface RangeBarSeriesType extends CommonSeriesType<'rangeBar'>, CartesianSeriesType {
@@ -1,5 +1,5 @@
1
- import { type CartesianSeriesType, type CommonDefaultizedProps, type CommonSeriesType, type SeriesId, type DatasetElementType } from '@mui/x-charts/internals';
2
- import { type DefaultizedProps } from '@mui/x-internals/types';
1
+ import type { CartesianSeriesType, CommonDefaultizedProps, CommonSeriesType, SeriesId, DatasetElementType } from '@mui/x-charts/internals';
2
+ import type { DefaultizedProps } from '@mui/x-internals/types';
3
3
  /** [start, end] */
4
4
  export type RangeBarValueType = [number, number];
5
5
  export interface RangeBarSeriesType extends CommonSeriesType<'rangeBar'>, CartesianSeriesType {
@@ -1,4 +1,4 @@
1
- import { type RangeBarValueType } from "../models/index.mjs";
1
+ import type { RangeBarValueType } from "../models/index.mjs";
2
2
  declare module '@mui/x-charts/models' {
3
3
  interface ChartsTypeFeatureFlags {
4
4
  seriesValuesOverride: RangeBarValueType | number | null | undefined;
@@ -1,4 +1,4 @@
1
- import { type RangeBarValueType } from "../models/index.js";
1
+ import type { RangeBarValueType } from "../models/index.js";
2
2
  declare module '@mui/x-charts/models' {
3
3
  interface ChartsTypeFeatureFlags {
4
4
  seriesValuesOverride: RangeBarValueType | number | null | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui/x-charts-premium",
3
- "version": "9.6.0",
3
+ "version": "9.8.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.0.1",
31
+ "@mui/utils": "^9.1.1",
32
32
  "clsx": "^2.1.1",
33
33
  "prop-types": "^15.8.1",
34
- "@mui/x-charts": "^9.6.0",
35
- "@mui/x-license": "^9.6.0",
36
- "@mui/x-internals": "^9.6.0",
37
34
  "@mui/x-charts-vendor": "^9.4.0",
38
- "@mui/x-charts-pro": "^9.6.0"
35
+ "@mui/x-internals": "^9.8.0",
36
+ "@mui/x-license": "^9.8.0",
37
+ "@mui/x-charts": "^9.8.0",
38
+ "@mui/x-charts-pro": "^9.8.0"
39
39
  },
40
40
  "peerDependencies": {
41
41
  "@emotion/react": "^11.9.0",
@@ -1,4 +1,4 @@
1
- import { type OHLCItemIdentifier } from "../../models/index.mjs";
1
+ import type { OHLCItemIdentifier } from "../../models/index.mjs";
2
2
  export declare const selectorCandlestickItemAtPosition: (args_0: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeriesConfig/useChartSeriesConfig.types").UseChartSeriesConfigState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types").UseChartExperimentalFeaturesState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.types").UseChartAnimationState & import("@mui/x-charts/internals").UseChartInteractionListenerState & Partial<{}> & {
3
3
  cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
4
4
  }, svgPoint: Pick<DOMPoint, "y" | "x">) => OHLCItemIdentifier | undefined;
@@ -1,4 +1,4 @@
1
- import { type OHLCItemIdentifier } from "../../models/index.js";
1
+ import type { OHLCItemIdentifier } from "../../models/index.js";
2
2
  export declare const selectorCandlestickItemAtPosition: (args_0: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeriesConfig/useChartSeriesConfig.types").UseChartSeriesConfigState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types").UseChartExperimentalFeaturesState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.types").UseChartAnimationState & import("@mui/x-charts/internals").UseChartInteractionListenerState & Partial<{}> & {
3
3
  cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
4
4
  }, svgPoint: Pick<DOMPoint, "y" | "x">) => OHLCItemIdentifier | undefined;
@@ -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;
@@ -0,0 +1,28 @@
1
+ import type { GrowableBuffer } from "./utils.js";
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;
@@ -0,0 +1,57 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.bindInstancedAttribute = bindInstancedAttribute;
7
+ exports.createInstancedAttribute = createInstancedAttribute;
8
+ var _utils = require("./utils");
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
+ function createInstancedAttribute(gl, program, name, size, glType = gl.FLOAT, normalized = false) {
17
+ const buffer = (0, _utils.createGrowableBuffer)(gl);
18
+ return bindInstancedAttribute(gl, program, name, buffer, size, glType, normalized);
19
+ }
20
+
21
+ /**
22
+ * Wires up a per-instance vertex attribute that reads from an existing GrowableBuffer.
23
+ * Use this when the same buffer must back the same-named attribute in multiple
24
+ * VAOs (e.g. two shader-program variants over the same data).
25
+ *
26
+ * The caller MUST have the owning VAO bound when calling this.
27
+ *
28
+ * If the attribute is missing from the program (typo, or optimized out by the
29
+ * compiler), `getAttribLocation` returns -1. We skip the GL setup in that case to
30
+ * avoid `INVALID_VALUE` errors from `enableVertexAttribArray(-1)` and warn in dev.
31
+ */
32
+ function bindInstancedAttribute(gl, program, name, buffer, size, glType = gl.FLOAT, normalized = false) {
33
+ const location = gl.getAttribLocation(program, name);
34
+ if (location === -1) {
35
+ if (process.env.NODE_ENV !== 'production') {
36
+ console.warn(`WebGL attribute "${name}" not found in shader program (misspelled or optimized out).`);
37
+ }
38
+ return {
39
+ buffer,
40
+ location,
41
+ size,
42
+ glType,
43
+ normalized
44
+ };
45
+ }
46
+ gl.bindBuffer(gl.ARRAY_BUFFER, buffer.buffer);
47
+ gl.enableVertexAttribArray(location);
48
+ gl.vertexAttribPointer(location, size, glType, normalized, 0, 0);
49
+ gl.vertexAttribDivisor(location, 1);
50
+ return {
51
+ buffer,
52
+ location,
53
+ size,
54
+ glType,
55
+ normalized
56
+ };
57
+ }
@@ -0,0 +1,50 @@
1
+ import { createGrowableBuffer } from "./utils.mjs";
2
+ /**
3
+ * Creates a per-instance vertex attribute backed by a fresh grow-only GPU buffer.
4
+ *
5
+ * The caller MUST have the owning VAO bound when calling this — the
6
+ * vertexAttribPointer + vertexAttribDivisor calls register the binding into
7
+ * that VAO and the program then references it on each draw.
8
+ */
9
+ export function createInstancedAttribute(gl, program, name, size, glType = gl.FLOAT, normalized = false) {
10
+ const buffer = createGrowableBuffer(gl);
11
+ return bindInstancedAttribute(gl, program, name, buffer, size, glType, normalized);
12
+ }
13
+
14
+ /**
15
+ * Wires up a per-instance vertex attribute that reads from an existing GrowableBuffer.
16
+ * Use this when the same buffer must back the same-named attribute in multiple
17
+ * VAOs (e.g. two shader-program variants over the same data).
18
+ *
19
+ * The caller MUST have the owning VAO bound when calling this.
20
+ *
21
+ * If the attribute is missing from the program (typo, or optimized out by the
22
+ * compiler), `getAttribLocation` returns -1. We skip the GL setup in that case to
23
+ * avoid `INVALID_VALUE` errors from `enableVertexAttribArray(-1)` and warn in dev.
24
+ */
25
+ export function bindInstancedAttribute(gl, program, name, buffer, size, glType = gl.FLOAT, normalized = false) {
26
+ const location = gl.getAttribLocation(program, name);
27
+ if (location === -1) {
28
+ if (process.env.NODE_ENV !== 'production') {
29
+ console.warn(`WebGL attribute "${name}" not found in shader program (misspelled or optimized out).`);
30
+ }
31
+ return {
32
+ buffer,
33
+ location,
34
+ size,
35
+ glType,
36
+ normalized
37
+ };
38
+ }
39
+ gl.bindBuffer(gl.ARRAY_BUFFER, buffer.buffer);
40
+ gl.enableVertexAttribArray(location);
41
+ gl.vertexAttribPointer(location, size, glType, normalized, 0, 0);
42
+ gl.vertexAttribDivisor(location, 1);
43
+ return {
44
+ buffer,
45
+ location,
46
+ size,
47
+ glType,
48
+ normalized
49
+ };
50
+ }
@@ -1,7 +1,6 @@
1
1
  export declare function compileShader(gl: WebGL2RenderingContext, shaderSource: string, shaderType: WebGL2RenderingContext['FRAGMENT_SHADER'] | WebGL2RenderingContext['VERTEX_SHADER']): WebGLShader;
2
2
  export declare function uploadQuadBuffer(gl: WebGL2RenderingContext): WebGLBuffer;
3
3
  export declare function bindQuadBuffer(gl: WebGL2RenderingContext, program: WebGLProgram, quadBuffer: WebGLBuffer): void;
4
- export declare function attachShader(gl: WebGL2RenderingContext, program: WebGLProgram, shaderSource: string, shaderType: WebGL2RenderingContext['FRAGMENT_SHADER'] | WebGL2RenderingContext['VERTEX_SHADER']): WebGLShader;
5
4
  export type GrowableBuffer = {
6
5
  buffer: WebGLBuffer;
7
6
  capacity: number;
@@ -18,4 +17,24 @@ export declare function uploadGrowableBuffer(gl: WebGL2RenderingContext, target:
18
17
  /**
19
18
  * Logs WebGL errors to the console in development mode.
20
19
  */
21
- export declare function logWebGLErrors(gl: WebGL2RenderingContext): void;
20
+ export declare function logWebGLErrors(gl: WebGL2RenderingContext): void;
21
+ /** Enables the standard non-premultiplied src-alpha blending used by all premium WebGL renderers. */
22
+ export declare function setupStandardBlending(gl: WebGL2RenderingContext): void;
23
+ /**
24
+ * Returns `existing` when it's large enough to hold `length` elements, otherwise
25
+ * allocates a fresh typed array via `Ctor`. Lets consumers keep one ref per
26
+ * pool and short-circuit growth checks inline.
27
+ */
28
+ export declare function ensurePool<T extends {
29
+ length: number;
30
+ }>(existing: T | null | undefined, length: number, Ctor: new (length: number) => T): T;
31
+ export interface LinkedProgram {
32
+ program: WebGLProgram;
33
+ /** The vertex + fragment shaders that were attached. Hold them so dispose() can delete them. */
34
+ shaders: WebGLShader[];
35
+ }
36
+ /**
37
+ * Compiles vertex + fragment shaders, attaches them, links the program, and returns
38
+ * both the program and its shaders. Logs link/compile diagnostics in dev when linking fails.
39
+ */
40
+ export declare function linkProgram(gl: WebGL2RenderingContext, vertexShaderSource: string, fragmentShaderSource: string): LinkedProgram;
@@ -1,7 +1,6 @@
1
1
  export declare function compileShader(gl: WebGL2RenderingContext, shaderSource: string, shaderType: WebGL2RenderingContext['FRAGMENT_SHADER'] | WebGL2RenderingContext['VERTEX_SHADER']): WebGLShader;
2
2
  export declare function uploadQuadBuffer(gl: WebGL2RenderingContext): WebGLBuffer;
3
3
  export declare function bindQuadBuffer(gl: WebGL2RenderingContext, program: WebGLProgram, quadBuffer: WebGLBuffer): void;
4
- export declare function attachShader(gl: WebGL2RenderingContext, program: WebGLProgram, shaderSource: string, shaderType: WebGL2RenderingContext['FRAGMENT_SHADER'] | WebGL2RenderingContext['VERTEX_SHADER']): WebGLShader;
5
4
  export type GrowableBuffer = {
6
5
  buffer: WebGLBuffer;
7
6
  capacity: number;
@@ -18,4 +17,24 @@ export declare function uploadGrowableBuffer(gl: WebGL2RenderingContext, target:
18
17
  /**
19
18
  * Logs WebGL errors to the console in development mode.
20
19
  */
21
- export declare function logWebGLErrors(gl: WebGL2RenderingContext): void;
20
+ export declare function logWebGLErrors(gl: WebGL2RenderingContext): void;
21
+ /** Enables the standard non-premultiplied src-alpha blending used by all premium WebGL renderers. */
22
+ export declare function setupStandardBlending(gl: WebGL2RenderingContext): void;
23
+ /**
24
+ * Returns `existing` when it's large enough to hold `length` elements, otherwise
25
+ * allocates a fresh typed array via `Ctor`. Lets consumers keep one ref per
26
+ * pool and short-circuit growth checks inline.
27
+ */
28
+ export declare function ensurePool<T extends {
29
+ length: number;
30
+ }>(existing: T | null | undefined, length: number, Ctor: new (length: number) => T): T;
31
+ export interface LinkedProgram {
32
+ program: WebGLProgram;
33
+ /** The vertex + fragment shaders that were attached. Hold them so dispose() can delete them. */
34
+ shaders: WebGLShader[];
35
+ }
36
+ /**
37
+ * Compiles vertex + fragment shaders, attaches them, links the program, and returns
38
+ * both the program and its shaders. Logs link/compile diagnostics in dev when linking fails.
39
+ */
40
+ export declare function linkProgram(gl: WebGL2RenderingContext, vertexShaderSource: string, fragmentShaderSource: string): LinkedProgram;