@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
@@ -1,9 +1,9 @@
1
1
  import * as React from 'react';
2
- import { type BarChartProProps, type BarChartProSlotProps, type BarChartProSlots } from '@mui/x-charts-pro/BarChartPro';
3
- import { type BarSeries } from '@mui/x-charts/BarChart';
2
+ import type { BarChartProProps, BarChartProSlotProps, BarChartProSlots } from '@mui/x-charts-pro/BarChartPro';
3
+ import type { BarSeries } from '@mui/x-charts/BarChart';
4
4
  import type { BarChartPremiumPluginSignatures } from "./BarChartPremium.plugins.mjs";
5
- import { type BarPlotPremiumProps } from "./BarPlotPremium.mjs";
6
- import { type BarItemIdentifier, type RangeBarItemIdentifier, type RangeBarSeriesType } from "../models/index.mjs";
5
+ import type { BarPlotPremiumProps } from "./BarPlotPremium.mjs";
6
+ import type { BarItemIdentifier, RangeBarItemIdentifier, RangeBarSeriesType } from "../models/index.mjs";
7
7
  import type { ChartsContainerPremiumProps } from "../ChartsContainerPremium/index.mjs";
8
8
  export type RangeBarSeries = RangeBarSeriesType;
9
9
  export interface BarChartPremiumSlots extends BarChartProSlots {}
@@ -1,9 +1,9 @@
1
1
  import * as React from 'react';
2
- import { type BarChartProProps, type BarChartProSlotProps, type BarChartProSlots } from '@mui/x-charts-pro/BarChartPro';
3
- import { type BarSeries } from '@mui/x-charts/BarChart';
2
+ import type { BarChartProProps, BarChartProSlotProps, BarChartProSlots } from '@mui/x-charts-pro/BarChartPro';
3
+ import type { BarSeries } from '@mui/x-charts/BarChart';
4
4
  import type { BarChartPremiumPluginSignatures } from "./BarChartPremium.plugins.js";
5
- import { type BarPlotPremiumProps } from "./BarPlotPremium.js";
6
- import { type BarItemIdentifier, type RangeBarItemIdentifier, type RangeBarSeriesType } from "../models/index.js";
5
+ import type { BarPlotPremiumProps } from "./BarPlotPremium.js";
6
+ import type { BarItemIdentifier, RangeBarItemIdentifier, RangeBarSeriesType } from "../models/index.js";
7
7
  import type { ChartsContainerPremiumProps } from "../ChartsContainerPremium/index.js";
8
8
  export type RangeBarSeries = RangeBarSeriesType;
9
9
  export interface BarChartPremiumSlots extends BarChartProSlots {}
@@ -1,4 +1,4 @@
1
- import { type ConvertSignaturesIntoPlugins } from '@mui/x-charts/internals';
2
- import { type BarChartProPluginSignatures } from '@mui/x-charts-pro/BarChartPro';
1
+ import type { ConvertSignaturesIntoPlugins } from '@mui/x-charts/internals';
2
+ import type { BarChartProPluginSignatures } from '@mui/x-charts-pro/BarChartPro';
3
3
  export type BarChartPremiumPluginSignatures = BarChartProPluginSignatures;
4
4
  export declare const BAR_CHART_PREMIUM_PLUGINS: ConvertSignaturesIntoPlugins<BarChartPremiumPluginSignatures>;
@@ -1,4 +1,4 @@
1
- import { type ConvertSignaturesIntoPlugins } from '@mui/x-charts/internals';
2
- import { type BarChartProPluginSignatures } from '@mui/x-charts-pro/BarChartPro';
1
+ import type { ConvertSignaturesIntoPlugins } from '@mui/x-charts/internals';
2
+ import type { BarChartProPluginSignatures } from '@mui/x-charts-pro/BarChartPro';
3
3
  export type BarChartPremiumPluginSignatures = BarChartProPluginSignatures;
4
4
  export declare const BAR_CHART_PREMIUM_PLUGINS: ConvertSignaturesIntoPlugins<BarChartPremiumPluginSignatures>;
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { type BarPlotProps, type BarPlotSlotProps, type BarPlotSlots } from '@mui/x-charts/BarChart';
2
+ import type { BarPlotProps, BarPlotSlotProps, BarPlotSlots } from '@mui/x-charts/BarChart';
3
3
  import type { RendererType } from '@mui/x-charts/ScatterChart';
4
4
  export type BarPlotPremiumRenderer = RendererType | 'webgl';
5
5
  export interface BarPlotPremiumSlots extends BarPlotSlots {}
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { type BarPlotProps, type BarPlotSlotProps, type BarPlotSlots } from '@mui/x-charts/BarChart';
2
+ import type { BarPlotProps, BarPlotSlotProps, BarPlotSlots } from '@mui/x-charts/BarChart';
3
3
  import type { RendererType } from '@mui/x-charts/ScatterChart';
4
4
  export type BarPlotPremiumRenderer = RendererType | 'webgl';
5
5
  export interface BarPlotPremiumSlots extends BarPlotSlots {}
