@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
@@ -5,19 +5,15 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.HeatmapWebGLProgram = void 0;
7
7
  var _utils = require("../../utils/webgl/utils");
8
+ var _instancedAttribute = require("../../utils/webgl/instancedAttribute");
8
9
  var _shaders = require("./shaders");
9
- const QUAD_VERTICES = new Float32Array([-1, -1, 1, -1, -1, 1, 1, 1]);
10
10
  class HeatmapWebGLProgram {
11
11
  shaders = [];
12
12
  constructor(gl) {
13
13
  this.gl = gl;
14
- /* Enable blending for transparency
15
- * These are global to the WebGL context and need to be set only once */
16
- gl.enable(gl.BLEND);
17
- gl.blendFunc(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA);
18
- this.quadBuffer = gl.createBuffer();
19
- gl.bindBuffer(gl.ARRAY_BUFFER, this.quadBuffer);
20
- gl.bufferData(gl.ARRAY_BUFFER, QUAD_VERTICES, gl.STATIC_DRAW);
14
+ /* These are global to the WebGL context and need to be set only once. */
15
+ (0, _utils.setupStandardBlending)(gl);
16
+ this.quadBuffer = (0, _utils.uploadQuadBuffer)(gl);
21
17
  this.centers = (0, _utils.createGrowableBuffer)(gl);
22
18
  this.colors = (0, _utils.createGrowableBuffer)(gl);
23
19
  this.saturations = (0, _utils.createGrowableBuffer)(gl);
@@ -29,28 +25,16 @@ class HeatmapWebGLProgram {
29
25
  }
30
26
  buildVariant(fragmentShaderSource) {
31
27
  const gl = this.gl;
32
- const program = gl.createProgram();
33
- const vertexShader = (0, _utils.compileShader)(gl, _shaders.heatmapVertexShaderSource, gl.VERTEX_SHADER);
34
- gl.attachShader(program, vertexShader);
35
- const fragmentShader = (0, _utils.attachShader)(gl, program, fragmentShaderSource, gl.FRAGMENT_SHADER);
36
- gl.linkProgram(program);
37
-
38
- /* https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/WebGL_best_practices#dont_check_shader_compile_status_unless_linking_fails */
39
- if (process.env.NODE_ENV !== 'production') {
40
- if (!gl.getProgramParameter(program, gl.LINK_STATUS)) {
41
- console.error(`Program linking failed: ${gl.getProgramInfoLog(program)}`);
42
- console.error(`Vertex shader info-log: ${gl.getShaderInfoLog(vertexShader)}`);
43
- console.error(`Fragment shader info-log: ${gl.getShaderInfoLog(fragmentShader)}`);
44
- }
45
- }
46
- this.shaders.push(vertexShader, fragmentShader);
28
+ const linked = (0, _utils.linkProgram)(gl, _shaders.heatmapVertexShaderSource, fragmentShaderSource);
29
+ this.shaders.push(...linked.shaders);
30
+ const program = linked.program;
47
31
  const vao = gl.createVertexArray();
48
32
  gl.bindVertexArray(vao);
49
- bindAttribute(gl, program, 'a_position', this.quadBuffer, 2, 0);
50
- bindAttribute(gl, program, 'a_center', this.centers.buffer, 2, 1);
33
+ (0, _utils.bindQuadBuffer)(gl, program, this.quadBuffer);
34
+ (0, _instancedAttribute.bindInstancedAttribute)(gl, program, 'a_center', this.centers, 2);
51
35
  /* Colors are uploaded as Uint8(Clamped)Array; shader sees normalized [0, 1] floats. */
52
- bindAttribute(gl, program, 'a_color', this.colors.buffer, 4, 1, gl.UNSIGNED_BYTE, true);
53
- bindAttribute(gl, program, 'a_saturation', this.saturations.buffer, 1, 1);
36
+ (0, _instancedAttribute.bindInstancedAttribute)(gl, program, 'a_color', this.colors, 4, gl.UNSIGNED_BYTE, true);
37
+ (0, _instancedAttribute.bindInstancedAttribute)(gl, program, 'a_saturation', this.saturations, 1);
54
38
  gl.bindVertexArray(null);
55
39
  return {
56
40
  program,
@@ -120,13 +104,4 @@ class HeatmapWebGLProgram {
120
104
  this.shaders.forEach(shader => gl.deleteShader(shader));
121
105
  }
122
106
  }
123
- exports.HeatmapWebGLProgram = HeatmapWebGLProgram;
124
- function bindAttribute(gl, program, name, buffer, size, divisor, type = gl.FLOAT, normalized = false) {
125
- const location = gl.getAttribLocation(program, name);
126
- gl.bindBuffer(gl.ARRAY_BUFFER, buffer);
127
- gl.enableVertexAttribArray(location);
128
- gl.vertexAttribPointer(location, size, type, normalized, 0, 0);
129
- if (divisor !== 0) {
130
- gl.vertexAttribDivisor(location, divisor);
131
- }
132
- }
107
+ exports.HeatmapWebGLProgram = HeatmapWebGLProgram;
@@ -1,17 +1,13 @@
1
- import { attachShader, compileShader, createGrowableBuffer, logWebGLErrors, uploadGrowableBuffer } from "../../utils/webgl/utils.mjs";
1
+ import { bindQuadBuffer, createGrowableBuffer, linkProgram, logWebGLErrors, setupStandardBlending, uploadGrowableBuffer, uploadQuadBuffer } from "../../utils/webgl/utils.mjs";
2
+ import { bindInstancedAttribute } from "../../utils/webgl/instancedAttribute.mjs";
2
3
  import { heatmapFragmentShaderSourceNoBorderRadius, heatmapFragmentShaderSourceWithBorderRadius, heatmapVertexShaderSource } from "./shaders.mjs";
3
- const QUAD_VERTICES = new Float32Array([-1, -1, 1, -1, -1, 1, 1, 1]);
4
4
  export class HeatmapWebGLProgram {
5
5
  shaders = [];
6
6
  constructor(gl) {
7
7
  this.gl = gl;
8
- /* Enable blending for transparency
9
- * These are global to the WebGL context and need to be set only once */
10
- gl.enable(gl.BLEND);
11
- gl.blendFunc(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA);
12
- this.quadBuffer = gl.createBuffer();
13
- gl.bindBuffer(gl.ARRAY_BUFFER, this.quadBuffer);
14
- gl.bufferData(gl.ARRAY_BUFFER, QUAD_VERTICES, gl.STATIC_DRAW);
8
+ /* These are global to the WebGL context and need to be set only once. */
9
+ setupStandardBlending(gl);
10
+ this.quadBuffer = uploadQuadBuffer(gl);
15
11
  this.centers = createGrowableBuffer(gl);
16
12
  this.colors = createGrowableBuffer(gl);
17
13
  this.saturations = createGrowableBuffer(gl);
@@ -23,28 +19,16 @@ export class HeatmapWebGLProgram {
23
19
  }
24
20
  buildVariant(fragmentShaderSource) {
25
21
  const gl = this.gl;
26
- const program = gl.createProgram();
27
- const vertexShader = compileShader(gl, heatmapVertexShaderSource, gl.VERTEX_SHADER);
28
- gl.attachShader(program, vertexShader);
29
- const fragmentShader = attachShader(gl, program, fragmentShaderSource, gl.FRAGMENT_SHADER);
30
- gl.linkProgram(program);
31
-
32
- /* https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/WebGL_best_practices#dont_check_shader_compile_status_unless_linking_fails */
33
- if (process.env.NODE_ENV !== 'production') {
34
- if (!gl.getProgramParameter(program, gl.LINK_STATUS)) {
35
- console.error(`Program linking failed: ${gl.getProgramInfoLog(program)}`);
36
- console.error(`Vertex shader info-log: ${gl.getShaderInfoLog(vertexShader)}`);
37
- console.error(`Fragment shader info-log: ${gl.getShaderInfoLog(fragmentShader)}`);
38
- }
39
- }
40
- this.shaders.push(vertexShader, fragmentShader);
22
+ const linked = linkProgram(gl, heatmapVertexShaderSource, fragmentShaderSource);
23
+ this.shaders.push(...linked.shaders);
24
+ const program = linked.program;
41
25
  const vao = gl.createVertexArray();
42
26
  gl.bindVertexArray(vao);
43
- bindAttribute(gl, program, 'a_position', this.quadBuffer, 2, 0);
44
- bindAttribute(gl, program, 'a_center', this.centers.buffer, 2, 1);
27
+ bindQuadBuffer(gl, program, this.quadBuffer);
28
+ bindInstancedAttribute(gl, program, 'a_center', this.centers, 2);
45
29
  /* Colors are uploaded as Uint8(Clamped)Array; shader sees normalized [0, 1] floats. */
46
- bindAttribute(gl, program, 'a_color', this.colors.buffer, 4, 1, gl.UNSIGNED_BYTE, true);
47
- bindAttribute(gl, program, 'a_saturation', this.saturations.buffer, 1, 1);
30
+ bindInstancedAttribute(gl, program, 'a_color', this.colors, 4, gl.UNSIGNED_BYTE, true);
31
+ bindInstancedAttribute(gl, program, 'a_saturation', this.saturations, 1);
48
32
  gl.bindVertexArray(null);
49
33
  return {
50
34
  program,
@@ -113,13 +97,4 @@ export class HeatmapWebGLProgram {
113
97
  gl.deleteVertexArray(this.roundedVariant.vao);
114
98
  this.shaders.forEach(shader => gl.deleteShader(shader));
115
99
  }
116
- }
117
- function bindAttribute(gl, program, name, buffer, size, divisor, type = gl.FLOAT, normalized = false) {
118
- const location = gl.getAttribLocation(program, name);
119
- gl.bindBuffer(gl.ARRAY_BUFFER, buffer);
120
- gl.enableVertexAttribArray(location);
121
- gl.vertexAttribPointer(location, size, type, normalized, 0, 0);
122
- if (divisor !== 0) {
123
- gl.vertexAttribDivisor(location, divisor);
124
- }
125
100
  }
@@ -1,3 +1,3 @@
1
- export declare const heatmapVertexShaderSource = "\n precision mediump float;\n \n attribute vec2 a_position;\n attribute vec2 a_center;\n attribute vec4 a_color;\n attribute float a_saturation;\n \n varying vec4 v_color;\n varying vec2 v_pos;\n \n uniform vec2 u_dimensions;\n uniform vec2 u_resolution;\n \n // https://tsev.dev/posts/2020-06-19-colour-correction-with-webgl/\n vec3 adjust_saturation(vec3 color, float value) {\n // https://www.w3.org/TR/WCAG22/#dfn-relative-luminance\n const vec3 luminosityFactor = vec3(0.2126, 0.7152, 0.0722);\n vec3 grayscale = vec3(dot(color, luminosityFactor));\n \n return mix(grayscale, color, 1.0 + value);\n }\n \n void main() {\n // Convert from pixels to clip space (-1 to 1)\n vec2 position = a_center + a_position * u_dimensions / 2.0;\n vec2 clipSpace = (position / u_resolution) * 2.0 - 1.0;\n gl_Position = vec4(clipSpace * vec2(1, -1), 0, 1);\n \n v_color = vec4(adjust_saturation(a_color.rgb, a_saturation), 1.0);\n v_pos = a_position * u_dimensions / 2.0;\n }\n ";
2
- export declare const heatmapFragmentShaderSourceNoBorderRadius = "\n precision mediump float;\n \n varying vec4 v_color;\n \n void main() {\n gl_FragColor = v_color;\n }\n ";
3
- export declare const heatmapFragmentShaderSourceWithBorderRadius = "\n precision mediump float;\n\n varying vec4 v_color;\n varying vec2 v_pos;\n\n uniform vec2 u_dimensions;\n uniform float u_borderRadius;\n\n float roundedBoxSDF(vec2 pos, vec2 half_size, float radius) {\n vec2 q = abs(pos) - half_size + radius;\n return min(max(q.x, q.y), 0.0) + length(max(q, 0.0)) - radius;\n }\n\n void main() {\n // Calculate distance from rounded rectangle edge\n float dist = roundedBoxSDF(v_pos, u_dimensions / 2.0, u_borderRadius);\n \n // Create smooth alpha based on distance\n float alpha = 1.0 - smoothstep(-0.5, 0.5, dist);\n \n gl_FragColor = vec4(v_color.rgb, v_color.a * alpha);\n }\n ";
1
+ export declare const heatmapVertexShaderSource = "\n precision mediump float;\n \n attribute vec2 a_position;\n attribute vec2 a_center;\n attribute vec4 a_color;\n attribute float a_saturation;\n\n varying vec4 v_color;\n varying vec2 v_pos;\n\n uniform vec2 u_dimensions;\n uniform vec2 u_resolution;\n // https://tsev.dev/posts/2020-06-19-colour-correction-with-webgl/\n vec3 adjust_saturation(vec3 color, float value) {\n // https://www.w3.org/TR/WCAG22/#dfn-relative-luminance\n const vec3 luminosityFactor = vec3(0.2126, 0.7152, 0.0722);\n vec3 grayscale = vec3(dot(color, luminosityFactor));\n\n return mix(grayscale, color, 1.0 + value);\n }\n\n void main() {\n // Convert from pixels to clip space (-1 to 1)\n vec2 position = a_center + a_position * u_dimensions / 2.0;\n vec2 clipSpace = (position / u_resolution) * 2.0 - 1.0;\n gl_Position = vec4(clipSpace * vec2(1, -1), 0, 1);\n\n v_color = vec4(adjust_saturation(a_color.rgb, a_saturation), 1.0);\n v_pos = a_position * u_dimensions / 2.0;\n }\n ";
2
+ export declare const heatmapFragmentShaderSourceNoBorderRadius = "\n precision mediump float;\n\n varying vec4 v_color;\n\n void main() {\n gl_FragColor = v_color;\n }\n ";
3
+ export declare const heatmapFragmentShaderSourceWithBorderRadius = "\n precision mediump float;\n\n varying vec4 v_color;\n varying vec2 v_pos;\n\n uniform vec2 u_dimensions;\n uniform float u_borderRadius;\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 // Calculate distance from rounded rectangle edge\n float dist = roundedBoxSDF(v_pos, u_dimensions / 2.0, vec4(u_borderRadius));\n\n // Create smooth alpha based on distance\n float alpha = 1.0 - smoothstep(-0.5, 0.5, dist);\n\n gl_FragColor = vec4(v_color.rgb, v_color.a * alpha);\n }\n ";
@@ -1,3 +1,3 @@
1
- export declare const heatmapVertexShaderSource = "\n precision mediump float;\n \n attribute vec2 a_position;\n attribute vec2 a_center;\n attribute vec4 a_color;\n attribute float a_saturation;\n \n varying vec4 v_color;\n varying vec2 v_pos;\n \n uniform vec2 u_dimensions;\n uniform vec2 u_resolution;\n \n // https://tsev.dev/posts/2020-06-19-colour-correction-with-webgl/\n vec3 adjust_saturation(vec3 color, float value) {\n // https://www.w3.org/TR/WCAG22/#dfn-relative-luminance\n const vec3 luminosityFactor = vec3(0.2126, 0.7152, 0.0722);\n vec3 grayscale = vec3(dot(color, luminosityFactor));\n \n return mix(grayscale, color, 1.0 + value);\n }\n \n void main() {\n // Convert from pixels to clip space (-1 to 1)\n vec2 position = a_center + a_position * u_dimensions / 2.0;\n vec2 clipSpace = (position / u_resolution) * 2.0 - 1.0;\n gl_Position = vec4(clipSpace * vec2(1, -1), 0, 1);\n \n v_color = vec4(adjust_saturation(a_color.rgb, a_saturation), 1.0);\n v_pos = a_position * u_dimensions / 2.0;\n }\n ";
2
- export declare const heatmapFragmentShaderSourceNoBorderRadius = "\n precision mediump float;\n \n varying vec4 v_color;\n \n void main() {\n gl_FragColor = v_color;\n }\n ";
3
- export declare const heatmapFragmentShaderSourceWithBorderRadius = "\n precision mediump float;\n\n varying vec4 v_color;\n varying vec2 v_pos;\n\n uniform vec2 u_dimensions;\n uniform float u_borderRadius;\n\n float roundedBoxSDF(vec2 pos, vec2 half_size, float radius) {\n vec2 q = abs(pos) - half_size + radius;\n return min(max(q.x, q.y), 0.0) + length(max(q, 0.0)) - radius;\n }\n\n void main() {\n // Calculate distance from rounded rectangle edge\n float dist = roundedBoxSDF(v_pos, u_dimensions / 2.0, u_borderRadius);\n \n // Create smooth alpha based on distance\n float alpha = 1.0 - smoothstep(-0.5, 0.5, dist);\n \n gl_FragColor = vec4(v_color.rgb, v_color.a * alpha);\n }\n ";
1
+ export declare const heatmapVertexShaderSource = "\n precision mediump float;\n \n attribute vec2 a_position;\n attribute vec2 a_center;\n attribute vec4 a_color;\n attribute float a_saturation;\n\n varying vec4 v_color;\n varying vec2 v_pos;\n\n uniform vec2 u_dimensions;\n uniform vec2 u_resolution;\n // https://tsev.dev/posts/2020-06-19-colour-correction-with-webgl/\n vec3 adjust_saturation(vec3 color, float value) {\n // https://www.w3.org/TR/WCAG22/#dfn-relative-luminance\n const vec3 luminosityFactor = vec3(0.2126, 0.7152, 0.0722);\n vec3 grayscale = vec3(dot(color, luminosityFactor));\n\n return mix(grayscale, color, 1.0 + value);\n }\n\n void main() {\n // Convert from pixels to clip space (-1 to 1)\n vec2 position = a_center + a_position * u_dimensions / 2.0;\n vec2 clipSpace = (position / u_resolution) * 2.0 - 1.0;\n gl_Position = vec4(clipSpace * vec2(1, -1), 0, 1);\n\n v_color = vec4(adjust_saturation(a_color.rgb, a_saturation), 1.0);\n v_pos = a_position * u_dimensions / 2.0;\n }\n ";
2
+ export declare const heatmapFragmentShaderSourceNoBorderRadius = "\n precision mediump float;\n\n varying vec4 v_color;\n\n void main() {\n gl_FragColor = v_color;\n }\n ";
3
+ export declare const heatmapFragmentShaderSourceWithBorderRadius = "\n precision mediump float;\n\n varying vec4 v_color;\n varying vec2 v_pos;\n\n uniform vec2 u_dimensions;\n uniform float u_borderRadius;\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 // Calculate distance from rounded rectangle edge\n float dist = roundedBoxSDF(v_pos, u_dimensions / 2.0, vec4(u_borderRadius));\n\n // Create smooth alpha based on distance\n float alpha = 1.0 - smoothstep(-0.5, 0.5, dist);\n\n gl_FragColor = vec4(v_color.rgb, v_color.a * alpha);\n }\n ";
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.heatmapVertexShaderSource = exports.heatmapFragmentShaderSourceWithBorderRadius = exports.heatmapFragmentShaderSourceNoBorderRadius = void 0;
7
+ var _glsl = require("../../utils/webgl/glsl");
7
8
  // language=Glsl
8
9
  const heatmapVertexShaderSource = exports.heatmapVertexShaderSource = /* glsl */`
9
10
  precision mediump float;
@@ -12,28 +13,27 @@ const heatmapVertexShaderSource = exports.heatmapVertexShaderSource = /* glsl */
12
13
  attribute vec2 a_center;
13
14
  attribute vec4 a_color;
14
15
  attribute float a_saturation;
15
-
16
+
16
17
  varying vec4 v_color;
17
18
  varying vec2 v_pos;
18
-
19
+
19
20
  uniform vec2 u_dimensions;
20
21
  uniform vec2 u_resolution;
21
-
22
22
  // https://tsev.dev/posts/2020-06-19-colour-correction-with-webgl/
23
23
  vec3 adjust_saturation(vec3 color, float value) {
24
24
  // https://www.w3.org/TR/WCAG22/#dfn-relative-luminance
25
25
  const vec3 luminosityFactor = vec3(0.2126, 0.7152, 0.0722);
26
26
  vec3 grayscale = vec3(dot(color, luminosityFactor));
27
-
27
+
28
28
  return mix(grayscale, color, 1.0 + value);
29
29
  }
30
-
30
+
31
31
  void main() {
32
32
  // Convert from pixels to clip space (-1 to 1)
33
33
  vec2 position = a_center + a_position * u_dimensions / 2.0;
34
34
  vec2 clipSpace = (position / u_resolution) * 2.0 - 1.0;
35
35
  gl_Position = vec4(clipSpace * vec2(1, -1), 0, 1);
36
-
36
+
37
37
  v_color = vec4(adjust_saturation(a_color.rgb, a_saturation), 1.0);
38
38
  v_pos = a_position * u_dimensions / 2.0;
39
39
  }
@@ -42,9 +42,9 @@ const heatmapVertexShaderSource = exports.heatmapVertexShaderSource = /* glsl */
42
42
  // language=Glsl
43
43
  const heatmapFragmentShaderSourceNoBorderRadius = exports.heatmapFragmentShaderSourceNoBorderRadius = /* glsl */`
44
44
  precision mediump float;
45
-
45
+
46
46
  varying vec4 v_color;
47
-
47
+
48
48
  void main() {
49
49
  gl_FragColor = v_color;
50
50
  }
@@ -60,18 +60,15 @@ const heatmapFragmentShaderSourceWithBorderRadius = exports.heatmapFragmentShade
60
60
  uniform vec2 u_dimensions;
61
61
  uniform float u_borderRadius;
62
62
 
63
- float roundedBoxSDF(vec2 pos, vec2 half_size, float radius) {
64
- vec2 q = abs(pos) - half_size + radius;
65
- return min(max(q.x, q.y), 0.0) + length(max(q, 0.0)) - radius;
66
- }
63
+ ${_glsl.ROUNDED_BOX_SDF_GLSL}
67
64
 
68
65
  void main() {
69
66
  // Calculate distance from rounded rectangle edge
70
- float dist = roundedBoxSDF(v_pos, u_dimensions / 2.0, u_borderRadius);
71
-
67
+ float dist = roundedBoxSDF(v_pos, u_dimensions / 2.0, vec4(u_borderRadius));
68
+
72
69
  // Create smooth alpha based on distance
73
70
  float alpha = 1.0 - smoothstep(-0.5, 0.5, dist);
74
-
71
+
75
72
  gl_FragColor = vec4(v_color.rgb, v_color.a * alpha);
76
73
  }
77
74
  `;
@@ -1,3 +1,5 @@
1
+ import { ROUNDED_BOX_SDF_GLSL } from "../../utils/webgl/glsl.mjs";
2
+
1
3
  // language=Glsl
2
4
  export const heatmapVertexShaderSource = /* glsl */`
3
5
  precision mediump float;
@@ -6,28 +8,27 @@ export const heatmapVertexShaderSource = /* glsl */`
6
8
  attribute vec2 a_center;
7
9
  attribute vec4 a_color;
8
10
  attribute float a_saturation;
9
-
11
+
10
12
  varying vec4 v_color;
11
13
  varying vec2 v_pos;
12
-
14
+
13
15
  uniform vec2 u_dimensions;
14
16
  uniform vec2 u_resolution;
15
-
16
17
  // https://tsev.dev/posts/2020-06-19-colour-correction-with-webgl/
17
18
  vec3 adjust_saturation(vec3 color, float value) {
18
19
  // https://www.w3.org/TR/WCAG22/#dfn-relative-luminance
19
20
  const vec3 luminosityFactor = vec3(0.2126, 0.7152, 0.0722);
20
21
  vec3 grayscale = vec3(dot(color, luminosityFactor));
21
-
22
+
22
23
  return mix(grayscale, color, 1.0 + value);
23
24
  }
24
-
25
+
25
26
  void main() {
26
27
  // Convert from pixels to clip space (-1 to 1)
27
28
  vec2 position = a_center + a_position * u_dimensions / 2.0;
28
29
  vec2 clipSpace = (position / u_resolution) * 2.0 - 1.0;
29
30
  gl_Position = vec4(clipSpace * vec2(1, -1), 0, 1);
30
-
31
+
31
32
  v_color = vec4(adjust_saturation(a_color.rgb, a_saturation), 1.0);
32
33
  v_pos = a_position * u_dimensions / 2.0;
33
34
  }
@@ -36,9 +37,9 @@ export const heatmapVertexShaderSource = /* glsl */`
36
37
  // language=Glsl
37
38
  export const heatmapFragmentShaderSourceNoBorderRadius = /* glsl */`
38
39
  precision mediump float;
39
-
40
+
40
41
  varying vec4 v_color;
41
-
42
+
42
43
  void main() {
43
44
  gl_FragColor = v_color;
44
45
  }
@@ -54,18 +55,15 @@ export const heatmapFragmentShaderSourceWithBorderRadius = /* glsl */`
54
55
  uniform vec2 u_dimensions;
55
56
  uniform float u_borderRadius;
56
57
 
57
- float roundedBoxSDF(vec2 pos, vec2 half_size, float radius) {
58
- vec2 q = abs(pos) - half_size + radius;
59
- return min(max(q.x, q.y), 0.0) + length(max(q, 0.0)) - radius;
60
- }
58
+ ${ROUNDED_BOX_SDF_GLSL}
61
59
 
62
60
  void main() {
63
61
  // Calculate distance from rounded rectangle edge
64
- float dist = roundedBoxSDF(v_pos, u_dimensions / 2.0, u_borderRadius);
65
-
62
+ float dist = roundedBoxSDF(v_pos, u_dimensions / 2.0, vec4(u_borderRadius));
63
+
66
64
  // Create smooth alpha based on distance
67
65
  float alpha = 1.0 - smoothstep(-0.5, 0.5, dist);
68
-
66
+
69
67
  gl_FragColor = vec4(v_color.rgb, v_color.a * alpha);
70
68
  }
71
69
  `;
@@ -1,6 +1,6 @@
1
- import { type ScaleBand } from '@mui/x-charts-vendor/d3-scale';
2
- import { type DefaultizedHeatmapSeriesType } from '@mui/x-charts-pro/models';
3
- import { type ChartDrawingArea } from '@mui/x-charts/hooks';
1
+ import type { ScaleBand } from '@mui/x-charts-vendor/d3-scale';
2
+ import type { DefaultizedHeatmapSeriesType } from '@mui/x-charts-pro/models';
3
+ import type { ChartDrawingArea } from '@mui/x-charts/hooks';
4
4
  export declare function useHeatmapPlotData(drawingArea: ChartDrawingArea, series: DefaultizedHeatmapSeriesType, xScale: ScaleBand<{
5
5
  toString(): string;
6
6
  }>, yScale: ScaleBand<{
@@ -1,6 +1,6 @@
1
- import { type ScaleBand } from '@mui/x-charts-vendor/d3-scale';
2
- import { type DefaultizedHeatmapSeriesType } from '@mui/x-charts-pro/models';
3
- import { type ChartDrawingArea } from '@mui/x-charts/hooks';
1
+ import type { ScaleBand } from '@mui/x-charts-vendor/d3-scale';
2
+ import type { DefaultizedHeatmapSeriesType } from '@mui/x-charts-pro/models';
3
+ import type { ChartDrawingArea } from '@mui/x-charts/hooks';
4
4
  export declare function useHeatmapPlotData(drawingArea: ChartDrawingArea, series: DefaultizedHeatmapSeriesType, xScale: ScaleBand<{
5
5
  toString(): string;
6
6
  }>, yScale: ScaleBand<{
@@ -10,15 +10,10 @@ var React = _interopRequireWildcard(require("react"));
10
10
  var _hooks = require("@mui/x-charts/hooks");
11
11
  var _internals = require("@mui/x-charts/internals");
12
12
  var _parseColor = require("../../utils/webgl/parseColor");
13
+ var _utils = require("../../utils/webgl/utils");
13
14
  /* Far enough off-canvas that the rect is never visible; used for invalid x/y entries.
14
15
  * Avoids coupling the position pass to the color/saturation passes. */
15
16
  const OFFSCREEN = -1e9;
16
- function ensurePoolFloat32(pool, n) {
17
- if (pool && pool.length >= n) {
18
- return pool;
19
- }
20
- return new Float32Array(n);
21
- }
22
17
  function useHeatmapPlotData(drawingArea, series, xScale, yScale) {
23
18
  const width = xScale.bandwidth();
24
19
  const height = yScale.bandwidth();
@@ -52,7 +47,7 @@ function useHeatmapPlotData(drawingArea, series, xScale, yScale) {
52
47
  const saturationsPoolRef = React.useRef(null);
53
48
  const saturations = React.useMemo(() => {
54
49
  const n = series.data.length;
55
- const pool = ensurePoolFloat32(saturationsPoolRef.current ?? undefined, n);
50
+ const pool = (0, _utils.ensurePool)(saturationsPoolRef.current, n, Float32Array);
56
51
  saturationsPoolRef.current = pool;
57
52
  for (let dataIndex = 0; dataIndex < n; dataIndex += 1) {
58
53
  const item = series.data[dataIndex];
@@ -79,7 +74,7 @@ function useHeatmapPlotData(drawingArea, series, xScale, yScale) {
79
74
  const centersPoolRef = React.useRef(null);
80
75
  const centers = React.useMemo(() => {
81
76
  const n = series.data.length;
82
- const pool = ensurePoolFloat32(centersPoolRef.current ?? undefined, n * 2);
77
+ const pool = (0, _utils.ensurePool)(centersPoolRef.current, n * 2, Float32Array);
83
78
  centersPoolRef.current = pool;
84
79
  const left = drawingArea.left;
85
80
  const top = drawingArea.top;
@@ -4,16 +4,11 @@ import * as React from 'react';
4
4
  import { useZColorScale } from '@mui/x-charts/hooks';
5
5
  import { selectorChartsHighlightStateCallback, useStore } from '@mui/x-charts/internals';
6
6
  import { parseColor } from "../../utils/webgl/parseColor.mjs";
7
+ import { ensurePool } from "../../utils/webgl/utils.mjs";
7
8
 
8
9
  /* Far enough off-canvas that the rect is never visible; used for invalid x/y entries.
9
10
  * Avoids coupling the position pass to the color/saturation passes. */
10
11
  const OFFSCREEN = -1e9;
11
- function ensurePoolFloat32(pool, n) {
12
- if (pool && pool.length >= n) {
13
- return pool;
14
- }
15
- return new Float32Array(n);
16
- }
17
12
  export function useHeatmapPlotData(drawingArea, series, xScale, yScale) {
18
13
  const width = xScale.bandwidth();
19
14
  const height = yScale.bandwidth();
@@ -47,7 +42,7 @@ export function useHeatmapPlotData(drawingArea, series, xScale, yScale) {
47
42
  const saturationsPoolRef = React.useRef(null);
48
43
  const saturations = React.useMemo(() => {
49
44
  const n = series.data.length;
50
- const pool = ensurePoolFloat32(saturationsPoolRef.current ?? undefined, n);
45
+ const pool = ensurePool(saturationsPoolRef.current, n, Float32Array);
51
46
  saturationsPoolRef.current = pool;
52
47
  for (let dataIndex = 0; dataIndex < n; dataIndex += 1) {
53
48
  const item = series.data[dataIndex];
@@ -74,7 +69,7 @@ export function useHeatmapPlotData(drawingArea, series, xScale, yScale) {
74
69
  const centersPoolRef = React.useRef(null);
75
70
  const centers = React.useMemo(() => {
76
71
  const n = series.data.length;
77
- const pool = ensurePoolFloat32(centersPoolRef.current ?? undefined, n * 2);
72
+ const pool = ensurePool(centersPoolRef.current, n * 2, Float32Array);
78
73
  centersPoolRef.current = pool;
79
74
  const left = drawingArea.left;
80
75
  const top = drawingArea.top;
@@ -42,7 +42,11 @@ function FocusedMapShape() {
42
42
  if (!seriesItem || seriesItem.hidden) {
43
43
  return null;
44
44
  }
45
- const dataItem = seriesItem.data[focusedItem.dataIndex];
45
+ const dataIndex = seriesItem.lookupByName.get(focusedItem.name);
46
+ if (dataIndex === undefined) {
47
+ return null;
48
+ }
49
+ const dataItem = seriesItem.data[dataIndex];
46
50
  if (!dataItem || dataItem.hidden) {
47
51
  return null;
48
52
  }
@@ -36,7 +36,11 @@ export function FocusedMapShape() {
36
36
  if (!seriesItem || seriesItem.hidden) {
37
37
  return null;
38
38
  }
39
- const dataItem = seriesItem.data[focusedItem.dataIndex];
39
+ const dataIndex = seriesItem.lookupByName.get(focusedItem.name);
40
+ if (dataIndex === undefined) {
41
+ return null;
42
+ }
43
+ const dataItem = seriesItem.data[dataIndex];
40
44
  if (!dataItem || dataItem.hidden) {
41
45
  return null;
42
46
  }
@@ -0,0 +1,39 @@
1
+ import * as React from 'react';
2
+ export interface MapImagePlotProps extends React.SVGProps<SVGImageElement> {
3
+ /**
4
+ * URL of the image to render as the base map.
5
+ * Must be same-origin (or CORS-enabled) so it can be reprojected on a canvas.
6
+ */
7
+ href?: string;
8
+ /**
9
+ * Geographic extent the source image covers, as `[[west, south], [east, north]]`.
10
+ * The image is assumed to be in the equirectangular (plate carrée) projection.
11
+ * If `west` is greater than `east`, the range wraps across the antimeridian.
12
+ * @default [[-180, -90], [180, 90]]
13
+ */
14
+ imageBounds?: [[number, number], [number, number]];
15
+ /**
16
+ * Called after each reprojection.
17
+ * @param {string | null} dataUrl The reprojected raster as a data URL, or `null` when it could not be produced.
18
+ */
19
+ onReady?: (dataUrl: string | null) => void;
20
+ }
21
+ /**
22
+ * Renders a raster base map (for example a satellite mosaic) under the series,
23
+ * reprojected to match the chart's `projection` so it follows the geography
24
+ * instead of being a flat rectangle. Pixels outside the projection's visible
25
+ * footprint are left transparent.
26
+ *
27
+ * The source image is loaded only when `href` changes; changing the projection or
28
+ * resizing reuses the decoded image and only re-runs the (synchronous) canvas
29
+ * reprojection.
30
+ *
31
+ * The source image is assumed to be equirectangular; use `imageBounds` when it
32
+ * does not cover the whole globe. Any other SVG image attribute is forwarded to
33
+ * the underlying element.
34
+ */
35
+ declare function MapImagePlot(props: MapImagePlotProps): import("react/jsx-runtime").JSX.Element | null;
36
+ declare namespace MapImagePlot {
37
+ var propTypes: any;
38
+ }
39
+ export { MapImagePlot };
@@ -0,0 +1,39 @@
1
+ import * as React from 'react';
2
+ export interface MapImagePlotProps extends React.SVGProps<SVGImageElement> {
3
+ /**
4
+ * URL of the image to render as the base map.
5
+ * Must be same-origin (or CORS-enabled) so it can be reprojected on a canvas.
6
+ */
7
+ href?: string;
8
+ /**
9
+ * Geographic extent the source image covers, as `[[west, south], [east, north]]`.
10
+ * The image is assumed to be in the equirectangular (plate carrée) projection.
11
+ * If `west` is greater than `east`, the range wraps across the antimeridian.
12
+ * @default [[-180, -90], [180, 90]]
13
+ */
14
+ imageBounds?: [[number, number], [number, number]];
15
+ /**
16
+ * Called after each reprojection.
17
+ * @param {string | null} dataUrl The reprojected raster as a data URL, or `null` when it could not be produced.
18
+ */
19
+ onReady?: (dataUrl: string | null) => void;
20
+ }
21
+ /**
22
+ * Renders a raster base map (for example a satellite mosaic) under the series,
23
+ * reprojected to match the chart's `projection` so it follows the geography
24
+ * instead of being a flat rectangle. Pixels outside the projection's visible
25
+ * footprint are left transparent.
26
+ *
27
+ * The source image is loaded only when `href` changes; changing the projection or
28
+ * resizing reuses the decoded image and only re-runs the (synchronous) canvas
29
+ * reprojection.
30
+ *
31
+ * The source image is assumed to be equirectangular; use `imageBounds` when it
32
+ * does not cover the whole globe. Any other SVG image attribute is forwarded to
33
+ * the underlying element.
34
+ */
35
+ declare function MapImagePlot(props: MapImagePlotProps): import("react/jsx-runtime").JSX.Element | null;
36
+ declare namespace MapImagePlot {
37
+ var propTypes: any;
38
+ }
39
+ export { MapImagePlot };