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