@@ -1,4 +1,4 @@
1
- import { type BarProps } from '@mui/x-charts/BarChart';
1
+ import type { BarProps } from '@mui/x-charts/BarChart';
2
2
  export interface AnimatedRangeBarElementProps extends BarProps {
3
3
  /**
4
4
  * If true, the bar is hidden and will animate to a collapsed state.
@@ -1,4 +1,4 @@
1
- import { type BarProps } from '@mui/x-charts/BarChart';
1
+ import type { BarProps } from '@mui/x-charts/BarChart';
2
2
  export interface AnimatedRangeBarElementProps extends BarProps {
3
3
  /**
4
4
  * If true, the bar is hidden and will animate to a collapsed state.
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
- import { type BarElementSlotProps, type BarElementSlots, type BarLabelSlots, type BarLabelSlotProps } from '@mui/x-charts/BarChart';
3
- import { type RangeBarItemIdentifier } from "../../models/index.mjs";
2
+ import type { BarElementSlotProps, BarElementSlots, BarLabelSlots, BarLabelSlotProps } from '@mui/x-charts/BarChart';
3
+ import type { RangeBarItemIdentifier } from "../../models/index.mjs";
4
4
  export type RangeBarPlotRenderer = 'svg-single' | 'webgl';
5
5
  export interface RangeBarPlotSlots extends BarElementSlots, BarLabelSlots {}
6
6
  export interface RangeBarPlotSlotProps extends BarElementSlotProps, BarLabelSlotProps {}
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
- import { type BarElementSlotProps, type BarElementSlots, type BarLabelSlots, type BarLabelSlotProps } from '@mui/x-charts/BarChart';
3
- import { type RangeBarItemIdentifier } from "../../models/index.js";
2
+ import type { BarElementSlotProps, BarElementSlots, BarLabelSlots, BarLabelSlotProps } from '@mui/x-charts/BarChart';
3
+ import type { RangeBarItemIdentifier } from "../../models/index.js";
4
4
  export type RangeBarPlotRenderer = 'svg-single' | 'webgl';
5
5
  export interface RangeBarPlotSlots extends BarElementSlots, BarLabelSlots {}
6
6
  export interface RangeBarPlotSlotProps extends BarElementSlotProps, BarLabelSlotProps {}
@@ -1,4 +1,4 @@
1
- import { type ChartSeriesDefaultized, type ChartsXAxisProps, type ChartsYAxisProps, type ComputedAxis, type ScaleName } from '@mui/x-charts/internals';
1
+ import type { ChartSeriesDefaultized, ChartsXAxisProps, ChartsYAxisProps, ComputedAxis, ScaleName } from '@mui/x-charts/internals';
2
2
  export declare function createGetRangeBarDimensions(params: {
3
3
  verticalLayout: boolean;
4
4
  xAxisConfig: ComputedAxis<ScaleName, any, ChartsXAxisProps>;
@@ -1,4 +1,4 @@
1
- import { type ChartSeriesDefaultized, type ChartsXAxisProps, type ChartsYAxisProps, type ComputedAxis, type ScaleName } from '@mui/x-charts/internals';
1
+ import type { ChartSeriesDefaultized, ChartsXAxisProps, ChartsYAxisProps, ComputedAxis, ScaleName } from '@mui/x-charts/internals';
2
2
  export declare function createGetRangeBarDimensions(params: {
3
3
  verticalLayout: boolean;
4
4
  xAxisConfig: ComputedAxis<ScaleName, any, ChartsXAxisProps>;
@@ -1,3 +1,3 @@
1
- import { type DescriptionGetter } from '@mui/x-charts/internals';
1
+ import type { DescriptionGetter } from '@mui/x-charts/internals';
2
2
  declare const descriptionGetter: DescriptionGetter<'rangeBar'>;
3
3
  export default descriptionGetter;
@@ -1,3 +1,3 @@
1
- import { type DescriptionGetter } from '@mui/x-charts/internals';
1
+ import type { DescriptionGetter } from '@mui/x-charts/internals';
2
2
  declare const descriptionGetter: DescriptionGetter<'rangeBar'>;
3
3
  export default descriptionGetter;
@@ -1,3 +1,3 @@
1
- import { type CartesianExtremumGetter } from '@mui/x-charts/internals';
1
+ import type { CartesianExtremumGetter } from '@mui/x-charts/internals';
2
2
  export declare const getExtremumX: CartesianExtremumGetter<'rangeBar'>;
3
3
  export declare const getExtremumY: CartesianExtremumGetter<'rangeBar'>;
@@ -1,3 +1,3 @@
1
- import { type CartesianExtremumGetter } from '@mui/x-charts/internals';
1
+ import type { CartesianExtremumGetter } from '@mui/x-charts/internals';
2
2
  export declare const getExtremumX: CartesianExtremumGetter<'rangeBar'>;
3
3
  export declare const getExtremumY: CartesianExtremumGetter<'rangeBar'>;
@@ -1,3 +1,3 @@
1
- import { type ColorProcessor } from '@mui/x-charts/internals';
1
+ import type { ColorProcessor } from '@mui/x-charts/internals';
2
2
  declare const getColor: ColorProcessor<'rangeBar'>;
3
3
  export default getColor;
@@ -1,3 +1,3 @@
1
- import { type ColorProcessor } from '@mui/x-charts/internals';
1
+ import type { ColorProcessor } from '@mui/x-charts/internals';
2
2
  declare const getColor: ColorProcessor<'rangeBar'>;
3
3
  export default getColor;
@@ -1,4 +1,4 @@
1
- import { type AllSeriesType } from '@mui/x-charts/models';
1
+ import type { AllSeriesType } from '@mui/x-charts/models';
2
2
  export declare function getSeriesWithDefaultValues(seriesData: AllSeriesType<'rangeBar'>, seriesIndex: number, colors: readonly string[]): {
3
3
  id: string;
4
4
  color: string;
@@ -1,4 +1,4 @@
1
- import { type AllSeriesType } from '@mui/x-charts/models';
1
+ import type { AllSeriesType } from '@mui/x-charts/models';
2
2
  export declare function getSeriesWithDefaultValues(seriesData: AllSeriesType<'rangeBar'>, seriesIndex: number, colors: readonly string[]): {
3
3
  id: string;
4
4
  color: string;
@@ -1,2 +1,2 @@
1
- import { type ChartSeriesTypeConfig } from '@mui/x-charts/internals';
1
+ import type { ChartSeriesTypeConfig } from '@mui/x-charts/internals';
2
2
  export declare const rangeBarSeriesConfig: ChartSeriesTypeConfig<'rangeBar'>;
@@ -1,2 +1,2 @@
1
- import { type ChartSeriesTypeConfig } from '@mui/x-charts/internals';
1
+ import type { ChartSeriesTypeConfig } from '@mui/x-charts/internals';
2
2
  export declare const rangeBarSeriesConfig: ChartSeriesTypeConfig<'rangeBar'>;
@@ -1,3 +1,3 @@
1
- import { type KeyboardFocusHandler, type ComposableCartesianChartSeriesType } from '@mui/x-charts/internals';
1
+ import type { KeyboardFocusHandler, ComposableCartesianChartSeriesType } from '@mui/x-charts/internals';
2
2
  declare const keyboardFocusHandler: KeyboardFocusHandler<'rangeBar', ComposableCartesianChartSeriesType>;
3
3
  export default keyboardFocusHandler;
@@ -1,3 +1,3 @@
1
- import { type KeyboardFocusHandler, type ComposableCartesianChartSeriesType } from '@mui/x-charts/internals';
1
+ import type { KeyboardFocusHandler, ComposableCartesianChartSeriesType } from '@mui/x-charts/internals';
2
2
  declare const keyboardFocusHandler: KeyboardFocusHandler<'rangeBar', ComposableCartesianChartSeriesType>;
3
3
  export default keyboardFocusHandler;
@@ -1,3 +1,3 @@
1
- import { type LegendGetter } from '@mui/x-charts/internals';
1
+ import type { LegendGetter } from '@mui/x-charts/internals';
2
2
  declare const legendGetter: LegendGetter<'rangeBar'>;
3
3
  export default legendGetter;
@@ -1,3 +1,3 @@
1
- import { type LegendGetter } from '@mui/x-charts/internals';
1
+ import type { LegendGetter } from '@mui/x-charts/internals';
2
2
  declare const legendGetter: LegendGetter<'rangeBar'>;
3
3
  export default legendGetter;
@@ -1,3 +1,3 @@
1
- import { type SeriesProcessor } from '@mui/x-charts/internals';
1
+ import type { SeriesProcessor } from '@mui/x-charts/internals';
2
2
  declare const seriesProcessor: SeriesProcessor<'rangeBar'>;
3
3
  export default seriesProcessor;
@@ -1,3 +1,3 @@
1
- import { type SeriesProcessor } from '@mui/x-charts/internals';
1
+ import type { SeriesProcessor } from '@mui/x-charts/internals';
2
2
  declare const seriesProcessor: SeriesProcessor<'rangeBar'>;
3
3
  export default seriesProcessor;
@@ -1,4 +1,4 @@
1
- import { type AxisTooltipGetter, type TooltipGetter } from '@mui/x-charts/internals';
1
+ import type { AxisTooltipGetter, TooltipGetter } from '@mui/x-charts/internals';
2
2
  declare const tooltipGetter: TooltipGetter<'rangeBar'>;
3
3
  export declare const axisTooltipGetter: AxisTooltipGetter<'rangeBar', 'x' | 'y'>;
4
4
  export default tooltipGetter;
@@ -1,4 +1,4 @@
1
- import { type AxisTooltipGetter, type TooltipGetter } from '@mui/x-charts/internals';
1
+ import type { AxisTooltipGetter, TooltipGetter } from '@mui/x-charts/internals';
2
2
  declare const tooltipGetter: TooltipGetter<'rangeBar'>;
3
3
  export declare const axisTooltipGetter: AxisTooltipGetter<'rangeBar', 'x' | 'y'>;
4
4
  export default tooltipGetter;
@@ -1,3 +1,3 @@
1
- import { type TooltipItemPositionGetter } from '@mui/x-charts/internals';
1
+ import type { TooltipItemPositionGetter } from '@mui/x-charts/internals';
2
2
  declare const tooltipItemPositionGetter: TooltipItemPositionGetter<'rangeBar'>;
3
3
  export default tooltipItemPositionGetter;
@@ -1,3 +1,3 @@
1
- import { type TooltipItemPositionGetter } from '@mui/x-charts/internals';
1
+ import type { TooltipItemPositionGetter } from '@mui/x-charts/internals';
2
2
  declare const tooltipItemPositionGetter: TooltipItemPositionGetter<'rangeBar'>;
3
3
  export default tooltipItemPositionGetter;
@@ -1,5 +1,5 @@
1
- import { type ChartDrawingArea } from '@mui/x-charts/hooks';
2
- import { type ComputedAxisConfig } from '@mui/x-charts/internals';
3
- import { type ChartsXAxisProps, type ChartsYAxisProps } from '@mui/x-charts/models';
4
- import { type ProcessedRangeBarSeriesData } from "./types.mjs";
1
+ import type { ChartDrawingArea } from '@mui/x-charts/hooks';
2
+ import type { ComputedAxisConfig } from '@mui/x-charts/internals';
3
+ import type { ChartsXAxisProps, ChartsYAxisProps } from '@mui/x-charts/models';
4
+ import type { ProcessedRangeBarSeriesData } from "./types.mjs";
5
5
  export declare function useRangeBarPlotData(drawingArea: ChartDrawingArea, xAxes: ComputedAxisConfig<ChartsXAxisProps>, yAxes: ComputedAxisConfig<ChartsYAxisProps>): ProcessedRangeBarSeriesData[];
@@ -1,5 +1,5 @@
1
- import { type ChartDrawingArea } from '@mui/x-charts/hooks';
2
- import { type ComputedAxisConfig } from '@mui/x-charts/internals';
3
- import { type ChartsXAxisProps, type ChartsYAxisProps } from '@mui/x-charts/models';
4
- import { type ProcessedRangeBarSeriesData } from "./types.js";
1
+ import type { ChartDrawingArea } from '@mui/x-charts/hooks';
2
+ import type { ComputedAxisConfig } from '@mui/x-charts/internals';
3
+ import type { ChartsXAxisProps, ChartsYAxisProps } from '@mui/x-charts/models';
4
+ import type { ProcessedRangeBarSeriesData } from "./types.js";
5
5
  export declare function useRangeBarPlotData(drawingArea: ChartDrawingArea, xAxes: ComputedAxisConfig<ChartsXAxisProps>, yAxes: ComputedAxisConfig<ChartsYAxisProps>): ProcessedRangeBarSeriesData[];
@@ -1,8 +1,8 @@
1
- import { type BarChartPluginSignatures } from '@mui/x-charts/BarChart';
2
- import { type ChartsContainerProps } from '@mui/x-charts/ChartsContainer';
3
- import { type BarChartPremiumProps } from "./BarChartPremium.mjs";
4
- import { type BarPlotPremiumProps } from "./BarPlotPremium.mjs";
5
- import { type RangeBarPlotProps } from "./RangeBar/RangeBarPlot.mjs";
1
+ import type { BarChartPluginSignatures } from '@mui/x-charts/BarChart';
2
+ import type { ChartsContainerProps } from '@mui/x-charts/ChartsContainer';
3
+ import type { BarChartPremiumProps } from "./BarChartPremium.mjs";
4
+ import type { BarPlotPremiumProps } from "./BarPlotPremium.mjs";
5
+ import type { RangeBarPlotProps } from "./RangeBar/RangeBarPlot.mjs";
6
6
  /**
7
7
  * A helper function that extracts BarChartPremiumProps from the input props
8
8
  * and returns an object with props for the children components of BarChartPremium.
@@ -1,8 +1,8 @@
1
- import { type BarChartPluginSignatures } from '@mui/x-charts/BarChart';
2
- import { type ChartsContainerProps } from '@mui/x-charts/ChartsContainer';
3
- import { type BarChartPremiumProps } from "./BarChartPremium.js";
4
- import { type BarPlotPremiumProps } from "./BarPlotPremium.js";
5
- import { type RangeBarPlotProps } from "./RangeBar/RangeBarPlot.js";
1
+ import type { BarChartPluginSignatures } from '@mui/x-charts/BarChart';
2
+ import type { ChartsContainerProps } from '@mui/x-charts/ChartsContainer';
3
+ import type { BarChartPremiumProps } from "./BarChartPremium.js";
4
+ import type { BarPlotPremiumProps } from "./BarPlotPremium.js";
5
+ import type { RangeBarPlotProps } from "./RangeBar/RangeBarPlot.js";
6
6
  /**
7
7
  * A helper function that extracts BarChartPremiumProps from the input props
8
8
  * and returns an object with props for the children components of BarChartPremium.
@@ -1,15 +1,14 @@
1
- import { type BarWebGLPlotData } from "./useBarWebGLPlotData.mjs";
1
+ import type { BarWebGLPlotData } from "./useBarWebGLPlotData.mjs";
2
2
  export declare class BarWebGLProgram {
3
3
  private gl;
4
4
  private readonly shaders;
5
5
  private readonly program;
6
6
  private readonly vao;
7
7
  private readonly quadBuffer;
8
- private readonly aPositionLocation;
9
- private readonly centersBuffer;
10
- private readonly halfSizesBuffer;
11
- private readonly colorsBuffer;
12
- private readonly cornerRadiiBuffer;
8
+ private readonly centers;
9
+ private readonly halfSizes;
10
+ private readonly colors;
11
+ private readonly cornerRadii;
13
12
  private readonly uResolution;
14
13
  constructor(gl: WebGL2RenderingContext);
15
14
  setResolution(width: number, height: number): void;
@@ -1,15 +1,14 @@
1
- import { type BarWebGLPlotData } from "./useBarWebGLPlotData.js";
1
+ import type { BarWebGLPlotData } from "./useBarWebGLPlotData.js";
2
2
  export declare class BarWebGLProgram {
3
3
  private gl;
4
4
  private readonly shaders;
5
5
  private readonly program;
6
6
  private readonly vao;
7
7
  private readonly quadBuffer;
8
- private readonly aPositionLocation;
9
- private readonly centersBuffer;
10
- private readonly halfSizesBuffer;
11
- private readonly colorsBuffer;
12
- private readonly cornerRadiiBuffer;
8
+ private readonly centers;
9
+ private readonly halfSizes;
10
+ private readonly colors;
11
+ private readonly cornerRadii;
13
12
  private readonly uResolution;
14
13
  constructor(gl: WebGL2RenderingContext);
15
14
  setResolution(width: number, height: number): void;
@@ -5,36 +5,29 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.BarWebGLProgram = void 0;
7
7
  var _utils = require("../../utils/webgl/utils");
8
+ var _instancedAttribute = require("../../utils/webgl/instancedAttribute");
8
9
  var _shaders = require("./shaders");
9
10
  class BarWebGLProgram {
10
11
  shaders = [];
12
+
13
+ /* Colors come in as Uint8 [0, 255]; normalized=true makes the GPU read them back as vec4 in [0, 1]. */
14
+
11
15
  constructor(gl) {
12
16
  this.gl = gl;
13
- gl.enable(gl.BLEND);
14
- gl.blendFunc(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA);
15
- this.program = gl.createProgram();
16
- const vertexShader = (0, _utils.compileShader)(gl, _shaders.barVertexShaderSource, gl.VERTEX_SHADER);
17
- const fragmentShader = (0, _utils.compileShader)(gl, _shaders.barFragmentShaderSource, gl.FRAGMENT_SHADER);
18
- gl.attachShader(this.program, vertexShader);
19
- gl.attachShader(this.program, fragmentShader);
20
- gl.linkProgram(this.program);
21
- this.shaders.push(vertexShader, fragmentShader);
22
- if (process.env.NODE_ENV !== 'production' && !gl.getProgramParameter(this.program, gl.LINK_STATUS)) {
23
- console.error(`Program linking failed: ${gl.getProgramInfoLog(this.program)}`);
24
- console.error(`Vertex info-log: ${gl.getShaderInfoLog(vertexShader)}`);
25
- console.error(`Fragment info-log: ${gl.getShaderInfoLog(fragmentShader)}`);
26
- }
27
-
28
- // Cache locations once.
17
+ (0, _utils.setupStandardBlending)(gl);
18
+ const linked = (0, _utils.linkProgram)(gl, _shaders.barVertexShaderSource, _shaders.barFragmentShaderSource);
19
+ this.program = linked.program;
20
+ this.shaders.push(...linked.shaders);
29
21
  this.uResolution = gl.getUniformLocation(this.program, 'u_resolution');
30
- this.aPositionLocation = gl.getAttribLocation(this.program, 'a_position');
31
22
  this.quadBuffer = (0, _utils.uploadQuadBuffer)(gl);
32
23
  this.vao = gl.createVertexArray();
33
- this.centersBuffer = createInstancedBuffer(gl, this.program, 'a_center', 2, gl.FLOAT, false);
34
- this.halfSizesBuffer = createInstancedBuffer(gl, this.program, 'a_halfSize', 2, gl.FLOAT, false);
35
- // Colors come in as Uint8 [0, 255]; normalized=true makes the GPU read them back as vec4 in [0, 1].
36
- this.colorsBuffer = createInstancedBuffer(gl, this.program, 'a_color', 4, gl.UNSIGNED_BYTE, true);
37
- this.cornerRadiiBuffer = createInstancedBuffer(gl, this.program, 'a_cornerRadii', 4, gl.FLOAT, false);
24
+ gl.bindVertexArray(this.vao);
25
+ (0, _utils.bindQuadBuffer)(gl, this.program, this.quadBuffer);
26
+ this.centers = (0, _instancedAttribute.createInstancedAttribute)(gl, this.program, 'a_center', 2);
27
+ this.halfSizes = (0, _instancedAttribute.createInstancedAttribute)(gl, this.program, 'a_halfSize', 2);
28
+ this.colors = (0, _instancedAttribute.createInstancedAttribute)(gl, this.program, 'a_color', 4, gl.UNSIGNED_BYTE, true);
29
+ this.cornerRadii = (0, _instancedAttribute.createInstancedAttribute)(gl, this.program, 'a_cornerRadii', 4);
30
+ gl.bindVertexArray(null);
38
31
  }
39
32
  setResolution(width, height) {
40
33
  this.gl.useProgram(this.program);
@@ -42,18 +35,10 @@ class BarWebGLProgram {
42
35
  }
43
36
  plot(plotData) {
44
37
  const gl = this.gl;
45
- gl.useProgram(this.program);
46
- gl.bindVertexArray(this.vao);
47
-
48
- // Bind quad buffer + a_position (per-vertex).
49
- gl.bindBuffer(gl.ARRAY_BUFFER, this.quadBuffer);
50
- gl.enableVertexAttribArray(this.aPositionLocation);
51
- gl.vertexAttribPointer(this.aPositionLocation, 2, gl.FLOAT, false, 0, 0);
52
- uploadAndBindInstanced(gl, this.centersBuffer, plotData.centers);
53
- uploadAndBindInstanced(gl, this.halfSizesBuffer, plotData.halfSizes);
54
- uploadAndBindInstanced(gl, this.colorsBuffer, plotData.colors);
55
- uploadAndBindInstanced(gl, this.cornerRadiiBuffer, plotData.cornerRadii);
56
- gl.bindVertexArray(null);
38
+ (0, _utils.uploadGrowableBuffer)(gl, this.centers.buffer, plotData.centers);
39
+ (0, _utils.uploadGrowableBuffer)(gl, this.halfSizes.buffer, plotData.halfSizes);
40
+ (0, _utils.uploadGrowableBuffer)(gl, this.colors.buffer, plotData.colors);
41
+ (0, _utils.uploadGrowableBuffer)(gl, this.cornerRadii.buffer, plotData.cornerRadii);
57
42
  (0, _utils.logWebGLErrors)(gl);
58
43
  }
59
44
  render(count) {
@@ -71,37 +56,11 @@ class BarWebGLProgram {
71
56
  gl.deleteProgram(this.program);
72
57
  gl.deleteVertexArray(this.vao);
73
58
  gl.deleteBuffer(this.quadBuffer);
74
- gl.deleteBuffer(this.centersBuffer.buffer);
75
- gl.deleteBuffer(this.halfSizesBuffer.buffer);
76
- gl.deleteBuffer(this.colorsBuffer.buffer);
77
- gl.deleteBuffer(this.cornerRadiiBuffer.buffer);
59
+ gl.deleteBuffer(this.centers.buffer.buffer);
60
+ gl.deleteBuffer(this.halfSizes.buffer.buffer);
61
+ gl.deleteBuffer(this.colors.buffer.buffer);
62
+ gl.deleteBuffer(this.cornerRadii.buffer.buffer);
78
63
  this.shaders.forEach(shader => gl.deleteShader(shader));
79
64
  }
80
65
  }
81
- exports.BarWebGLProgram = BarWebGLProgram;
82
- function createInstancedBuffer(gl, program, name, size, glType, normalized) {
83
- return {
84
- buffer: gl.createBuffer(),
85
- capacityBytes: 0,
86
- lastUploaded: null,
87
- location: gl.getAttribLocation(program, name),
88
- size,
89
- glType,
90
- normalized
91
- };
92
- }
93
- function uploadAndBindInstanced(gl, target, data) {
94
- gl.bindBuffer(gl.ARRAY_BUFFER, target.buffer);
95
- if (target.lastUploaded !== data) {
96
- if (data.byteLength <= target.capacityBytes) {
97
- gl.bufferSubData(gl.ARRAY_BUFFER, 0, data);
98
- } else {
99
- gl.bufferData(gl.ARRAY_BUFFER, data, gl.DYNAMIC_DRAW);
100
- target.capacityBytes = data.byteLength;
101
- }
102
- target.lastUploaded = data;
103
- }
104
- gl.enableVertexAttribArray(target.location);
105
- gl.vertexAttribPointer(target.location, target.size, target.glType, target.normalized, 0, 0);
106
- gl.vertexAttribDivisor(target.location, 1);
107
- }
66
+ exports.BarWebGLProgram = BarWebGLProgram;
@@ -1,34 +1,27 @@
1
- import { compileShader, logWebGLErrors, uploadQuadBuffer } from "../../utils/webgl/utils.mjs";
1
+ import { bindQuadBuffer, linkProgram, logWebGLErrors, setupStandardBlending, uploadGrowableBuffer, uploadQuadBuffer } from "../../utils/webgl/utils.mjs";
2
+ import { createInstancedAttribute } from "../../utils/webgl/instancedAttribute.mjs";
2
3
  import { barFragmentShaderSource, barVertexShaderSource } from "./shaders.mjs";
3
4
  export class BarWebGLProgram {
4
5
  shaders = [];
6
+
7
+ /* Colors come in as Uint8 [0, 255]; normalized=true makes the GPU read them back as vec4 in [0, 1]. */
8
+
5
9
  constructor(gl) {
6
10
  this.gl = gl;
7
- gl.enable(gl.BLEND);
8
- gl.blendFunc(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA);
9
- this.program = gl.createProgram();
10
- const vertexShader = compileShader(gl, barVertexShaderSource, gl.VERTEX_SHADER);
11
- const fragmentShader = compileShader(gl, barFragmentShaderSource, gl.FRAGMENT_SHADER);
12
- gl.attachShader(this.program, vertexShader);
13
- gl.attachShader(this.program, fragmentShader);
14
- gl.linkProgram(this.program);
15
- this.shaders.push(vertexShader, fragmentShader);
16
- if (process.env.NODE_ENV !== 'production' && !gl.getProgramParameter(this.program, gl.LINK_STATUS)) {
17
- console.error(`Program linking failed: ${gl.getProgramInfoLog(this.program)}`);
18
- console.error(`Vertex info-log: ${gl.getShaderInfoLog(vertexShader)}`);
19
- console.error(`Fragment info-log: ${gl.getShaderInfoLog(fragmentShader)}`);
20
- }
21
-
22
- // Cache locations once.
11
+ setupStandardBlending(gl);
12
+ const linked = linkProgram(gl, barVertexShaderSource, barFragmentShaderSource);
13
+ this.program = linked.program;
14
+ this.shaders.push(...linked.shaders);
23
15
  this.uResolution = gl.getUniformLocation(this.program, 'u_resolution');
24
- this.aPositionLocation = gl.getAttribLocation(this.program, 'a_position');
25
16
  this.quadBuffer = uploadQuadBuffer(gl);
26
17
  this.vao = gl.createVertexArray();
27
- this.centersBuffer = createInstancedBuffer(gl, this.program, 'a_center', 2, gl.FLOAT, false);
28
- this.halfSizesBuffer = createInstancedBuffer(gl, this.program, 'a_halfSize', 2, gl.FLOAT, false);
29
- // Colors come in as Uint8 [0, 255]; normalized=true makes the GPU read them back as vec4 in [0, 1].
30
- this.colorsBuffer = createInstancedBuffer(gl, this.program, 'a_color', 4, gl.UNSIGNED_BYTE, true);
31
- this.cornerRadiiBuffer = createInstancedBuffer(gl, this.program, 'a_cornerRadii', 4, gl.FLOAT, false);
18
+ gl.bindVertexArray(this.vao);
19
+ bindQuadBuffer(gl, this.program, this.quadBuffer);
20
+ this.centers = createInstancedAttribute(gl, this.program, 'a_center', 2);
21
+ this.halfSizes = createInstancedAttribute(gl, this.program, 'a_halfSize', 2);
22
+ this.colors = createInstancedAttribute(gl, this.program, 'a_color', 4, gl.UNSIGNED_BYTE, true);
23
+ this.cornerRadii = createInstancedAttribute(gl, this.program, 'a_cornerRadii', 4);
24
+ gl.bindVertexArray(null);
32
25
  }
33
26
  setResolution(width, height) {
34
27
  this.gl.useProgram(this.program);
@@ -36,18 +29,10 @@ export class BarWebGLProgram {
36
29
  }
37
30
  plot(plotData) {
38
31
  const gl = this.gl;
39
- gl.useProgram(this.program);
40
- gl.bindVertexArray(this.vao);
41
-
42
- // Bind quad buffer + a_position (per-vertex).
43
- gl.bindBuffer(gl.ARRAY_BUFFER, this.quadBuffer);
44
- gl.enableVertexAttribArray(this.aPositionLocation);
45
- gl.vertexAttribPointer(this.aPositionLocation, 2, gl.FLOAT, false, 0, 0);
46
- uploadAndBindInstanced(gl, this.centersBuffer, plotData.centers);
47
- uploadAndBindInstanced(gl, this.halfSizesBuffer, plotData.halfSizes);
48
- uploadAndBindInstanced(gl, this.colorsBuffer, plotData.colors);
49
- uploadAndBindInstanced(gl, this.cornerRadiiBuffer, plotData.cornerRadii);
50
- gl.bindVertexArray(null);
32
+ uploadGrowableBuffer(gl, this.centers.buffer, plotData.centers);
33
+ uploadGrowableBuffer(gl, this.halfSizes.buffer, plotData.halfSizes);
34
+ uploadGrowableBuffer(gl, this.colors.buffer, plotData.colors);
35
+ uploadGrowableBuffer(gl, this.cornerRadii.buffer, plotData.cornerRadii);
51
36
  logWebGLErrors(gl);
52
37
  }
53
38
  render(count) {
@@ -65,36 +50,10 @@ export class BarWebGLProgram {
65
50
  gl.deleteProgram(this.program);
66
51
  gl.deleteVertexArray(this.vao);
67
52
  gl.deleteBuffer(this.quadBuffer);
68
- gl.deleteBuffer(this.centersBuffer.buffer);
69
- gl.deleteBuffer(this.halfSizesBuffer.buffer);
70
- gl.deleteBuffer(this.colorsBuffer.buffer);
71
- gl.deleteBuffer(this.cornerRadiiBuffer.buffer);
53
+ gl.deleteBuffer(this.centers.buffer.buffer);
54
+ gl.deleteBuffer(this.halfSizes.buffer.buffer);
55
+ gl.deleteBuffer(this.colors.buffer.buffer);
56
+ gl.deleteBuffer(this.cornerRadii.buffer.buffer);
72
57
  this.shaders.forEach(shader => gl.deleteShader(shader));
73
58
  }
74
- }
75
- function createInstancedBuffer(gl, program, name, size, glType, normalized) {
76
- return {
77
- buffer: gl.createBuffer(),
78
- capacityBytes: 0,
79
- lastUploaded: null,
80
- location: gl.getAttribLocation(program, name),
81
- size,
82
- glType,
83
- normalized
84
- };
85
- }
86
- function uploadAndBindInstanced(gl, target, data) {
87
- gl.bindBuffer(gl.ARRAY_BUFFER, target.buffer);
88
- if (target.lastUploaded !== data) {
89
- if (data.byteLength <= target.capacityBytes) {
90
- gl.bufferSubData(gl.ARRAY_BUFFER, 0, data);
91
- } else {
92
- gl.bufferData(gl.ARRAY_BUFFER, data, gl.DYNAMIC_DRAW);
93
- target.capacityBytes = data.byteLength;
94
- }
95
- target.lastUploaded = data;
96
- }
97
- gl.enableVertexAttribArray(target.location);
98
- gl.vertexAttribPointer(target.location, target.size, target.glType, target.normalized, 0, 0);
99
- gl.vertexAttribDivisor(target.location, 1);
100
59
  }
@@ -1,2 +1,2 @@
1
1
  export declare const barVertexShaderSource = "\n precision mediump float;\n\n attribute vec2 a_position;\n attribute vec2 a_center;\n attribute vec2 a_halfSize;\n attribute vec4 a_color;\n attribute vec4 a_cornerRadii;\n\n varying vec4 v_color;\n varying vec2 v_pos;\n varying vec2 v_halfSize;\n varying vec4 v_cornerRadii;\n\n uniform vec2 u_resolution;\n\n void main() {\n vec2 position = a_center + a_position * a_halfSize;\n vec2 clipSpace = (position / u_resolution) * 2.0 - 1.0;\n gl_Position = vec4(clipSpace * vec2(1, -1), 0, 1);\n\n v_color = a_color;\n v_pos = a_position * a_halfSize;\n v_halfSize = a_halfSize;\n v_cornerRadii = a_cornerRadii;\n }\n ";
2
- export declare const barFragmentShaderSource = "\n precision mediump float;\n\n varying vec4 v_color;\n varying vec2 v_pos;\n varying vec2 v_halfSize;\n varying vec4 v_cornerRadii;\n\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\n void main() {\n float dist = roundedBoxSDF(v_pos, v_halfSize, v_cornerRadii);\n // Anti-alias only outside the SDF (dist >= 0). Starting smoothstep at 0\n // keeps interior pixels at full color instead of fading them.\n float alpha = 1.0 - smoothstep(0.0, 0.5, dist);\n\n gl_FragColor = vec4(v_color.rgb, v_color.a * alpha);\n }\n ";
2
+ export declare const barFragmentShaderSource = "\n precision mediump float;\n\n varying vec4 v_color;\n varying vec2 v_pos;\n varying vec2 v_halfSize;\n varying vec4 v_cornerRadii;\n\n \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 \n\n void main() {\n float dist = roundedBoxSDF(v_pos, v_halfSize, v_cornerRadii);\n // Anti-alias only outside the SDF (dist >= 0). Starting smoothstep at 0\n // keeps interior pixels at full color instead of fading them.\n float alpha = 1.0 - smoothstep(0.0, 0.5, dist);\n\n gl_FragColor = vec4(v_color.rgb, v_color.a * alpha);\n }\n ";
@@ -1,2 +1,2 @@
1
1
  export declare const barVertexShaderSource = "\n precision mediump float;\n\n attribute vec2 a_position;\n attribute vec2 a_center;\n attribute vec2 a_halfSize;\n attribute vec4 a_color;\n attribute vec4 a_cornerRadii;\n\n varying vec4 v_color;\n varying vec2 v_pos;\n varying vec2 v_halfSize;\n varying vec4 v_cornerRadii;\n\n uniform vec2 u_resolution;\n\n void main() {\n vec2 position = a_center + a_position * a_halfSize;\n vec2 clipSpace = (position / u_resolution) * 2.0 - 1.0;\n gl_Position = vec4(clipSpace * vec2(1, -1), 0, 1);\n\n v_color = a_color;\n v_pos = a_position * a_halfSize;\n v_halfSize = a_halfSize;\n v_cornerRadii = a_cornerRadii;\n }\n ";
2
- export declare const barFragmentShaderSource = "\n precision mediump float;\n\n varying vec4 v_color;\n varying vec2 v_pos;\n varying vec2 v_halfSize;\n varying vec4 v_cornerRadii;\n\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\n void main() {\n float dist = roundedBoxSDF(v_pos, v_halfSize, v_cornerRadii);\n // Anti-alias only outside the SDF (dist >= 0). Starting smoothstep at 0\n // keeps interior pixels at full color instead of fading them.\n float alpha = 1.0 - smoothstep(0.0, 0.5, dist);\n\n gl_FragColor = vec4(v_color.rgb, v_color.a * alpha);\n }\n ";
2
+ export declare const barFragmentShaderSource = "\n precision mediump float;\n\n varying vec4 v_color;\n varying vec2 v_pos;\n varying vec2 v_halfSize;\n varying vec4 v_cornerRadii;\n\n \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 \n\n void main() {\n float dist = roundedBoxSDF(v_pos, v_halfSize, v_cornerRadii);\n // Anti-alias only outside the SDF (dist >= 0). Starting smoothstep at 0\n // keeps interior pixels at full color instead of fading them.\n float alpha = 1.0 - smoothstep(0.0, 0.5, dist);\n\n gl_FragColor = vec4(v_color.rgb, v_color.a * alpha);\n }\n ";