@mui/x-charts 9.3.0 → 9.5.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/BarChart/BarElement.d.mts +3 -2
- package/BarChart/BarElement.d.ts +3 -2
- package/BarChart/BarLabel/BarLabelItem.d.mts +3 -2
- package/BarChart/BarLabel/BarLabelItem.d.ts +3 -2
- package/BarChart/seriesConfig/bar/extremums.js +7 -2
- package/BarChart/seriesConfig/bar/extremums.mjs +7 -2
- package/CHANGELOG.md +296 -0
- package/ChartsContainer/ChartsContainer.js +21 -0
- package/ChartsContainer/ChartsContainer.mjs +21 -0
- package/ChartsLabel/ChartsLabelMark.js +1 -21
- package/ChartsLabel/ChartsLabelMark.mjs +0 -20
- package/ChartsLegend/chartsLegend.types.d.mts +3 -2
- package/ChartsLegend/chartsLegend.types.d.ts +3 -2
- package/ChartsLegend/piecewiseColorLegendClasses.js +8 -2
- package/ChartsLegend/piecewiseColorLegendClasses.mjs +8 -2
- package/ChartsOverlay/ChartsOverlay.d.mts +5 -4
- package/ChartsOverlay/ChartsOverlay.d.ts +5 -4
- package/ChartsRadialAxisHighlight/index.d.mts +6 -1
- package/ChartsRadialAxisHighlight/index.d.ts +6 -1
- package/ChartsRadialAxisHighlight/index.js +9 -2
- package/ChartsRadialAxisHighlight/index.mjs +8 -1
- package/ChartsRadialDataProvider/ChartsRadialDataProvider.d.mts +1 -1
- package/ChartsRadialDataProvider/ChartsRadialDataProvider.d.ts +1 -1
- package/ChartsRadialDataProvider/ChartsRadialDataProvider.js +1 -1
- package/ChartsRadialDataProvider/ChartsRadialDataProvider.mjs +1 -1
- package/ChartsRadialDataProvider/index.d.mts +5 -0
- package/ChartsRadialDataProvider/index.d.ts +5 -0
- package/ChartsRadialDataProvider/index.js +12 -1
- package/ChartsRadialDataProvider/index.mjs +7 -0
- package/ChartsRadialGrid/index.d.mts +6 -1
- package/ChartsRadialGrid/index.d.ts +6 -1
- package/ChartsRadialGrid/index.js +8 -2
- package/ChartsRadialGrid/index.mjs +8 -1
- package/ChartsRadiusAxis/index.d.mts +6 -1
- package/ChartsRadiusAxis/index.d.ts +6 -1
- package/ChartsRadiusAxis/index.js +10 -2
- package/ChartsRadiusAxis/index.mjs +7 -1
- package/ChartsReferenceLine/ChartsXReferenceLine.js +6 -1
- package/ChartsReferenceLine/ChartsXReferenceLine.mjs +6 -1
- package/ChartsReferenceLine/ChartsYReferenceLine.js +5 -0
- package/ChartsReferenceLine/ChartsYReferenceLine.mjs +5 -0
- package/ChartsRotationAxis/index.d.mts +6 -1
- package/ChartsRotationAxis/index.d.ts +6 -1
- package/ChartsRotationAxis/index.js +10 -2
- package/ChartsRotationAxis/index.mjs +7 -1
- package/ChartsTooltip/ChartTooltip.types.d.mts +3 -2
- package/ChartsTooltip/ChartTooltip.types.d.ts +3 -2
- package/ChartsTooltip/ChartsTooltipContainer.js +11 -4
- package/ChartsTooltip/ChartsTooltipContainer.mjs +11 -4
- package/ChartsTooltip/useAxesTooltip.js +2 -2
- package/ChartsTooltip/useAxesTooltip.mjs +2 -2
- package/ChartsTooltip/useItemTooltip.js +2 -2
- package/ChartsTooltip/useItemTooltip.mjs +2 -2
- package/ChartsXAxis/useAxisTicksProps.d.mts +84 -3
- package/ChartsXAxis/useAxisTicksProps.d.ts +84 -3
- package/ChartsYAxis/useAxisTicksProps.d.mts +84 -3
- package/ChartsYAxis/useAxisTicksProps.d.ts +84 -3
- package/LineChart/AreaElement.d.mts +3 -2
- package/LineChart/AreaElement.d.ts +3 -2
- package/LineChart/AreaElement.js +1 -1
- package/LineChart/AreaElement.mjs +1 -1
- package/LineChart/CircleMarkElement.js +1 -1
- package/LineChart/CircleMarkElement.mjs +1 -1
- package/LineChart/LineElement.d.mts +3 -2
- package/LineChart/LineElement.d.ts +3 -2
- package/LineChart/LineElement.js +1 -1
- package/LineChart/LineElement.mjs +1 -1
- package/LineChart/LineHighlightPlot.d.mts +3 -2
- package/LineChart/LineHighlightPlot.d.ts +3 -2
- package/LineChart/LineHighlightPlot.js +65 -45
- package/LineChart/LineHighlightPlot.mjs +65 -45
- package/LineChart/MarkElement.js +1 -1
- package/LineChart/MarkElement.mjs +1 -1
- package/LineChart/MarkPlot.d.mts +3 -2
- package/LineChart/MarkPlot.d.ts +3 -2
- package/LineChart/seriesConfig/curveEvaluation.js +28 -14
- package/LineChart/seriesConfig/curveEvaluation.mjs +27 -14
- package/LineChart/seriesConfig/extremums.js +5 -1
- package/LineChart/seriesConfig/extremums.mjs +5 -1
- package/LineChart/useMarkPlotData.js +3 -1
- package/LineChart/useMarkPlotData.mjs +3 -1
- package/PieChart/PieArcLabelPlot.d.mts +3 -2
- package/PieChart/PieArcLabelPlot.d.ts +3 -2
- package/PieChart/PieArcPlot.d.mts +3 -2
- package/PieChart/PieArcPlot.d.ts +3 -2
- package/RadarChart/RadarAxis/RadarAxis.utils.d.mts +2 -2
- package/RadarChart/RadarAxis/RadarAxis.utils.d.ts +2 -2
- package/ScatterChart/BatchScatter.d.mts +2 -8
- package/ScatterChart/BatchScatter.d.ts +2 -8
- package/ScatterChart/BatchScatter.js +17 -12
- package/ScatterChart/BatchScatter.mjs +17 -12
- package/ScatterChart/FocusedScatterMark.js +2 -2
- package/ScatterChart/FocusedScatterMark.mjs +2 -2
- package/ScatterChart/HighlightedScatterMark.js +3 -3
- package/ScatterChart/HighlightedScatterMark.mjs +3 -3
- package/ScatterChart/Scatter.d.mts +5 -0
- package/ScatterChart/Scatter.d.ts +5 -0
- package/ScatterChart/Scatter.js +7 -2
- package/ScatterChart/Scatter.mjs +7 -2
- package/ScatterChart/ScatterChart.d.mts +2 -1
- package/ScatterChart/ScatterChart.d.ts +2 -1
- package/ScatterChart/ScatterChart.js +28 -3
- package/ScatterChart/ScatterChart.mjs +28 -3
- package/ScatterChart/ScatterChart.plugins.d.mts +2 -1
- package/ScatterChart/ScatterChart.plugins.d.ts +2 -1
- package/ScatterChart/ScatterChart.plugins.js +2 -1
- package/ScatterChart/ScatterChart.plugins.mjs +2 -1
- package/ScatterChart/ScatterMarker.types.d.mts +3 -2
- package/ScatterChart/ScatterMarker.types.d.ts +3 -2
- package/ScatterChart/ScatterPlot.d.mts +7 -4
- package/ScatterChart/ScatterPlot.d.ts +7 -4
- package/ScatterChart/ScatterPlot.js +31 -4
- package/ScatterChart/ScatterPlot.mjs +31 -4
- package/ScatterChart/async/ScatterAsync.d.mts +9 -0
- package/ScatterChart/async/ScatterAsync.d.ts +9 -0
- package/ScatterChart/async/ScatterAsync.js +71 -0
- package/ScatterChart/async/ScatterAsync.mjs +67 -0
- package/ScatterChart/async/ScatterAsyncBatch.d.mts +24 -0
- package/ScatterChart/async/ScatterAsyncBatch.d.ts +24 -0
- package/ScatterChart/async/ScatterAsyncBatch.js +112 -0
- package/ScatterChart/async/ScatterAsyncBatch.mjs +106 -0
- package/ScatterChart/async/scatterRenderData.selectors.d.mts +38 -0
- package/ScatterChart/async/scatterRenderData.selectors.d.ts +38 -0
- package/ScatterChart/async/scatterRenderData.selectors.js +93 -0
- package/ScatterChart/async/scatterRenderData.selectors.mjs +87 -0
- package/ScatterChart/seriesConfig/extremums.js +6 -0
- package/ScatterChart/seriesConfig/extremums.mjs +6 -0
- package/ScatterChart/seriesConfig/getColor.js +1 -1
- package/ScatterChart/seriesConfig/getColor.mjs +1 -1
- package/ScatterChart/seriesConfig/getMarkerSize.d.mts +18 -0
- package/ScatterChart/seriesConfig/getMarkerSize.d.ts +18 -0
- package/ScatterChart/seriesConfig/getMarkerSize.js +43 -0
- package/ScatterChart/seriesConfig/getMarkerSize.mjs +37 -0
- package/ScatterChart/seriesConfig/seriesProcessor.js +23 -8
- package/ScatterChart/seriesConfig/seriesProcessor.mjs +23 -8
- package/ScatterChart/useScatterItemPosition.d.mts +4 -0
- package/ScatterChart/useScatterItemPosition.d.ts +4 -0
- package/ScatterChart/useScatterItemPosition.js +9 -0
- package/ScatterChart/useScatterItemPosition.mjs +8 -0
- package/SparkLineChart/SparkLineChart.js +2 -1
- package/SparkLineChart/SparkLineChart.mjs +2 -1
- package/Toolbar/Toolbar.types.d.mts +3 -2
- package/Toolbar/Toolbar.types.d.ts +3 -2
- package/index.js +1 -1
- package/index.mjs +1 -1
- package/internals/animation/animation.d.mts +1 -2
- package/internals/animation/animation.d.ts +1 -2
- package/internals/commonNextFocusItem.d.mts +10 -2
- package/internals/commonNextFocusItem.d.ts +10 -2
- package/internals/commonNextFocusItem.js +12 -4
- package/internals/commonNextFocusItem.mjs +12 -4
- package/internals/createCommonKeyboardFocusHandler.d.mts +1 -1
- package/internals/createCommonKeyboardFocusHandler.d.ts +1 -1
- package/internals/createCommonKeyboardFocusHandler.js +3 -3
- package/internals/createCommonKeyboardFocusHandler.mjs +3 -3
- package/internals/getSeriesColorFn.d.mts +5 -5
- package/internals/getSeriesColorFn.d.ts +5 -5
- package/internals/incompleteDatasetKeysError.d.mts +1 -0
- package/internals/incompleteDatasetKeysError.d.ts +1 -0
- package/internals/incompleteDatasetKeysError.js +11 -0
- package/internals/incompleteDatasetKeysError.mjs +4 -0
- package/internals/index.d.mts +3 -0
- package/internals/index.d.ts +3 -0
- package/internals/index.js +36 -0
- package/internals/index.mjs +3 -0
- package/internals/plugins/allPlugins.d.mts +4 -3
- package/internals/plugins/allPlugins.d.ts +4 -3
- package/internals/plugins/allPlugins.js +2 -1
- package/internals/plugins/allPlugins.mjs +2 -1
- package/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.selectors.d.mts +12 -3
- package/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.selectors.d.ts +12 -3
- package/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.selectors.js +10 -1
- package/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.selectors.mjs +10 -1
- package/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types.d.mts +15 -1
- package/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types.d.ts +15 -1
- package/internals/plugins/featurePlugins/useChartCartesianAxis/createZoomLookup.js +3 -2
- package/internals/plugins/featurePlugins/useChartCartesianAxis/createZoomLookup.mjs +4 -3
- package/internals/plugins/featurePlugins/useChartCartesianAxis/defaultizeAxis.js +2 -2
- package/internals/plugins/featurePlugins/useChartCartesianAxis/defaultizeAxis.mjs +3 -3
- package/internals/plugins/featurePlugins/useChartCartesianAxis/defaultizeZoom.d.mts +10 -1
- package/internals/plugins/featurePlugins/useChartCartesianAxis/defaultizeZoom.d.ts +10 -1
- package/internals/plugins/featurePlugins/useChartCartesianAxis/defaultizeZoom.js +18 -1
- package/internals/plugins/featurePlugins/useChartCartesianAxis/defaultizeZoom.mjs +16 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisScale.js +27 -2
- package/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisScale.mjs +27 -2
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.js +1 -3
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.mjs +1 -3
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.d.mts +11 -3
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.d.ts +11 -3
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.js +24 -5
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.mjs +24 -5
- package/internals/plugins/featurePlugins/useChartClosestPoint/findClosestPoints.d.mts +1 -1
- package/internals/plugins/featurePlugins/useChartClosestPoint/findClosestPoints.d.ts +1 -1
- package/internals/plugins/featurePlugins/useChartClosestPoint/findClosestPoints.js +46 -2
- package/internals/plugins/featurePlugins/useChartClosestPoint/findClosestPoints.mjs +47 -2
- package/internals/plugins/featurePlugins/useChartClosestPoint/useChartClosestPoint.js +46 -11
- package/internals/plugins/featurePlugins/useChartClosestPoint/useChartClosestPoint.mjs +46 -11
- package/internals/plugins/featurePlugins/useChartClosestPoint/useChartClosestPoint.types.d.mts +2 -1
- package/internals/plugins/featurePlugins/useChartClosestPoint/useChartClosestPoint.types.d.ts +2 -1
- package/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.js +3 -2
- package/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.mjs +3 -2
- package/internals/plugins/featurePlugins/useChartPolarAxis/coordinateTransformation.d.mts +4 -0
- package/internals/plugins/featurePlugins/useChartPolarAxis/coordinateTransformation.d.ts +4 -0
- package/internals/plugins/featurePlugins/useChartPolarAxis/coordinateTransformation.js +3 -1
- package/internals/plugins/featurePlugins/useChartPolarAxis/coordinateTransformation.mjs +1 -0
- package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.js +5 -3
- package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.mjs +7 -5
- package/internals/plugins/featurePlugins/useChartZAxis/useChartZAxis.js +17 -3
- package/internals/plugins/featurePlugins/useChartZAxis/useChartZAxis.mjs +17 -3
- package/internals/plugins/featurePlugins/useProgressiveRendering/index.d.mts +3 -0
- package/internals/plugins/featurePlugins/useProgressiveRendering/index.d.ts +3 -0
- package/internals/plugins/featurePlugins/useProgressiveRendering/index.js +27 -0
- package/internals/plugins/featurePlugins/useProgressiveRendering/index.mjs +2 -0
- package/internals/plugins/featurePlugins/useProgressiveRendering/useProgressiveRendering.d.mts +13 -0
- package/internals/plugins/featurePlugins/useProgressiveRendering/useProgressiveRendering.d.ts +13 -0
- package/internals/plugins/featurePlugins/useProgressiveRendering/useProgressiveRendering.js +136 -0
- package/internals/plugins/featurePlugins/useProgressiveRendering/useProgressiveRendering.mjs +128 -0
- package/internals/plugins/featurePlugins/useProgressiveRendering/useProgressiveRendering.selectors.d.mts +42 -0
- package/internals/plugins/featurePlugins/useProgressiveRendering/useProgressiveRendering.selectors.d.ts +42 -0
- package/internals/plugins/featurePlugins/useProgressiveRendering/useProgressiveRendering.selectors.js +166 -0
- package/internals/plugins/featurePlugins/useProgressiveRendering/useProgressiveRendering.selectors.mjs +159 -0
- package/internals/plugins/featurePlugins/useProgressiveRendering/useProgressiveRendering.types.d.mts +34 -0
- package/internals/plugins/featurePlugins/useProgressiveRendering/useProgressiveRendering.types.d.ts +34 -0
- package/internals/plugins/featurePlugins/useProgressiveRendering/useProgressiveRendering.types.js +5 -0
- package/internals/plugins/featurePlugins/useProgressiveRendering/useProgressiveRendering.types.mjs +1 -0
- package/internals/scales/scaleBand.js +70 -43
- package/internals/scales/scaleBand.mjs +71 -44
- package/internals/sizeScale.d.mts +6 -0
- package/internals/sizeScale.d.ts +6 -0
- package/internals/sizeScale.js +46 -0
- package/internals/sizeScale.mjs +38 -0
- package/models/axis.d.mts +18 -12
- package/models/axis.d.ts +18 -12
- package/models/chartsSlotsComponentsProps.d.mts +25 -0
- package/models/chartsSlotsComponentsProps.d.ts +25 -0
- package/models/chartsSlotsComponentsProps.js +5 -0
- package/models/chartsSlotsComponentsProps.mjs +1 -0
- package/models/index.d.mts +1 -0
- package/models/index.d.ts +1 -0
- package/models/index.js +11 -0
- package/models/index.mjs +1 -0
- package/models/seriesType/bar.d.mts +1 -1
- package/models/seriesType/bar.d.ts +1 -1
- package/models/seriesType/common.d.mts +4 -4
- package/models/seriesType/common.d.ts +4 -4
- package/models/seriesType/config.d.mts +3 -3
- package/models/seriesType/config.d.ts +3 -3
- package/models/seriesType/line.d.mts +6 -3
- package/models/seriesType/line.d.ts +6 -3
- package/models/seriesType/pie.d.mts +1 -1
- package/models/seriesType/pie.d.ts +1 -1
- package/models/seriesType/radar.d.mts +1 -1
- package/models/seriesType/radar.d.ts +1 -1
- package/models/seriesType/scatter.d.mts +35 -3
- package/models/seriesType/scatter.d.ts +35 -3
- package/models/sizeMapping.d.mts +64 -0
- package/models/sizeMapping.d.ts +64 -0
- package/models/sizeMapping.js +5 -0
- package/models/sizeMapping.mjs +1 -0
- package/models/slots/chartsBaseSlots.d.mts +6 -5
- package/models/slots/chartsBaseSlots.d.ts +6 -5
- package/models/z-axis.d.mts +10 -1
- package/models/z-axis.d.ts +10 -1
- package/package.json +5 -5
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* eslint-disable func-names */
|
|
2
2
|
// Adapted from d3-scale v4.0.2
|
|
3
3
|
// https://github.com/d3/d3-scale/blob/d6904a4bde09e16005e0ad8ca3e25b10ce54fa0d/src/band.js
|
|
4
|
-
import { InternMap
|
|
4
|
+
import { InternMap } from '@mui/x-charts-vendor/d3-array';
|
|
5
5
|
export function keyof(value) {
|
|
6
6
|
if (Array.isArray(value)) {
|
|
7
7
|
return JSON.stringify(value);
|
|
@@ -13,60 +13,57 @@ export function keyof(value) {
|
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
* The generic corresponds to the data type of domain elements.
|
|
21
|
-
*
|
|
22
|
-
* @param range A two-element array of numeric values.
|
|
23
|
-
*/
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Constructs a new band scale with the specified domain and range, no padding, no rounding and center alignment.
|
|
27
|
-
*
|
|
28
|
-
* The generic corresponds to the data type of domain elements.
|
|
29
|
-
*
|
|
30
|
-
* @param domain Array of domain values.
|
|
31
|
-
* @param range A two-element array of numeric values.
|
|
16
|
+
* The internal state shared when copying a scale. The domain index (`InternMap`) is the expensive
|
|
17
|
+
* part to build — `O(domain)` — and is immutable once set (the domain setter replaces it rather than
|
|
18
|
+
* mutating it), so a copy can share the same reference instead of rebuilding it. This makes `copy()`
|
|
19
|
+
* `O(1)`, which matters because zooming copies the scale on every frame to apply a new range.
|
|
32
20
|
*/
|
|
33
21
|
|
|
34
|
-
|
|
22
|
+
function createScaleBand(seed) {
|
|
35
23
|
// @ts-expect-error, InternMap accepts two arguments, but its types are set as Map, which doesn't.
|
|
36
|
-
let index = new InternMap(undefined, keyof);
|
|
37
|
-
let domain = [];
|
|
38
|
-
let
|
|
39
|
-
let
|
|
40
|
-
let
|
|
24
|
+
let index = seed ? seed.index : new InternMap(undefined, keyof);
|
|
25
|
+
let domain = seed ? seed.domain : [];
|
|
26
|
+
let r0 = seed ? seed.r0 : 0;
|
|
27
|
+
let r1 = seed ? seed.r1 : 1;
|
|
28
|
+
let isRound = seed ? seed.isRound : false;
|
|
29
|
+
let paddingInner = seed ? seed.paddingInner : 0;
|
|
30
|
+
let paddingOuter = seed ? seed.paddingOuter : 0;
|
|
31
|
+
let align = seed ? seed.align : 0.5;
|
|
32
|
+
|
|
33
|
+
// Derived on every rescale. Positions are affine in the index, so they are computed on demand in
|
|
34
|
+
// `scale()` rather than materialized into an array — keeping rescale `O(1)` instead of `O(domain)`.
|
|
41
35
|
let step;
|
|
42
36
|
let bandwidth;
|
|
43
|
-
let
|
|
44
|
-
let
|
|
45
|
-
let paddingOuter = 0;
|
|
46
|
-
let align = 0.5;
|
|
37
|
+
let reverse = false;
|
|
38
|
+
let start = 0;
|
|
47
39
|
const scale = d => {
|
|
48
40
|
const i = index.get(d);
|
|
49
41
|
if (i === undefined) {
|
|
50
42
|
return undefined;
|
|
51
43
|
}
|
|
52
|
-
|
|
44
|
+
const n = domain.length;
|
|
45
|
+
if (n === 0) {
|
|
46
|
+
return undefined;
|
|
47
|
+
}
|
|
48
|
+
const k = reverse ? n - 1 - i % n : i % n;
|
|
49
|
+
return start + step * k;
|
|
53
50
|
};
|
|
54
51
|
const rescale = () => {
|
|
55
52
|
const n = domain.length;
|
|
56
|
-
|
|
57
|
-
const
|
|
58
|
-
const
|
|
59
|
-
step = (
|
|
53
|
+
reverse = r1 < r0;
|
|
54
|
+
const lo = reverse ? r1 : r0;
|
|
55
|
+
const hi = reverse ? r0 : r1;
|
|
56
|
+
step = (hi - lo) / Math.max(1, n - paddingInner + paddingOuter * 2);
|
|
60
57
|
if (isRound) {
|
|
61
58
|
step = Math.floor(step);
|
|
62
59
|
}
|
|
63
|
-
|
|
60
|
+
let adjustedStart = lo + (hi - lo - step * (n - paddingInner)) * align;
|
|
64
61
|
bandwidth = step * (1 - paddingInner);
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
62
|
+
if (isRound) {
|
|
63
|
+
adjustedStart = Math.round(adjustedStart);
|
|
64
|
+
bandwidth = Math.round(bandwidth);
|
|
65
|
+
}
|
|
66
|
+
start = adjustedStart;
|
|
70
67
|
return scale;
|
|
71
68
|
};
|
|
72
69
|
scale.domain = function (_) {
|
|
@@ -141,19 +138,49 @@ export function scaleBand(...args) {
|
|
|
141
138
|
align = Math.max(0, Math.min(1, _));
|
|
142
139
|
return rescale();
|
|
143
140
|
};
|
|
144
|
-
scale.copy = () => {
|
|
145
|
-
return scaleBand(domain, [r0, r1]).round(isRound).paddingInner(paddingInner).paddingOuter(paddingOuter).align(align);
|
|
146
|
-
};
|
|
147
141
|
|
|
148
|
-
//
|
|
142
|
+
// Shares the immutable domain index with the copy, so copying does not rebuild it.
|
|
143
|
+
scale.copy = () => createScaleBand({
|
|
144
|
+
index,
|
|
145
|
+
domain,
|
|
146
|
+
r0,
|
|
147
|
+
r1,
|
|
148
|
+
isRound,
|
|
149
|
+
paddingInner,
|
|
150
|
+
paddingOuter,
|
|
151
|
+
align
|
|
152
|
+
});
|
|
153
|
+
rescale();
|
|
154
|
+
return scale;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* Constructs a new band scale with the specified range, no padding, no rounding and center alignment.
|
|
159
|
+
* The domain defaults to the empty domain.
|
|
160
|
+
* If range is not specified, it defaults to the unit range [0, 1].
|
|
161
|
+
*
|
|
162
|
+
* The generic corresponds to the data type of domain elements.
|
|
163
|
+
*
|
|
164
|
+
* @param range A two-element array of numeric values.
|
|
165
|
+
*/
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* Constructs a new band scale with the specified domain and range, no padding, no rounding and center alignment.
|
|
169
|
+
*
|
|
170
|
+
* The generic corresponds to the data type of domain elements.
|
|
171
|
+
*
|
|
172
|
+
* @param domain Array of domain values.
|
|
173
|
+
* @param range A two-element array of numeric values.
|
|
174
|
+
*/
|
|
175
|
+
|
|
176
|
+
export function scaleBand(...args) {
|
|
177
|
+
const scale = createScaleBand();
|
|
149
178
|
const [arg0, arg1] = args;
|
|
150
179
|
if (args.length > 1) {
|
|
151
180
|
scale.domain(arg0);
|
|
152
181
|
scale.range(arg1);
|
|
153
182
|
} else if (arg0) {
|
|
154
183
|
scale.range(arg0);
|
|
155
|
-
} else {
|
|
156
|
-
rescale();
|
|
157
184
|
}
|
|
158
185
|
return scale;
|
|
159
186
|
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type ScaleOrdinal, type ScaleThreshold, type ScaleSequential } from '@mui/x-charts-vendor/d3-scale';
|
|
2
|
+
import { type ContinuousSizeConfig, type PiecewiseSizeConfig, type OrdinalSizeConfig } from "../models/sizeMapping.mjs";
|
|
3
|
+
export declare function getSequentialSizeScale<Value extends number | Date>(config: ContinuousSizeConfig<Value> | PiecewiseSizeConfig<Value>): ScaleThreshold<Value, number, never> | ScaleSequential<number, never>;
|
|
4
|
+
export declare function getOrdinalSizeScale(config: OrdinalSizeConfig): ScaleOrdinal<number | Date | string, number, number | null>;
|
|
5
|
+
export declare function getSizeScale(config: OrdinalSizeConfig): ScaleOrdinal<number | Date | string, number, number | null>;
|
|
6
|
+
export declare function getSizeScale(config: ContinuousSizeConfig | PiecewiseSizeConfig): ScaleThreshold<number | Date, number | null> | ScaleSequential<number, number | null>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type ScaleOrdinal, type ScaleThreshold, type ScaleSequential } from '@mui/x-charts-vendor/d3-scale';
|
|
2
|
+
import { type ContinuousSizeConfig, type PiecewiseSizeConfig, type OrdinalSizeConfig } from "../models/sizeMapping.js";
|
|
3
|
+
export declare function getSequentialSizeScale<Value extends number | Date>(config: ContinuousSizeConfig<Value> | PiecewiseSizeConfig<Value>): ScaleThreshold<Value, number, never> | ScaleSequential<number, never>;
|
|
4
|
+
export declare function getOrdinalSizeScale(config: OrdinalSizeConfig): ScaleOrdinal<number | Date | string, number, number | null>;
|
|
5
|
+
export declare function getSizeScale(config: OrdinalSizeConfig): ScaleOrdinal<number | Date | string, number, number | null>;
|
|
6
|
+
export declare function getSizeScale(config: ContinuousSizeConfig | PiecewiseSizeConfig): ScaleThreshold<number | Date, number | null> | ScaleSequential<number, number | null>;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getOrdinalSizeScale = getOrdinalSizeScale;
|
|
7
|
+
exports.getSequentialSizeScale = getSequentialSizeScale;
|
|
8
|
+
exports.getSizeScale = getSizeScale;
|
|
9
|
+
var _d3Scale = require("@mui/x-charts-vendor/d3-scale");
|
|
10
|
+
const isFunctionInterpolator = config => {
|
|
11
|
+
return typeof config.size === 'function';
|
|
12
|
+
};
|
|
13
|
+
function getClampedSize(sizes) {
|
|
14
|
+
const [minSize, maxSize] = sizes;
|
|
15
|
+
return t => {
|
|
16
|
+
const clampedT = Math.max(Math.min(t, 1), 0);
|
|
17
|
+
return minSize + clampedT * (maxSize - minSize);
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
function getSequentialSizeScale(config) {
|
|
21
|
+
if (config.type === 'piecewise') {
|
|
22
|
+
return (0, _d3Scale.scaleThreshold)(config.thresholds, config.sizes);
|
|
23
|
+
}
|
|
24
|
+
if (isFunctionInterpolator(config)) {
|
|
25
|
+
return (0, _d3Scale.scaleSequential)([config.min ?? 0, config.max ?? 100], config.size);
|
|
26
|
+
}
|
|
27
|
+
const interpolator = config.interpolator ?? 'sqrt';
|
|
28
|
+
switch (interpolator) {
|
|
29
|
+
case 'log':
|
|
30
|
+
return (0, _d3Scale.scaleSequentialLog)([config.min ?? 0, config.max ?? 100], getClampedSize(config.size));
|
|
31
|
+
case 'linear':
|
|
32
|
+
return (0, _d3Scale.scaleSequential)([config.min ?? 0, config.max ?? 100], getClampedSize(config.size));
|
|
33
|
+
case 'sqrt':
|
|
34
|
+
default:
|
|
35
|
+
return (0, _d3Scale.scaleSequentialSqrt)([config.min ?? 0, config.max ?? 100], getClampedSize(config.size));
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
function getOrdinalSizeScale(config) {
|
|
39
|
+
if (config.values) {
|
|
40
|
+
return (0, _d3Scale.scaleOrdinal)(config.values, config.sizes).unknown(config.unknownSize ?? null);
|
|
41
|
+
}
|
|
42
|
+
return (0, _d3Scale.scaleOrdinal)(config.sizes.map((_, index) => index), config.sizes).unknown(config.unknownSize ?? null);
|
|
43
|
+
}
|
|
44
|
+
function getSizeScale(config) {
|
|
45
|
+
return config.type === 'ordinal' ? getOrdinalSizeScale(config) : getSequentialSizeScale(config);
|
|
46
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { scaleOrdinal, scaleThreshold, scaleSequential, scaleSequentialSqrt, scaleSequentialLog } from '@mui/x-charts-vendor/d3-scale';
|
|
2
|
+
const isFunctionInterpolator = config => {
|
|
3
|
+
return typeof config.size === 'function';
|
|
4
|
+
};
|
|
5
|
+
function getClampedSize(sizes) {
|
|
6
|
+
const [minSize, maxSize] = sizes;
|
|
7
|
+
return t => {
|
|
8
|
+
const clampedT = Math.max(Math.min(t, 1), 0);
|
|
9
|
+
return minSize + clampedT * (maxSize - minSize);
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
export function getSequentialSizeScale(config) {
|
|
13
|
+
if (config.type === 'piecewise') {
|
|
14
|
+
return scaleThreshold(config.thresholds, config.sizes);
|
|
15
|
+
}
|
|
16
|
+
if (isFunctionInterpolator(config)) {
|
|
17
|
+
return scaleSequential([config.min ?? 0, config.max ?? 100], config.size);
|
|
18
|
+
}
|
|
19
|
+
const interpolator = config.interpolator ?? 'sqrt';
|
|
20
|
+
switch (interpolator) {
|
|
21
|
+
case 'log':
|
|
22
|
+
return scaleSequentialLog([config.min ?? 0, config.max ?? 100], getClampedSize(config.size));
|
|
23
|
+
case 'linear':
|
|
24
|
+
return scaleSequential([config.min ?? 0, config.max ?? 100], getClampedSize(config.size));
|
|
25
|
+
case 'sqrt':
|
|
26
|
+
default:
|
|
27
|
+
return scaleSequentialSqrt([config.min ?? 0, config.max ?? 100], getClampedSize(config.size));
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
export function getOrdinalSizeScale(config) {
|
|
31
|
+
if (config.values) {
|
|
32
|
+
return scaleOrdinal(config.values, config.sizes).unknown(config.unknownSize ?? null);
|
|
33
|
+
}
|
|
34
|
+
return scaleOrdinal(config.sizes.map((_, index) => index), config.sizes).unknown(config.unknownSize ?? null);
|
|
35
|
+
}
|
|
36
|
+
export function getSizeScale(config) {
|
|
37
|
+
return config.type === 'ordinal' ? getOrdinalSizeScale(config) : getSequentialSizeScale(config);
|
|
38
|
+
}
|
package/models/axis.d.mts
CHANGED
|
@@ -6,6 +6,7 @@ import { type DatasetElementType } from "./seriesType/config.mjs";
|
|
|
6
6
|
import type { DefaultizedZoomOptions } from "../internals/plugins/featurePlugins/useChartCartesianAxis/index.mjs";
|
|
7
7
|
import { type ChartsAxisClasses } from "../ChartsAxis/axisClasses.mjs";
|
|
8
8
|
import type { TickParams } from "../hooks/useTicks.mjs";
|
|
9
|
+
import type { AxisLinePropsOverrides, AxisTickPropsOverrides, AxisTickLabelPropsOverrides, AxisLabelPropsOverrides, XAxisPropsOverrides, YAxisPropsOverrides } from "./chartsSlotsComponentsProps.mjs";
|
|
9
10
|
import type { ChartsTextProps } from "../ChartsText/index.mjs";
|
|
10
11
|
import type { ContinuousColorConfig, OrdinalColorConfig, PiecewiseColorConfig } from "./colorMapping.mjs";
|
|
11
12
|
import type { OrdinalTimeTicks } from "./timeTicks.mjs";
|
|
@@ -28,40 +29,40 @@ export interface ChartsAxisSlots {
|
|
|
28
29
|
* Custom component for the axis main line.
|
|
29
30
|
* @default 'line'
|
|
30
31
|
*/
|
|
31
|
-
axisLine?: React.JSXElementConstructor<React.SVGAttributes<SVGPathElement
|
|
32
|
+
axisLine?: React.JSXElementConstructor<React.SVGAttributes<SVGPathElement> & AxisLinePropsOverrides>;
|
|
32
33
|
/**
|
|
33
34
|
* Custom component for the axis tick.
|
|
34
35
|
* @default 'line'
|
|
35
36
|
*/
|
|
36
|
-
axisTick?: React.JSXElementConstructor<React.SVGAttributes<SVGPathElement
|
|
37
|
+
axisTick?: React.JSXElementConstructor<React.SVGAttributes<SVGPathElement> & AxisTickPropsOverrides>;
|
|
37
38
|
/**
|
|
38
39
|
* Custom component for tick label.
|
|
39
40
|
* @default ChartsText
|
|
40
41
|
*/
|
|
41
|
-
axisTickLabel?: React.JSXElementConstructor<ChartsTextProps>;
|
|
42
|
+
axisTickLabel?: React.JSXElementConstructor<ChartsTextProps & AxisTickLabelPropsOverrides>;
|
|
42
43
|
/**
|
|
43
44
|
* Custom component for axis label.
|
|
44
45
|
* @default ChartsText
|
|
45
46
|
*/
|
|
46
|
-
axisLabel?: React.JSXElementConstructor<ChartsTextProps>;
|
|
47
|
+
axisLabel?: React.JSXElementConstructor<ChartsTextProps & AxisLabelPropsOverrides>;
|
|
47
48
|
/**
|
|
48
49
|
* Custom component for the x-axis.
|
|
49
50
|
* @default ChartsXAxis
|
|
50
51
|
*/
|
|
51
|
-
xAxis?: React.JSXElementConstructor<ChartsXAxisProps>;
|
|
52
|
+
xAxis?: React.JSXElementConstructor<ChartsXAxisProps & XAxisPropsOverrides>;
|
|
52
53
|
/**
|
|
53
54
|
* Custom component for the y-axis.
|
|
54
55
|
* @default ChartsYAxis
|
|
55
56
|
*/
|
|
56
|
-
yAxis?: React.JSXElementConstructor<ChartsYAxisProps>;
|
|
57
|
+
yAxis?: React.JSXElementConstructor<ChartsYAxisProps & YAxisPropsOverrides>;
|
|
57
58
|
}
|
|
58
59
|
export interface ChartsAxisSlotProps {
|
|
59
|
-
axisLine?: Partial<React.SVGAttributes<SVGPathElement
|
|
60
|
-
axisTick?: Partial<React.SVGAttributes<SVGPathElement
|
|
61
|
-
axisTickLabel?: Partial<ChartsTextProps
|
|
62
|
-
axisLabel?: Partial<ChartsTextProps
|
|
63
|
-
xAxis?: Partial<ChartsXAxisProps
|
|
64
|
-
yAxis?: Partial<ChartsYAxisProps
|
|
60
|
+
axisLine?: Partial<React.SVGAttributes<SVGPathElement>> & AxisLinePropsOverrides;
|
|
61
|
+
axisTick?: Partial<React.SVGAttributes<SVGPathElement>> & AxisTickPropsOverrides;
|
|
62
|
+
axisTickLabel?: Partial<ChartsTextProps> & AxisTickLabelPropsOverrides;
|
|
63
|
+
axisLabel?: Partial<ChartsTextProps> & AxisLabelPropsOverrides;
|
|
64
|
+
xAxis?: Partial<ChartsXAxisProps> & XAxisPropsOverrides;
|
|
65
|
+
yAxis?: Partial<ChartsYAxisProps> & YAxisPropsOverrides;
|
|
65
66
|
}
|
|
66
67
|
export interface ChartsAxisProps extends TickParams {
|
|
67
68
|
/**
|
|
@@ -515,6 +516,11 @@ type CommonAxisConfig<S extends ScaleName = ScaleName, V = any> = {
|
|
|
515
516
|
min: NumberValue;
|
|
516
517
|
max: NumberValue;
|
|
517
518
|
});
|
|
519
|
+
/**
|
|
520
|
+
* Defines the series used to compute the axis domain.
|
|
521
|
+
* @default "all"
|
|
522
|
+
*/
|
|
523
|
+
domainSeries?: 'all' | 'visible';
|
|
518
524
|
/**
|
|
519
525
|
* If `true`, the axis will be ignored by the tooltip with `trigger='axis'`.
|
|
520
526
|
*/
|
package/models/axis.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ import { type DatasetElementType } from "./seriesType/config.js";
|
|
|
6
6
|
import type { DefaultizedZoomOptions } from "../internals/plugins/featurePlugins/useChartCartesianAxis/index.js";
|
|
7
7
|
import { type ChartsAxisClasses } from "../ChartsAxis/axisClasses.js";
|
|
8
8
|
import type { TickParams } from "../hooks/useTicks.js";
|
|
9
|
+
import type { AxisLinePropsOverrides, AxisTickPropsOverrides, AxisTickLabelPropsOverrides, AxisLabelPropsOverrides, XAxisPropsOverrides, YAxisPropsOverrides } from "./chartsSlotsComponentsProps.js";
|
|
9
10
|
import type { ChartsTextProps } from "../ChartsText/index.js";
|
|
10
11
|
import type { ContinuousColorConfig, OrdinalColorConfig, PiecewiseColorConfig } from "./colorMapping.js";
|
|
11
12
|
import type { OrdinalTimeTicks } from "./timeTicks.js";
|
|
@@ -28,40 +29,40 @@ export interface ChartsAxisSlots {
|
|
|
28
29
|
* Custom component for the axis main line.
|
|
29
30
|
* @default 'line'
|
|
30
31
|
*/
|
|
31
|
-
axisLine?: React.JSXElementConstructor<React.SVGAttributes<SVGPathElement
|
|
32
|
+
axisLine?: React.JSXElementConstructor<React.SVGAttributes<SVGPathElement> & AxisLinePropsOverrides>;
|
|
32
33
|
/**
|
|
33
34
|
* Custom component for the axis tick.
|
|
34
35
|
* @default 'line'
|
|
35
36
|
*/
|
|
36
|
-
axisTick?: React.JSXElementConstructor<React.SVGAttributes<SVGPathElement
|
|
37
|
+
axisTick?: React.JSXElementConstructor<React.SVGAttributes<SVGPathElement> & AxisTickPropsOverrides>;
|
|
37
38
|
/**
|
|
38
39
|
* Custom component for tick label.
|
|
39
40
|
* @default ChartsText
|
|
40
41
|
*/
|
|
41
|
-
axisTickLabel?: React.JSXElementConstructor<ChartsTextProps>;
|
|
42
|
+
axisTickLabel?: React.JSXElementConstructor<ChartsTextProps & AxisTickLabelPropsOverrides>;
|
|
42
43
|
/**
|
|
43
44
|
* Custom component for axis label.
|
|
44
45
|
* @default ChartsText
|
|
45
46
|
*/
|
|
46
|
-
axisLabel?: React.JSXElementConstructor<ChartsTextProps>;
|
|
47
|
+
axisLabel?: React.JSXElementConstructor<ChartsTextProps & AxisLabelPropsOverrides>;
|
|
47
48
|
/**
|
|
48
49
|
* Custom component for the x-axis.
|
|
49
50
|
* @default ChartsXAxis
|
|
50
51
|
*/
|
|
51
|
-
xAxis?: React.JSXElementConstructor<ChartsXAxisProps>;
|
|
52
|
+
xAxis?: React.JSXElementConstructor<ChartsXAxisProps & XAxisPropsOverrides>;
|
|
52
53
|
/**
|
|
53
54
|
* Custom component for the y-axis.
|
|
54
55
|
* @default ChartsYAxis
|
|
55
56
|
*/
|
|
56
|
-
yAxis?: React.JSXElementConstructor<ChartsYAxisProps>;
|
|
57
|
+
yAxis?: React.JSXElementConstructor<ChartsYAxisProps & YAxisPropsOverrides>;
|
|
57
58
|
}
|
|
58
59
|
export interface ChartsAxisSlotProps {
|
|
59
|
-
axisLine?: Partial<React.SVGAttributes<SVGPathElement
|
|
60
|
-
axisTick?: Partial<React.SVGAttributes<SVGPathElement
|
|
61
|
-
axisTickLabel?: Partial<ChartsTextProps
|
|
62
|
-
axisLabel?: Partial<ChartsTextProps
|
|
63
|
-
xAxis?: Partial<ChartsXAxisProps
|
|
64
|
-
yAxis?: Partial<ChartsYAxisProps
|
|
60
|
+
axisLine?: Partial<React.SVGAttributes<SVGPathElement>> & AxisLinePropsOverrides;
|
|
61
|
+
axisTick?: Partial<React.SVGAttributes<SVGPathElement>> & AxisTickPropsOverrides;
|
|
62
|
+
axisTickLabel?: Partial<ChartsTextProps> & AxisTickLabelPropsOverrides;
|
|
63
|
+
axisLabel?: Partial<ChartsTextProps> & AxisLabelPropsOverrides;
|
|
64
|
+
xAxis?: Partial<ChartsXAxisProps> & XAxisPropsOverrides;
|
|
65
|
+
yAxis?: Partial<ChartsYAxisProps> & YAxisPropsOverrides;
|
|
65
66
|
}
|
|
66
67
|
export interface ChartsAxisProps extends TickParams {
|
|
67
68
|
/**
|
|
@@ -515,6 +516,11 @@ type CommonAxisConfig<S extends ScaleName = ScaleName, V = any> = {
|
|
|
515
516
|
min: NumberValue;
|
|
516
517
|
max: NumberValue;
|
|
517
518
|
});
|
|
519
|
+
/**
|
|
520
|
+
* Defines the series used to compute the axis domain.
|
|
521
|
+
* @default "all"
|
|
522
|
+
*/
|
|
523
|
+
domainSeries?: 'all' | 'visible';
|
|
518
524
|
/**
|
|
519
525
|
* If `true`, the axis will be ignored by the tooltip with `trigger='axis'`.
|
|
520
526
|
*/
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export interface BaseButtonPropsOverrides {}
|
|
2
|
+
export interface BaseIconButtonPropsOverrides {}
|
|
3
|
+
export interface BaseToggleButtonPropsOverrides {}
|
|
4
|
+
export interface BaseToggleButtonGroupPropsOverrides {}
|
|
5
|
+
export interface AxisLinePropsOverrides {}
|
|
6
|
+
export interface AxisTickPropsOverrides {}
|
|
7
|
+
export interface AxisTickLabelPropsOverrides {}
|
|
8
|
+
export interface AxisLabelPropsOverrides {}
|
|
9
|
+
export interface XAxisPropsOverrides {}
|
|
10
|
+
export interface YAxisPropsOverrides {}
|
|
11
|
+
export interface BarPropsOverrides {}
|
|
12
|
+
export interface BarLabelPropsOverrides {}
|
|
13
|
+
export interface LinePropsOverrides {}
|
|
14
|
+
export interface AreaPropsOverrides {}
|
|
15
|
+
export interface MarkPropsOverrides {}
|
|
16
|
+
export interface LineHighlightPropsOverrides {}
|
|
17
|
+
export interface PieArcPropsOverrides {}
|
|
18
|
+
export interface PieArcLabelPropsOverrides {}
|
|
19
|
+
export interface ScatterPropsOverrides {}
|
|
20
|
+
export interface MarkerPropsOverrides {}
|
|
21
|
+
export interface LegendPropsOverrides {}
|
|
22
|
+
export interface LoadingOverlayPropsOverrides {}
|
|
23
|
+
export interface NoDataOverlayPropsOverrides {}
|
|
24
|
+
export interface ToolbarPropsOverrides {}
|
|
25
|
+
export interface TooltipPropsOverrides {}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export interface BaseButtonPropsOverrides {}
|
|
2
|
+
export interface BaseIconButtonPropsOverrides {}
|
|
3
|
+
export interface BaseToggleButtonPropsOverrides {}
|
|
4
|
+
export interface BaseToggleButtonGroupPropsOverrides {}
|
|
5
|
+
export interface AxisLinePropsOverrides {}
|
|
6
|
+
export interface AxisTickPropsOverrides {}
|
|
7
|
+
export interface AxisTickLabelPropsOverrides {}
|
|
8
|
+
export interface AxisLabelPropsOverrides {}
|
|
9
|
+
export interface XAxisPropsOverrides {}
|
|
10
|
+
export interface YAxisPropsOverrides {}
|
|
11
|
+
export interface BarPropsOverrides {}
|
|
12
|
+
export interface BarLabelPropsOverrides {}
|
|
13
|
+
export interface LinePropsOverrides {}
|
|
14
|
+
export interface AreaPropsOverrides {}
|
|
15
|
+
export interface MarkPropsOverrides {}
|
|
16
|
+
export interface LineHighlightPropsOverrides {}
|
|
17
|
+
export interface PieArcPropsOverrides {}
|
|
18
|
+
export interface PieArcLabelPropsOverrides {}
|
|
19
|
+
export interface ScatterPropsOverrides {}
|
|
20
|
+
export interface MarkerPropsOverrides {}
|
|
21
|
+
export interface LegendPropsOverrides {}
|
|
22
|
+
export interface LoadingOverlayPropsOverrides {}
|
|
23
|
+
export interface NoDataOverlayPropsOverrides {}
|
|
24
|
+
export interface ToolbarPropsOverrides {}
|
|
25
|
+
export interface TooltipPropsOverrides {}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/models/index.d.mts
CHANGED
|
@@ -2,6 +2,7 @@ export * from "./seriesType/index.mjs";
|
|
|
2
2
|
export * from "./stacking.mjs";
|
|
3
3
|
export * from "./slots/index.mjs";
|
|
4
4
|
export * from "./featureFlags.mjs";
|
|
5
|
+
export * from "./chartsSlotsComponentsProps.mjs";
|
|
5
6
|
export type { AxisConfig, ChartsYAxisProps, ChartsXAxisProps, ScaleName, ContinuousScaleName, ChartsAxisData, XAxis, YAxis, RadiusAxis, RotationAxis, AxisItemIdentifier, AxisValueFormatterContext } from "./axis.mjs";
|
|
6
7
|
export type { NumberValue } from '@mui/x-charts-vendor/d3-scale';
|
|
7
8
|
export type { PropsFromSlot } from '@mui/x-internals/slots';
|
package/models/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ export * from "./seriesType/index.js";
|
|
|
2
2
|
export * from "./stacking.js";
|
|
3
3
|
export * from "./slots/index.js";
|
|
4
4
|
export * from "./featureFlags.js";
|
|
5
|
+
export * from "./chartsSlotsComponentsProps.js";
|
|
5
6
|
export type { AxisConfig, ChartsYAxisProps, ChartsXAxisProps, ScaleName, ContinuousScaleName, ChartsAxisData, XAxis, YAxis, RadiusAxis, RotationAxis, AxisItemIdentifier, AxisValueFormatterContext } from "./axis.js";
|
|
6
7
|
export type { NumberValue } from '@mui/x-charts-vendor/d3-scale';
|
|
7
8
|
export type { PropsFromSlot } from '@mui/x-internals/slots';
|
package/models/index.js
CHANGED
|
@@ -46,4 +46,15 @@ Object.keys(_featureFlags).forEach(function (key) {
|
|
|
46
46
|
return _featureFlags[key];
|
|
47
47
|
}
|
|
48
48
|
});
|
|
49
|
+
});
|
|
50
|
+
var _chartsSlotsComponentsProps = require("./chartsSlotsComponentsProps");
|
|
51
|
+
Object.keys(_chartsSlotsComponentsProps).forEach(function (key) {
|
|
52
|
+
if (key === "default" || key === "__esModule") return;
|
|
53
|
+
if (key in exports && exports[key] === _chartsSlotsComponentsProps[key]) return;
|
|
54
|
+
Object.defineProperty(exports, key, {
|
|
55
|
+
enumerable: true,
|
|
56
|
+
get: function () {
|
|
57
|
+
return _chartsSlotsComponentsProps[key];
|
|
58
|
+
}
|
|
59
|
+
});
|
|
49
60
|
});
|
package/models/index.mjs
CHANGED
|
@@ -52,7 +52,7 @@ export interface CommonBarSeriesType {
|
|
|
52
52
|
*/
|
|
53
53
|
barLabel?: 'value' | ((item: BarItem, context: BarLabelContext) => string | null | undefined);
|
|
54
54
|
}
|
|
55
|
-
export interface BarSeriesType extends CommonSeriesType<
|
|
55
|
+
export interface BarSeriesType extends CommonSeriesType<'bar'>, CartesianSeriesType, StackableSeriesType, CommonBarSeriesType {
|
|
56
56
|
type: 'bar';
|
|
57
57
|
/**
|
|
58
58
|
* The placement of the bar label. It accepts the following values:
|
|
@@ -52,7 +52,7 @@ export interface CommonBarSeriesType {
|
|
|
52
52
|
*/
|
|
53
53
|
barLabel?: 'value' | ((item: BarItem, context: BarLabelContext) => string | null | undefined);
|
|
54
54
|
}
|
|
55
|
-
export interface BarSeriesType extends CommonSeriesType<
|
|
55
|
+
export interface BarSeriesType extends CommonSeriesType<'bar'>, CartesianSeriesType, StackableSeriesType, CommonBarSeriesType {
|
|
56
56
|
type: 'bar';
|
|
57
57
|
/**
|
|
58
58
|
* The placement of the bar label. It accepts the following values:
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { StackOffsetType, StackOrderType } from "../stacking.mjs";
|
|
2
2
|
import type { ChartsLabelMarkType } from "../../ChartsLabel/ChartsLabelMark.mjs";
|
|
3
3
|
import type { AxisId } from "../axis.mjs";
|
|
4
|
-
import type { ChartSeriesType, HighlightScope } from "./config.mjs";
|
|
4
|
+
import type { ChartSeriesType, ChartsSeriesConfig, HighlightScope } from "./config.mjs";
|
|
5
5
|
/**
|
|
6
6
|
* The unique identifier of a series.
|
|
7
7
|
*/
|
|
@@ -33,18 +33,18 @@ export interface SeriesColor<TValue> {
|
|
|
33
33
|
*/
|
|
34
34
|
colorGetter?: (data: ColorCallbackValue<TValue>) => string;
|
|
35
35
|
}
|
|
36
|
-
export interface CommonSeriesType<
|
|
36
|
+
export interface CommonSeriesType<SeriesType extends ChartSeriesType> extends SeriesColor<ChartsSeriesConfig[SeriesType]['valueType']> {
|
|
37
37
|
/**
|
|
38
38
|
* The id of this series.
|
|
39
39
|
*/
|
|
40
40
|
id?: SeriesId;
|
|
41
41
|
/**
|
|
42
42
|
* Formatter used to render values in tooltip or other data display.
|
|
43
|
-
* @param {
|
|
43
|
+
* @param {ChartsSeriesConfig[SeriesType]['valueType']} value The series' value to render.
|
|
44
44
|
* @param {SeriesValueFormatterContext} context The rendering context of the value.
|
|
45
45
|
* @returns {string | null} The string to display or null if the value should not be shown.
|
|
46
46
|
*/
|
|
47
|
-
valueFormatter?: SeriesValueFormatter<
|
|
47
|
+
valueFormatter?: SeriesValueFormatter<ChartsSeriesConfig[SeriesType]['valueType']>;
|
|
48
48
|
/**
|
|
49
49
|
* The scope to apply when the series is highlighted.
|
|
50
50
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { StackOffsetType, StackOrderType } from "../stacking.js";
|
|
2
2
|
import type { ChartsLabelMarkType } from "../../ChartsLabel/ChartsLabelMark.js";
|
|
3
3
|
import type { AxisId } from "../axis.js";
|
|
4
|
-
import type { ChartSeriesType, HighlightScope } from "./config.js";
|
|
4
|
+
import type { ChartSeriesType, ChartsSeriesConfig, HighlightScope } from "./config.js";
|
|
5
5
|
/**
|
|
6
6
|
* The unique identifier of a series.
|
|
7
7
|
*/
|
|
@@ -33,18 +33,18 @@ export interface SeriesColor<TValue> {
|
|
|
33
33
|
*/
|
|
34
34
|
colorGetter?: (data: ColorCallbackValue<TValue>) => string;
|
|
35
35
|
}
|
|
36
|
-
export interface CommonSeriesType<
|
|
36
|
+
export interface CommonSeriesType<SeriesType extends ChartSeriesType> extends SeriesColor<ChartsSeriesConfig[SeriesType]['valueType']> {
|
|
37
37
|
/**
|
|
38
38
|
* The id of this series.
|
|
39
39
|
*/
|
|
40
40
|
id?: SeriesId;
|
|
41
41
|
/**
|
|
42
42
|
* Formatter used to render values in tooltip or other data display.
|
|
43
|
-
* @param {
|
|
43
|
+
* @param {ChartsSeriesConfig[SeriesType]['valueType']} value The series' value to render.
|
|
44
44
|
* @param {SeriesValueFormatterContext} context The rendering context of the value.
|
|
45
45
|
* @returns {string | null} The string to display or null if the value should not be shown.
|
|
46
46
|
*/
|
|
47
|
-
valueFormatter?: SeriesValueFormatter<
|
|
47
|
+
valueFormatter?: SeriesValueFormatter<ChartsSeriesConfig[SeriesType]['valueType']>;
|
|
48
48
|
/**
|
|
49
49
|
* The scope to apply when the series is highlighted.
|
|
50
50
|
*/
|
|
@@ -2,7 +2,7 @@ import type { DefaultizedProps, MakeOptional, MakeRequired } from '@mui/x-intern
|
|
|
2
2
|
import type { ScatterSeriesType, DefaultizedScatterSeriesType, ScatterItemIdentifier, ScatterValueType } from "./scatter.mjs";
|
|
3
3
|
import type { LineSeriesType, DefaultizedLineSeriesType, LineItemIdentifier } from "./line.mjs";
|
|
4
4
|
import type { BarItemIdentifier, BarSeriesType, DefaultizedBarSeriesType } from "./bar.mjs";
|
|
5
|
-
import type { PieSeriesType, DefaultizedPieSeriesType, PieItemIdentifier, PieValueType,
|
|
5
|
+
import type { PieSeriesType, DefaultizedPieSeriesType, PieItemIdentifier, PieValueType, PieSeriesLayout } from "./pie.mjs";
|
|
6
6
|
import type { DefaultizedRadarSeriesType, RadarItemIdentifier, RadarSeriesType } from "./radar.mjs";
|
|
7
7
|
import type { SeriesColor, SeriesId } from "./common.mjs";
|
|
8
8
|
import type { ChartsRadiusAxisProps, ChartsRotationAxisProps, ComputedXAxis, ComputedYAxis, PolarAxisDefaultized } from "../axis.mjs";
|
|
@@ -74,7 +74,7 @@ export interface ChartsSeriesConfig {
|
|
|
74
74
|
};
|
|
75
75
|
};
|
|
76
76
|
scatter: {
|
|
77
|
-
seriesInput: DefaultizedProps<ScatterSeriesType, 'id'> & MakeRequired<SeriesColor<ScatterValueType
|
|
77
|
+
seriesInput: DefaultizedProps<ScatterSeriesType, 'id'> & MakeRequired<SeriesColor<ScatterValueType>, 'color'>;
|
|
78
78
|
series: DefaultizedScatterSeriesType;
|
|
79
79
|
seriesLayout: {};
|
|
80
80
|
seriesProp: ScatterSeriesType;
|
|
@@ -104,7 +104,7 @@ export interface ChartsSeriesConfig {
|
|
|
104
104
|
seriesProp: PieSeriesType<MakeOptional<PieValueType, 'id'>>;
|
|
105
105
|
itemIdentifier: PieItemIdentifier;
|
|
106
106
|
itemIdentifierWithData: PieItemIdentifier;
|
|
107
|
-
valueType:
|
|
107
|
+
valueType: PieValueType;
|
|
108
108
|
highlightScope: CommonHighlightScope;
|
|
109
109
|
descriptionGetterParams: {
|
|
110
110
|
identifier: PieItemIdentifier;
|