@mui/x-charts-premium 9.0.2 → 9.0.4
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/RangeBar/FocusedRangeBar.js +3 -0
- package/BarChartPremium/RangeBar/FocusedRangeBar.mjs +3 -0
- package/CHANGELOG.md +223 -0
- package/CandlestickChart/CandlestickPlot.js +27 -31
- package/CandlestickChart/CandlestickPlot.mjs +27 -31
- package/CandlestickChart/CandlestickWebGLProgram.js +0 -3
- package/CandlestickChart/CandlestickWebGLProgram.mjs +0 -3
- package/ChartsDataProviderPremium/ChartsDataProviderPremium.js +2 -2
- package/ChartsDataProviderPremium/ChartsDataProviderPremium.mjs +2 -2
- package/ChartsRadialDataProviderPremium/ChartsRadialDataProviderPremium.d.mts +35 -0
- package/ChartsRadialDataProviderPremium/ChartsRadialDataProviderPremium.d.ts +35 -0
- package/ChartsRadialDataProviderPremium/ChartsRadialDataProviderPremium.js +126 -0
- package/ChartsRadialDataProviderPremium/ChartsRadialDataProviderPremium.mjs +120 -0
- package/ChartsRadialDataProviderPremium/ChartsRadialDataProviderPremium.plugins.d.mts +5 -0
- package/ChartsRadialDataProviderPremium/ChartsRadialDataProviderPremium.plugins.d.ts +5 -0
- package/ChartsRadialDataProviderPremium/ChartsRadialDataProviderPremium.plugins.js +9 -0
- package/ChartsRadialDataProviderPremium/ChartsRadialDataProviderPremium.plugins.mjs +3 -0
- package/ChartsRadialDataProviderPremium/index.d.mts +3 -0
- package/ChartsRadialDataProviderPremium/index.d.ts +3 -0
- package/ChartsRadialDataProviderPremium/index.js +20 -0
- package/ChartsRadialDataProviderPremium/index.mjs +3 -0
- package/ChartsRadialDataProviderPremium/useChartsRadialDataProviderPremiumProps.d.mts +10 -0
- package/ChartsRadialDataProviderPremium/useChartsRadialDataProviderPremiumProps.d.ts +10 -0
- package/ChartsRadialDataProviderPremium/useChartsRadialDataProviderPremiumProps.js +25 -0
- package/ChartsRadialDataProviderPremium/useChartsRadialDataProviderPremiumProps.mjs +19 -0
- package/ChartsRadiusAxis/index.d.mts +1 -0
- package/ChartsRadiusAxis/index.d.ts +1 -0
- package/ChartsRadiusAxis/index.js +16 -0
- package/ChartsRadiusAxis/index.mjs +2 -0
- package/ChartsRotationAxis/index.d.mts +1 -0
- package/ChartsRotationAxis/index.d.ts +1 -0
- package/ChartsRotationAxis/index.js +16 -0
- package/ChartsRotationAxis/index.mjs +2 -0
- package/ChartsWebGLLayer/ChartsWebGLContext.d.mts +5 -0
- package/ChartsWebGLLayer/ChartsWebGLContext.d.ts +5 -0
- package/ChartsWebGLLayer/ChartsWebGLContext.js +31 -0
- package/ChartsWebGLLayer/ChartsWebGLContext.mjs +23 -0
- package/ChartsWebGLLayer/ChartsWebGLLayer.d.mts +0 -1
- package/ChartsWebGLLayer/ChartsWebGLLayer.d.ts +0 -1
- package/ChartsWebGLLayer/ChartsWebGLLayer.js +63 -12
- package/ChartsWebGLLayer/ChartsWebGLLayer.mjs +62 -10
- package/ChartsWebGLLayer/ChartsWebGLLayer.types.d.mts +26 -0
- package/ChartsWebGLLayer/ChartsWebGLLayer.types.d.ts +26 -0
- package/ChartsWebGLLayer/ChartsWebGLLayer.types.js +5 -0
- package/ChartsWebGLLayer/ChartsWebGLLayer.types.mjs +1 -0
- package/ChartsWebGLLayer/ChartsWebGLOrderContext.d.mts +6 -0
- package/ChartsWebGLLayer/ChartsWebGLOrderContext.d.ts +6 -0
- package/ChartsWebGLLayer/ChartsWebGLOrderContext.js +15 -0
- package/ChartsWebGLLayer/ChartsWebGLOrderContext.mjs +10 -0
- package/HeatmapPremium/HeatmapPlotPremium.js +2 -2
- package/HeatmapPremium/HeatmapPlotPremium.mjs +2 -2
- package/HeatmapPremium/webgl/HeatmapWebGLPlot.js +26 -33
- package/HeatmapPremium/webgl/HeatmapWebGLPlot.mjs +26 -33
- package/HeatmapPremium/webgl/shaders.d.mts +1 -1
- package/HeatmapPremium/webgl/shaders.d.ts +1 -1
- package/HeatmapPremium/webgl/shaders.js +1 -1
- package/HeatmapPremium/webgl/shaders.mjs +1 -1
- package/RadialBarChart/seriesConfig/axisTooltipGetter.d.mts +2 -0
- package/RadialBarChart/seriesConfig/axisTooltipGetter.d.ts +2 -0
- package/RadialBarChart/seriesConfig/axisTooltipGetter.js +13 -0
- package/RadialBarChart/seriesConfig/axisTooltipGetter.mjs +6 -0
- package/RadialBarChart/seriesConfig/descriptionGetter.d.mts +3 -0
- package/RadialBarChart/seriesConfig/descriptionGetter.d.ts +3 -0
- package/RadialBarChart/seriesConfig/descriptionGetter.js +34 -0
- package/RadialBarChart/seriesConfig/descriptionGetter.mjs +28 -0
- package/RadialBarChart/seriesConfig/extremums.d.mts +3 -0
- package/RadialBarChart/seriesConfig/extremums.d.ts +3 -0
- package/RadialBarChart/seriesConfig/extremums.js +44 -0
- package/RadialBarChart/seriesConfig/extremums.mjs +36 -0
- package/RadialBarChart/seriesConfig/getColor.d.mts +3 -0
- package/RadialBarChart/seriesConfig/getColor.d.ts +3 -0
- package/RadialBarChart/seriesConfig/getColor.js +61 -0
- package/RadialBarChart/seriesConfig/getColor.mjs +55 -0
- package/RadialBarChart/seriesConfig/getSeriesWithDefaultValues.d.mts +3 -0
- package/RadialBarChart/seriesConfig/getSeriesWithDefaultValues.d.ts +3 -0
- package/RadialBarChart/seriesConfig/getSeriesWithDefaultValues.js +16 -0
- package/RadialBarChart/seriesConfig/getSeriesWithDefaultValues.mjs +9 -0
- package/RadialBarChart/seriesConfig/index.d.mts +2 -0
- package/RadialBarChart/seriesConfig/index.d.ts +2 -0
- package/RadialBarChart/seriesConfig/index.js +37 -0
- package/RadialBarChart/seriesConfig/index.mjs +30 -0
- package/RadialBarChart/seriesConfig/keyboardFocusHandler.d.mts +3 -0
- package/RadialBarChart/seriesConfig/keyboardFocusHandler.d.ts +3 -0
- package/RadialBarChart/seriesConfig/keyboardFocusHandler.js +9 -0
- package/RadialBarChart/seriesConfig/keyboardFocusHandler.mjs +3 -0
- package/RadialBarChart/seriesConfig/legend.d.mts +3 -0
- package/RadialBarChart/seriesConfig/legend.d.ts +3 -0
- package/RadialBarChart/seriesConfig/legend.js +9 -0
- package/RadialBarChart/seriesConfig/legend.mjs +3 -0
- package/RadialBarChart/seriesConfig/seriesProcessor.d.mts +3 -0
- package/RadialBarChart/seriesConfig/seriesProcessor.d.ts +3 -0
- package/RadialBarChart/seriesConfig/seriesProcessor.js +137 -0
- package/RadialBarChart/seriesConfig/seriesProcessor.mjs +130 -0
- package/RadialBarChart/seriesConfig/tooltip.d.mts +3 -0
- package/RadialBarChart/seriesConfig/tooltip.d.ts +3 -0
- package/RadialBarChart/seriesConfig/tooltip.js +34 -0
- package/RadialBarChart/seriesConfig/tooltip.mjs +28 -0
- package/RadialBarChart/seriesConfig/tooltipPosition.d.mts +3 -0
- package/RadialBarChart/seriesConfig/tooltipPosition.d.ts +3 -0
- package/RadialBarChart/seriesConfig/tooltipPosition.js +11 -0
- package/RadialBarChart/seriesConfig/tooltipPosition.mjs +5 -0
- package/RadialLineChart/RadialArea.d.mts +12 -0
- package/RadialLineChart/RadialArea.d.ts +12 -0
- package/RadialLineChart/RadialArea.js +33 -0
- package/RadialLineChart/RadialArea.mjs +26 -0
- package/RadialLineChart/RadialAreaPlot.d.mts +5 -0
- package/RadialLineChart/RadialAreaPlot.d.ts +5 -0
- package/RadialLineChart/RadialAreaPlot.js +51 -0
- package/RadialLineChart/RadialAreaPlot.mjs +45 -0
- package/RadialLineChart/RadialLine.d.mts +12 -0
- package/RadialLineChart/RadialLine.d.ts +12 -0
- package/RadialLineChart/RadialLine.js +33 -0
- package/RadialLineChart/RadialLine.mjs +26 -0
- package/RadialLineChart/RadialLineChart.d.mts +62 -0
- package/RadialLineChart/RadialLineChart.d.ts +62 -0
- package/RadialLineChart/RadialLineChart.js +967 -0
- package/RadialLineChart/RadialLineChart.mjs +960 -0
- package/RadialLineChart/RadialLineChart.plugins.d.mts +4 -0
- package/RadialLineChart/RadialLineChart.plugins.d.ts +4 -0
- package/RadialLineChart/RadialLineChart.plugins.js +9 -0
- package/RadialLineChart/RadialLineChart.plugins.mjs +3 -0
- package/RadialLineChart/RadialLinePlot.d.mts +5 -0
- package/RadialLineChart/RadialLinePlot.d.ts +5 -0
- package/RadialLineChart/RadialLinePlot.js +50 -0
- package/RadialLineChart/RadialLinePlot.mjs +44 -0
- package/RadialLineChart/RadialMarkPlot.d.mts +5 -0
- package/RadialLineChart/RadialMarkPlot.d.ts +5 -0
- package/RadialLineChart/RadialMarkPlot.js +62 -0
- package/RadialLineChart/RadialMarkPlot.mjs +56 -0
- package/RadialLineChart/index.d.mts +4 -0
- package/RadialLineChart/index.d.ts +4 -0
- package/RadialLineChart/index.js +49 -0
- package/RadialLineChart/index.mjs +4 -0
- package/RadialLineChart/radialLineClasses.d.mts +25 -0
- package/RadialLineChart/radialLineClasses.d.ts +25 -0
- package/RadialLineChart/radialLineClasses.js +30 -0
- package/RadialLineChart/radialLineClasses.mjs +21 -0
- package/RadialLineChart/seriesConfig/axisTooltipGetter.d.mts +2 -0
- package/RadialLineChart/seriesConfig/axisTooltipGetter.d.ts +2 -0
- package/RadialLineChart/seriesConfig/axisTooltipGetter.js +13 -0
- package/RadialLineChart/seriesConfig/axisTooltipGetter.mjs +6 -0
- package/RadialLineChart/seriesConfig/descriptionGetter.d.mts +3 -0
- package/RadialLineChart/seriesConfig/descriptionGetter.d.ts +3 -0
- package/RadialLineChart/seriesConfig/descriptionGetter.js +39 -0
- package/RadialLineChart/seriesConfig/descriptionGetter.mjs +33 -0
- package/RadialLineChart/seriesConfig/extremums.d.mts +3 -0
- package/RadialLineChart/seriesConfig/extremums.d.ts +3 -0
- package/RadialLineChart/seriesConfig/extremums.js +48 -0
- package/RadialLineChart/seriesConfig/extremums.mjs +40 -0
- package/RadialLineChart/seriesConfig/getColor.d.mts +3 -0
- package/RadialLineChart/seriesConfig/getColor.d.ts +3 -0
- package/RadialLineChart/seriesConfig/getColor.js +61 -0
- package/RadialLineChart/seriesConfig/getColor.mjs +55 -0
- package/RadialLineChart/seriesConfig/getSeriesWithDefaultValues.d.mts +3 -0
- package/RadialLineChart/seriesConfig/getSeriesWithDefaultValues.d.ts +3 -0
- package/RadialLineChart/seriesConfig/getSeriesWithDefaultValues.js +13 -0
- package/RadialLineChart/seriesConfig/getSeriesWithDefaultValues.mjs +6 -0
- package/RadialLineChart/seriesConfig/index.d.mts +2 -0
- package/RadialLineChart/seriesConfig/index.d.ts +2 -0
- package/RadialLineChart/seriesConfig/index.js +37 -0
- package/RadialLineChart/seriesConfig/index.mjs +30 -0
- package/RadialLineChart/seriesConfig/keyboardFocusHandler.d.mts +3 -0
- package/RadialLineChart/seriesConfig/keyboardFocusHandler.d.ts +3 -0
- package/RadialLineChart/seriesConfig/keyboardFocusHandler.js +9 -0
- package/RadialLineChart/seriesConfig/keyboardFocusHandler.mjs +3 -0
- package/RadialLineChart/seriesConfig/legend.d.mts +3 -0
- package/RadialLineChart/seriesConfig/legend.d.ts +3 -0
- package/RadialLineChart/seriesConfig/legend.js +29 -0
- package/RadialLineChart/seriesConfig/legend.mjs +23 -0
- package/RadialLineChart/seriesConfig/seriesProcessor.d.mts +3 -0
- package/RadialLineChart/seriesConfig/seriesProcessor.d.ts +3 -0
- package/RadialLineChart/seriesConfig/seriesProcessor.js +142 -0
- package/RadialLineChart/seriesConfig/seriesProcessor.mjs +135 -0
- package/RadialLineChart/seriesConfig/tooltip.d.mts +3 -0
- package/RadialLineChart/seriesConfig/tooltip.d.ts +3 -0
- package/RadialLineChart/seriesConfig/tooltip.js +32 -0
- package/RadialLineChart/seriesConfig/tooltip.mjs +26 -0
- package/RadialLineChart/seriesConfig/tooltipPosition.d.mts +3 -0
- package/RadialLineChart/seriesConfig/tooltipPosition.d.ts +3 -0
- package/RadialLineChart/seriesConfig/tooltipPosition.js +11 -0
- package/RadialLineChart/seriesConfig/tooltipPosition.mjs +5 -0
- package/RadialLineChart/useRadialLineChartProps.d.mts +28 -0
- package/RadialLineChart/useRadialLineChartProps.d.ts +28 -0
- package/RadialLineChart/useRadialLineChartProps.js +99 -0
- package/RadialLineChart/useRadialLineChartProps.mjs +92 -0
- package/RadialLineChart/useRadialLinePlotData.d.mts +21 -0
- package/RadialLineChart/useRadialLinePlotData.d.ts +21 -0
- package/RadialLineChart/useRadialLinePlotData.js +82 -0
- package/RadialLineChart/useRadialLinePlotData.mjs +75 -0
- package/hooks/useRadialLineSeries.d.mts +34 -0
- package/hooks/useRadialLineSeries.d.ts +34 -0
- package/hooks/useRadialLineSeries.js +45 -0
- package/hooks/useRadialLineSeries.mjs +40 -0
- package/index.d.mts +7 -1
- package/index.d.ts +7 -1
- package/index.js +69 -1
- package/index.mjs +8 -2
- package/models/seriesType/index.d.mts +3 -1
- package/models/seriesType/index.d.ts +3 -1
- package/models/seriesType/index.js +22 -0
- package/models/seriesType/index.mjs +3 -1
- package/models/seriesType/radialBar.d.mts +23 -0
- package/models/seriesType/radialBar.d.ts +23 -0
- package/models/seriesType/radialBar.js +5 -0
- package/models/seriesType/radialBar.mjs +1 -0
- package/models/seriesType/radialLine.d.mts +26 -0
- package/models/seriesType/radialLine.d.ts +26 -0
- package/models/seriesType/radialLine.js +5 -0
- package/models/seriesType/radialLine.mjs +1 -0
- package/package.json +62 -6
- package/typeOverloads/modules.d.mts +48 -2
- package/typeOverloads/modules.d.ts +48 -2
- package/utils/webgl/useWebGLResizeObserver.d.mts +3 -2
- package/utils/webgl/useWebGLResizeObserver.d.ts +3 -2
- package/utils/webgl/useWebGLResizeObserver.js +3 -4
- package/utils/webgl/useWebGLResizeObserver.mjs +3 -4
- package/HeatmapPremium/webgl/HeatmapWebGLRenderer.d.mts +0 -4
- package/HeatmapPremium/webgl/HeatmapWebGLRenderer.d.ts +0 -4
- package/HeatmapPremium/webgl/HeatmapWebGLRenderer.js +0 -21
- package/HeatmapPremium/webgl/HeatmapWebGLRenderer.mjs +0 -15
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
'use client';
|
|
3
|
+
|
|
4
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
5
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
6
|
+
Object.defineProperty(exports, "__esModule", {
|
|
7
|
+
value: true
|
|
8
|
+
});
|
|
9
|
+
exports.ChartsRadialDataProviderPremium = ChartsRadialDataProviderPremium;
|
|
10
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
|
+
var React = _interopRequireWildcard(require("react"));
|
|
12
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
|
+
var _internals = require("@mui/x-charts/internals");
|
|
14
|
+
var _ChartsLocalizationProvider = require("@mui/x-charts/ChartsLocalizationProvider");
|
|
15
|
+
var _internals2 = require("@mui/x-charts-pro/internals");
|
|
16
|
+
var _internals3 = require("@mui/x-license/internals");
|
|
17
|
+
var _useChartsRadialDataProviderPremiumProps = require("./useChartsRadialDataProviderPremiumProps");
|
|
18
|
+
var _ChartsRadialDataProviderPremium = require("./ChartsRadialDataProviderPremium.plugins");
|
|
19
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
20
|
+
const packageInfo = {
|
|
21
|
+
releaseDate: "MTc3NzMzNDQwMDAwMA==",
|
|
22
|
+
version: "9.0.4",
|
|
23
|
+
name: 'x-charts-premium'
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Orchestrates the data providers for radial chart components and hooks.
|
|
27
|
+
*
|
|
28
|
+
* Similar to `ChartsDataProviderPremium`, but uses the radial axis plugin instead of the cartesian one,
|
|
29
|
+
* and only supports polar series types.
|
|
30
|
+
*
|
|
31
|
+
* Demos:
|
|
32
|
+
*
|
|
33
|
+
* - [Composition](https://mui.com/x/react-charts/composition/)
|
|
34
|
+
*
|
|
35
|
+
* API:
|
|
36
|
+
*
|
|
37
|
+
* - [ChartsRadialDataProviderPremium API](https://mui.com/x/api/charts/charts-radial-data-provider-premium/)
|
|
38
|
+
*/
|
|
39
|
+
function ChartsRadialDataProviderPremium(props) {
|
|
40
|
+
const {
|
|
41
|
+
children,
|
|
42
|
+
localeText,
|
|
43
|
+
chartProviderProps,
|
|
44
|
+
slots,
|
|
45
|
+
slotProps
|
|
46
|
+
} = (0, _useChartsRadialDataProviderPremiumProps.useChartsRadialDataProviderPremiumProps)((0, _extends2.default)({}, props, {
|
|
47
|
+
plugins: props.plugins ?? _ChartsRadialDataProviderPremium.RADIAL_PREMIUM_PLUGINS
|
|
48
|
+
}));
|
|
49
|
+
(0, _internals3.useLicenseVerifier)(packageInfo);
|
|
50
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_internals.ChartsProvider, (0, _extends2.default)({}, chartProviderProps, {
|
|
51
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsLocalizationProvider.ChartsLocalizationProvider, {
|
|
52
|
+
localeText: localeText,
|
|
53
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_internals.ChartsSlotsProvider, {
|
|
54
|
+
slots: slots,
|
|
55
|
+
slotProps: slotProps,
|
|
56
|
+
defaultSlots: _internals2.defaultSlotsMaterial,
|
|
57
|
+
children: children
|
|
58
|
+
})
|
|
59
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_internals2.ChartsWatermark, {
|
|
60
|
+
packageInfo: packageInfo
|
|
61
|
+
})]
|
|
62
|
+
}));
|
|
63
|
+
}
|
|
64
|
+
process.env.NODE_ENV !== "production" ? ChartsRadialDataProviderPremium.propTypes = {
|
|
65
|
+
// ----------------------------- Warning --------------------------------
|
|
66
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
67
|
+
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
68
|
+
// ----------------------------------------------------------------------
|
|
69
|
+
apiRef: _propTypes.default.shape({
|
|
70
|
+
current: _propTypes.default.any
|
|
71
|
+
}),
|
|
72
|
+
/**
|
|
73
|
+
* Color palette used to colorize multiple series.
|
|
74
|
+
* @default rainbowSurgePalette
|
|
75
|
+
*/
|
|
76
|
+
colors: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.string), _propTypes.default.func]),
|
|
77
|
+
/**
|
|
78
|
+
* The height of the chart in px. If not defined, it takes the height of the parent element.
|
|
79
|
+
*/
|
|
80
|
+
height: _propTypes.default.number,
|
|
81
|
+
/**
|
|
82
|
+
* This prop is used to help implement the accessibility logic.
|
|
83
|
+
* If you don't provide this prop. It falls back to a randomly generated id.
|
|
84
|
+
*/
|
|
85
|
+
id: _propTypes.default.string,
|
|
86
|
+
/**
|
|
87
|
+
* Localized text for chart components.
|
|
88
|
+
*/
|
|
89
|
+
localeText: _propTypes.default.object,
|
|
90
|
+
/**
|
|
91
|
+
* The margin between the SVG and the drawing area.
|
|
92
|
+
* It's used for leaving some space for extra information such as the x- and y-axis or legend.
|
|
93
|
+
*
|
|
94
|
+
* Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`.
|
|
95
|
+
*/
|
|
96
|
+
margin: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.shape({
|
|
97
|
+
bottom: _propTypes.default.number,
|
|
98
|
+
left: _propTypes.default.number,
|
|
99
|
+
right: _propTypes.default.number,
|
|
100
|
+
top: _propTypes.default.number
|
|
101
|
+
})]),
|
|
102
|
+
/**
|
|
103
|
+
* The array of series to display.
|
|
104
|
+
* Each type of series has its own specificity.
|
|
105
|
+
* Please refer to the appropriate docs page to learn more about it.
|
|
106
|
+
*/
|
|
107
|
+
series: _propTypes.default.arrayOf(_propTypes.default.object),
|
|
108
|
+
/**
|
|
109
|
+
* If `true`, animations are skipped.
|
|
110
|
+
* If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting.
|
|
111
|
+
*/
|
|
112
|
+
skipAnimation: _propTypes.default.bool,
|
|
113
|
+
/**
|
|
114
|
+
* The props for the slots.
|
|
115
|
+
*/
|
|
116
|
+
slotProps: _propTypes.default.object,
|
|
117
|
+
/**
|
|
118
|
+
* Slots to customize charts' components.
|
|
119
|
+
*/
|
|
120
|
+
slots: _propTypes.default.object,
|
|
121
|
+
theme: _propTypes.default.oneOf(['dark', 'light']),
|
|
122
|
+
/**
|
|
123
|
+
* The width of the chart in px. If not defined, it takes the width of the parent element.
|
|
124
|
+
*/
|
|
125
|
+
width: _propTypes.default.number
|
|
126
|
+
} : void 0;
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import PropTypes from 'prop-types';
|
|
6
|
+
import { ChartsProvider, ChartsSlotsProvider } from '@mui/x-charts/internals';
|
|
7
|
+
import { ChartsLocalizationProvider } from '@mui/x-charts/ChartsLocalizationProvider';
|
|
8
|
+
import { ChartsWatermark, defaultSlotsMaterial } from '@mui/x-charts-pro/internals';
|
|
9
|
+
import { useLicenseVerifier } from '@mui/x-license/internals';
|
|
10
|
+
import { useChartsRadialDataProviderPremiumProps } from "./useChartsRadialDataProviderPremiumProps.mjs";
|
|
11
|
+
import { RADIAL_PREMIUM_PLUGINS } from "./ChartsRadialDataProviderPremium.plugins.mjs";
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
const packageInfo = {
|
|
14
|
+
releaseDate: "MTc3NzMzNDQwMDAwMA==",
|
|
15
|
+
version: "9.0.4",
|
|
16
|
+
name: 'x-charts-premium'
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Orchestrates the data providers for radial chart components and hooks.
|
|
20
|
+
*
|
|
21
|
+
* Similar to `ChartsDataProviderPremium`, but uses the radial axis plugin instead of the cartesian one,
|
|
22
|
+
* and only supports polar series types.
|
|
23
|
+
*
|
|
24
|
+
* Demos:
|
|
25
|
+
*
|
|
26
|
+
* - [Composition](https://mui.com/x/react-charts/composition/)
|
|
27
|
+
*
|
|
28
|
+
* API:
|
|
29
|
+
*
|
|
30
|
+
* - [ChartsRadialDataProviderPremium API](https://mui.com/x/api/charts/charts-radial-data-provider-premium/)
|
|
31
|
+
*/
|
|
32
|
+
function ChartsRadialDataProviderPremium(props) {
|
|
33
|
+
const {
|
|
34
|
+
children,
|
|
35
|
+
localeText,
|
|
36
|
+
chartProviderProps,
|
|
37
|
+
slots,
|
|
38
|
+
slotProps
|
|
39
|
+
} = useChartsRadialDataProviderPremiumProps(_extends({}, props, {
|
|
40
|
+
plugins: props.plugins ?? RADIAL_PREMIUM_PLUGINS
|
|
41
|
+
}));
|
|
42
|
+
useLicenseVerifier(packageInfo);
|
|
43
|
+
return /*#__PURE__*/_jsxs(ChartsProvider, _extends({}, chartProviderProps, {
|
|
44
|
+
children: [/*#__PURE__*/_jsx(ChartsLocalizationProvider, {
|
|
45
|
+
localeText: localeText,
|
|
46
|
+
children: /*#__PURE__*/_jsx(ChartsSlotsProvider, {
|
|
47
|
+
slots: slots,
|
|
48
|
+
slotProps: slotProps,
|
|
49
|
+
defaultSlots: defaultSlotsMaterial,
|
|
50
|
+
children: children
|
|
51
|
+
})
|
|
52
|
+
}), /*#__PURE__*/_jsx(ChartsWatermark, {
|
|
53
|
+
packageInfo: packageInfo
|
|
54
|
+
})]
|
|
55
|
+
}));
|
|
56
|
+
}
|
|
57
|
+
process.env.NODE_ENV !== "production" ? ChartsRadialDataProviderPremium.propTypes = {
|
|
58
|
+
// ----------------------------- Warning --------------------------------
|
|
59
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
60
|
+
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
61
|
+
// ----------------------------------------------------------------------
|
|
62
|
+
apiRef: PropTypes.shape({
|
|
63
|
+
current: PropTypes.any
|
|
64
|
+
}),
|
|
65
|
+
/**
|
|
66
|
+
* Color palette used to colorize multiple series.
|
|
67
|
+
* @default rainbowSurgePalette
|
|
68
|
+
*/
|
|
69
|
+
colors: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.string), PropTypes.func]),
|
|
70
|
+
/**
|
|
71
|
+
* The height of the chart in px. If not defined, it takes the height of the parent element.
|
|
72
|
+
*/
|
|
73
|
+
height: PropTypes.number,
|
|
74
|
+
/**
|
|
75
|
+
* This prop is used to help implement the accessibility logic.
|
|
76
|
+
* If you don't provide this prop. It falls back to a randomly generated id.
|
|
77
|
+
*/
|
|
78
|
+
id: PropTypes.string,
|
|
79
|
+
/**
|
|
80
|
+
* Localized text for chart components.
|
|
81
|
+
*/
|
|
82
|
+
localeText: PropTypes.object,
|
|
83
|
+
/**
|
|
84
|
+
* The margin between the SVG and the drawing area.
|
|
85
|
+
* It's used for leaving some space for extra information such as the x- and y-axis or legend.
|
|
86
|
+
*
|
|
87
|
+
* Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`.
|
|
88
|
+
*/
|
|
89
|
+
margin: PropTypes.oneOfType([PropTypes.number, PropTypes.shape({
|
|
90
|
+
bottom: PropTypes.number,
|
|
91
|
+
left: PropTypes.number,
|
|
92
|
+
right: PropTypes.number,
|
|
93
|
+
top: PropTypes.number
|
|
94
|
+
})]),
|
|
95
|
+
/**
|
|
96
|
+
* The array of series to display.
|
|
97
|
+
* Each type of series has its own specificity.
|
|
98
|
+
* Please refer to the appropriate docs page to learn more about it.
|
|
99
|
+
*/
|
|
100
|
+
series: PropTypes.arrayOf(PropTypes.object),
|
|
101
|
+
/**
|
|
102
|
+
* If `true`, animations are skipped.
|
|
103
|
+
* If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting.
|
|
104
|
+
*/
|
|
105
|
+
skipAnimation: PropTypes.bool,
|
|
106
|
+
/**
|
|
107
|
+
* The props for the slots.
|
|
108
|
+
*/
|
|
109
|
+
slotProps: PropTypes.object,
|
|
110
|
+
/**
|
|
111
|
+
* Slots to customize charts' components.
|
|
112
|
+
*/
|
|
113
|
+
slots: PropTypes.object,
|
|
114
|
+
theme: PropTypes.oneOf(['dark', 'light']),
|
|
115
|
+
/**
|
|
116
|
+
* The width of the chart in px. If not defined, it takes the width of the parent element.
|
|
117
|
+
*/
|
|
118
|
+
width: PropTypes.number
|
|
119
|
+
} : void 0;
|
|
120
|
+
export { ChartsRadialDataProviderPremium };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type RadialPluginSignatures } from '@mui/x-charts/ChartsRadialDataProvider';
|
|
2
|
+
import { type PolarChartSeriesType } from '@mui/x-charts/internals';
|
|
3
|
+
import { type UseChartProExportSignature } from '@mui/x-charts-pro/plugins';
|
|
4
|
+
export declare const RADIAL_PREMIUM_PLUGINS: readonly [import("@mui/x-charts/internals").ChartPlugin<import("@mui/x-charts").UseChartTooltipSignature<any>>, import("@mui/x-charts/internals").ChartPlugin<import("@mui/x-charts").UseChartInteractionSignature>, import("@mui/x-charts/internals").ChartPlugin<import("@mui/x-charts").UseChartPolarAxisSignature<any>>, import("@mui/x-charts/internals").ChartPlugin<import("@mui/x-charts").UseChartHighlightSignature<any>>, import("@mui/x-charts/internals").ChartPlugin<import("@mui/x-charts/internals").UseChartKeyboardNavigationSignature>, import("@mui/x-charts/internals").ChartPlugin<import("@mui/x-charts").UseChartVisibilityManagerSignature<any>>, import("@mui/x-charts/internals").ChartPlugin<UseChartProExportSignature>];
|
|
5
|
+
export type RadialPremiumPluginSignatures<SeriesType extends PolarChartSeriesType = PolarChartSeriesType> = [...RadialPluginSignatures<SeriesType>, UseChartProExportSignature];
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type RadialPluginSignatures } from '@mui/x-charts/ChartsRadialDataProvider';
|
|
2
|
+
import { type PolarChartSeriesType } from '@mui/x-charts/internals';
|
|
3
|
+
import { type UseChartProExportSignature } from '@mui/x-charts-pro/plugins';
|
|
4
|
+
export declare const RADIAL_PREMIUM_PLUGINS: readonly [import("@mui/x-charts/internals").ChartPlugin<import("@mui/x-charts").UseChartTooltipSignature<any>>, import("@mui/x-charts/internals").ChartPlugin<import("@mui/x-charts").UseChartInteractionSignature>, import("@mui/x-charts/internals").ChartPlugin<import("@mui/x-charts").UseChartPolarAxisSignature<any>>, import("@mui/x-charts/internals").ChartPlugin<import("@mui/x-charts").UseChartHighlightSignature<any>>, import("@mui/x-charts/internals").ChartPlugin<import("@mui/x-charts/internals").UseChartKeyboardNavigationSignature>, import("@mui/x-charts/internals").ChartPlugin<import("@mui/x-charts").UseChartVisibilityManagerSignature<any>>, import("@mui/x-charts/internals").ChartPlugin<UseChartProExportSignature>];
|
|
5
|
+
export type RadialPremiumPluginSignatures<SeriesType extends PolarChartSeriesType = PolarChartSeriesType> = [...RadialPluginSignatures<SeriesType>, UseChartProExportSignature];
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.RADIAL_PREMIUM_PLUGINS = void 0;
|
|
7
|
+
var _ChartsRadialDataProvider = require("@mui/x-charts/ChartsRadialDataProvider");
|
|
8
|
+
var _plugins = require("@mui/x-charts-pro/plugins");
|
|
9
|
+
const RADIAL_PREMIUM_PLUGINS = exports.RADIAL_PREMIUM_PLUGINS = [..._ChartsRadialDataProvider.RADIAL_PLUGINS, _plugins.useChartProExport];
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import "../typeOverloads/index.mjs";
|
|
2
|
+
export { ChartsRadialDataProviderPremium, type ChartsRadialDataProviderPremiumProps, type ChartsRadialDataProviderPremiumSlots, type ChartsRadialDataProviderPremiumSlotProps } from "./ChartsRadialDataProviderPremium.mjs";
|
|
3
|
+
export { RADIAL_PREMIUM_PLUGINS, type RadialPremiumPluginSignatures } from "./ChartsRadialDataProviderPremium.plugins.mjs";
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import "../typeOverloads/index.js";
|
|
2
|
+
export { ChartsRadialDataProviderPremium, type ChartsRadialDataProviderPremiumProps, type ChartsRadialDataProviderPremiumSlots, type ChartsRadialDataProviderPremiumSlotProps } from "./ChartsRadialDataProviderPremium.js";
|
|
3
|
+
export { RADIAL_PREMIUM_PLUGINS, type RadialPremiumPluginSignatures } from "./ChartsRadialDataProviderPremium.plugins.js";
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "ChartsRadialDataProviderPremium", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _ChartsRadialDataProviderPremium.ChartsRadialDataProviderPremium;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "RADIAL_PREMIUM_PLUGINS", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return _ChartsRadialDataProviderPremium2.RADIAL_PREMIUM_PLUGINS;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
require("../typeOverloads");
|
|
19
|
+
var _ChartsRadialDataProviderPremium = require("./ChartsRadialDataProviderPremium");
|
|
20
|
+
var _ChartsRadialDataProviderPremium2 = require("./ChartsRadialDataProviderPremium.plugins");
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type ChartAnyPluginSignature, type PolarChartSeriesType } from '@mui/x-charts/internals';
|
|
2
|
+
import type { ChartsRadialDataProviderPremiumProps } from "./ChartsRadialDataProviderPremium.mjs";
|
|
3
|
+
import type { RadialPremiumPluginSignatures } from "./ChartsRadialDataProviderPremium.plugins.mjs";
|
|
4
|
+
export declare const useChartsRadialDataProviderPremiumProps: <SeriesType extends PolarChartSeriesType = PolarChartSeriesType, TSignatures extends readonly ChartAnyPluginSignature[] = RadialPremiumPluginSignatures<SeriesType>>(props: ChartsRadialDataProviderPremiumProps<SeriesType, TSignatures>) => {
|
|
5
|
+
children: import("react").ReactNode;
|
|
6
|
+
localeText: Partial<import("@mui/x-charts/locales").ChartsLocaleText> | undefined;
|
|
7
|
+
chartProviderProps: import("@mui/x-charts/internals").ChartsProviderProps<"radar" | "radialLine" | "radialBar", TSignatures>;
|
|
8
|
+
slots: Partial<import("@mui/x-charts").ChartsRadialDataProviderSlots> | undefined;
|
|
9
|
+
slotProps: Partial<import("@mui/x-charts").ChartsRadialDataProviderSlotProps> | undefined;
|
|
10
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type ChartAnyPluginSignature, type PolarChartSeriesType } from '@mui/x-charts/internals';
|
|
2
|
+
import type { ChartsRadialDataProviderPremiumProps } from "./ChartsRadialDataProviderPremium.js";
|
|
3
|
+
import type { RadialPremiumPluginSignatures } from "./ChartsRadialDataProviderPremium.plugins.js";
|
|
4
|
+
export declare const useChartsRadialDataProviderPremiumProps: <SeriesType extends PolarChartSeriesType = PolarChartSeriesType, TSignatures extends readonly ChartAnyPluginSignature[] = RadialPremiumPluginSignatures<SeriesType>>(props: ChartsRadialDataProviderPremiumProps<SeriesType, TSignatures>) => {
|
|
5
|
+
children: import("react").ReactNode;
|
|
6
|
+
localeText: Partial<import("@mui/x-charts/locales").ChartsLocaleText> | undefined;
|
|
7
|
+
chartProviderProps: import("@mui/x-charts/internals").ChartsProviderProps<"radar" | "radialLine" | "radialBar", TSignatures>;
|
|
8
|
+
slots: Partial<import("@mui/x-charts").ChartsRadialDataProviderSlots> | undefined;
|
|
9
|
+
slotProps: Partial<import("@mui/x-charts").ChartsRadialDataProviderSlotProps> | undefined;
|
|
10
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
'use client';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.useChartsRadialDataProviderPremiumProps = void 0;
|
|
8
|
+
var _internals = require("@mui/x-charts/internals");
|
|
9
|
+
const useChartsRadialDataProviderPremiumProps = props => {
|
|
10
|
+
const {
|
|
11
|
+
chartProviderProps,
|
|
12
|
+
localeText,
|
|
13
|
+
slots,
|
|
14
|
+
slotProps,
|
|
15
|
+
children
|
|
16
|
+
} = (0, _internals.useChartsRadialDataProviderProps)(props);
|
|
17
|
+
return {
|
|
18
|
+
children,
|
|
19
|
+
localeText,
|
|
20
|
+
chartProviderProps,
|
|
21
|
+
slots,
|
|
22
|
+
slotProps
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
exports.useChartsRadialDataProviderPremiumProps = useChartsRadialDataProviderPremiumProps;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { useChartsRadialDataProviderProps } from '@mui/x-charts/internals';
|
|
4
|
+
export const useChartsRadialDataProviderPremiumProps = props => {
|
|
5
|
+
const {
|
|
6
|
+
chartProviderProps,
|
|
7
|
+
localeText,
|
|
8
|
+
slots,
|
|
9
|
+
slotProps,
|
|
10
|
+
children
|
|
11
|
+
} = useChartsRadialDataProviderProps(props);
|
|
12
|
+
return {
|
|
13
|
+
children,
|
|
14
|
+
localeText,
|
|
15
|
+
chartProviderProps,
|
|
16
|
+
slots,
|
|
17
|
+
slotProps
|
|
18
|
+
};
|
|
19
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@mui/x-charts/ChartsRadiusAxis';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@mui/x-charts/ChartsRadiusAxis';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _ChartsRadiusAxis = require("@mui/x-charts/ChartsRadiusAxis");
|
|
7
|
+
Object.keys(_ChartsRadiusAxis).forEach(function (key) {
|
|
8
|
+
if (key === "default" || key === "__esModule") return;
|
|
9
|
+
if (key in exports && exports[key] === _ChartsRadiusAxis[key]) return;
|
|
10
|
+
Object.defineProperty(exports, key, {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function () {
|
|
13
|
+
return _ChartsRadiusAxis[key];
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@mui/x-charts/ChartsRotationAxis';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@mui/x-charts/ChartsRotationAxis';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _ChartsRotationAxis = require("@mui/x-charts/ChartsRotationAxis");
|
|
7
|
+
Object.keys(_ChartsRotationAxis).forEach(function (key) {
|
|
8
|
+
if (key === "default" || key === "__esModule") return;
|
|
9
|
+
if (key in exports && exports[key] === _ChartsRotationAxis[key]) return;
|
|
10
|
+
Object.defineProperty(exports, key, {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function () {
|
|
13
|
+
return _ChartsRotationAxis[key];
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
});
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { ChartsWebGLContextValue, UseWebGLLayerValue } from "./ChartsWebGLLayer.types.mjs";
|
|
3
|
+
export declare const ChartsWebGLContext: React.Context<ChartsWebGLContextValue | null>;
|
|
4
|
+
export declare function useWebGLContext(): WebGL2RenderingContext | null;
|
|
5
|
+
export declare function useWebGLLayer(): UseWebGLLayerValue | null;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { ChartsWebGLContextValue, UseWebGLLayerValue } from "./ChartsWebGLLayer.types.js";
|
|
3
|
+
export declare const ChartsWebGLContext: React.Context<ChartsWebGLContextValue | null>;
|
|
4
|
+
export declare function useWebGLContext(): WebGL2RenderingContext | null;
|
|
5
|
+
export declare function useWebGLLayer(): UseWebGLLayerValue | null;
|
|
@@ -0,0 +1,31 @@
|
|
|
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.ChartsWebGLContext = void 0;
|
|
9
|
+
exports.useWebGLContext = useWebGLContext;
|
|
10
|
+
exports.useWebGLLayer = useWebGLLayer;
|
|
11
|
+
var React = _interopRequireWildcard(require("react"));
|
|
12
|
+
var _ChartsWebGLOrderContext = require("./ChartsWebGLOrderContext");
|
|
13
|
+
const ChartsWebGLContext = exports.ChartsWebGLContext = /*#__PURE__*/React.createContext(null);
|
|
14
|
+
if (process.env.NODE_ENV !== "production") ChartsWebGLContext.displayName = "ChartsWebGLContext";
|
|
15
|
+
function useWebGLContext() {
|
|
16
|
+
return React.useContext(ChartsWebGLContext)?.gl ?? null;
|
|
17
|
+
}
|
|
18
|
+
function useWebGLLayer() {
|
|
19
|
+
const layer = React.useContext(ChartsWebGLContext);
|
|
20
|
+
const order = React.useContext(_ChartsWebGLOrderContext.ChartsWebGLOrderContext);
|
|
21
|
+
return React.useMemo(() => {
|
|
22
|
+
if (!layer) {
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
25
|
+
return {
|
|
26
|
+
gl: layer.gl,
|
|
27
|
+
registerDraw: drawRef => layer.registerDraw(drawRef, order),
|
|
28
|
+
requestRender: layer.requestRender
|
|
29
|
+
};
|
|
30
|
+
}, [layer, order]);
|
|
31
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { ChartsWebGLOrderContext } from "./ChartsWebGLOrderContext.mjs";
|
|
5
|
+
export const ChartsWebGLContext = /*#__PURE__*/React.createContext(null);
|
|
6
|
+
if (process.env.NODE_ENV !== "production") ChartsWebGLContext.displayName = "ChartsWebGLContext";
|
|
7
|
+
export function useWebGLContext() {
|
|
8
|
+
return React.useContext(ChartsWebGLContext)?.gl ?? null;
|
|
9
|
+
}
|
|
10
|
+
export function useWebGLLayer() {
|
|
11
|
+
const layer = React.useContext(ChartsWebGLContext);
|
|
12
|
+
const order = React.useContext(ChartsWebGLOrderContext);
|
|
13
|
+
return React.useMemo(() => {
|
|
14
|
+
if (!layer) {
|
|
15
|
+
return null;
|
|
16
|
+
}
|
|
17
|
+
return {
|
|
18
|
+
gl: layer.gl,
|
|
19
|
+
registerDraw: drawRef => layer.registerDraw(drawRef, order),
|
|
20
|
+
requestRender: layer.requestRender
|
|
21
|
+
};
|
|
22
|
+
}, [layer, order]);
|
|
23
|
+
}
|
|
@@ -1,3 +1,2 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
export declare function useWebGLContext(): WebGL2RenderingContext | null;
|
|
3
2
|
export declare const ChartsWebGLLayer: React.ForwardRefExoticComponent<Omit<React.PropsWithChildren<React.DetailedHTMLProps<React.CanvasHTMLAttributes<HTMLCanvasElement>, HTMLCanvasElement>>, "ref"> & React.RefAttributes<HTMLCanvasElement>>;
|
|
@@ -1,3 +1,2 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
export declare function useWebGLContext(): WebGL2RenderingContext | null;
|
|
3
2
|
export declare const ChartsWebGLLayer: React.ForwardRefExoticComponent<Omit<React.PropsWithChildren<React.DetailedHTMLProps<React.CanvasHTMLAttributes<HTMLCanvasElement>, HTMLCanvasElement>>, "ref"> & React.RefAttributes<HTMLCanvasElement>>;
|
|
@@ -7,32 +7,75 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
value: true
|
|
8
8
|
});
|
|
9
9
|
exports.ChartsWebGLLayer = void 0;
|
|
10
|
-
exports.useWebGLContext = useWebGLContext;
|
|
11
10
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
12
11
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
13
12
|
var React = _interopRequireWildcard(require("react"));
|
|
14
13
|
var _useForkRef = _interopRequireDefault(require("@mui/utils/useForkRef"));
|
|
15
14
|
var _internals = require("@mui/x-charts/internals");
|
|
16
15
|
var _hooks = require("@mui/x-charts/hooks");
|
|
16
|
+
var _useWebGLResizeObserver = require("../utils/webgl/useWebGLResizeObserver");
|
|
17
|
+
var _ChartsWebGLContext = require("./ChartsWebGLContext");
|
|
18
|
+
var _ChartsWebGLOrderContext = require("./ChartsWebGLOrderContext");
|
|
17
19
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
18
20
|
const _excluded = ["children"],
|
|
19
21
|
_excluded2 = ["children"];
|
|
20
|
-
const ChartsWebGLContext = /*#__PURE__*/React.createContext(null);
|
|
21
|
-
if (process.env.NODE_ENV !== "production") ChartsWebGLContext.displayName = "ChartsWebGLContext";
|
|
22
|
-
function useWebGLContext() {
|
|
23
|
-
return React.useContext(ChartsWebGLContext);
|
|
24
|
-
}
|
|
25
22
|
const ChartsWebGLLayer = exports.ChartsWebGLLayer = /*#__PURE__*/React.forwardRef(function WebGLProvider(_ref, ref) {
|
|
26
23
|
let {
|
|
27
24
|
children
|
|
28
25
|
} = _ref,
|
|
29
26
|
props = (0, _objectWithoutPropertiesLoose2.default)(_ref, _excluded);
|
|
30
27
|
const canvasRef = React.useRef(null);
|
|
31
|
-
const [
|
|
28
|
+
const [glContext, setGlContext] = React.useState(null);
|
|
32
29
|
const handleRef = (0, _useForkRef.default)(canvasRef, ref);
|
|
33
30
|
const chartRoot = (0, _hooks.useChartRootRef)().current;
|
|
34
31
|
const drawingArea = (0, _hooks.useDrawingArea)();
|
|
35
32
|
const [, rerender] = React.useReducer(s => s + 1, 0);
|
|
33
|
+
const drawEntriesRef = React.useRef([]);
|
|
34
|
+
const renderScheduledRef = React.useRef(false);
|
|
35
|
+
const renderAll = React.useCallback(() => {
|
|
36
|
+
if (!glContext) {
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
renderScheduledRef.current = false;
|
|
40
|
+
glContext.clearColor(0, 0, 0, 0.0);
|
|
41
|
+
glContext.clear(glContext.COLOR_BUFFER_BIT);
|
|
42
|
+
// Sort by order so z-order matches children's position in ChartsWebGLLayer,
|
|
43
|
+
// stable across remount.
|
|
44
|
+
const sorted = [...drawEntriesRef.current].sort((a, b) => a.order - b.order);
|
|
45
|
+
for (const {
|
|
46
|
+
drawRef
|
|
47
|
+
} of sorted) {
|
|
48
|
+
drawRef.current?.();
|
|
49
|
+
}
|
|
50
|
+
}, [glContext]);
|
|
51
|
+
const registerDraw = React.useCallback((drawRef, order) => {
|
|
52
|
+
const entry = {
|
|
53
|
+
drawRef,
|
|
54
|
+
order
|
|
55
|
+
};
|
|
56
|
+
drawEntriesRef.current.push(entry);
|
|
57
|
+
return () => {
|
|
58
|
+
const idx = drawEntriesRef.current.indexOf(entry);
|
|
59
|
+
if (idx >= 0) {
|
|
60
|
+
drawEntriesRef.current.splice(idx, 1);
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
}, []);
|
|
64
|
+
const requestRender = React.useCallback(() => {
|
|
65
|
+
renderScheduledRef.current = true;
|
|
66
|
+
// Trigger a re-render so the flush effect runs, even if only a child's state changed
|
|
67
|
+
rerender();
|
|
68
|
+
}, []);
|
|
69
|
+
|
|
70
|
+
// Centralized resize handling — render all plots on canvas resize
|
|
71
|
+
(0, _useWebGLResizeObserver.useWebGLResizeObserver)(glContext, renderAll);
|
|
72
|
+
|
|
73
|
+
// Flush scheduled renders after all children's effects have run
|
|
74
|
+
React.useEffect(() => {
|
|
75
|
+
if (renderScheduledRef.current) {
|
|
76
|
+
renderAll();
|
|
77
|
+
}
|
|
78
|
+
});
|
|
36
79
|
React.useEffect(() => {
|
|
37
80
|
/* The chart root isn't available on first render because the ref is only set after mounting the root component. */
|
|
38
81
|
if (!chartRoot) {
|
|
@@ -48,7 +91,7 @@ const ChartsWebGLLayer = exports.ChartsWebGLLayer = /*#__PURE__*/React.forwardRe
|
|
|
48
91
|
// Must prevent default otherwise the context won't be marked as restorable
|
|
49
92
|
// https://registry.khronos.org/webgl/extensions/WEBGL_lose_context/
|
|
50
93
|
event.preventDefault();
|
|
51
|
-
|
|
94
|
+
setGlContext(null);
|
|
52
95
|
};
|
|
53
96
|
const initializeContext = () => {
|
|
54
97
|
const ctx = canvas.getContext('webgl2', {
|
|
@@ -60,7 +103,7 @@ const ChartsWebGLLayer = exports.ChartsWebGLLayer = /*#__PURE__*/React.forwardRe
|
|
|
60
103
|
if (!ctx) {
|
|
61
104
|
return;
|
|
62
105
|
}
|
|
63
|
-
|
|
106
|
+
setGlContext(ctx);
|
|
64
107
|
};
|
|
65
108
|
canvas.addEventListener('webglcontextlost', handleContextLost);
|
|
66
109
|
canvas.addEventListener('webglcontextrestored', initializeContext);
|
|
@@ -70,11 +113,16 @@ const ChartsWebGLLayer = exports.ChartsWebGLLayer = /*#__PURE__*/React.forwardRe
|
|
|
70
113
|
canvas.removeEventListener('webglcontextrestored', initializeContext);
|
|
71
114
|
};
|
|
72
115
|
}, [chartRoot]);
|
|
116
|
+
const contextValue = React.useMemo(() => glContext ? {
|
|
117
|
+
gl: glContext,
|
|
118
|
+
registerDraw,
|
|
119
|
+
requestRender
|
|
120
|
+
} : null, [glContext, registerDraw, requestRender]);
|
|
73
121
|
if (!chartRoot) {
|
|
74
122
|
return null;
|
|
75
123
|
}
|
|
76
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(ChartsWebGLContext.Provider, {
|
|
77
|
-
value:
|
|
124
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_ChartsWebGLContext.ChartsWebGLContext.Provider, {
|
|
125
|
+
value: contextValue,
|
|
78
126
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(CanvasPositioner, {
|
|
79
127
|
"aria-hidden": "true",
|
|
80
128
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("canvas", (0, _extends2.default)({
|
|
@@ -88,7 +136,10 @@ const ChartsWebGLLayer = exports.ChartsWebGLLayer = /*#__PURE__*/React.forwardRe
|
|
|
88
136
|
height: drawingArea.height
|
|
89
137
|
}
|
|
90
138
|
}))
|
|
91
|
-
}), children
|
|
139
|
+
}), React.Children.map(children, (child, index) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsWebGLOrderContext.ChartsWebGLOrderContext.Provider, {
|
|
140
|
+
value: index,
|
|
141
|
+
children: child
|
|
142
|
+
}))]
|
|
92
143
|
});
|
|
93
144
|
});
|
|
94
145
|
if (process.env.NODE_ENV !== "production") ChartsWebGLLayer.displayName = "ChartsWebGLLayer";
|