@mui/x-charts-premium 9.0.1 → 9.0.3
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 +20 -1
- package/BarChartPremium/BarChartPremium.mjs +20 -1
- package/BarChartPremium/RangeBar/seriesConfig/getSeriesWithDefaultValues.d.mts +1 -0
- package/BarChartPremium/RangeBar/seriesConfig/getSeriesWithDefaultValues.d.ts +1 -0
- package/BarChartPremium/RangeBar/seriesConfig/seriesProcessor.js +16 -8
- package/BarChartPremium/RangeBar/seriesConfig/seriesProcessor.mjs +16 -8
- package/CHANGELOG.md +257 -0
- package/CandlestickChart/CandlestickChart.js +18 -0
- package/CandlestickChart/CandlestickChart.mjs +18 -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/CandlestickChart/seriesConfig/getSeriesWithDefaultValues.d.mts +1 -0
- package/CandlestickChart/seriesConfig/getSeriesWithDefaultValues.d.ts +1 -0
- package/CandlestickChart/seriesConfig/seriesProcessor.js +21 -13
- package/CandlestickChart/seriesConfig/seriesProcessor.mjs +21 -13
- package/ChartsDataProviderPremium/ChartsDataProviderPremium.js +2 -2
- package/ChartsDataProviderPremium/ChartsDataProviderPremium.mjs +2 -2
- package/ChartsRadialDataProvider/index.d.mts +1 -0
- package/ChartsRadialDataProvider/index.d.ts +1 -0
- package/ChartsRadialDataProvider/index.js +16 -0
- package/ChartsRadialDataProvider/index.mjs +2 -0
- 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/ChartsRadialGrid/index.d.mts +1 -0
- package/ChartsRadialGrid/index.d.ts +1 -0
- package/ChartsRadialGrid/index.js +16 -0
- package/ChartsRadialGrid/index.mjs +2 -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/HeatmapPremium.js +4 -1
- package/HeatmapPremium/HeatmapPremium.mjs +4 -1
- package/HeatmapPremium/webgl/HeatmapWebGLPlot.js +26 -33
- package/HeatmapPremium/webgl/HeatmapWebGLPlot.mjs +26 -33
- 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 +48 -0
- package/RadialLineChart/RadialMarkPlot.mjs +42 -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 +19 -0
- package/RadialLineChart/useRadialLinePlotData.d.ts +19 -0
- package/RadialLineChart/useRadialLinePlotData.js +79 -0
- package/RadialLineChart/useRadialLinePlotData.mjs +72 -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/ohlc.d.mts +7 -1
- package/models/seriesType/ohlc.d.ts +7 -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/models/seriesType/rangeBar.d.mts +7 -1
- package/models/seriesType/rangeBar.d.ts +7 -1
- package/package.json +90 -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,137 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = void 0;
|
|
8
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
|
+
var _formatErrorMessage2 = _interopRequireDefault(require("@mui/x-internals/formatErrorMessage"));
|
|
10
|
+
var _d3Shape = require("@mui/x-charts-vendor/d3-shape");
|
|
11
|
+
var _warning = require("@mui/x-internals/warning");
|
|
12
|
+
var _internals = require("@mui/x-charts/internals");
|
|
13
|
+
const radialBarValueFormatter = v => v == null ? '' : v.toLocaleString();
|
|
14
|
+
function seriesProcessor(params, dataset, isItemVisible) {
|
|
15
|
+
const {
|
|
16
|
+
seriesOrder,
|
|
17
|
+
series
|
|
18
|
+
} = params;
|
|
19
|
+
const stackingGroups = (0, _internals.getStackingGroups)(params);
|
|
20
|
+
|
|
21
|
+
// Create a data set with format adapted to d3
|
|
22
|
+
const d3Dataset = dataset ?? [];
|
|
23
|
+
seriesOrder.forEach(id => {
|
|
24
|
+
const data = series[id].data;
|
|
25
|
+
if (data !== undefined) {
|
|
26
|
+
data.forEach((value, dataIndex) => {
|
|
27
|
+
if (d3Dataset.length <= dataIndex) {
|
|
28
|
+
d3Dataset.push({
|
|
29
|
+
[id]: value
|
|
30
|
+
});
|
|
31
|
+
} else {
|
|
32
|
+
d3Dataset[dataIndex][id] = value;
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
} else if (series[id].valueGetter && dataset) {
|
|
36
|
+
// When valueGetter is used without dataKey, populate d3Dataset with the series id as key
|
|
37
|
+
dataset.forEach((entry, dataIndex) => {
|
|
38
|
+
const value = series[id].valueGetter(entry);
|
|
39
|
+
if (d3Dataset.length <= dataIndex) {
|
|
40
|
+
d3Dataset.push({
|
|
41
|
+
[id]: value
|
|
42
|
+
});
|
|
43
|
+
} else {
|
|
44
|
+
d3Dataset[dataIndex][id] = value;
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
} else if (dataset === undefined && process.env.NODE_ENV !== 'production') {
|
|
48
|
+
throw new Error(process.env.NODE_ENV !== "production" ? `MUI X Charts: Radial bar series with id="${id}" has no data. ` + 'The chart cannot render this series without data. ' + 'Provide a data property to the series or use the dataset prop.' : (0, _formatErrorMessage2.default)(269, id));
|
|
49
|
+
}
|
|
50
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
51
|
+
if (!data && dataset) {
|
|
52
|
+
const dataKey = series[id].dataKey;
|
|
53
|
+
if (!dataKey && !series[id].valueGetter) {
|
|
54
|
+
throw new Error(`MUI X Charts: Radial bar series with id="${id}" has no data, no dataKey, and no valueGetter. ` + 'When using the dataset prop, each series must have a dataKey or valueGetter to identify which dataset values to use. ' + 'Add a dataKey or valueGetter property to the series configuration.');
|
|
55
|
+
}
|
|
56
|
+
if (dataKey) {
|
|
57
|
+
dataset.forEach((entry, index) => {
|
|
58
|
+
const value = entry[dataKey];
|
|
59
|
+
if (value != null && typeof value !== 'number') {
|
|
60
|
+
(0, _warning.warnOnce)(`MUI X Charts: your dataset key "${dataKey}" is used for plotting radial bars, but the dataset contains the non-null non-numerical element "${value}" at index ${index}.
|
|
61
|
+
Radial bar plots only support numeric and null values.`);
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
const completedSeries = {};
|
|
69
|
+
stackingGroups.forEach(stackingGroup => {
|
|
70
|
+
const {
|
|
71
|
+
ids,
|
|
72
|
+
stackingOffset,
|
|
73
|
+
stackingOrder
|
|
74
|
+
} = stackingGroup;
|
|
75
|
+
const keys = ids.map(id => {
|
|
76
|
+
// Use dataKey if needed and available
|
|
77
|
+
const dataKey = series[id].dataKey;
|
|
78
|
+
return series[id].data === undefined && dataKey !== undefined ? dataKey : id;
|
|
79
|
+
});
|
|
80
|
+
const stackedData = (0, _d3Shape.stack)().keys(keys).value((d, key) => d[key] ?? 0) // defaultize null value to 0
|
|
81
|
+
.order(stackingOrder).offset(stackingOffset)(d3Dataset);
|
|
82
|
+
const idOrder = stackedData.map(s => s.index);
|
|
83
|
+
const fixedOrder = () => idOrder;
|
|
84
|
+
|
|
85
|
+
// Compute visible stacked data
|
|
86
|
+
const visibleStackedData = (0, _d3Shape.stack)().keys(keys).value((d, key) => {
|
|
87
|
+
const keyIndex = keys.indexOf(key);
|
|
88
|
+
const seriesId = ids[keyIndex];
|
|
89
|
+
if (!isItemVisible?.({
|
|
90
|
+
type: 'radialBar',
|
|
91
|
+
seriesId
|
|
92
|
+
})) {
|
|
93
|
+
// For hidden series, return 0 so they don't contribute to the stack
|
|
94
|
+
return 0;
|
|
95
|
+
}
|
|
96
|
+
return d[key] ?? 0;
|
|
97
|
+
}).order(fixedOrder).offset(stackingOffset)(d3Dataset);
|
|
98
|
+
ids.forEach((id, index) => {
|
|
99
|
+
const {
|
|
100
|
+
dataKey,
|
|
101
|
+
valueGetter
|
|
102
|
+
} = series[id];
|
|
103
|
+
let data;
|
|
104
|
+
if (valueGetter) {
|
|
105
|
+
data = dataset.map(d => valueGetter(d));
|
|
106
|
+
} else if (dataKey) {
|
|
107
|
+
data = dataset.map(d => {
|
|
108
|
+
const value = d[dataKey];
|
|
109
|
+
return typeof value === 'number' ? value : null;
|
|
110
|
+
});
|
|
111
|
+
} else {
|
|
112
|
+
data = series[id].data;
|
|
113
|
+
}
|
|
114
|
+
const hidden = !isItemVisible?.({
|
|
115
|
+
type: 'radialBar',
|
|
116
|
+
seriesId: id
|
|
117
|
+
});
|
|
118
|
+
completedSeries[id] = (0, _extends2.default)({
|
|
119
|
+
layout: 'vertical',
|
|
120
|
+
labelMarkType: 'square',
|
|
121
|
+
minBarSize: 0,
|
|
122
|
+
valueFormatter: series[id].valueFormatter ?? radialBarValueFormatter
|
|
123
|
+
}, series[id], {
|
|
124
|
+
data,
|
|
125
|
+
hidden,
|
|
126
|
+
stackedData: stackedData[index],
|
|
127
|
+
visibleStackedData: visibleStackedData[index]
|
|
128
|
+
});
|
|
129
|
+
});
|
|
130
|
+
});
|
|
131
|
+
return {
|
|
132
|
+
seriesOrder,
|
|
133
|
+
stackingGroups,
|
|
134
|
+
series: completedSeries
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
var _default = exports.default = seriesProcessor;
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import _formatErrorMessage from "@mui/x-internals/formatErrorMessage";
|
|
3
|
+
import { stack as d3Stack } from '@mui/x-charts-vendor/d3-shape';
|
|
4
|
+
import { warnOnce } from '@mui/x-internals/warning';
|
|
5
|
+
import { getStackingGroups } from '@mui/x-charts/internals';
|
|
6
|
+
const radialBarValueFormatter = v => v == null ? '' : v.toLocaleString();
|
|
7
|
+
function seriesProcessor(params, dataset, isItemVisible) {
|
|
8
|
+
const {
|
|
9
|
+
seriesOrder,
|
|
10
|
+
series
|
|
11
|
+
} = params;
|
|
12
|
+
const stackingGroups = getStackingGroups(params);
|
|
13
|
+
|
|
14
|
+
// Create a data set with format adapted to d3
|
|
15
|
+
const d3Dataset = dataset ?? [];
|
|
16
|
+
seriesOrder.forEach(id => {
|
|
17
|
+
const data = series[id].data;
|
|
18
|
+
if (data !== undefined) {
|
|
19
|
+
data.forEach((value, dataIndex) => {
|
|
20
|
+
if (d3Dataset.length <= dataIndex) {
|
|
21
|
+
d3Dataset.push({
|
|
22
|
+
[id]: value
|
|
23
|
+
});
|
|
24
|
+
} else {
|
|
25
|
+
d3Dataset[dataIndex][id] = value;
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
} else if (series[id].valueGetter && dataset) {
|
|
29
|
+
// When valueGetter is used without dataKey, populate d3Dataset with the series id as key
|
|
30
|
+
dataset.forEach((entry, dataIndex) => {
|
|
31
|
+
const value = series[id].valueGetter(entry);
|
|
32
|
+
if (d3Dataset.length <= dataIndex) {
|
|
33
|
+
d3Dataset.push({
|
|
34
|
+
[id]: value
|
|
35
|
+
});
|
|
36
|
+
} else {
|
|
37
|
+
d3Dataset[dataIndex][id] = value;
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
} else if (dataset === undefined && process.env.NODE_ENV !== 'production') {
|
|
41
|
+
throw new Error(process.env.NODE_ENV !== "production" ? `MUI X Charts: Radial bar series with id="${id}" has no data. ` + 'The chart cannot render this series without data. ' + 'Provide a data property to the series or use the dataset prop.' : _formatErrorMessage(269, id));
|
|
42
|
+
}
|
|
43
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
44
|
+
if (!data && dataset) {
|
|
45
|
+
const dataKey = series[id].dataKey;
|
|
46
|
+
if (!dataKey && !series[id].valueGetter) {
|
|
47
|
+
throw new Error(`MUI X Charts: Radial bar series with id="${id}" has no data, no dataKey, and no valueGetter. ` + 'When using the dataset prop, each series must have a dataKey or valueGetter to identify which dataset values to use. ' + 'Add a dataKey or valueGetter property to the series configuration.');
|
|
48
|
+
}
|
|
49
|
+
if (dataKey) {
|
|
50
|
+
dataset.forEach((entry, index) => {
|
|
51
|
+
const value = entry[dataKey];
|
|
52
|
+
if (value != null && typeof value !== 'number') {
|
|
53
|
+
warnOnce(`MUI X Charts: your dataset key "${dataKey}" is used for plotting radial bars, but the dataset contains the non-null non-numerical element "${value}" at index ${index}.
|
|
54
|
+
Radial bar plots only support numeric and null values.`);
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
const completedSeries = {};
|
|
62
|
+
stackingGroups.forEach(stackingGroup => {
|
|
63
|
+
const {
|
|
64
|
+
ids,
|
|
65
|
+
stackingOffset,
|
|
66
|
+
stackingOrder
|
|
67
|
+
} = stackingGroup;
|
|
68
|
+
const keys = ids.map(id => {
|
|
69
|
+
// Use dataKey if needed and available
|
|
70
|
+
const dataKey = series[id].dataKey;
|
|
71
|
+
return series[id].data === undefined && dataKey !== undefined ? dataKey : id;
|
|
72
|
+
});
|
|
73
|
+
const stackedData = d3Stack().keys(keys).value((d, key) => d[key] ?? 0) // defaultize null value to 0
|
|
74
|
+
.order(stackingOrder).offset(stackingOffset)(d3Dataset);
|
|
75
|
+
const idOrder = stackedData.map(s => s.index);
|
|
76
|
+
const fixedOrder = () => idOrder;
|
|
77
|
+
|
|
78
|
+
// Compute visible stacked data
|
|
79
|
+
const visibleStackedData = d3Stack().keys(keys).value((d, key) => {
|
|
80
|
+
const keyIndex = keys.indexOf(key);
|
|
81
|
+
const seriesId = ids[keyIndex];
|
|
82
|
+
if (!isItemVisible?.({
|
|
83
|
+
type: 'radialBar',
|
|
84
|
+
seriesId
|
|
85
|
+
})) {
|
|
86
|
+
// For hidden series, return 0 so they don't contribute to the stack
|
|
87
|
+
return 0;
|
|
88
|
+
}
|
|
89
|
+
return d[key] ?? 0;
|
|
90
|
+
}).order(fixedOrder).offset(stackingOffset)(d3Dataset);
|
|
91
|
+
ids.forEach((id, index) => {
|
|
92
|
+
const {
|
|
93
|
+
dataKey,
|
|
94
|
+
valueGetter
|
|
95
|
+
} = series[id];
|
|
96
|
+
let data;
|
|
97
|
+
if (valueGetter) {
|
|
98
|
+
data = dataset.map(d => valueGetter(d));
|
|
99
|
+
} else if (dataKey) {
|
|
100
|
+
data = dataset.map(d => {
|
|
101
|
+
const value = d[dataKey];
|
|
102
|
+
return typeof value === 'number' ? value : null;
|
|
103
|
+
});
|
|
104
|
+
} else {
|
|
105
|
+
data = series[id].data;
|
|
106
|
+
}
|
|
107
|
+
const hidden = !isItemVisible?.({
|
|
108
|
+
type: 'radialBar',
|
|
109
|
+
seriesId: id
|
|
110
|
+
});
|
|
111
|
+
completedSeries[id] = _extends({
|
|
112
|
+
layout: 'vertical',
|
|
113
|
+
labelMarkType: 'square',
|
|
114
|
+
minBarSize: 0,
|
|
115
|
+
valueFormatter: series[id].valueFormatter ?? radialBarValueFormatter
|
|
116
|
+
}, series[id], {
|
|
117
|
+
data,
|
|
118
|
+
hidden,
|
|
119
|
+
stackedData: stackedData[index],
|
|
120
|
+
visibleStackedData: visibleStackedData[index]
|
|
121
|
+
});
|
|
122
|
+
});
|
|
123
|
+
});
|
|
124
|
+
return {
|
|
125
|
+
seriesOrder,
|
|
126
|
+
stackingGroups,
|
|
127
|
+
series: completedSeries
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
export default seriesProcessor;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _internals = require("@mui/x-charts/internals");
|
|
8
|
+
const tooltipGetter = params => {
|
|
9
|
+
const {
|
|
10
|
+
series,
|
|
11
|
+
getColor,
|
|
12
|
+
identifier
|
|
13
|
+
} = params;
|
|
14
|
+
if (!identifier || identifier.dataIndex === undefined) {
|
|
15
|
+
return null;
|
|
16
|
+
}
|
|
17
|
+
const label = (0, _internals.getLabel)(series.label, 'tooltip');
|
|
18
|
+
const value = series.data[identifier.dataIndex];
|
|
19
|
+
if (value == null) {
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
22
|
+
const formattedValue = series.valueFormatter(value, {
|
|
23
|
+
dataIndex: identifier.dataIndex
|
|
24
|
+
});
|
|
25
|
+
return {
|
|
26
|
+
identifier,
|
|
27
|
+
color: getColor(identifier.dataIndex),
|
|
28
|
+
label,
|
|
29
|
+
value,
|
|
30
|
+
formattedValue,
|
|
31
|
+
markType: series.labelMarkType
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
var _default = exports.default = tooltipGetter;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { getLabel } from '@mui/x-charts/internals';
|
|
2
|
+
const tooltipGetter = params => {
|
|
3
|
+
const {
|
|
4
|
+
series,
|
|
5
|
+
getColor,
|
|
6
|
+
identifier
|
|
7
|
+
} = params;
|
|
8
|
+
if (!identifier || identifier.dataIndex === undefined) {
|
|
9
|
+
return null;
|
|
10
|
+
}
|
|
11
|
+
const label = getLabel(series.label, 'tooltip');
|
|
12
|
+
const value = series.data[identifier.dataIndex];
|
|
13
|
+
if (value == null) {
|
|
14
|
+
return null;
|
|
15
|
+
}
|
|
16
|
+
const formattedValue = series.valueFormatter(value, {
|
|
17
|
+
dataIndex: identifier.dataIndex
|
|
18
|
+
});
|
|
19
|
+
return {
|
|
20
|
+
identifier,
|
|
21
|
+
color: getColor(identifier.dataIndex),
|
|
22
|
+
label,
|
|
23
|
+
value,
|
|
24
|
+
formattedValue,
|
|
25
|
+
markType: series.labelMarkType
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
export default tooltipGetter;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
const tooltipItemPositionGetter = () => {
|
|
8
|
+
// Todo: to implement
|
|
9
|
+
return null;
|
|
10
|
+
};
|
|
11
|
+
var _default = exports.default = tooltipItemPositionGetter;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { CurveType, SeriesId } from '@mui/x-charts/models';
|
|
3
|
+
import { type RadialLinePoint } from "./useRadialLinePlotData.mjs";
|
|
4
|
+
export interface RadialAreaProps extends Omit<React.SVGProps<SVGPathElement>, 'ref' | 'points'> {
|
|
5
|
+
seriesId: SeriesId;
|
|
6
|
+
color: string;
|
|
7
|
+
hidden?: boolean;
|
|
8
|
+
curve?: CurveType;
|
|
9
|
+
points: RadialLinePoint[];
|
|
10
|
+
}
|
|
11
|
+
declare function RadialArea(props: RadialAreaProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export { RadialArea };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { CurveType, SeriesId } from '@mui/x-charts/models';
|
|
3
|
+
import { type RadialLinePoint } from "./useRadialLinePlotData.js";
|
|
4
|
+
export interface RadialAreaProps extends Omit<React.SVGProps<SVGPathElement>, 'ref' | 'points'> {
|
|
5
|
+
seriesId: SeriesId;
|
|
6
|
+
color: string;
|
|
7
|
+
hidden?: boolean;
|
|
8
|
+
curve?: CurveType;
|
|
9
|
+
points: RadialLinePoint[];
|
|
10
|
+
}
|
|
11
|
+
declare function RadialArea(props: RadialAreaProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export { RadialArea };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.RadialArea = RadialArea;
|
|
9
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
|
+
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
11
|
+
var React = _interopRequireWildcard(require("react"));
|
|
12
|
+
var _d3Shape = require("@mui/x-charts-vendor/d3-shape");
|
|
13
|
+
var _internals = require("@mui/x-charts/internals");
|
|
14
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
|
+
const _excluded = ["seriesId", "color", "hidden", "curve", "points"];
|
|
16
|
+
function RadialArea(props) {
|
|
17
|
+
const {
|
|
18
|
+
seriesId,
|
|
19
|
+
color,
|
|
20
|
+
hidden,
|
|
21
|
+
curve,
|
|
22
|
+
points
|
|
23
|
+
} = props,
|
|
24
|
+
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
25
|
+
const d = (0, _d3Shape.areaRadial)().angle(p => p.angle).innerRadius(p => p.baseRadius).outerRadius(p => p.radius).curve((0, _internals.getCurveFactory)(curve))(points) || '';
|
|
26
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("path", (0, _extends2.default)({
|
|
27
|
+
"data-series": seriesId,
|
|
28
|
+
d: d,
|
|
29
|
+
fill: color,
|
|
30
|
+
stroke: "none",
|
|
31
|
+
opacity: hidden ? 0 : 1
|
|
32
|
+
}, other));
|
|
33
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
+
const _excluded = ["seriesId", "color", "hidden", "curve", "points"];
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import { areaRadial as d3AreaRadial } from '@mui/x-charts-vendor/d3-shape';
|
|
6
|
+
import { getCurveFactory } from '@mui/x-charts/internals';
|
|
7
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
|
+
function RadialArea(props) {
|
|
9
|
+
const {
|
|
10
|
+
seriesId,
|
|
11
|
+
color,
|
|
12
|
+
hidden,
|
|
13
|
+
curve,
|
|
14
|
+
points
|
|
15
|
+
} = props,
|
|
16
|
+
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
17
|
+
const d = d3AreaRadial().angle(p => p.angle).innerRadius(p => p.baseRadius).outerRadius(p => p.radius).curve(getCurveFactory(curve))(points) || '';
|
|
18
|
+
return /*#__PURE__*/_jsx("path", _extends({
|
|
19
|
+
"data-series": seriesId,
|
|
20
|
+
d: d,
|
|
21
|
+
fill: color,
|
|
22
|
+
stroke: "none",
|
|
23
|
+
opacity: hidden ? 0 : 1
|
|
24
|
+
}, other));
|
|
25
|
+
}
|
|
26
|
+
export { RadialArea };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type RadialLineClasses } from "./radialLineClasses.mjs";
|
|
2
|
+
export interface RadialAreaPlotProps {
|
|
3
|
+
classes?: Partial<Pick<RadialLineClasses, 'area' | 'areaPlot'>>;
|
|
4
|
+
}
|
|
5
|
+
export declare function RadialAreaPlot(props: RadialAreaPlotProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type RadialLineClasses } from "./radialLineClasses.js";
|
|
2
|
+
export interface RadialAreaPlotProps {
|
|
3
|
+
classes?: Partial<Pick<RadialLineClasses, 'area' | 'areaPlot'>>;
|
|
4
|
+
}
|
|
5
|
+
export declare function RadialAreaPlot(props: RadialAreaPlotProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.RadialAreaPlot = RadialAreaPlot;
|
|
7
|
+
var _styles = require("@mui/material/styles");
|
|
8
|
+
var _internals = require("@mui/x-charts/internals");
|
|
9
|
+
var _useRadialLinePlotData = require("./useRadialLinePlotData");
|
|
10
|
+
var _radialLineClasses = require("./radialLineClasses");
|
|
11
|
+
var _RadialArea = require("./RadialArea");
|
|
12
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
+
const RadialAreaPlotRoot = (0, _styles.styled)('g', {
|
|
14
|
+
name: 'MuiRadialAreaPlot',
|
|
15
|
+
slot: 'Root'
|
|
16
|
+
})();
|
|
17
|
+
function RadialAreaPlot(props) {
|
|
18
|
+
const {
|
|
19
|
+
classes: inClasses
|
|
20
|
+
} = props;
|
|
21
|
+
const completedData = (0, _useRadialLinePlotData.useRadialLinePlotData)();
|
|
22
|
+
const {
|
|
23
|
+
store
|
|
24
|
+
} = (0, _internals.useChartsContext)();
|
|
25
|
+
const {
|
|
26
|
+
cx,
|
|
27
|
+
cy
|
|
28
|
+
} = store.use(_internals.selectorChartPolarCenter);
|
|
29
|
+
const classes = (0, _radialLineClasses.useUtilityClasses)({
|
|
30
|
+
classes: inClasses
|
|
31
|
+
});
|
|
32
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(RadialAreaPlotRoot, {
|
|
33
|
+
className: classes.areaPlot,
|
|
34
|
+
transform: `translate(${cx} ${cy})`,
|
|
35
|
+
children: completedData.map(({
|
|
36
|
+
seriesId,
|
|
37
|
+
color,
|
|
38
|
+
hidden,
|
|
39
|
+
area,
|
|
40
|
+
curve,
|
|
41
|
+
points
|
|
42
|
+
}) => area && /*#__PURE__*/(0, _jsxRuntime.jsx)(_RadialArea.RadialArea, {
|
|
43
|
+
seriesId: seriesId,
|
|
44
|
+
color: color,
|
|
45
|
+
hidden: hidden,
|
|
46
|
+
curve: curve,
|
|
47
|
+
points: points,
|
|
48
|
+
className: classes.area
|
|
49
|
+
}, seriesId))
|
|
50
|
+
});
|
|
51
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { styled } from '@mui/material/styles';
|
|
2
|
+
import { selectorChartPolarCenter, useChartsContext } from '@mui/x-charts/internals';
|
|
3
|
+
import { useRadialLinePlotData } from "./useRadialLinePlotData.mjs";
|
|
4
|
+
import { useUtilityClasses } from "./radialLineClasses.mjs";
|
|
5
|
+
import { RadialArea } from "./RadialArea.mjs";
|
|
6
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
|
+
const RadialAreaPlotRoot = styled('g', {
|
|
8
|
+
name: 'MuiRadialAreaPlot',
|
|
9
|
+
slot: 'Root'
|
|
10
|
+
})();
|
|
11
|
+
export function RadialAreaPlot(props) {
|
|
12
|
+
const {
|
|
13
|
+
classes: inClasses
|
|
14
|
+
} = props;
|
|
15
|
+
const completedData = useRadialLinePlotData();
|
|
16
|
+
const {
|
|
17
|
+
store
|
|
18
|
+
} = useChartsContext();
|
|
19
|
+
const {
|
|
20
|
+
cx,
|
|
21
|
+
cy
|
|
22
|
+
} = store.use(selectorChartPolarCenter);
|
|
23
|
+
const classes = useUtilityClasses({
|
|
24
|
+
classes: inClasses
|
|
25
|
+
});
|
|
26
|
+
return /*#__PURE__*/_jsx(RadialAreaPlotRoot, {
|
|
27
|
+
className: classes.areaPlot,
|
|
28
|
+
transform: `translate(${cx} ${cy})`,
|
|
29
|
+
children: completedData.map(({
|
|
30
|
+
seriesId,
|
|
31
|
+
color,
|
|
32
|
+
hidden,
|
|
33
|
+
area,
|
|
34
|
+
curve,
|
|
35
|
+
points
|
|
36
|
+
}) => area && /*#__PURE__*/_jsx(RadialArea, {
|
|
37
|
+
seriesId: seriesId,
|
|
38
|
+
color: color,
|
|
39
|
+
hidden: hidden,
|
|
40
|
+
curve: curve,
|
|
41
|
+
points: points,
|
|
42
|
+
className: classes.area
|
|
43
|
+
}, seriesId))
|
|
44
|
+
});
|
|
45
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { type CurveType, type SeriesId } from '@mui/x-charts/models';
|
|
3
|
+
import { type RadialLinePoint } from "./useRadialLinePlotData.mjs";
|
|
4
|
+
export interface RadialLineProps extends Omit<React.SVGProps<SVGPathElement>, 'ref' | 'points'> {
|
|
5
|
+
seriesId: SeriesId;
|
|
6
|
+
color: string;
|
|
7
|
+
hidden?: boolean;
|
|
8
|
+
points: RadialLinePoint[];
|
|
9
|
+
curve?: CurveType;
|
|
10
|
+
}
|
|
11
|
+
declare function RadialLine(props: RadialLineProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export { RadialLine };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { type CurveType, type SeriesId } from '@mui/x-charts/models';
|
|
3
|
+
import { type RadialLinePoint } from "./useRadialLinePlotData.js";
|
|
4
|
+
export interface RadialLineProps extends Omit<React.SVGProps<SVGPathElement>, 'ref' | 'points'> {
|
|
5
|
+
seriesId: SeriesId;
|
|
6
|
+
color: string;
|
|
7
|
+
hidden?: boolean;
|
|
8
|
+
points: RadialLinePoint[];
|
|
9
|
+
curve?: CurveType;
|
|
10
|
+
}
|
|
11
|
+
declare function RadialLine(props: RadialLineProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export { RadialLine };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.RadialLine = RadialLine;
|
|
9
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
|
+
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
11
|
+
var React = _interopRequireWildcard(require("react"));
|
|
12
|
+
var _d3Shape = require("@mui/x-charts-vendor/d3-shape");
|
|
13
|
+
var _internals = require("@mui/x-charts/internals");
|
|
14
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
|
+
const _excluded = ["seriesId", "color", "hidden", "points", "curve"];
|
|
16
|
+
function RadialLine(props) {
|
|
17
|
+
const {
|
|
18
|
+
seriesId,
|
|
19
|
+
color,
|
|
20
|
+
hidden,
|
|
21
|
+
points,
|
|
22
|
+
curve
|
|
23
|
+
} = props,
|
|
24
|
+
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
25
|
+
const d = (0, _d3Shape.lineRadial)().angle(p => p.angle).radius(p => p.radius).curve((0, _internals.getCurveFactory)(curve))(points) || '';
|
|
26
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("path", (0, _extends2.default)({
|
|
27
|
+
"data-series": seriesId,
|
|
28
|
+
d: d,
|
|
29
|
+
stroke: color,
|
|
30
|
+
fill: "none",
|
|
31
|
+
opacity: hidden ? 0 : 1
|
|
32
|
+
}, other));
|
|
33
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
+
const _excluded = ["seriesId", "color", "hidden", "points", "curve"];
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import { lineRadial as d3LineRadial } from '@mui/x-charts-vendor/d3-shape';
|
|
6
|
+
import { getCurveFactory } from '@mui/x-charts/internals';
|
|
7
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
|
+
function RadialLine(props) {
|
|
9
|
+
const {
|
|
10
|
+
seriesId,
|
|
11
|
+
color,
|
|
12
|
+
hidden,
|
|
13
|
+
points,
|
|
14
|
+
curve
|
|
15
|
+
} = props,
|
|
16
|
+
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
17
|
+
const d = d3LineRadial().angle(p => p.angle).radius(p => p.radius).curve(getCurveFactory(curve))(points) || '';
|
|
18
|
+
return /*#__PURE__*/_jsx("path", _extends({
|
|
19
|
+
"data-series": seriesId,
|
|
20
|
+
d: d,
|
|
21
|
+
stroke: color,
|
|
22
|
+
fill: "none",
|
|
23
|
+
opacity: hidden ? 0 : 1
|
|
24
|
+
}, other));
|
|
25
|
+
}
|
|
26
|
+
export { RadialLine };
|