@mui/x-charts-premium 9.3.0 → 9.4.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.js +35 -5
- package/BarChartPremium/BarChartPremium.mjs +35 -5
- package/BarChartPremium/RangeBar/RangeBarPlot.d.mts +10 -0
- package/BarChartPremium/RangeBar/RangeBarPlot.d.ts +10 -0
- package/BarChartPremium/RangeBar/RangeBarPlot.js +59 -2
- package/BarChartPremium/RangeBar/RangeBarPlot.mjs +59 -2
- package/BarChartPremium/RangeBar/RangeBarWebGLPlot.d.mts +10 -0
- package/BarChartPremium/RangeBar/RangeBarWebGLPlot.d.ts +10 -0
- package/BarChartPremium/RangeBar/RangeBarWebGLPlot.js +82 -0
- package/BarChartPremium/RangeBar/RangeBarWebGLPlot.mjs +76 -0
- package/BarChartPremium/RangeBar/seriesConfig/extrema.js +3 -0
- package/BarChartPremium/RangeBar/seriesConfig/extrema.mjs +3 -0
- package/BarChartPremium/RangeBar/seriesConfig/seriesProcessor.js +2 -2
- package/BarChartPremium/RangeBar/seriesConfig/seriesProcessor.mjs +2 -2
- package/BarChartPremium/useBarChartPremiumProps.js +2 -1
- package/BarChartPremium/useBarChartPremiumProps.mjs +2 -1
- package/BarChartPremium/webgl/useBarWebGLPlotData.d.mts +2 -7
- package/BarChartPremium/webgl/useBarWebGLPlotData.d.ts +2 -7
- package/BarChartPremium/webgl/useBarWebGLPlotData.js +4 -151
- package/BarChartPremium/webgl/useBarWebGLPlotData.mjs +4 -150
- package/BarChartPremium/webgl/useWebGLBarLikePlotData.d.mts +39 -0
- package/BarChartPremium/webgl/useWebGLBarLikePlotData.d.ts +39 -0
- package/BarChartPremium/webgl/useWebGLBarLikePlotData.js +169 -0
- package/BarChartPremium/webgl/useWebGLBarLikePlotData.mjs +163 -0
- package/CHANGELOG.md +196 -0
- package/CandlestickChart/CandlestickChart.js +11 -2
- package/CandlestickChart/CandlestickChart.mjs +11 -2
- package/CandlestickChart/seriesConfig/extrema.js +3 -0
- package/CandlestickChart/seriesConfig/extrema.mjs +3 -0
- package/CandlestickChart/seriesConfig/seriesProcessor.js +2 -2
- package/CandlestickChart/seriesConfig/seriesProcessor.mjs +2 -2
- package/ChartsDataProviderPremium/ChartsDataProviderPremium.js +2 -2
- package/ChartsDataProviderPremium/ChartsDataProviderPremium.mjs +2 -2
- package/ChartsGeoDataProviderPremium/ChartsGeoDataProviderPremium.d.mts +35 -0
- package/ChartsGeoDataProviderPremium/ChartsGeoDataProviderPremium.d.ts +35 -0
- package/ChartsGeoDataProviderPremium/ChartsGeoDataProviderPremium.js +125 -0
- package/ChartsGeoDataProviderPremium/ChartsGeoDataProviderPremium.mjs +119 -0
- package/ChartsGeoDataProviderPremium/ChartsGeoDataProviderPremium.plugins.d.mts +5 -0
- package/ChartsGeoDataProviderPremium/ChartsGeoDataProviderPremium.plugins.d.ts +5 -0
- package/ChartsGeoDataProviderPremium/ChartsGeoDataProviderPremium.plugins.js +10 -0
- package/ChartsGeoDataProviderPremium/ChartsGeoDataProviderPremium.plugins.mjs +4 -0
- package/ChartsGeoDataProviderPremium/index.d.mts +3 -0
- package/ChartsGeoDataProviderPremium/index.d.ts +3 -0
- package/ChartsGeoDataProviderPremium/index.js +20 -0
- package/ChartsGeoDataProviderPremium/index.mjs +3 -0
- package/ChartsGeoDataProviderPremium/useChartsGeoDataProviderPremiumProps.d.mts +10 -0
- package/ChartsGeoDataProviderPremium/useChartsGeoDataProviderPremiumProps.d.ts +10 -0
- package/ChartsGeoDataProviderPremium/useChartsGeoDataProviderPremiumProps.js +49 -0
- package/ChartsGeoDataProviderPremium/useChartsGeoDataProviderPremiumProps.mjs +42 -0
- package/ChartsRadialDataProviderPremium/ChartsRadialDataProviderPremium.js +2 -2
- package/ChartsRadialDataProviderPremium/ChartsRadialDataProviderPremium.mjs +2 -2
- package/HeatmapPremium/HeatmapPremium.js +32 -2
- package/HeatmapPremium/HeatmapPremium.mjs +32 -2
- package/Map/FocusedMapShape.d.mts +4 -0
- package/Map/FocusedMapShape.d.ts +4 -0
- package/Map/FocusedMapShape.js +66 -0
- package/Map/FocusedMapShape.mjs +60 -0
- package/Map/GeoDataPlot.d.mts +26 -0
- package/Map/GeoDataPlot.d.ts +26 -0
- package/Map/GeoDataPlot.js +65 -0
- package/Map/GeoDataPlot.mjs +60 -0
- package/Map/Graticule.d.mts +1 -0
- package/Map/Graticule.d.ts +1 -0
- package/Map/Graticule.js +30 -0
- package/Map/Graticule.mjs +24 -0
- package/Map/MapShape.d.mts +10 -0
- package/Map/MapShape.d.ts +10 -0
- package/Map/MapShape.js +55 -0
- package/Map/MapShape.mjs +49 -0
- package/Map/MapShapePlot.d.mts +21 -0
- package/Map/MapShapePlot.d.ts +21 -0
- package/Map/MapShapePlot.js +86 -0
- package/Map/MapShapePlot.mjs +80 -0
- package/Map/index.d.mts +7 -0
- package/Map/index.d.ts +7 -0
- package/Map/index.js +60 -0
- package/Map/index.mjs +8 -0
- package/Map/seriesConfig/descriptionGetter.d.mts +3 -0
- package/Map/seriesConfig/descriptionGetter.d.ts +3 -0
- package/Map/seriesConfig/descriptionGetter.js +19 -0
- package/Map/seriesConfig/descriptionGetter.mjs +13 -0
- package/Map/seriesConfig/getColor.d.mts +3 -0
- package/Map/seriesConfig/getColor.d.ts +3 -0
- package/Map/seriesConfig/getColor.js +35 -0
- package/Map/seriesConfig/getColor.mjs +29 -0
- package/Map/seriesConfig/getSeriesWithDefaultValues.d.mts +3 -0
- package/Map/seriesConfig/getSeriesWithDefaultValues.d.ts +3 -0
- package/Map/seriesConfig/getSeriesWithDefaultValues.js +15 -0
- package/Map/seriesConfig/getSeriesWithDefaultValues.mjs +8 -0
- package/Map/seriesConfig/index.d.mts +2 -0
- package/Map/seriesConfig/index.d.ts +2 -0
- package/Map/seriesConfig/index.js +28 -0
- package/Map/seriesConfig/index.mjs +21 -0
- package/Map/seriesConfig/keyboardFocusHandler.d.mts +9 -0
- package/Map/seriesConfig/keyboardFocusHandler.d.ts +9 -0
- package/Map/seriesConfig/keyboardFocusHandler.js +19 -0
- package/Map/seriesConfig/keyboardFocusHandler.mjs +13 -0
- package/Map/seriesConfig/legend.d.mts +3 -0
- package/Map/seriesConfig/legend.d.ts +3 -0
- package/Map/seriesConfig/legend.js +28 -0
- package/Map/seriesConfig/legend.mjs +22 -0
- package/Map/seriesConfig/seriesProcessor.d.mts +3 -0
- package/Map/seriesConfig/seriesProcessor.d.ts +3 -0
- package/Map/seriesConfig/seriesProcessor.js +66 -0
- package/Map/seriesConfig/seriesProcessor.mjs +59 -0
- package/Map/seriesConfig/tooltip.d.mts +3 -0
- package/Map/seriesConfig/tooltip.d.ts +3 -0
- package/Map/seriesConfig/tooltip.js +33 -0
- package/Map/seriesConfig/tooltip.mjs +27 -0
- package/RadialLineChart/RadialLineHighlightPlot.d.mts +3 -2
- package/RadialLineChart/RadialLineHighlightPlot.d.ts +3 -2
- package/ScatterChartPremium/ScatterChartPremium.d.mts +2 -1
- package/ScatterChartPremium/ScatterChartPremium.d.ts +2 -1
- package/ScatterChartPremium/ScatterChartPremium.js +32 -2
- package/ScatterChartPremium/ScatterChartPremium.mjs +32 -2
- package/hooks/index.d.mts +4 -1
- package/hooks/index.d.ts +4 -1
- package/hooks/index.js +33 -0
- package/hooks/index.mjs +4 -1
- package/hooks/useGeoData.d.mts +6 -0
- package/hooks/useGeoData.d.ts +6 -0
- package/hooks/useGeoData.js +17 -0
- package/hooks/useGeoData.mjs +13 -0
- package/hooks/useGeoFeatureIndexesByName.d.mts +7 -0
- package/hooks/useGeoFeatureIndexesByName.d.ts +7 -0
- package/hooks/useGeoFeatureIndexesByName.js +19 -0
- package/hooks/useGeoFeatureIndexesByName.mjs +15 -0
- package/hooks/useGeoPath.d.mts +6 -0
- package/hooks/useGeoPath.d.ts +6 -0
- package/hooks/useGeoPath.js +17 -0
- package/hooks/useGeoPath.mjs +13 -0
- package/hooks/useMapShapeSeries.d.mts +34 -0
- package/hooks/useMapShapeSeries.d.ts +34 -0
- package/hooks/useMapShapeSeries.js +45 -0
- package/hooks/useMapShapeSeries.mjs +40 -0
- package/index.d.mts +2 -0
- package/index.d.ts +2 -0
- package/index.js +25 -1
- package/index.mjs +3 -1
- package/internals/plugins/useGeoProjection/index.d.mts +3 -0
- package/internals/plugins/useGeoProjection/index.d.ts +3 -0
- package/internals/plugins/useGeoProjection/index.js +38 -0
- package/internals/plugins/useGeoProjection/index.mjs +3 -0
- package/internals/plugins/useGeoProjection/useGeoProjection.d.mts +3 -0
- package/internals/plugins/useGeoProjection/useGeoProjection.d.ts +3 -0
- package/internals/plugins/useGeoProjection/useGeoProjection.js +58 -0
- package/internals/plugins/useGeoProjection/useGeoProjection.mjs +50 -0
- package/internals/plugins/useGeoProjection/useGeoProjection.selectors.d.mts +39 -0
- package/internals/plugins/useGeoProjection/useGeoProjection.selectors.d.ts +39 -0
- package/internals/plugins/useGeoProjection/useGeoProjection.selectors.js +135 -0
- package/internals/plugins/useGeoProjection/useGeoProjection.selectors.mjs +128 -0
- package/internals/plugins/useGeoProjection/useGeoProjection.types.d.mts +55 -0
- package/internals/plugins/useGeoProjection/useGeoProjection.types.d.ts +55 -0
- package/internals/plugins/useGeoProjection/useGeoProjection.types.js +5 -0
- package/internals/plugins/useGeoProjection/useGeoProjection.types.mjs +1 -0
- package/models/chartsSlotsComponentsPropsPremium.d.mts +1 -0
- package/models/chartsSlotsComponentsPropsPremium.d.ts +1 -0
- package/models/chartsSlotsComponentsPropsPremium.js +5 -0
- package/models/chartsSlotsComponentsPropsPremium.mjs +1 -0
- package/models/index.d.mts +2 -1
- package/models/index.d.ts +2 -1
- package/models/index.js +11 -0
- package/models/index.mjs +2 -1
- package/models/seriesType/index.d.mts +2 -1
- package/models/seriesType/index.d.ts +2 -1
- package/models/seriesType/index.js +11 -0
- package/models/seriesType/index.mjs +2 -1
- package/models/seriesType/mapShape.d.mts +105 -0
- package/models/seriesType/mapShape.d.ts +105 -0
- package/models/seriesType/mapShape.js +5 -0
- package/models/seriesType/mapShape.mjs +1 -0
- package/package.json +35 -7
- package/typeOverloads/modules.d.mts +16 -1
- package/typeOverloads/modules.d.ts +16 -1
- package/utils/webgl/useWebGLResizeObserver.js +3 -3
- package/utils/webgl/useWebGLResizeObserver.mjs +2 -2
|
@@ -94,12 +94,12 @@ const BarChartPremium = exports.BarChartPremium = /*#__PURE__*/React.forwardRef(
|
|
|
94
94
|
children: [renderer === 'webgl' && /*#__PURE__*/(0, _jsxRuntime.jsxs)(React.Fragment, {
|
|
95
95
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsSvgLayer.ChartsSvgLayer, {
|
|
96
96
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsGrid.ChartsGrid, (0, _extends2.default)({}, gridProps))
|
|
97
|
-
}), /*#__PURE__*/(0, _jsxRuntime.
|
|
98
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_BarPlotPremium.BarPlotPremium, (0, _extends2.default)({}, barPlotPremiumProps))
|
|
97
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_ChartsWebGLLayer.ChartsWebGLLayer, {
|
|
98
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_BarPlotPremium.BarPlotPremium, (0, _extends2.default)({}, barPlotPremiumProps)), /*#__PURE__*/(0, _jsxRuntime.jsx)(_RangeBarPlot.RangeBarPlot, (0, _extends2.default)({}, rangeBarPlotProps))]
|
|
99
99
|
})]
|
|
100
100
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_ChartsSvgLayer.ChartsSvgLayer, (0, _extends2.default)({}, chartsSurfaceProps, {
|
|
101
101
|
children: [renderer !== 'webgl' && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsGrid.ChartsGrid, (0, _extends2.default)({}, gridProps)), /*#__PURE__*/(0, _jsxRuntime.jsxs)("g", (0, _extends2.default)({}, clipPathGroupProps, {
|
|
102
|
-
children: [renderer !== 'webgl' && /*#__PURE__*/(0, _jsxRuntime.jsx)(_BarPlotPremium.BarPlotPremium, (0, _extends2.default)({}, barPlotPremiumProps)), /*#__PURE__*/(0, _jsxRuntime.jsx)(_RangeBarPlot.RangeBarPlot, (0, _extends2.default)({}, rangeBarPlotProps)), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsOverlay.ChartsOverlay, (0, _extends2.default)({}, overlayProps)), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsAxisHighlight.ChartsAxisHighlight, (0, _extends2.default)({}, axisHighlightProps)), /*#__PURE__*/(0, _jsxRuntime.jsx)(_BarChart.FocusedBar, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_FocusedRangeBar.FocusedRangeBar, {})]
|
|
102
|
+
children: [renderer !== 'webgl' && /*#__PURE__*/(0, _jsxRuntime.jsx)(_BarPlotPremium.BarPlotPremium, (0, _extends2.default)({}, barPlotPremiumProps)), renderer !== 'webgl' && /*#__PURE__*/(0, _jsxRuntime.jsx)(_RangeBarPlot.RangeBarPlot, (0, _extends2.default)({}, rangeBarPlotProps)), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsOverlay.ChartsOverlay, (0, _extends2.default)({}, overlayProps)), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsAxisHighlight.ChartsAxisHighlight, (0, _extends2.default)({}, axisHighlightProps)), /*#__PURE__*/(0, _jsxRuntime.jsx)(_BarChart.FocusedBar, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_FocusedRangeBar.FocusedRangeBar, {})]
|
|
103
103
|
})), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsAxis.ChartsAxis, (0, _extends2.default)({}, chartsAxisProps)), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsZoomSlider.ChartsZoomSlider, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsBrushOverlay.ChartsBrushOverlay, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsClipPath.ChartsClipPath, (0, _extends2.default)({}, clipPathProps)), children]
|
|
104
104
|
}))]
|
|
105
105
|
}), !props.loading && /*#__PURE__*/(0, _jsxRuntime.jsx)(Tooltip, (0, _extends2.default)({}, props.slotProps?.tooltip))]
|
|
@@ -279,12 +279,21 @@ process.env.NODE_ENV !== "production" ? BarChartPremium.propTypes = {
|
|
|
279
279
|
/**
|
|
280
280
|
* The list of zoom data related to each axis.
|
|
281
281
|
* Used to initialize the zoom in a specific configuration without controlling it.
|
|
282
|
+
*
|
|
283
|
+
* Each entry is either explicit zoom percentages (`{ axisId, start, end }`) or a
|
|
284
|
+
* range value (`{ axisId, value }`) resolved against the axis domain.
|
|
282
285
|
*/
|
|
283
|
-
initialZoom: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
286
|
+
initialZoom: _propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.shape({
|
|
284
287
|
axisId: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]).isRequired,
|
|
285
288
|
end: _propTypes.default.number.isRequired,
|
|
286
289
|
start: _propTypes.default.number.isRequired
|
|
287
|
-
})
|
|
290
|
+
}), _propTypes.default.shape({
|
|
291
|
+
axisId: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]).isRequired,
|
|
292
|
+
value: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.instanceOf(Date).isRequired), _propTypes.default.arrayOf(_propTypes.default.string.isRequired), _propTypes.default.func, _propTypes.default.shape({
|
|
293
|
+
step: _propTypes.default.number,
|
|
294
|
+
unit: _propTypes.default.oneOf(['day', 'hour', 'microsecond', 'millisecond', 'minute', 'month', 'second', 'week', 'year']).isRequired
|
|
295
|
+
})])
|
|
296
|
+
})]).isRequired),
|
|
288
297
|
/**
|
|
289
298
|
* The direction of the bar elements.
|
|
290
299
|
* @default 'vertical'
|
|
@@ -465,6 +474,27 @@ process.env.NODE_ENV !== "production" ? BarChartPremium.propTypes = {
|
|
|
465
474
|
id: _propTypes.default.string,
|
|
466
475
|
max: _propTypes.default.number,
|
|
467
476
|
min: _propTypes.default.number,
|
|
477
|
+
sizeMap: _propTypes.default.oneOfType([_propTypes.default.shape({
|
|
478
|
+
interpolator: _propTypes.default.oneOf(['linear', 'log', 'sqrt']),
|
|
479
|
+
max: _propTypes.default.oneOfType([_propTypes.default.instanceOf(Date), _propTypes.default.number]),
|
|
480
|
+
min: _propTypes.default.oneOfType([_propTypes.default.instanceOf(Date), _propTypes.default.number]),
|
|
481
|
+
size: _propTypes.default.arrayOf(_propTypes.default.number.isRequired).isRequired,
|
|
482
|
+
type: _propTypes.default.oneOf(['continuous']).isRequired
|
|
483
|
+
}), _propTypes.default.shape({
|
|
484
|
+
max: _propTypes.default.oneOfType([_propTypes.default.instanceOf(Date), _propTypes.default.number]),
|
|
485
|
+
min: _propTypes.default.oneOfType([_propTypes.default.instanceOf(Date), _propTypes.default.number]),
|
|
486
|
+
size: _propTypes.default.func.isRequired,
|
|
487
|
+
type: _propTypes.default.oneOf(['continuous']).isRequired
|
|
488
|
+
}), _propTypes.default.shape({
|
|
489
|
+
sizes: _propTypes.default.arrayOf(_propTypes.default.number).isRequired,
|
|
490
|
+
thresholds: _propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.instanceOf(Date), _propTypes.default.number]).isRequired).isRequired,
|
|
491
|
+
type: _propTypes.default.oneOf(['piecewise']).isRequired
|
|
492
|
+
}), _propTypes.default.shape({
|
|
493
|
+
sizes: _propTypes.default.arrayOf(_propTypes.default.number).isRequired,
|
|
494
|
+
type: _propTypes.default.oneOf(['ordinal']).isRequired,
|
|
495
|
+
unknownSize: _propTypes.default.number,
|
|
496
|
+
values: _propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.instanceOf(Date), _propTypes.default.number, _propTypes.default.string]).isRequired)
|
|
497
|
+
})]),
|
|
468
498
|
valueGetter: _propTypes.default.func
|
|
469
499
|
})),
|
|
470
500
|
/**
|
|
@@ -87,12 +87,12 @@ const BarChartPremium = /*#__PURE__*/React.forwardRef(function BarChartPremium(i
|
|
|
87
87
|
children: [renderer === 'webgl' && /*#__PURE__*/_jsxs(React.Fragment, {
|
|
88
88
|
children: [/*#__PURE__*/_jsx(ChartsSvgLayer, {
|
|
89
89
|
children: /*#__PURE__*/_jsx(ChartsGrid, _extends({}, gridProps))
|
|
90
|
-
}), /*#__PURE__*/
|
|
91
|
-
children: /*#__PURE__*/_jsx(BarPlotPremium, _extends({}, barPlotPremiumProps))
|
|
90
|
+
}), /*#__PURE__*/_jsxs(ChartsWebGLLayer, {
|
|
91
|
+
children: [/*#__PURE__*/_jsx(BarPlotPremium, _extends({}, barPlotPremiumProps)), /*#__PURE__*/_jsx(RangeBarPlot, _extends({}, rangeBarPlotProps))]
|
|
92
92
|
})]
|
|
93
93
|
}), /*#__PURE__*/_jsxs(ChartsSvgLayer, _extends({}, chartsSurfaceProps, {
|
|
94
94
|
children: [renderer !== 'webgl' && /*#__PURE__*/_jsx(ChartsGrid, _extends({}, gridProps)), /*#__PURE__*/_jsxs("g", _extends({}, clipPathGroupProps, {
|
|
95
|
-
children: [renderer !== 'webgl' && /*#__PURE__*/_jsx(BarPlotPremium, _extends({}, barPlotPremiumProps)), /*#__PURE__*/_jsx(RangeBarPlot, _extends({}, rangeBarPlotProps)), /*#__PURE__*/_jsx(ChartsOverlay, _extends({}, overlayProps)), /*#__PURE__*/_jsx(ChartsAxisHighlight, _extends({}, axisHighlightProps)), /*#__PURE__*/_jsx(FocusedBar, {}), /*#__PURE__*/_jsx(FocusedRangeBar, {})]
|
|
95
|
+
children: [renderer !== 'webgl' && /*#__PURE__*/_jsx(BarPlotPremium, _extends({}, barPlotPremiumProps)), renderer !== 'webgl' && /*#__PURE__*/_jsx(RangeBarPlot, _extends({}, rangeBarPlotProps)), /*#__PURE__*/_jsx(ChartsOverlay, _extends({}, overlayProps)), /*#__PURE__*/_jsx(ChartsAxisHighlight, _extends({}, axisHighlightProps)), /*#__PURE__*/_jsx(FocusedBar, {}), /*#__PURE__*/_jsx(FocusedRangeBar, {})]
|
|
96
96
|
})), /*#__PURE__*/_jsx(ChartsAxis, _extends({}, chartsAxisProps)), /*#__PURE__*/_jsx(ChartsZoomSlider, {}), /*#__PURE__*/_jsx(ChartsBrushOverlay, {}), /*#__PURE__*/_jsx(ChartsClipPath, _extends({}, clipPathProps)), children]
|
|
97
97
|
}))]
|
|
98
98
|
}), !props.loading && /*#__PURE__*/_jsx(Tooltip, _extends({}, props.slotProps?.tooltip))]
|
|
@@ -272,12 +272,21 @@ process.env.NODE_ENV !== "production" ? BarChartPremium.propTypes = {
|
|
|
272
272
|
/**
|
|
273
273
|
* The list of zoom data related to each axis.
|
|
274
274
|
* Used to initialize the zoom in a specific configuration without controlling it.
|
|
275
|
+
*
|
|
276
|
+
* Each entry is either explicit zoom percentages (`{ axisId, start, end }`) or a
|
|
277
|
+
* range value (`{ axisId, value }`) resolved against the axis domain.
|
|
275
278
|
*/
|
|
276
|
-
initialZoom: PropTypes.arrayOf(PropTypes.shape({
|
|
279
|
+
initialZoom: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.shape({
|
|
277
280
|
axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
|
|
278
281
|
end: PropTypes.number.isRequired,
|
|
279
282
|
start: PropTypes.number.isRequired
|
|
280
|
-
})
|
|
283
|
+
}), PropTypes.shape({
|
|
284
|
+
axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
|
|
285
|
+
value: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.instanceOf(Date).isRequired), PropTypes.arrayOf(PropTypes.string.isRequired), PropTypes.func, PropTypes.shape({
|
|
286
|
+
step: PropTypes.number,
|
|
287
|
+
unit: PropTypes.oneOf(['day', 'hour', 'microsecond', 'millisecond', 'minute', 'month', 'second', 'week', 'year']).isRequired
|
|
288
|
+
})])
|
|
289
|
+
})]).isRequired),
|
|
281
290
|
/**
|
|
282
291
|
* The direction of the bar elements.
|
|
283
292
|
* @default 'vertical'
|
|
@@ -458,6 +467,27 @@ process.env.NODE_ENV !== "production" ? BarChartPremium.propTypes = {
|
|
|
458
467
|
id: PropTypes.string,
|
|
459
468
|
max: PropTypes.number,
|
|
460
469
|
min: PropTypes.number,
|
|
470
|
+
sizeMap: PropTypes.oneOfType([PropTypes.shape({
|
|
471
|
+
interpolator: PropTypes.oneOf(['linear', 'log', 'sqrt']),
|
|
472
|
+
max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
473
|
+
min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
474
|
+
size: PropTypes.arrayOf(PropTypes.number.isRequired).isRequired,
|
|
475
|
+
type: PropTypes.oneOf(['continuous']).isRequired
|
|
476
|
+
}), PropTypes.shape({
|
|
477
|
+
max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
478
|
+
min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
479
|
+
size: PropTypes.func.isRequired,
|
|
480
|
+
type: PropTypes.oneOf(['continuous']).isRequired
|
|
481
|
+
}), PropTypes.shape({
|
|
482
|
+
sizes: PropTypes.arrayOf(PropTypes.number).isRequired,
|
|
483
|
+
thresholds: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]).isRequired).isRequired,
|
|
484
|
+
type: PropTypes.oneOf(['piecewise']).isRequired
|
|
485
|
+
}), PropTypes.shape({
|
|
486
|
+
sizes: PropTypes.arrayOf(PropTypes.number).isRequired,
|
|
487
|
+
type: PropTypes.oneOf(['ordinal']).isRequired,
|
|
488
|
+
unknownSize: PropTypes.number,
|
|
489
|
+
values: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number, PropTypes.string]).isRequired)
|
|
490
|
+
})]),
|
|
461
491
|
valueGetter: PropTypes.func
|
|
462
492
|
})),
|
|
463
493
|
/**
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { type BarElementSlotProps, type BarElementSlots, type BarLabelSlots, type BarLabelSlotProps } from '@mui/x-charts/BarChart';
|
|
3
3
|
import { type RangeBarItemIdentifier } from "../../models/index.mjs";
|
|
4
|
+
export type RangeBarPlotRenderer = 'svg-single' | 'webgl';
|
|
4
5
|
export interface RangeBarPlotSlots extends BarElementSlots, BarLabelSlots {}
|
|
5
6
|
export interface RangeBarPlotSlotProps extends BarElementSlotProps, BarLabelSlotProps {}
|
|
6
7
|
export interface RangeBarPlotProps {
|
|
@@ -19,6 +20,15 @@ export interface RangeBarPlotProps {
|
|
|
19
20
|
* Defines the border radius of the bar element.
|
|
20
21
|
*/
|
|
21
22
|
borderRadius?: number;
|
|
23
|
+
/**
|
|
24
|
+
* The type of renderer to use for the range bar plot.
|
|
25
|
+
* - `svg-single`: Renders every bar in a `<rect />` element.
|
|
26
|
+
* - `webgl`: Renders bars using WebGL for better performance with very large datasets, at the cost of some limitations.
|
|
27
|
+
* Read more: https://mui.com/x/react-charts/bars/#performance
|
|
28
|
+
*
|
|
29
|
+
* @default 'svg-single'
|
|
30
|
+
*/
|
|
31
|
+
renderer?: RangeBarPlotRenderer;
|
|
22
32
|
/**
|
|
23
33
|
* The props used for each component slot.
|
|
24
34
|
* @default {}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { type BarElementSlotProps, type BarElementSlots, type BarLabelSlots, type BarLabelSlotProps } from '@mui/x-charts/BarChart';
|
|
3
3
|
import { type RangeBarItemIdentifier } from "../../models/index.js";
|
|
4
|
+
export type RangeBarPlotRenderer = 'svg-single' | 'webgl';
|
|
4
5
|
export interface RangeBarPlotSlots extends BarElementSlots, BarLabelSlots {}
|
|
5
6
|
export interface RangeBarPlotSlotProps extends BarElementSlotProps, BarLabelSlotProps {}
|
|
6
7
|
export interface RangeBarPlotProps {
|
|
@@ -19,6 +20,15 @@ export interface RangeBarPlotProps {
|
|
|
19
20
|
* Defines the border radius of the bar element.
|
|
20
21
|
*/
|
|
21
22
|
borderRadius?: number;
|
|
23
|
+
/**
|
|
24
|
+
* The type of renderer to use for the range bar plot.
|
|
25
|
+
* - `svg-single`: Renders every bar in a `<rect />` element.
|
|
26
|
+
* - `webgl`: Renders bars using WebGL for better performance with very large datasets, at the cost of some limitations.
|
|
27
|
+
* Read more: https://mui.com/x/react-charts/bars/#performance
|
|
28
|
+
*
|
|
29
|
+
* @default 'svg-single'
|
|
30
|
+
*/
|
|
31
|
+
renderer?: RangeBarPlotRenderer;
|
|
22
32
|
/**
|
|
23
33
|
* The props used for each component slot.
|
|
24
34
|
* @default {}
|
|
@@ -19,8 +19,10 @@ var _hooks2 = require("@mui/x-charts-pro/hooks");
|
|
|
19
19
|
var _useUtilityClasses = require("./useUtilityClasses");
|
|
20
20
|
var _useRangeBarPlotData = require("./useRangeBarPlotData");
|
|
21
21
|
var _AnimatedRangeBarElement = require("./AnimatedRangeBarElement");
|
|
22
|
+
var _RangeBarWebGLPlot = require("./RangeBarWebGLPlot");
|
|
22
23
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
23
|
-
const _excluded = ["
|
|
24
|
+
const _excluded = ["renderer", "borderRadius"],
|
|
25
|
+
_excluded2 = ["skipAnimation", "onItemClick", "borderRadius"];
|
|
24
26
|
const RangeBarPlotRoot = (0, _styles.styled)('g', {
|
|
25
27
|
name: 'MuiRangeBarPlot',
|
|
26
28
|
slot: 'Root'
|
|
@@ -40,12 +42,27 @@ const RangeBarPlotRoot = (0, _styles.styled)('g', {
|
|
|
40
42
|
* - [RangeBarPlot API](https://mui.com/x/api/charts/range-bar-plot/)
|
|
41
43
|
*/
|
|
42
44
|
function RangeBarPlot(props) {
|
|
45
|
+
const {
|
|
46
|
+
renderer,
|
|
47
|
+
borderRadius
|
|
48
|
+
} = props,
|
|
49
|
+
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
50
|
+
if (renderer === 'webgl') {
|
|
51
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_RangeBarWebGLPlot.RangeBarWebGLPlot, {
|
|
52
|
+
borderRadius: borderRadius
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(RangeBarSvgPlot, (0, _extends2.default)({
|
|
56
|
+
borderRadius: borderRadius
|
|
57
|
+
}, other));
|
|
58
|
+
}
|
|
59
|
+
function RangeBarSvgPlot(props) {
|
|
43
60
|
const {
|
|
44
61
|
skipAnimation: inSkipAnimation,
|
|
45
62
|
onItemClick,
|
|
46
63
|
borderRadius
|
|
47
64
|
} = props,
|
|
48
|
-
other = (0, _objectWithoutPropertiesLoose2.default)(props,
|
|
65
|
+
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded2);
|
|
49
66
|
const isZoomInteracting = (0, _hooks2.useIsZoomInteracting)();
|
|
50
67
|
const skipAnimation = (0, _internals.useSkipAnimation)(isZoomInteracting || inSkipAnimation);
|
|
51
68
|
const {
|
|
@@ -110,6 +127,37 @@ function RangeBarPlot(props) {
|
|
|
110
127
|
})
|
|
111
128
|
});
|
|
112
129
|
}
|
|
130
|
+
process.env.NODE_ENV !== "production" ? RangeBarSvgPlot.propTypes = {
|
|
131
|
+
// ----------------------------- Warning --------------------------------
|
|
132
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
133
|
+
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
134
|
+
// ----------------------------------------------------------------------
|
|
135
|
+
/**
|
|
136
|
+
* Defines the border radius of the bar element.
|
|
137
|
+
*/
|
|
138
|
+
borderRadius: _propTypes.default.number,
|
|
139
|
+
/**
|
|
140
|
+
* Callback fired when a bar item is clicked.
|
|
141
|
+
* @param {React.MouseEvent<SVGElement, MouseEvent>} event The event source of the callback.
|
|
142
|
+
* @param {RangeBarItemIdentifier} barItemIdentifier The range bar item identifier.
|
|
143
|
+
*/
|
|
144
|
+
onItemClick: _propTypes.default.func,
|
|
145
|
+
/**
|
|
146
|
+
* If `true`, animations are skipped.
|
|
147
|
+
* @default undefined
|
|
148
|
+
*/
|
|
149
|
+
skipAnimation: _propTypes.default.bool,
|
|
150
|
+
/**
|
|
151
|
+
* The props used for each component slot.
|
|
152
|
+
* @default {}
|
|
153
|
+
*/
|
|
154
|
+
slotProps: _propTypes.default.object,
|
|
155
|
+
/**
|
|
156
|
+
* Overridable component slots.
|
|
157
|
+
* @default {}
|
|
158
|
+
*/
|
|
159
|
+
slots: _propTypes.default.object
|
|
160
|
+
} : void 0;
|
|
113
161
|
process.env.NODE_ENV !== "production" ? RangeBarPlot.propTypes = {
|
|
114
162
|
// ----------------------------- Warning --------------------------------
|
|
115
163
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
@@ -125,6 +173,15 @@ process.env.NODE_ENV !== "production" ? RangeBarPlot.propTypes = {
|
|
|
125
173
|
* @param {RangeBarItemIdentifier} barItemIdentifier The range bar item identifier.
|
|
126
174
|
*/
|
|
127
175
|
onItemClick: _propTypes.default.func,
|
|
176
|
+
/**
|
|
177
|
+
* The type of renderer to use for the range bar plot.
|
|
178
|
+
* - `svg-single`: Renders every bar in a `<rect />` element.
|
|
179
|
+
* - `webgl`: Renders bars using WebGL for better performance with very large datasets, at the cost of some limitations.
|
|
180
|
+
* Read more: https://mui.com/x/react-charts/bars/#performance
|
|
181
|
+
*
|
|
182
|
+
* @default 'svg-single'
|
|
183
|
+
*/
|
|
184
|
+
renderer: _propTypes.default.oneOf(['svg-single', 'webgl']),
|
|
128
185
|
/**
|
|
129
186
|
* If `true`, animations are skipped.
|
|
130
187
|
* @default undefined
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
4
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
5
|
-
const _excluded = ["
|
|
5
|
+
const _excluded = ["renderer", "borderRadius"],
|
|
6
|
+
_excluded2 = ["skipAnimation", "onItemClick", "borderRadius"];
|
|
6
7
|
import * as React from 'react';
|
|
7
8
|
import PropTypes from 'prop-types';
|
|
8
9
|
import { styled } from '@mui/material/styles';
|
|
@@ -13,6 +14,7 @@ import { useIsZoomInteracting } from '@mui/x-charts-pro/hooks';
|
|
|
13
14
|
import { useUtilityClasses } from "./useUtilityClasses.mjs";
|
|
14
15
|
import { useRangeBarPlotData } from "./useRangeBarPlotData.mjs";
|
|
15
16
|
import { AnimatedRangeBarElement } from "./AnimatedRangeBarElement.mjs";
|
|
17
|
+
import { RangeBarWebGLPlot } from "./RangeBarWebGLPlot.mjs";
|
|
16
18
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
17
19
|
const RangeBarPlotRoot = styled('g', {
|
|
18
20
|
name: 'MuiRangeBarPlot',
|
|
@@ -33,12 +35,27 @@ const RangeBarPlotRoot = styled('g', {
|
|
|
33
35
|
* - [RangeBarPlot API](https://mui.com/x/api/charts/range-bar-plot/)
|
|
34
36
|
*/
|
|
35
37
|
function RangeBarPlot(props) {
|
|
38
|
+
const {
|
|
39
|
+
renderer,
|
|
40
|
+
borderRadius
|
|
41
|
+
} = props,
|
|
42
|
+
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
43
|
+
if (renderer === 'webgl') {
|
|
44
|
+
return /*#__PURE__*/_jsx(RangeBarWebGLPlot, {
|
|
45
|
+
borderRadius: borderRadius
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
return /*#__PURE__*/_jsx(RangeBarSvgPlot, _extends({
|
|
49
|
+
borderRadius: borderRadius
|
|
50
|
+
}, other));
|
|
51
|
+
}
|
|
52
|
+
function RangeBarSvgPlot(props) {
|
|
36
53
|
const {
|
|
37
54
|
skipAnimation: inSkipAnimation,
|
|
38
55
|
onItemClick,
|
|
39
56
|
borderRadius
|
|
40
57
|
} = props,
|
|
41
|
-
other = _objectWithoutPropertiesLoose(props,
|
|
58
|
+
other = _objectWithoutPropertiesLoose(props, _excluded2);
|
|
42
59
|
const isZoomInteracting = useIsZoomInteracting();
|
|
43
60
|
const skipAnimation = useSkipAnimation(isZoomInteracting || inSkipAnimation);
|
|
44
61
|
const {
|
|
@@ -103,6 +120,37 @@ function RangeBarPlot(props) {
|
|
|
103
120
|
})
|
|
104
121
|
});
|
|
105
122
|
}
|
|
123
|
+
process.env.NODE_ENV !== "production" ? RangeBarSvgPlot.propTypes = {
|
|
124
|
+
// ----------------------------- Warning --------------------------------
|
|
125
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
126
|
+
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
127
|
+
// ----------------------------------------------------------------------
|
|
128
|
+
/**
|
|
129
|
+
* Defines the border radius of the bar element.
|
|
130
|
+
*/
|
|
131
|
+
borderRadius: PropTypes.number,
|
|
132
|
+
/**
|
|
133
|
+
* Callback fired when a bar item is clicked.
|
|
134
|
+
* @param {React.MouseEvent<SVGElement, MouseEvent>} event The event source of the callback.
|
|
135
|
+
* @param {RangeBarItemIdentifier} barItemIdentifier The range bar item identifier.
|
|
136
|
+
*/
|
|
137
|
+
onItemClick: PropTypes.func,
|
|
138
|
+
/**
|
|
139
|
+
* If `true`, animations are skipped.
|
|
140
|
+
* @default undefined
|
|
141
|
+
*/
|
|
142
|
+
skipAnimation: PropTypes.bool,
|
|
143
|
+
/**
|
|
144
|
+
* The props used for each component slot.
|
|
145
|
+
* @default {}
|
|
146
|
+
*/
|
|
147
|
+
slotProps: PropTypes.object,
|
|
148
|
+
/**
|
|
149
|
+
* Overridable component slots.
|
|
150
|
+
* @default {}
|
|
151
|
+
*/
|
|
152
|
+
slots: PropTypes.object
|
|
153
|
+
} : void 0;
|
|
106
154
|
process.env.NODE_ENV !== "production" ? RangeBarPlot.propTypes = {
|
|
107
155
|
// ----------------------------- Warning --------------------------------
|
|
108
156
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
@@ -118,6 +166,15 @@ process.env.NODE_ENV !== "production" ? RangeBarPlot.propTypes = {
|
|
|
118
166
|
* @param {RangeBarItemIdentifier} barItemIdentifier The range bar item identifier.
|
|
119
167
|
*/
|
|
120
168
|
onItemClick: PropTypes.func,
|
|
169
|
+
/**
|
|
170
|
+
* The type of renderer to use for the range bar plot.
|
|
171
|
+
* - `svg-single`: Renders every bar in a `<rect />` element.
|
|
172
|
+
* - `webgl`: Renders bars using WebGL for better performance with very large datasets, at the cost of some limitations.
|
|
173
|
+
* Read more: https://mui.com/x/react-charts/bars/#performance
|
|
174
|
+
*
|
|
175
|
+
* @default 'svg-single'
|
|
176
|
+
*/
|
|
177
|
+
renderer: PropTypes.oneOf(['svg-single', 'webgl']),
|
|
121
178
|
/**
|
|
122
179
|
* If `true`, animations are skipped.
|
|
123
180
|
* @default undefined
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export interface RangeBarWebGLPlotProps {
|
|
3
|
+
borderRadius?: number;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* @ignore - Internal component used for rendering the range bar plot using WebGL. Not exported from the package.
|
|
7
|
+
*/
|
|
8
|
+
export declare function RangeBarWebGLPlot({
|
|
9
|
+
borderRadius
|
|
10
|
+
}: RangeBarWebGLPlotProps): React.JSX.Element | null;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export interface RangeBarWebGLPlotProps {
|
|
3
|
+
borderRadius?: number;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* @ignore - Internal component used for rendering the range bar plot using WebGL. Not exported from the package.
|
|
7
|
+
*/
|
|
8
|
+
export declare function RangeBarWebGLPlot({
|
|
9
|
+
borderRadius
|
|
10
|
+
}: RangeBarWebGLPlotProps): React.JSX.Element | null;
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
'use client';
|
|
3
|
+
|
|
4
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.RangeBarWebGLPlot = RangeBarWebGLPlot;
|
|
9
|
+
var React = _interopRequireWildcard(require("react"));
|
|
10
|
+
var _hooks = require("@mui/x-charts/hooks");
|
|
11
|
+
var _ChartsWebGLContext = require("../../ChartsWebGLLayer/ChartsWebGLContext");
|
|
12
|
+
var _BarWebGLProgram = require("../webgl/BarWebGLProgram");
|
|
13
|
+
var _useWebGLBarLikePlotData = require("../webgl/useWebGLBarLikePlotData");
|
|
14
|
+
var _useRangeBarPlotData = require("./useRangeBarPlotData");
|
|
15
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
16
|
+
/**
|
|
17
|
+
* @ignore - Internal component used for rendering the range bar plot using WebGL. Not exported from the package.
|
|
18
|
+
*/
|
|
19
|
+
function RangeBarWebGLPlot({
|
|
20
|
+
borderRadius = 0
|
|
21
|
+
}) {
|
|
22
|
+
const layer = (0, _ChartsWebGLContext.useWebGLLayer)();
|
|
23
|
+
const drawingArea = (0, _hooks.useDrawingArea)();
|
|
24
|
+
const {
|
|
25
|
+
xAxis: xAxes
|
|
26
|
+
} = (0, _hooks.useXAxes)();
|
|
27
|
+
const {
|
|
28
|
+
yAxis: yAxes
|
|
29
|
+
} = (0, _hooks.useYAxes)();
|
|
30
|
+
const completedData = (0, _useRangeBarPlotData.useRangeBarPlotData)(drawingArea, xAxes, yAxes);
|
|
31
|
+
if (!layer) {
|
|
32
|
+
return null;
|
|
33
|
+
}
|
|
34
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(RangeBarWebGLPlotImpl, {
|
|
35
|
+
gl: layer.gl,
|
|
36
|
+
registerDraw: layer.registerDraw,
|
|
37
|
+
requestRender: layer.requestRender,
|
|
38
|
+
borderRadius: borderRadius,
|
|
39
|
+
completedData: completedData
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
function RangeBarWebGLPlotImpl(props) {
|
|
43
|
+
const {
|
|
44
|
+
gl,
|
|
45
|
+
registerDraw,
|
|
46
|
+
requestRender,
|
|
47
|
+
borderRadius,
|
|
48
|
+
completedData
|
|
49
|
+
} = props;
|
|
50
|
+
const drawingArea = (0, _hooks.useDrawingArea)();
|
|
51
|
+
const plotData = (0, _useWebGLBarLikePlotData.useWebGLBarLikePlotData)(drawingArea, completedData, borderRadius, {
|
|
52
|
+
highlightType: 'rangeBar',
|
|
53
|
+
fullRoundedCorners: true
|
|
54
|
+
});
|
|
55
|
+
const [program, setProgram] = React.useState(null);
|
|
56
|
+
const drawRef = React.useRef(null);
|
|
57
|
+
React.useEffect(() => {
|
|
58
|
+
const prog = new _BarWebGLProgram.BarWebGLProgram(gl);
|
|
59
|
+
setProgram(prog);
|
|
60
|
+
return () => {
|
|
61
|
+
prog.dispose();
|
|
62
|
+
};
|
|
63
|
+
}, [gl]);
|
|
64
|
+
React.useEffect(() => {
|
|
65
|
+
drawRef.current = () => {
|
|
66
|
+
program?.render(plotData.count);
|
|
67
|
+
};
|
|
68
|
+
}, [program, plotData.count]);
|
|
69
|
+
React.useEffect(() => {
|
|
70
|
+
const unregister = registerDraw(drawRef);
|
|
71
|
+
return unregister;
|
|
72
|
+
}, [registerDraw]);
|
|
73
|
+
React.useEffect(() => {
|
|
74
|
+
program?.setResolution(drawingArea.width, drawingArea.height);
|
|
75
|
+
requestRender();
|
|
76
|
+
}, [drawingArea.width, drawingArea.height, program, requestRender]);
|
|
77
|
+
React.useEffect(() => {
|
|
78
|
+
program?.plot(plotData);
|
|
79
|
+
requestRender();
|
|
80
|
+
}, [program, plotData, requestRender]);
|
|
81
|
+
return null;
|
|
82
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { useDrawingArea, useXAxes, useYAxes } from '@mui/x-charts/hooks';
|
|
5
|
+
import { useWebGLLayer } from "../../ChartsWebGLLayer/ChartsWebGLContext.mjs";
|
|
6
|
+
import { BarWebGLProgram } from "../webgl/BarWebGLProgram.mjs";
|
|
7
|
+
import { useWebGLBarLikePlotData } from "../webgl/useWebGLBarLikePlotData.mjs";
|
|
8
|
+
import { useRangeBarPlotData } from "./useRangeBarPlotData.mjs";
|
|
9
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
|
+
/**
|
|
11
|
+
* @ignore - Internal component used for rendering the range bar plot using WebGL. Not exported from the package.
|
|
12
|
+
*/
|
|
13
|
+
export function RangeBarWebGLPlot({
|
|
14
|
+
borderRadius = 0
|
|
15
|
+
}) {
|
|
16
|
+
const layer = useWebGLLayer();
|
|
17
|
+
const drawingArea = useDrawingArea();
|
|
18
|
+
const {
|
|
19
|
+
xAxis: xAxes
|
|
20
|
+
} = useXAxes();
|
|
21
|
+
const {
|
|
22
|
+
yAxis: yAxes
|
|
23
|
+
} = useYAxes();
|
|
24
|
+
const completedData = useRangeBarPlotData(drawingArea, xAxes, yAxes);
|
|
25
|
+
if (!layer) {
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
28
|
+
return /*#__PURE__*/_jsx(RangeBarWebGLPlotImpl, {
|
|
29
|
+
gl: layer.gl,
|
|
30
|
+
registerDraw: layer.registerDraw,
|
|
31
|
+
requestRender: layer.requestRender,
|
|
32
|
+
borderRadius: borderRadius,
|
|
33
|
+
completedData: completedData
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
function RangeBarWebGLPlotImpl(props) {
|
|
37
|
+
const {
|
|
38
|
+
gl,
|
|
39
|
+
registerDraw,
|
|
40
|
+
requestRender,
|
|
41
|
+
borderRadius,
|
|
42
|
+
completedData
|
|
43
|
+
} = props;
|
|
44
|
+
const drawingArea = useDrawingArea();
|
|
45
|
+
const plotData = useWebGLBarLikePlotData(drawingArea, completedData, borderRadius, {
|
|
46
|
+
highlightType: 'rangeBar',
|
|
47
|
+
fullRoundedCorners: true
|
|
48
|
+
});
|
|
49
|
+
const [program, setProgram] = React.useState(null);
|
|
50
|
+
const drawRef = React.useRef(null);
|
|
51
|
+
React.useEffect(() => {
|
|
52
|
+
const prog = new BarWebGLProgram(gl);
|
|
53
|
+
setProgram(prog);
|
|
54
|
+
return () => {
|
|
55
|
+
prog.dispose();
|
|
56
|
+
};
|
|
57
|
+
}, [gl]);
|
|
58
|
+
React.useEffect(() => {
|
|
59
|
+
drawRef.current = () => {
|
|
60
|
+
program?.render(plotData.count);
|
|
61
|
+
};
|
|
62
|
+
}, [program, plotData.count]);
|
|
63
|
+
React.useEffect(() => {
|
|
64
|
+
const unregister = registerDraw(drawRef);
|
|
65
|
+
return unregister;
|
|
66
|
+
}, [registerDraw]);
|
|
67
|
+
React.useEffect(() => {
|
|
68
|
+
program?.setResolution(drawingArea.width, drawingArea.height);
|
|
69
|
+
requestRender();
|
|
70
|
+
}, [drawingArea.width, drawingArea.height, program, requestRender]);
|
|
71
|
+
React.useEffect(() => {
|
|
72
|
+
program?.plot(plotData);
|
|
73
|
+
requestRender();
|
|
74
|
+
}, [program, plotData, requestRender]);
|
|
75
|
+
return null;
|
|
76
|
+
}
|
|
@@ -41,6 +41,9 @@ const getValueExtremum = direction => params => {
|
|
|
41
41
|
isDefaultAxis
|
|
42
42
|
} = params;
|
|
43
43
|
return Object.keys(series).filter(seriesId => {
|
|
44
|
+
if (axis.domainSeries === 'visible' && series[seriesId].hidden) {
|
|
45
|
+
return false;
|
|
46
|
+
}
|
|
44
47
|
const axisId = direction === 'x' ? series[seriesId].xAxisId : series[seriesId].yAxisId;
|
|
45
48
|
return axisId === axis.id || isDefaultAxis && axisId === undefined;
|
|
46
49
|
}).reduce((acc, seriesId) => {
|
|
@@ -35,6 +35,9 @@ const getValueExtremum = direction => params => {
|
|
|
35
35
|
isDefaultAxis
|
|
36
36
|
} = params;
|
|
37
37
|
return Object.keys(series).filter(seriesId => {
|
|
38
|
+
if (axis.domainSeries === 'visible' && series[seriesId].hidden) {
|
|
39
|
+
return false;
|
|
40
|
+
}
|
|
38
41
|
const axisId = direction === 'x' ? series[seriesId].xAxisId : series[seriesId].yAxisId;
|
|
39
42
|
return axisId === axis.id || isDefaultAxis && axisId === undefined;
|
|
40
43
|
}).reduce((acc, seriesId) => {
|
|
@@ -8,6 +8,7 @@ exports.default = void 0;
|
|
|
8
8
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
9
|
var _formatErrorMessage2 = _interopRequireDefault(require("@mui/x-internals/formatErrorMessage"));
|
|
10
10
|
var _warning = require("@mui/x-internals/warning");
|
|
11
|
+
var _internals = require("@mui/x-charts/internals");
|
|
11
12
|
const rangeBarValueFormatter = v => v == null ? '' : `[${v[0]}, ${v[1]}]`;
|
|
12
13
|
const seriesProcessor = (params, dataset, isItemVisible) => {
|
|
13
14
|
const {
|
|
@@ -26,8 +27,7 @@ Either provide a data property to the series or use the dataset prop.` : (0, _fo
|
|
|
26
27
|
}
|
|
27
28
|
const missingKeys = ['start', 'end'].filter(key => typeof datasetKeys?.[key] !== 'string');
|
|
28
29
|
if (datasetKeys && missingKeys.length > 0) {
|
|
29
|
-
|
|
30
|
-
Properties ${missingKeys.map(key => `"${key}"`).join(', ')} are missing.` : (0, _formatErrorMessage2.default)(45, id, missingKeys.map(key => `"${key}"`).join(', ')));
|
|
30
|
+
(0, _internals.incompleteDatasetKeysError)('RangeBar', id, missingKeys);
|
|
31
31
|
}
|
|
32
32
|
let data;
|
|
33
33
|
if (seriesData.valueGetter) {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _formatErrorMessage from "@mui/x-internals/formatErrorMessage";
|
|
3
3
|
import { warnOnce } from '@mui/x-internals/warning';
|
|
4
|
+
import { incompleteDatasetKeysError } from '@mui/x-charts/internals';
|
|
4
5
|
const rangeBarValueFormatter = v => v == null ? '' : `[${v[0]}, ${v[1]}]`;
|
|
5
6
|
const seriesProcessor = (params, dataset, isItemVisible) => {
|
|
6
7
|
const {
|
|
@@ -19,8 +20,7 @@ Either provide a data property to the series or use the dataset prop.` : _format
|
|
|
19
20
|
}
|
|
20
21
|
const missingKeys = ['start', 'end'].filter(key => typeof datasetKeys?.[key] !== 'string');
|
|
21
22
|
if (datasetKeys && missingKeys.length > 0) {
|
|
22
|
-
|
|
23
|
-
Properties ${missingKeys.map(key => `"${key}"`).join(', ')} are missing.` : _formatErrorMessage(45, id, missingKeys.map(key => `"${key}"`).join(', ')));
|
|
23
|
+
incompleteDatasetKeysError('RangeBar', id, missingKeys);
|
|
24
24
|
}
|
|
25
25
|
let data;
|
|
26
26
|
if (seriesData.valueGetter) {
|
|
@@ -46,7 +46,8 @@ function useBarChartPremiumProps(props) {
|
|
|
46
46
|
onItemClick: props.onItemClick,
|
|
47
47
|
slots: props.slots,
|
|
48
48
|
slotProps: props.slotProps,
|
|
49
|
-
borderRadius: props.borderRadius
|
|
49
|
+
borderRadius: props.borderRadius,
|
|
50
|
+
renderer: renderer === 'webgl' ? 'webgl' : undefined
|
|
50
51
|
};
|
|
51
52
|
return (0, _extends2.default)({}, barChartProps, {
|
|
52
53
|
chartsContainerProps: premiumContainerProps,
|
|
@@ -39,7 +39,8 @@ export function useBarChartPremiumProps(props) {
|
|
|
39
39
|
onItemClick: props.onItemClick,
|
|
40
40
|
slots: props.slots,
|
|
41
41
|
slotProps: props.slotProps,
|
|
42
|
-
borderRadius: props.borderRadius
|
|
42
|
+
borderRadius: props.borderRadius,
|
|
43
|
+
renderer: renderer === 'webgl' ? 'webgl' : undefined
|
|
43
44
|
};
|
|
44
45
|
return _extends({}, barChartProps, {
|
|
45
46
|
chartsContainerProps: premiumContainerProps,
|