@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.
- package/BarChartPremium/BarChartPremium.d.mts +4 -4
- package/BarChartPremium/BarChartPremium.d.ts +4 -4
- package/BarChartPremium/BarChartPremium.plugins.d.mts +2 -2
- package/BarChartPremium/BarChartPremium.plugins.d.ts +2 -2
- package/BarChartPremium/BarPlotPremium.d.mts +1 -1
- package/BarChartPremium/BarPlotPremium.d.ts +1 -1
- package/BarChartPremium/RangeBar/AnimatedRangeBarElement.d.mts +1 -1
- package/BarChartPremium/RangeBar/AnimatedRangeBarElement.d.ts +1 -1
- package/BarChartPremium/RangeBar/RangeBarPlot.d.mts +2 -2
- package/BarChartPremium/RangeBar/RangeBarPlot.d.ts +2 -2
- package/BarChartPremium/RangeBar/createGetRangeBarDimensions.d.mts +1 -1
- package/BarChartPremium/RangeBar/createGetRangeBarDimensions.d.ts +1 -1
- package/BarChartPremium/RangeBar/seriesConfig/descriptionGetter.d.mts +1 -1
- package/BarChartPremium/RangeBar/seriesConfig/descriptionGetter.d.ts +1 -1
- package/BarChartPremium/RangeBar/seriesConfig/extrema.d.mts +1 -1
- package/BarChartPremium/RangeBar/seriesConfig/extrema.d.ts +1 -1
- package/BarChartPremium/RangeBar/seriesConfig/getColor.d.mts +1 -1
- package/BarChartPremium/RangeBar/seriesConfig/getColor.d.ts +1 -1
- package/BarChartPremium/RangeBar/seriesConfig/getSeriesWithDefaultValues.d.mts +1 -1
- package/BarChartPremium/RangeBar/seriesConfig/getSeriesWithDefaultValues.d.ts +1 -1
- package/BarChartPremium/RangeBar/seriesConfig/index.d.mts +1 -1
- package/BarChartPremium/RangeBar/seriesConfig/index.d.ts +1 -1
- package/BarChartPremium/RangeBar/seriesConfig/keyboardFocusHandler.d.mts +1 -1
- package/BarChartPremium/RangeBar/seriesConfig/keyboardFocusHandler.d.ts +1 -1
- package/BarChartPremium/RangeBar/seriesConfig/legend.d.mts +1 -1
- package/BarChartPremium/RangeBar/seriesConfig/legend.d.ts +1 -1
- package/BarChartPremium/RangeBar/seriesConfig/seriesProcessor.d.mts +1 -1
- package/BarChartPremium/RangeBar/seriesConfig/seriesProcessor.d.ts +1 -1
- package/BarChartPremium/RangeBar/seriesConfig/tooltip.d.mts +1 -1
- package/BarChartPremium/RangeBar/seriesConfig/tooltip.d.ts +1 -1
- package/BarChartPremium/RangeBar/seriesConfig/tooltipPosition.d.mts +1 -1
- package/BarChartPremium/RangeBar/seriesConfig/tooltipPosition.d.ts +1 -1
- package/BarChartPremium/RangeBar/useRangeBarPlotData.d.mts +4 -4
- package/BarChartPremium/RangeBar/useRangeBarPlotData.d.ts +4 -4
- package/BarChartPremium/useBarChartPremiumProps.d.mts +5 -5
- package/BarChartPremium/useBarChartPremiumProps.d.ts +5 -5
- package/BarChartPremium/webgl/BarWebGLProgram.d.mts +5 -6
- package/BarChartPremium/webgl/BarWebGLProgram.d.ts +5 -6
- package/BarChartPremium/webgl/BarWebGLProgram.js +24 -65
- package/BarChartPremium/webgl/BarWebGLProgram.mjs +24 -65
- package/BarChartPremium/webgl/shaders.d.mts +1 -1
- package/BarChartPremium/webgl/shaders.d.ts +1 -1
- package/BarChartPremium/webgl/shaders.js +2 -15
- package/BarChartPremium/webgl/shaders.mjs +3 -15
- package/BarChartPremium/webgl/useBarWebGLPlotData.d.mts +3 -3
- package/BarChartPremium/webgl/useBarWebGLPlotData.d.ts +3 -3
- package/BarChartPremium/webgl/useWebGLBarLikePlotData.d.mts +3 -3
- package/BarChartPremium/webgl/useWebGLBarLikePlotData.d.ts +3 -3
- package/CHANGELOG.md +241 -2
- package/CandlestickChart/CandlestickChart.d.mts +12 -12
- package/CandlestickChart/CandlestickChart.d.ts +12 -12
- package/CandlestickChart/CandlestickChart.plugins.d.mts +2 -2
- package/CandlestickChart/CandlestickChart.plugins.d.ts +2 -2
- package/CandlestickChart/CandlestickWebGLProgram.d.mts +1 -1
- package/CandlestickChart/CandlestickWebGLProgram.d.ts +1 -1
- package/CandlestickChart/checkCandlestickScaleErrors.d.mts +2 -2
- package/CandlestickChart/checkCandlestickScaleErrors.d.ts +2 -2
- package/CandlestickChart/seriesConfig/OHLCTooltipContent.d.mts +1 -1
- package/CandlestickChart/seriesConfig/OHLCTooltipContent.d.ts +1 -1
- package/CandlestickChart/seriesConfig/descriptionGetter.d.mts +1 -1
- package/CandlestickChart/seriesConfig/descriptionGetter.d.ts +1 -1
- package/CandlestickChart/seriesConfig/extrema.d.mts +1 -1
- package/CandlestickChart/seriesConfig/extrema.d.ts +1 -1
- package/CandlestickChart/seriesConfig/getColor.d.mts +1 -1
- package/CandlestickChart/seriesConfig/getColor.d.ts +1 -1
- package/CandlestickChart/seriesConfig/getSeriesWithDefaultValues.d.mts +1 -1
- package/CandlestickChart/seriesConfig/getSeriesWithDefaultValues.d.ts +1 -1
- package/CandlestickChart/seriesConfig/index.d.mts +1 -1
- package/CandlestickChart/seriesConfig/index.d.ts +1 -1
- package/CandlestickChart/seriesConfig/legend.d.mts +1 -1
- package/CandlestickChart/seriesConfig/legend.d.ts +1 -1
- package/CandlestickChart/seriesConfig/seriesProcessor.d.mts +1 -1
- package/CandlestickChart/seriesConfig/seriesProcessor.d.ts +1 -1
- package/CandlestickChart/seriesConfig/tooltip.d.mts +1 -1
- package/CandlestickChart/seriesConfig/tooltip.d.ts +1 -1
- package/CandlestickChart/seriesConfig/tooltipPosition.d.mts +1 -1
- package/CandlestickChart/seriesConfig/tooltipPosition.d.ts +1 -1
- package/CandlestickChart/useCandlestickChartProps.d.mts +9 -9
- package/CandlestickChart/useCandlestickChartProps.d.ts +9 -9
- package/CandlestickChart/useCandlestickChartProps.mjs +0 -1
- package/CandlestickChart/useCandlestickPlotData.d.mts +3 -3
- package/CandlestickChart/useCandlestickPlotData.d.ts +3 -3
- package/ChartsContainerPremium/ChartsContainerPremium.d.mts +4 -4
- package/ChartsContainerPremium/ChartsContainerPremium.d.ts +4 -4
- package/ChartsContainerPremium/useChartsContainerPremiumProps.d.mts +2 -2
- package/ChartsContainerPremium/useChartsContainerPremiumProps.d.ts +2 -2
- package/ChartsDataProviderPremium/ChartsDataProviderPremium.d.mts +4 -4
- package/ChartsDataProviderPremium/ChartsDataProviderPremium.d.ts +4 -4
- package/ChartsDataProviderPremium/ChartsDataProviderPremium.js +2 -2
- package/ChartsDataProviderPremium/ChartsDataProviderPremium.mjs +3 -4
- package/ChartsDataProviderPremium/useChartsDataProviderPremiumProps.d.mts +1 -1
- package/ChartsDataProviderPremium/useChartsDataProviderPremiumProps.d.ts +1 -1
- package/ChartsGeoDataProviderPremium/ChartsGeoDataProviderPremium.d.mts +4 -4
- package/ChartsGeoDataProviderPremium/ChartsGeoDataProviderPremium.d.ts +4 -4
- package/ChartsGeoDataProviderPremium/ChartsGeoDataProviderPremium.js +2 -2
- package/ChartsGeoDataProviderPremium/ChartsGeoDataProviderPremium.mjs +2 -2
- package/ChartsGeoDataProviderPremium/ChartsGeoDataProviderPremium.plugins.d.mts +3 -3
- package/ChartsGeoDataProviderPremium/ChartsGeoDataProviderPremium.plugins.d.ts +3 -3
- package/ChartsGeoDataProviderPremium/useChartsGeoDataProviderPremiumProps.d.mts +2 -2
- package/ChartsGeoDataProviderPremium/useChartsGeoDataProviderPremiumProps.d.ts +2 -2
- package/ChartsRadialDataProviderPremium/ChartsRadialDataProviderPremium.d.mts +4 -4
- package/ChartsRadialDataProviderPremium/ChartsRadialDataProviderPremium.d.ts +4 -4
- package/ChartsRadialDataProviderPremium/ChartsRadialDataProviderPremium.js +2 -2
- package/ChartsRadialDataProviderPremium/ChartsRadialDataProviderPremium.mjs +2 -2
- package/ChartsRadialDataProviderPremium/ChartsRadialDataProviderPremium.plugins.d.mts +3 -3
- package/ChartsRadialDataProviderPremium/ChartsRadialDataProviderPremium.plugins.d.ts +3 -3
- package/ChartsRadialDataProviderPremium/useChartsRadialDataProviderPremiumProps.d.mts +1 -1
- package/ChartsRadialDataProviderPremium/useChartsRadialDataProviderPremiumProps.d.ts +1 -1
- package/ChartsRenderer/colors.d.mts +1 -1
- package/ChartsRenderer/colors.d.ts +1 -1
- package/ChartsRenderer/configuration.d.mts +1 -1
- package/ChartsRenderer/configuration.d.ts +1 -1
- package/ChartsZoomSlider/internals/previews/CandlestickPreviewPlot.d.mts +1 -1
- package/ChartsZoomSlider/internals/previews/CandlestickPreviewPlot.d.ts +1 -1
- package/ChartsZoomSlider/internals/previews/RangeBarPreviewPlot.d.mts +1 -1
- package/ChartsZoomSlider/internals/previews/RangeBarPreviewPlot.d.ts +1 -1
- package/HeatmapPremium/HeatmapPlotPremium.d.mts +1 -1
- package/HeatmapPremium/HeatmapPlotPremium.d.ts +1 -1
- package/HeatmapPremium/HeatmapPremium.d.mts +1 -1
- package/HeatmapPremium/HeatmapPremium.d.ts +1 -1
- package/HeatmapPremium/HeatmapPremium.plugins.d.mts +2 -2
- package/HeatmapPremium/HeatmapPremium.plugins.d.ts +2 -2
- package/HeatmapPremium/useHeatmapPremiumProps.d.mts +2 -2
- package/HeatmapPremium/useHeatmapPremiumProps.d.ts +2 -2
- package/HeatmapPremium/webgl/HeatmapWebGLProgram.js +12 -37
- package/HeatmapPremium/webgl/HeatmapWebGLProgram.mjs +12 -37
- package/HeatmapPremium/webgl/shaders.d.mts +3 -3
- package/HeatmapPremium/webgl/shaders.d.ts +3 -3
- package/HeatmapPremium/webgl/shaders.js +12 -15
- package/HeatmapPremium/webgl/shaders.mjs +13 -15
- package/HeatmapPremium/webgl/useHeatmapPlotData.d.mts +3 -3
- package/HeatmapPremium/webgl/useHeatmapPlotData.d.ts +3 -3
- package/HeatmapPremium/webgl/useHeatmapPlotData.js +3 -8
- package/HeatmapPremium/webgl/useHeatmapPlotData.mjs +3 -8
- package/Map/FocusedMapShape.js +5 -1
- package/Map/FocusedMapShape.mjs +5 -1
- package/Map/MapImagePlot.d.mts +39 -0
- package/Map/MapImagePlot.d.ts +39 -0
- package/Map/MapImagePlot.js +138 -0
- package/Map/MapImagePlot.mjs +132 -0
- package/Map/MapShape.d.mts +2 -2
- package/Map/MapShape.d.ts +2 -2
- package/Map/MapShape.js +6 -6
- package/Map/MapShape.mjs +6 -6
- package/Map/MapShapePlot.d.mts +8 -0
- package/Map/MapShapePlot.d.ts +8 -0
- package/Map/MapShapePlot.js +17 -5
- package/Map/MapShapePlot.mjs +17 -5
- package/Map/index.d.mts +2 -1
- package/Map/index.d.ts +2 -1
- package/Map/index.js +11 -0
- package/Map/index.mjs +1 -0
- package/Map/reprojectEquirectangularImage.d.mts +60 -0
- package/Map/reprojectEquirectangularImage.d.ts +60 -0
- package/Map/reprojectEquirectangularImage.js +116 -0
- package/Map/reprojectEquirectangularImage.mjs +110 -0
- package/Map/seriesConfig/descriptionGetter.d.mts +1 -1
- package/Map/seriesConfig/descriptionGetter.d.ts +1 -1
- package/Map/seriesConfig/descriptionGetter.js +5 -1
- package/Map/seriesConfig/descriptionGetter.mjs +5 -1
- package/Map/seriesConfig/getColor.js +18 -6
- package/Map/seriesConfig/getColor.mjs +18 -6
- package/Map/seriesConfig/highlight.d.mts +10 -0
- package/Map/seriesConfig/highlight.d.ts +10 -0
- package/Map/seriesConfig/highlight.js +52 -0
- package/Map/seriesConfig/highlight.mjs +45 -0
- package/Map/seriesConfig/identifierCleaner.d.mts +3 -0
- package/Map/seriesConfig/identifierCleaner.d.ts +3 -0
- package/Map/seriesConfig/identifierCleaner.js +14 -0
- package/Map/seriesConfig/identifierCleaner.mjs +8 -0
- package/Map/seriesConfig/identifierSerializer.d.mts +3 -0
- package/Map/seriesConfig/identifierSerializer.d.ts +3 -0
- package/Map/seriesConfig/identifierSerializer.js +12 -0
- package/Map/seriesConfig/identifierSerializer.mjs +6 -0
- package/Map/seriesConfig/index.d.mts +1 -1
- package/Map/seriesConfig/index.d.ts +1 -1
- package/Map/seriesConfig/index.js +8 -6
- package/Map/seriesConfig/index.mjs +7 -5
- package/Map/seriesConfig/keyboardFocusHandler.d.mts +1 -7
- package/Map/seriesConfig/keyboardFocusHandler.d.ts +1 -7
- package/Map/seriesConfig/keyboardFocusHandler.js +40 -7
- package/Map/seriesConfig/keyboardFocusHandler.mjs +41 -8
- package/Map/seriesConfig/legend.d.mts +1 -1
- package/Map/seriesConfig/legend.d.ts +1 -1
- package/Map/seriesConfig/seriesProcessor.d.mts +1 -1
- package/Map/seriesConfig/seriesProcessor.d.ts +1 -1
- package/Map/seriesConfig/seriesProcessor.js +11 -2
- package/Map/seriesConfig/seriesProcessor.mjs +11 -2
- package/Map/seriesConfig/tooltip.d.mts +1 -1
- package/Map/seriesConfig/tooltip.d.ts +1 -1
- package/Map/seriesConfig/tooltip.js +8 -4
- package/Map/seriesConfig/tooltip.mjs +8 -4
- package/Map/seriesConfig/tooltipPosition.d.mts +8 -3
- package/Map/seriesConfig/tooltipPosition.d.ts +8 -3
- package/Map/seriesConfig/tooltipPosition.js +21 -27
- package/Map/seriesConfig/tooltipPosition.mjs +22 -27
- package/RadialBarChart/RadialBarChart.d.mts +10 -10
- package/RadialBarChart/RadialBarChart.d.ts +10 -10
- package/RadialBarChart/RadialBarChart.plugins.d.mts +2 -2
- package/RadialBarChart/RadialBarChart.plugins.d.ts +2 -2
- package/RadialBarChart/RadialBarElement.d.mts +2 -2
- package/RadialBarChart/RadialBarElement.d.ts +2 -2
- package/RadialBarChart/seriesConfig/descriptionGetter.d.mts +1 -1
- package/RadialBarChart/seriesConfig/descriptionGetter.d.ts +1 -1
- package/RadialBarChart/seriesConfig/extremums.d.mts +1 -1
- package/RadialBarChart/seriesConfig/extremums.d.ts +1 -1
- package/RadialBarChart/seriesConfig/getColor.d.mts +1 -1
- package/RadialBarChart/seriesConfig/getColor.d.ts +1 -1
- package/RadialBarChart/seriesConfig/getItemAtPosition.d.mts +1 -1
- package/RadialBarChart/seriesConfig/getItemAtPosition.d.ts +1 -1
- package/RadialBarChart/seriesConfig/index.d.mts +1 -1
- package/RadialBarChart/seriesConfig/index.d.ts +1 -1
- package/RadialBarChart/seriesConfig/keyboardFocusHandler.d.mts +1 -1
- package/RadialBarChart/seriesConfig/keyboardFocusHandler.d.ts +1 -1
- package/RadialBarChart/seriesConfig/tooltip.d.mts +1 -1
- package/RadialBarChart/seriesConfig/tooltip.d.ts +1 -1
- package/RadialBarChart/useRadialBarChartProps.d.mts +6 -6
- package/RadialBarChart/useRadialBarChartProps.d.ts +6 -6
- package/RadialBarChart/useRadialBarPlotData.d.mts +1 -1
- package/RadialBarChart/useRadialBarPlotData.d.ts +1 -1
- package/RadialBarChart/useRadialBarPlotData.js +4 -1
- package/RadialBarChart/useRadialBarPlotData.mjs +3 -1
- package/RadialLineChart/RadialArea.d.mts +1 -1
- package/RadialLineChart/RadialArea.d.ts +1 -1
- package/RadialLineChart/RadialAreaPlot.d.mts +1 -1
- package/RadialLineChart/RadialAreaPlot.d.ts +1 -1
- package/RadialLineChart/RadialLine.d.mts +2 -2
- package/RadialLineChart/RadialLine.d.ts +2 -2
- package/RadialLineChart/RadialLineChart.d.mts +10 -10
- package/RadialLineChart/RadialLineChart.d.ts +10 -10
- package/RadialLineChart/RadialLineChart.plugins.d.mts +2 -2
- package/RadialLineChart/RadialLineChart.plugins.d.ts +2 -2
- package/RadialLineChart/RadialLineHighlightElement.d.mts +1 -1
- package/RadialLineChart/RadialLineHighlightElement.d.ts +1 -1
- package/RadialLineChart/RadialLineHighlightPlot.d.mts +2 -2
- package/RadialLineChart/RadialLineHighlightPlot.d.ts +2 -2
- package/RadialLineChart/RadialLinePlot.d.mts +1 -1
- package/RadialLineChart/RadialLinePlot.d.ts +1 -1
- package/RadialLineChart/RadialMarkPlot.d.mts +1 -1
- package/RadialLineChart/RadialMarkPlot.d.ts +1 -1
- package/RadialLineChart/seriesConfig/descriptionGetter.d.mts +1 -1
- package/RadialLineChart/seriesConfig/descriptionGetter.d.ts +1 -1
- package/RadialLineChart/seriesConfig/extremums.d.mts +1 -1
- package/RadialLineChart/seriesConfig/extremums.d.ts +1 -1
- package/RadialLineChart/seriesConfig/getColor.d.mts +1 -1
- package/RadialLineChart/seriesConfig/getColor.d.ts +1 -1
- package/RadialLineChart/seriesConfig/getItemAtPosition.d.mts +1 -1
- package/RadialLineChart/seriesConfig/getItemAtPosition.d.ts +1 -1
- package/RadialLineChart/seriesConfig/getItemAtPosition.mjs +1 -2
- package/RadialLineChart/seriesConfig/index.d.mts +1 -1
- package/RadialLineChart/seriesConfig/index.d.ts +1 -1
- package/RadialLineChart/seriesConfig/keyboardFocusHandler.d.mts +1 -1
- package/RadialLineChart/seriesConfig/keyboardFocusHandler.d.ts +1 -1
- package/RadialLineChart/seriesConfig/legend.d.mts +1 -1
- package/RadialLineChart/seriesConfig/legend.d.ts +1 -1
- package/RadialLineChart/seriesConfig/seriesProcessor.d.mts +1 -1
- package/RadialLineChart/seriesConfig/seriesProcessor.d.ts +1 -1
- package/RadialLineChart/seriesConfig/tooltip.d.mts +1 -1
- package/RadialLineChart/seriesConfig/tooltip.d.ts +1 -1
- package/RadialLineChart/useRadialLineChartProps.d.mts +7 -7
- package/RadialLineChart/useRadialLineChartProps.d.ts +7 -7
- package/RadialLineChart/useRadialLinePlotData.d.mts +1 -1
- package/RadialLineChart/useRadialLinePlotData.d.ts +1 -1
- package/ScatterChartPremium/ScatterChartPremium.d.mts +6 -6
- package/ScatterChartPremium/ScatterChartPremium.d.ts +6 -6
- package/ScatterChartPremium/ScatterChartPremium.plugins.d.mts +1 -1
- package/ScatterChartPremium/ScatterChartPremium.plugins.d.ts +1 -1
- package/ScatterChartPremium/ScatterPlotPremium.d.mts +1 -1
- package/ScatterChartPremium/ScatterPlotPremium.d.ts +1 -1
- package/ScatterChartPremium/webgl/ScatterWebGLProgram.d.mts +1 -3
- package/ScatterChartPremium/webgl/ScatterWebGLProgram.d.ts +1 -3
- package/ScatterChartPremium/webgl/ScatterWebGLProgram.js +23 -81
- package/ScatterChartPremium/webgl/ScatterWebGLProgram.mjs +23 -81
- package/context/useChartPremiumApiContext.d.mts +1 -1
- package/context/useChartPremiumApiContext.d.ts +1 -1
- package/hooks/animation/useAnimateRangeBar.d.mts +1 -1
- package/hooks/animation/useAnimateRangeBar.d.ts +1 -1
- package/hooks/useChartPremiumApiRef.d.mts +4 -4
- package/hooks/useChartPremiumApiRef.d.ts +4 -4
- package/hooks/useGeoData.d.mts +1 -1
- package/hooks/useGeoData.d.ts +1 -1
- package/hooks/useGeoData.mjs +0 -1
- package/hooks/useGeoFeatureIndexesByName.mjs +0 -1
- package/hooks/useGeoPath.d.mts +1 -1
- package/hooks/useGeoPath.d.ts +1 -1
- package/hooks/useGeoPath.mjs +0 -1
- package/hooks/useMapShapeSeries.d.mts +2 -2
- package/hooks/useMapShapeSeries.d.ts +2 -2
- package/hooks/useOHLCSeries.d.mts +2 -2
- package/hooks/useOHLCSeries.d.ts +2 -2
- package/hooks/useRadialLineSeries.d.mts +2 -2
- package/hooks/useRadialLineSeries.d.ts +2 -2
- package/hooks/useRangeBarSeries.d.mts +2 -2
- package/hooks/useRangeBarSeries.d.ts +2 -2
- package/index.js +1 -1
- package/index.mjs +1 -1
- package/internals/createGetVisibleCoordinate.d.mts +14 -0
- package/internals/createGetVisibleCoordinate.d.ts +14 -0
- package/internals/createGetVisibleCoordinate.js +66 -0
- package/internals/createGetVisibleCoordinate.mjs +60 -0
- package/internals/plugins/allPlugins.d.mts +2 -2
- package/internals/plugins/allPlugins.d.ts +2 -2
- package/internals/plugins/useGeoProjection/useGeoProjection.d.mts +1 -1
- package/internals/plugins/useGeoProjection/useGeoProjection.d.ts +1 -1
- package/internals/plugins/useGeoProjection/useGeoProjection.types.d.mts +1 -1
- package/internals/plugins/useGeoProjection/useGeoProjection.types.d.ts +1 -1
- package/models/seriesType/mapShape.d.mts +2 -1
- package/models/seriesType/mapShape.d.ts +2 -1
- package/models/seriesType/ohlc.d.mts +2 -2
- package/models/seriesType/ohlc.d.ts +2 -2
- package/models/seriesType/rangeBar.d.mts +2 -2
- package/models/seriesType/rangeBar.d.ts +2 -2
- package/moduleAugmentation/rangeBarOnClick.d.mts +1 -1
- package/moduleAugmentation/rangeBarOnClick.d.ts +1 -1
- package/package.json +6 -6
- package/plugins/selectors/useChartCandlestickPosition.selectors.d.mts +1 -1
- package/plugins/selectors/useChartCandlestickPosition.selectors.d.ts +1 -1
- package/utils/webgl/glsl.d.mts +15 -0
- package/utils/webgl/glsl.d.ts +15 -0
- package/utils/webgl/glsl.js +34 -0
- package/utils/webgl/glsl.mjs +28 -0
- package/utils/webgl/instancedAttribute.d.mts +28 -0
- package/utils/webgl/instancedAttribute.d.ts +28 -0
- package/utils/webgl/instancedAttribute.js +57 -0
- package/utils/webgl/instancedAttribute.mjs +50 -0
- package/utils/webgl/utils.d.mts +21 -2
- package/utils/webgl/utils.d.ts +21 -2
- package/utils/webgl/utils.js +44 -8
- package/utils/webgl/utils.mjs +41 -7
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
// A `GeoStream` sink that only records whether a point passed through (and where),
|
|
2
|
+
// so a projection/clip pipeline can be probed one point at a time.
|
|
3
|
+
|
|
4
|
+
function createPointSink() {
|
|
5
|
+
const sink = {
|
|
6
|
+
hit: false,
|
|
7
|
+
x: 0,
|
|
8
|
+
y: 0,
|
|
9
|
+
point(x, y) {
|
|
10
|
+
sink.hit = true;
|
|
11
|
+
sink.x = x;
|
|
12
|
+
sink.y = y;
|
|
13
|
+
},
|
|
14
|
+
lineStart() {},
|
|
15
|
+
lineEnd() {},
|
|
16
|
+
polygonStart() {},
|
|
17
|
+
polygonEnd() {}
|
|
18
|
+
};
|
|
19
|
+
return sink;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Builds a test that maps a device pixel to its `[lon, lat]`, or `null` when the
|
|
24
|
+
* pixel is not part of the visible map. It combines two clips that `projection.invert`
|
|
25
|
+
* alone misses:
|
|
26
|
+
*
|
|
27
|
+
* - the **post-clip** (cartesian) stream rejects device pixels outside the clip
|
|
28
|
+
* rectangle — relevant once the map is panned/zoomed with a `clipExtent`;
|
|
29
|
+
* - streaming the inverted coordinate **back** through the projection applies the
|
|
30
|
+
* pre-clip (spherical) boundary and checks the round trip: azimuthal projections
|
|
31
|
+
* clamp `invert` outside the visible disk to the limb, and those clamped points do
|
|
32
|
+
* not project back to the pixel they came from.
|
|
33
|
+
*/
|
|
34
|
+
export function createGetVisibleCoordinate(projection) {
|
|
35
|
+
const invert = projection.invert;
|
|
36
|
+
const forwardSink = createPointSink();
|
|
37
|
+
const forwardStream = projection.stream(forwardSink);
|
|
38
|
+
const postClip = projection.postclip?.();
|
|
39
|
+
const clipSink = createPointSink();
|
|
40
|
+
const clipStream = postClip?.(clipSink);
|
|
41
|
+
return ([deviceX, deviceY]) => {
|
|
42
|
+
if (clipStream) {
|
|
43
|
+
clipSink.hit = false;
|
|
44
|
+
clipStream.point(deviceX, deviceY);
|
|
45
|
+
if (!clipSink.hit) {
|
|
46
|
+
return null;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
const coordinates = invert([deviceX, deviceY]);
|
|
50
|
+
if (!coordinates) {
|
|
51
|
+
return null;
|
|
52
|
+
}
|
|
53
|
+
forwardSink.hit = false;
|
|
54
|
+
forwardStream.point(coordinates[0], coordinates[1]);
|
|
55
|
+
if (!forwardSink.hit || Math.abs(forwardSink.x - deviceX) > 0.5 || Math.abs(forwardSink.y - deviceY) > 0.5) {
|
|
56
|
+
return null;
|
|
57
|
+
}
|
|
58
|
+
return coordinates;
|
|
59
|
+
};
|
|
60
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import type { ChartSeriesType, ConvertSignaturesIntoPlugins, UseChartCartesianAxisSignature, UseChartTooltipSignature, UseChartInteractionSignature, UseChartZAxisSignature, UseChartHighlightSignature, UseChartPolarAxisSignature, UseChartBrushSignature, UseChartVisibilityManagerSignature, UseProgressiveRenderingSignature } from '@mui/x-charts/internals';
|
|
2
|
+
import type { UseChartProExportSignature, UseChartProZoomSignature } from '@mui/x-charts-pro/plugins';
|
|
3
3
|
export type AllPluginSignatures<SeriesType extends ChartSeriesType = ChartSeriesType> = [UseChartZAxisSignature, UseChartBrushSignature, UseChartTooltipSignature<SeriesType>, UseChartInteractionSignature, UseChartCartesianAxisSignature<SeriesType>, UseChartPolarAxisSignature<SeriesType>, UseChartHighlightSignature<SeriesType>, UseChartVisibilityManagerSignature<SeriesType>, UseChartProZoomSignature, UseChartProExportSignature, UseProgressiveRenderingSignature];
|
|
4
4
|
export type AllPluginsType<SeriesType extends ChartSeriesType = ChartSeriesType> = ConvertSignaturesIntoPlugins<AllPluginSignatures<SeriesType>>;
|
|
5
5
|
export declare const ALL_PLUGINS: (import("@mui/x-charts/internals").ChartPlugin<UseChartZAxisSignature> | import("@mui/x-charts/internals").ChartPlugin<UseChartBrushSignature> | import("@mui/x-charts/internals").ChartPlugin<UseChartInteractionSignature> | import("@mui/x-charts/internals").ChartPlugin<UseChartProZoomSignature> | import("@mui/x-charts/internals").ChartPlugin<UseChartProExportSignature> | import("@mui/x-charts/internals").ChartPlugin<UseProgressiveRenderingSignature> | import("@mui/x-charts/internals").ChartPlugin<UseChartTooltipSignature<any>> | import("@mui/x-charts/internals").ChartPlugin<UseChartCartesianAxisSignature<any>> | import("@mui/x-charts/internals").ChartPlugin<UseChartPolarAxisSignature<any>> | import("@mui/x-charts/internals").ChartPlugin<UseChartHighlightSignature<any>> | import("@mui/x-charts/internals").ChartPlugin<UseChartVisibilityManagerSignature<any>>)[];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import type { ChartSeriesType, ConvertSignaturesIntoPlugins, UseChartCartesianAxisSignature, UseChartTooltipSignature, UseChartInteractionSignature, UseChartZAxisSignature, UseChartHighlightSignature, UseChartPolarAxisSignature, UseChartBrushSignature, UseChartVisibilityManagerSignature, UseProgressiveRenderingSignature } from '@mui/x-charts/internals';
|
|
2
|
+
import type { UseChartProExportSignature, UseChartProZoomSignature } from '@mui/x-charts-pro/plugins';
|
|
3
3
|
export type AllPluginSignatures<SeriesType extends ChartSeriesType = ChartSeriesType> = [UseChartZAxisSignature, UseChartBrushSignature, UseChartTooltipSignature<SeriesType>, UseChartInteractionSignature, UseChartCartesianAxisSignature<SeriesType>, UseChartPolarAxisSignature<SeriesType>, UseChartHighlightSignature<SeriesType>, UseChartVisibilityManagerSignature<SeriesType>, UseChartProZoomSignature, UseChartProExportSignature, UseProgressiveRenderingSignature];
|
|
4
4
|
export type AllPluginsType<SeriesType extends ChartSeriesType = ChartSeriesType> = ConvertSignaturesIntoPlugins<AllPluginSignatures<SeriesType>>;
|
|
5
5
|
export declare const ALL_PLUGINS: (import("@mui/x-charts/internals").ChartPlugin<UseChartZAxisSignature> | import("@mui/x-charts/internals").ChartPlugin<UseChartBrushSignature> | import("@mui/x-charts/internals").ChartPlugin<UseChartInteractionSignature> | import("@mui/x-charts/internals").ChartPlugin<UseChartProZoomSignature> | import("@mui/x-charts/internals").ChartPlugin<UseChartProExportSignature> | import("@mui/x-charts/internals").ChartPlugin<UseProgressiveRenderingSignature> | import("@mui/x-charts/internals").ChartPlugin<UseChartTooltipSignature<any>> | import("@mui/x-charts/internals").ChartPlugin<UseChartCartesianAxisSignature<any>> | import("@mui/x-charts/internals").ChartPlugin<UseChartPolarAxisSignature<any>> | import("@mui/x-charts/internals").ChartPlugin<UseChartHighlightSignature<any>> | import("@mui/x-charts/internals").ChartPlugin<UseChartVisibilityManagerSignature<any>>)[];
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { ChartPlugin } from '@mui/x-charts/internals';
|
|
2
|
-
import {
|
|
2
|
+
import type { UseGeoProjectionSignature } from "./useGeoProjection.types.mjs";
|
|
3
3
|
export declare const useGeoProjection: ChartPlugin<UseGeoProjectionSignature>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { ChartPlugin } from '@mui/x-charts/internals';
|
|
2
|
-
import {
|
|
2
|
+
import type { UseGeoProjectionSignature } from "./useGeoProjection.types.js";
|
|
3
3
|
export declare const useGeoProjection: ChartPlugin<UseGeoProjectionSignature>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { useGeoProjectionTypes } from '@mui/x-charts/internals';
|
|
2
2
|
export type UseGeoProjectionSignature = useGeoProjectionTypes.UseGeoProjectionSignature;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { useGeoProjectionTypes } from '@mui/x-charts/internals';
|
|
2
2
|
export type UseGeoProjectionSignature = useGeoProjectionTypes.UseGeoProjectionSignature;
|
|
@@ -94,7 +94,7 @@ export interface MapShapeSeriesType extends Omit<CommonSeriesType<'mapShape'>, '
|
|
|
94
94
|
export type MapShapeItemIdentifier = {
|
|
95
95
|
type: 'mapShape';
|
|
96
96
|
seriesId: SeriesId;
|
|
97
|
-
|
|
97
|
+
name: string;
|
|
98
98
|
};
|
|
99
99
|
export type DefaultizedMapShapeValueType = MapShapeValueType & {
|
|
100
100
|
hidden: boolean;
|
|
@@ -102,4 +102,5 @@ export type DefaultizedMapShapeValueType = MapShapeValueType & {
|
|
|
102
102
|
export interface DefaultizedMapShapeSeriesType extends Omit<DefaultizedProps<MapShapeSeriesType, CommonDefaultizedProps | 'color'>, 'data'> {
|
|
103
103
|
hidden: boolean;
|
|
104
104
|
data: ReadonlyArray<DefaultizedMapShapeValueType>;
|
|
105
|
+
lookupByName: ReadonlyMap<string, number>;
|
|
105
106
|
}
|
|
@@ -94,7 +94,7 @@ export interface MapShapeSeriesType extends Omit<CommonSeriesType<'mapShape'>, '
|
|
|
94
94
|
export type MapShapeItemIdentifier = {
|
|
95
95
|
type: 'mapShape';
|
|
96
96
|
seriesId: SeriesId;
|
|
97
|
-
|
|
97
|
+
name: string;
|
|
98
98
|
};
|
|
99
99
|
export type DefaultizedMapShapeValueType = MapShapeValueType & {
|
|
100
100
|
hidden: boolean;
|
|
@@ -102,4 +102,5 @@ export type DefaultizedMapShapeValueType = MapShapeValueType & {
|
|
|
102
102
|
export interface DefaultizedMapShapeSeriesType extends Omit<DefaultizedProps<MapShapeSeriesType, CommonDefaultizedProps | 'color'>, 'data'> {
|
|
103
103
|
hidden: boolean;
|
|
104
104
|
data: ReadonlyArray<DefaultizedMapShapeValueType>;
|
|
105
|
+
lookupByName: ReadonlyMap<string, number>;
|
|
105
106
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ChartsColor } from '@mui/x-charts/colorPalettes';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import type { CommonSeriesType, CartesianSeriesType, SeriesId, CommonDefaultizedProps, DatasetElementType } from '@mui/x-charts/internals';
|
|
3
|
+
import type { DefaultizedProps } from '@mui/x-internals/types';
|
|
4
4
|
/**
|
|
5
5
|
* Type representing the values of a single OHLC element.
|
|
6
6
|
* The array contains four numbers in the following order:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ChartsColor } from '@mui/x-charts/colorPalettes';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import type { CommonSeriesType, CartesianSeriesType, SeriesId, CommonDefaultizedProps, DatasetElementType } from '@mui/x-charts/internals';
|
|
3
|
+
import type { DefaultizedProps } from '@mui/x-internals/types';
|
|
4
4
|
/**
|
|
5
5
|
* Type representing the values of a single OHLC element.
|
|
6
6
|
* The array contains four numbers in the following order:
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import type { CartesianSeriesType, CommonDefaultizedProps, CommonSeriesType, SeriesId, DatasetElementType } from '@mui/x-charts/internals';
|
|
2
|
+
import type { DefaultizedProps } from '@mui/x-internals/types';
|
|
3
3
|
/** [start, end] */
|
|
4
4
|
export type RangeBarValueType = [number, number];
|
|
5
5
|
export interface RangeBarSeriesType extends CommonSeriesType<'rangeBar'>, CartesianSeriesType {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import type { CartesianSeriesType, CommonDefaultizedProps, CommonSeriesType, SeriesId, DatasetElementType } from '@mui/x-charts/internals';
|
|
2
|
+
import type { DefaultizedProps } from '@mui/x-internals/types';
|
|
3
3
|
/** [start, end] */
|
|
4
4
|
export type RangeBarValueType = [number, number];
|
|
5
5
|
export interface RangeBarSeriesType extends CommonSeriesType<'rangeBar'>, CartesianSeriesType {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { RangeBarValueType } from "../models/index.mjs";
|
|
2
2
|
declare module '@mui/x-charts/models' {
|
|
3
3
|
interface ChartsTypeFeatureFlags {
|
|
4
4
|
seriesValuesOverride: RangeBarValueType | number | null | undefined;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { RangeBarValueType } from "../models/index.js";
|
|
2
2
|
declare module '@mui/x-charts/models' {
|
|
3
3
|
interface ChartsTypeFeatureFlags {
|
|
4
4
|
seriesValuesOverride: RangeBarValueType | number | null | undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mui/x-charts-premium",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.8.0",
|
|
4
4
|
"author": "MUI Team",
|
|
5
5
|
"description": "The Premium plan edition of the MUI X Charts components.",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE",
|
|
@@ -28,14 +28,14 @@
|
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"@babel/runtime": "^7.29.7",
|
|
31
|
-
"@mui/utils": "^9.
|
|
31
|
+
"@mui/utils": "^9.1.1",
|
|
32
32
|
"clsx": "^2.1.1",
|
|
33
33
|
"prop-types": "^15.8.1",
|
|
34
|
-
"@mui/x-charts": "^9.6.0",
|
|
35
|
-
"@mui/x-license": "^9.6.0",
|
|
36
|
-
"@mui/x-internals": "^9.6.0",
|
|
37
34
|
"@mui/x-charts-vendor": "^9.4.0",
|
|
38
|
-
"@mui/x-
|
|
35
|
+
"@mui/x-internals": "^9.8.0",
|
|
36
|
+
"@mui/x-license": "^9.8.0",
|
|
37
|
+
"@mui/x-charts": "^9.8.0",
|
|
38
|
+
"@mui/x-charts-pro": "^9.8.0"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
41
41
|
"@emotion/react": "^11.9.0",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { OHLCItemIdentifier } from "../../models/index.mjs";
|
|
2
2
|
export declare const selectorCandlestickItemAtPosition: (args_0: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeriesConfig/useChartSeriesConfig.types").UseChartSeriesConfigState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types").UseChartExperimentalFeaturesState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.types").UseChartAnimationState & import("@mui/x-charts/internals").UseChartInteractionListenerState & Partial<{}> & {
|
|
3
3
|
cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
|
|
4
4
|
}, svgPoint: Pick<DOMPoint, "y" | "x">) => OHLCItemIdentifier | undefined;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { OHLCItemIdentifier } from "../../models/index.js";
|
|
2
2
|
export declare const selectorCandlestickItemAtPosition: (args_0: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeriesConfig/useChartSeriesConfig.types").UseChartSeriesConfigState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types").UseChartExperimentalFeaturesState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.types").UseChartAnimationState & import("@mui/x-charts/internals").UseChartInteractionListenerState & Partial<{}> & {
|
|
3
3
|
cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
|
|
4
4
|
}, svgPoint: Pick<DOMPoint, "y" | "x">) => OHLCItemIdentifier | undefined;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GLSL snippet: signed distance field for a rounded box with per-corner radii.
|
|
3
|
+
*
|
|
4
|
+
* Convention:
|
|
5
|
+
* - `pos` and `halfSize` are in the same pixel-space coordinates.
|
|
6
|
+
* - `r` carries corner radii in CSS order: top-left, top-right, bottom-right, bottom-left.
|
|
7
|
+
* - For uniform-radius use cases pass `vec4(scalar)`.
|
|
8
|
+
*
|
|
9
|
+
* Screen-space conventions (after the y-flip in the vertex stage):
|
|
10
|
+
* pos.y < 0 -> top, pos.y > 0 -> bottom
|
|
11
|
+
* pos.x < 0 -> left, pos.x > 0 -> right
|
|
12
|
+
*
|
|
13
|
+
* Reference: Inigo Quilez, "Distance to a rounded box".
|
|
14
|
+
*/
|
|
15
|
+
export declare const ROUNDED_BOX_SDF_GLSL = "\n float roundedBoxSDF(vec2 pos, vec2 halfSize, vec4 r) {\n float radius;\n if (pos.x < 0.0) {\n radius = pos.y < 0.0 ? r.x : r.w;\n } else {\n radius = pos.y < 0.0 ? r.y : r.z;\n }\n\n vec2 q = abs(pos) - halfSize + radius;\n return min(max(q.x, q.y), 0.0) + length(max(q, 0.0)) - radius;\n }\n ";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GLSL snippet: signed distance field for a rounded box with per-corner radii.
|
|
3
|
+
*
|
|
4
|
+
* Convention:
|
|
5
|
+
* - `pos` and `halfSize` are in the same pixel-space coordinates.
|
|
6
|
+
* - `r` carries corner radii in CSS order: top-left, top-right, bottom-right, bottom-left.
|
|
7
|
+
* - For uniform-radius use cases pass `vec4(scalar)`.
|
|
8
|
+
*
|
|
9
|
+
* Screen-space conventions (after the y-flip in the vertex stage):
|
|
10
|
+
* pos.y < 0 -> top, pos.y > 0 -> bottom
|
|
11
|
+
* pos.x < 0 -> left, pos.x > 0 -> right
|
|
12
|
+
*
|
|
13
|
+
* Reference: Inigo Quilez, "Distance to a rounded box".
|
|
14
|
+
*/
|
|
15
|
+
export declare const ROUNDED_BOX_SDF_GLSL = "\n float roundedBoxSDF(vec2 pos, vec2 halfSize, vec4 r) {\n float radius;\n if (pos.x < 0.0) {\n radius = pos.y < 0.0 ? r.x : r.w;\n } else {\n radius = pos.y < 0.0 ? r.y : r.z;\n }\n\n vec2 q = abs(pos) - halfSize + radius;\n return min(max(q.x, q.y), 0.0) + length(max(q, 0.0)) - radius;\n }\n ";
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.ROUNDED_BOX_SDF_GLSL = void 0;
|
|
7
|
+
/**
|
|
8
|
+
* GLSL snippet: signed distance field for a rounded box with per-corner radii.
|
|
9
|
+
*
|
|
10
|
+
* Convention:
|
|
11
|
+
* - `pos` and `halfSize` are in the same pixel-space coordinates.
|
|
12
|
+
* - `r` carries corner radii in CSS order: top-left, top-right, bottom-right, bottom-left.
|
|
13
|
+
* - For uniform-radius use cases pass `vec4(scalar)`.
|
|
14
|
+
*
|
|
15
|
+
* Screen-space conventions (after the y-flip in the vertex stage):
|
|
16
|
+
* pos.y < 0 -> top, pos.y > 0 -> bottom
|
|
17
|
+
* pos.x < 0 -> left, pos.x > 0 -> right
|
|
18
|
+
*
|
|
19
|
+
* Reference: Inigo Quilez, "Distance to a rounded box".
|
|
20
|
+
*/
|
|
21
|
+
// language=Glsl
|
|
22
|
+
const ROUNDED_BOX_SDF_GLSL = exports.ROUNDED_BOX_SDF_GLSL = /* glsl */`
|
|
23
|
+
float roundedBoxSDF(vec2 pos, vec2 halfSize, vec4 r) {
|
|
24
|
+
float radius;
|
|
25
|
+
if (pos.x < 0.0) {
|
|
26
|
+
radius = pos.y < 0.0 ? r.x : r.w;
|
|
27
|
+
} else {
|
|
28
|
+
radius = pos.y < 0.0 ? r.y : r.z;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
vec2 q = abs(pos) - halfSize + radius;
|
|
32
|
+
return min(max(q.x, q.y), 0.0) + length(max(q, 0.0)) - radius;
|
|
33
|
+
}
|
|
34
|
+
`;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GLSL snippet: signed distance field for a rounded box with per-corner radii.
|
|
3
|
+
*
|
|
4
|
+
* Convention:
|
|
5
|
+
* - `pos` and `halfSize` are in the same pixel-space coordinates.
|
|
6
|
+
* - `r` carries corner radii in CSS order: top-left, top-right, bottom-right, bottom-left.
|
|
7
|
+
* - For uniform-radius use cases pass `vec4(scalar)`.
|
|
8
|
+
*
|
|
9
|
+
* Screen-space conventions (after the y-flip in the vertex stage):
|
|
10
|
+
* pos.y < 0 -> top, pos.y > 0 -> bottom
|
|
11
|
+
* pos.x < 0 -> left, pos.x > 0 -> right
|
|
12
|
+
*
|
|
13
|
+
* Reference: Inigo Quilez, "Distance to a rounded box".
|
|
14
|
+
*/
|
|
15
|
+
// language=Glsl
|
|
16
|
+
export const ROUNDED_BOX_SDF_GLSL = /* glsl */`
|
|
17
|
+
float roundedBoxSDF(vec2 pos, vec2 halfSize, vec4 r) {
|
|
18
|
+
float radius;
|
|
19
|
+
if (pos.x < 0.0) {
|
|
20
|
+
radius = pos.y < 0.0 ? r.x : r.w;
|
|
21
|
+
} else {
|
|
22
|
+
radius = pos.y < 0.0 ? r.y : r.z;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
vec2 q = abs(pos) - halfSize + radius;
|
|
26
|
+
return min(max(q.x, q.y), 0.0) + length(max(q, 0.0)) - radius;
|
|
27
|
+
}
|
|
28
|
+
`;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { GrowableBuffer } from "./utils.mjs";
|
|
2
|
+
export interface InstancedAttribute {
|
|
3
|
+
buffer: GrowableBuffer;
|
|
4
|
+
location: number;
|
|
5
|
+
size: number;
|
|
6
|
+
glType: GLenum;
|
|
7
|
+
normalized: boolean;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Creates a per-instance vertex attribute backed by a fresh grow-only GPU buffer.
|
|
11
|
+
*
|
|
12
|
+
* The caller MUST have the owning VAO bound when calling this — the
|
|
13
|
+
* vertexAttribPointer + vertexAttribDivisor calls register the binding into
|
|
14
|
+
* that VAO and the program then references it on each draw.
|
|
15
|
+
*/
|
|
16
|
+
export declare function createInstancedAttribute(gl: WebGL2RenderingContext, program: WebGLProgram, name: string, size: number, glType?: GLenum, normalized?: boolean): InstancedAttribute;
|
|
17
|
+
/**
|
|
18
|
+
* Wires up a per-instance vertex attribute that reads from an existing GrowableBuffer.
|
|
19
|
+
* Use this when the same buffer must back the same-named attribute in multiple
|
|
20
|
+
* VAOs (e.g. two shader-program variants over the same data).
|
|
21
|
+
*
|
|
22
|
+
* The caller MUST have the owning VAO bound when calling this.
|
|
23
|
+
*
|
|
24
|
+
* If the attribute is missing from the program (typo, or optimized out by the
|
|
25
|
+
* compiler), `getAttribLocation` returns -1. We skip the GL setup in that case to
|
|
26
|
+
* avoid `INVALID_VALUE` errors from `enableVertexAttribArray(-1)` and warn in dev.
|
|
27
|
+
*/
|
|
28
|
+
export declare function bindInstancedAttribute(gl: WebGL2RenderingContext, program: WebGLProgram, name: string, buffer: GrowableBuffer, size: number, glType?: GLenum, normalized?: boolean): InstancedAttribute;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { GrowableBuffer } from "./utils.js";
|
|
2
|
+
export interface InstancedAttribute {
|
|
3
|
+
buffer: GrowableBuffer;
|
|
4
|
+
location: number;
|
|
5
|
+
size: number;
|
|
6
|
+
glType: GLenum;
|
|
7
|
+
normalized: boolean;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Creates a per-instance vertex attribute backed by a fresh grow-only GPU buffer.
|
|
11
|
+
*
|
|
12
|
+
* The caller MUST have the owning VAO bound when calling this — the
|
|
13
|
+
* vertexAttribPointer + vertexAttribDivisor calls register the binding into
|
|
14
|
+
* that VAO and the program then references it on each draw.
|
|
15
|
+
*/
|
|
16
|
+
export declare function createInstancedAttribute(gl: WebGL2RenderingContext, program: WebGLProgram, name: string, size: number, glType?: GLenum, normalized?: boolean): InstancedAttribute;
|
|
17
|
+
/**
|
|
18
|
+
* Wires up a per-instance vertex attribute that reads from an existing GrowableBuffer.
|
|
19
|
+
* Use this when the same buffer must back the same-named attribute in multiple
|
|
20
|
+
* VAOs (e.g. two shader-program variants over the same data).
|
|
21
|
+
*
|
|
22
|
+
* The caller MUST have the owning VAO bound when calling this.
|
|
23
|
+
*
|
|
24
|
+
* If the attribute is missing from the program (typo, or optimized out by the
|
|
25
|
+
* compiler), `getAttribLocation` returns -1. We skip the GL setup in that case to
|
|
26
|
+
* avoid `INVALID_VALUE` errors from `enableVertexAttribArray(-1)` and warn in dev.
|
|
27
|
+
*/
|
|
28
|
+
export declare function bindInstancedAttribute(gl: WebGL2RenderingContext, program: WebGLProgram, name: string, buffer: GrowableBuffer, size: number, glType?: GLenum, normalized?: boolean): InstancedAttribute;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.bindInstancedAttribute = bindInstancedAttribute;
|
|
7
|
+
exports.createInstancedAttribute = createInstancedAttribute;
|
|
8
|
+
var _utils = require("./utils");
|
|
9
|
+
/**
|
|
10
|
+
* Creates a per-instance vertex attribute backed by a fresh grow-only GPU buffer.
|
|
11
|
+
*
|
|
12
|
+
* The caller MUST have the owning VAO bound when calling this — the
|
|
13
|
+
* vertexAttribPointer + vertexAttribDivisor calls register the binding into
|
|
14
|
+
* that VAO and the program then references it on each draw.
|
|
15
|
+
*/
|
|
16
|
+
function createInstancedAttribute(gl, program, name, size, glType = gl.FLOAT, normalized = false) {
|
|
17
|
+
const buffer = (0, _utils.createGrowableBuffer)(gl);
|
|
18
|
+
return bindInstancedAttribute(gl, program, name, buffer, size, glType, normalized);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Wires up a per-instance vertex attribute that reads from an existing GrowableBuffer.
|
|
23
|
+
* Use this when the same buffer must back the same-named attribute in multiple
|
|
24
|
+
* VAOs (e.g. two shader-program variants over the same data).
|
|
25
|
+
*
|
|
26
|
+
* The caller MUST have the owning VAO bound when calling this.
|
|
27
|
+
*
|
|
28
|
+
* If the attribute is missing from the program (typo, or optimized out by the
|
|
29
|
+
* compiler), `getAttribLocation` returns -1. We skip the GL setup in that case to
|
|
30
|
+
* avoid `INVALID_VALUE` errors from `enableVertexAttribArray(-1)` and warn in dev.
|
|
31
|
+
*/
|
|
32
|
+
function bindInstancedAttribute(gl, program, name, buffer, size, glType = gl.FLOAT, normalized = false) {
|
|
33
|
+
const location = gl.getAttribLocation(program, name);
|
|
34
|
+
if (location === -1) {
|
|
35
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
36
|
+
console.warn(`WebGL attribute "${name}" not found in shader program (misspelled or optimized out).`);
|
|
37
|
+
}
|
|
38
|
+
return {
|
|
39
|
+
buffer,
|
|
40
|
+
location,
|
|
41
|
+
size,
|
|
42
|
+
glType,
|
|
43
|
+
normalized
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
gl.bindBuffer(gl.ARRAY_BUFFER, buffer.buffer);
|
|
47
|
+
gl.enableVertexAttribArray(location);
|
|
48
|
+
gl.vertexAttribPointer(location, size, glType, normalized, 0, 0);
|
|
49
|
+
gl.vertexAttribDivisor(location, 1);
|
|
50
|
+
return {
|
|
51
|
+
buffer,
|
|
52
|
+
location,
|
|
53
|
+
size,
|
|
54
|
+
glType,
|
|
55
|
+
normalized
|
|
56
|
+
};
|
|
57
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { createGrowableBuffer } from "./utils.mjs";
|
|
2
|
+
/**
|
|
3
|
+
* Creates a per-instance vertex attribute backed by a fresh grow-only GPU buffer.
|
|
4
|
+
*
|
|
5
|
+
* The caller MUST have the owning VAO bound when calling this — the
|
|
6
|
+
* vertexAttribPointer + vertexAttribDivisor calls register the binding into
|
|
7
|
+
* that VAO and the program then references it on each draw.
|
|
8
|
+
*/
|
|
9
|
+
export function createInstancedAttribute(gl, program, name, size, glType = gl.FLOAT, normalized = false) {
|
|
10
|
+
const buffer = createGrowableBuffer(gl);
|
|
11
|
+
return bindInstancedAttribute(gl, program, name, buffer, size, glType, normalized);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Wires up a per-instance vertex attribute that reads from an existing GrowableBuffer.
|
|
16
|
+
* Use this when the same buffer must back the same-named attribute in multiple
|
|
17
|
+
* VAOs (e.g. two shader-program variants over the same data).
|
|
18
|
+
*
|
|
19
|
+
* The caller MUST have the owning VAO bound when calling this.
|
|
20
|
+
*
|
|
21
|
+
* If the attribute is missing from the program (typo, or optimized out by the
|
|
22
|
+
* compiler), `getAttribLocation` returns -1. We skip the GL setup in that case to
|
|
23
|
+
* avoid `INVALID_VALUE` errors from `enableVertexAttribArray(-1)` and warn in dev.
|
|
24
|
+
*/
|
|
25
|
+
export function bindInstancedAttribute(gl, program, name, buffer, size, glType = gl.FLOAT, normalized = false) {
|
|
26
|
+
const location = gl.getAttribLocation(program, name);
|
|
27
|
+
if (location === -1) {
|
|
28
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
29
|
+
console.warn(`WebGL attribute "${name}" not found in shader program (misspelled or optimized out).`);
|
|
30
|
+
}
|
|
31
|
+
return {
|
|
32
|
+
buffer,
|
|
33
|
+
location,
|
|
34
|
+
size,
|
|
35
|
+
glType,
|
|
36
|
+
normalized
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
gl.bindBuffer(gl.ARRAY_BUFFER, buffer.buffer);
|
|
40
|
+
gl.enableVertexAttribArray(location);
|
|
41
|
+
gl.vertexAttribPointer(location, size, glType, normalized, 0, 0);
|
|
42
|
+
gl.vertexAttribDivisor(location, 1);
|
|
43
|
+
return {
|
|
44
|
+
buffer,
|
|
45
|
+
location,
|
|
46
|
+
size,
|
|
47
|
+
glType,
|
|
48
|
+
normalized
|
|
49
|
+
};
|
|
50
|
+
}
|
package/utils/webgl/utils.d.mts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
export declare function compileShader(gl: WebGL2RenderingContext, shaderSource: string, shaderType: WebGL2RenderingContext['FRAGMENT_SHADER'] | WebGL2RenderingContext['VERTEX_SHADER']): WebGLShader;
|
|
2
2
|
export declare function uploadQuadBuffer(gl: WebGL2RenderingContext): WebGLBuffer;
|
|
3
3
|
export declare function bindQuadBuffer(gl: WebGL2RenderingContext, program: WebGLProgram, quadBuffer: WebGLBuffer): void;
|
|
4
|
-
export declare function attachShader(gl: WebGL2RenderingContext, program: WebGLProgram, shaderSource: string, shaderType: WebGL2RenderingContext['FRAGMENT_SHADER'] | WebGL2RenderingContext['VERTEX_SHADER']): WebGLShader;
|
|
5
4
|
export type GrowableBuffer = {
|
|
6
5
|
buffer: WebGLBuffer;
|
|
7
6
|
capacity: number;
|
|
@@ -18,4 +17,24 @@ export declare function uploadGrowableBuffer(gl: WebGL2RenderingContext, target:
|
|
|
18
17
|
/**
|
|
19
18
|
* Logs WebGL errors to the console in development mode.
|
|
20
19
|
*/
|
|
21
|
-
export declare function logWebGLErrors(gl: WebGL2RenderingContext): void;
|
|
20
|
+
export declare function logWebGLErrors(gl: WebGL2RenderingContext): void;
|
|
21
|
+
/** Enables the standard non-premultiplied src-alpha blending used by all premium WebGL renderers. */
|
|
22
|
+
export declare function setupStandardBlending(gl: WebGL2RenderingContext): void;
|
|
23
|
+
/**
|
|
24
|
+
* Returns `existing` when it's large enough to hold `length` elements, otherwise
|
|
25
|
+
* allocates a fresh typed array via `Ctor`. Lets consumers keep one ref per
|
|
26
|
+
* pool and short-circuit growth checks inline.
|
|
27
|
+
*/
|
|
28
|
+
export declare function ensurePool<T extends {
|
|
29
|
+
length: number;
|
|
30
|
+
}>(existing: T | null | undefined, length: number, Ctor: new (length: number) => T): T;
|
|
31
|
+
export interface LinkedProgram {
|
|
32
|
+
program: WebGLProgram;
|
|
33
|
+
/** The vertex + fragment shaders that were attached. Hold them so dispose() can delete them. */
|
|
34
|
+
shaders: WebGLShader[];
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Compiles vertex + fragment shaders, attaches them, links the program, and returns
|
|
38
|
+
* both the program and its shaders. Logs link/compile diagnostics in dev when linking fails.
|
|
39
|
+
*/
|
|
40
|
+
export declare function linkProgram(gl: WebGL2RenderingContext, vertexShaderSource: string, fragmentShaderSource: string): LinkedProgram;
|
package/utils/webgl/utils.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
export declare function compileShader(gl: WebGL2RenderingContext, shaderSource: string, shaderType: WebGL2RenderingContext['FRAGMENT_SHADER'] | WebGL2RenderingContext['VERTEX_SHADER']): WebGLShader;
|
|
2
2
|
export declare function uploadQuadBuffer(gl: WebGL2RenderingContext): WebGLBuffer;
|
|
3
3
|
export declare function bindQuadBuffer(gl: WebGL2RenderingContext, program: WebGLProgram, quadBuffer: WebGLBuffer): void;
|
|
4
|
-
export declare function attachShader(gl: WebGL2RenderingContext, program: WebGLProgram, shaderSource: string, shaderType: WebGL2RenderingContext['FRAGMENT_SHADER'] | WebGL2RenderingContext['VERTEX_SHADER']): WebGLShader;
|
|
5
4
|
export type GrowableBuffer = {
|
|
6
5
|
buffer: WebGLBuffer;
|
|
7
6
|
capacity: number;
|
|
@@ -18,4 +17,24 @@ export declare function uploadGrowableBuffer(gl: WebGL2RenderingContext, target:
|
|
|
18
17
|
/**
|
|
19
18
|
* Logs WebGL errors to the console in development mode.
|
|
20
19
|
*/
|
|
21
|
-
export declare function logWebGLErrors(gl: WebGL2RenderingContext): void;
|
|
20
|
+
export declare function logWebGLErrors(gl: WebGL2RenderingContext): void;
|
|
21
|
+
/** Enables the standard non-premultiplied src-alpha blending used by all premium WebGL renderers. */
|
|
22
|
+
export declare function setupStandardBlending(gl: WebGL2RenderingContext): void;
|
|
23
|
+
/**
|
|
24
|
+
* Returns `existing` when it's large enough to hold `length` elements, otherwise
|
|
25
|
+
* allocates a fresh typed array via `Ctor`. Lets consumers keep one ref per
|
|
26
|
+
* pool and short-circuit growth checks inline.
|
|
27
|
+
*/
|
|
28
|
+
export declare function ensurePool<T extends {
|
|
29
|
+
length: number;
|
|
30
|
+
}>(existing: T | null | undefined, length: number, Ctor: new (length: number) => T): T;
|
|
31
|
+
export interface LinkedProgram {
|
|
32
|
+
program: WebGLProgram;
|
|
33
|
+
/** The vertex + fragment shaders that were attached. Hold them so dispose() can delete them. */
|
|
34
|
+
shaders: WebGLShader[];
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Compiles vertex + fragment shaders, attaches them, links the program, and returns
|
|
38
|
+
* both the program and its shaders. Logs link/compile diagnostics in dev when linking fails.
|
|
39
|
+
*/
|
|
40
|
+
export declare function linkProgram(gl: WebGL2RenderingContext, vertexShaderSource: string, fragmentShaderSource: string): LinkedProgram;
|