@mui/x-charts 9.2.0 → 9.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/BarChart/BarChart.js +10 -10
- package/BarChart/BarChart.mjs +10 -10
- 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/BarChart/seriesConfig/bar/getColor.js +7 -53
- package/BarChart/seriesConfig/bar/getColor.mjs +7 -53
- package/BarChart/seriesConfig/bar/seriesProcessor.js +3 -1
- package/BarChart/seriesConfig/bar/seriesProcessor.mjs +3 -1
- package/BarChart/seriesConfig/bar/tooltip.js +4 -27
- package/BarChart/seriesConfig/bar/tooltip.mjs +4 -27
- package/CHANGELOG.md +314 -0
- package/ChartsContainer/ChartsContainer.js +30 -9
- package/ChartsContainer/ChartsContainer.mjs +30 -9
- package/ChartsLabel/ChartsLabelMark.js +1 -23
- package/ChartsLabel/ChartsLabelMark.mjs +0 -22
- package/ChartsLabel/labelMarkClasses.d.mts +0 -1
- package/ChartsLabel/labelMarkClasses.d.ts +0 -1
- package/ChartsLabel/labelMarkClasses.js +1 -2
- package/ChartsLabel/labelMarkClasses.mjs +2 -2
- package/ChartsLayerContainer/ChartsLayerContainer.js +36 -30
- package/ChartsLayerContainer/ChartsLayerContainer.mjs +36 -30
- 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/ChartsReferenceLine/ChartsXReferenceLine.js +6 -1
- package/ChartsReferenceLine/ChartsXReferenceLine.mjs +6 -1
- package/ChartsReferenceLine/ChartsYReferenceLine.js +5 -0
- package/ChartsReferenceLine/ChartsYReferenceLine.mjs +5 -0
- package/ChartsTooltip/ChartTooltip.types.d.mts +3 -2
- package/ChartsTooltip/ChartTooltip.types.d.ts +3 -2
- 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/ChartsXAxis.js +3 -1
- package/ChartsXAxis/ChartsXAxis.mjs +3 -1
- package/ChartsXAxis/useAxisTicksProps.d.mts +84 -3
- package/ChartsXAxis/useAxisTicksProps.d.ts +84 -3
- package/ChartsYAxis/ChartsYAxis.js +3 -1
- package/ChartsYAxis/ChartsYAxis.mjs +3 -1
- 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/LineChart.js +6 -6
- package/LineChart/LineChart.mjs +6 -6
- package/LineChart/LineElement.d.mts +3 -2
- package/LineChart/LineElement.d.ts +3 -2
- 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/MarkPlot.d.mts +3 -2
- package/LineChart/MarkPlot.d.ts +3 -2
- package/LineChart/seriesConfig/curveEvaluation.js +40 -15
- package/LineChart/seriesConfig/curveEvaluation.mjs +39 -15
- package/LineChart/seriesConfig/extremums.js +5 -1
- package/LineChart/seriesConfig/extremums.mjs +5 -1
- package/LineChart/seriesConfig/getColor.js +7 -54
- package/LineChart/seriesConfig/getColor.mjs +7 -54
- package/LineChart/seriesConfig/seriesProcessor.d.mts +2 -4
- package/LineChart/seriesConfig/seriesProcessor.d.ts +2 -4
- package/LineChart/seriesConfig/seriesProcessor.js +2 -139
- package/LineChart/seriesConfig/seriesProcessor.mjs +2 -138
- package/LineChart/seriesConfig/tooltip.js +4 -25
- package/LineChart/seriesConfig/tooltip.mjs +4 -25
- 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/PieChart/PieChart.js +6 -6
- package/PieChart/PieChart.mjs +6 -6
- package/RadarChart/RadarAxis/RadarAxis.utils.d.mts +2 -2
- package/RadarChart/RadarAxis/RadarAxis.utils.d.ts +2 -2
- package/RadarChart/RadarAxis/useRadarAxis.js +1 -1
- package/RadarChart/RadarAxis/useRadarAxis.mjs +1 -1
- package/RadarChart/RadarChart.js +8 -8
- package/RadarChart/RadarChart.mjs +8 -8
- package/RadarChart/RadarSeriesPlot/RadarSeriesArea.js +3 -1
- package/RadarChart/RadarSeriesPlot/RadarSeriesArea.mjs +3 -1
- package/RadarChart/RadarSeriesPlot/RadarSeriesMarks.js +1 -0
- package/RadarChart/RadarSeriesPlot/RadarSeriesMarks.mjs +1 -0
- package/RadarChart/RadarSeriesPlot/RadarSeriesPlot.js +1 -0
- package/RadarChart/RadarSeriesPlot/RadarSeriesPlot.mjs +1 -0
- 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 +32 -11
- package/ScatterChart/ScatterChart.mjs +32 -11
- package/ScatterChart/ScatterMarker.types.d.mts +3 -2
- package/ScatterChart/ScatterMarker.types.d.ts +3 -2
- package/ScatterChart/ScatterPlot.d.mts +3 -2
- package/ScatterChart/ScatterPlot.d.ts +3 -2
- package/ScatterChart/ScatterPlot.js +6 -1
- package/ScatterChart/ScatterPlot.mjs +6 -1
- 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/seriesConfig/tooltip.js +2 -24
- package/ScatterChart/seriesConfig/tooltip.mjs +2 -24
- 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 +27 -27
- package/SparkLineChart/SparkLineChart.mjs +27 -27
- 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/components/ChartsAccessibilityProxy/ChartsAccessibilityProxy.js +1 -1
- package/internals/components/ChartsAccessibilityProxy/ChartsAccessibilityProxy.mjs +1 -1
- 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/getLineLikeTooltip.d.mts +9 -0
- package/internals/getLineLikeTooltip.d.ts +9 -0
- package/internals/getLineLikeTooltip.js +38 -0
- package/internals/getLineLikeTooltip.mjs +31 -0
- 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 +5 -0
- package/internals/index.d.ts +5 -0
- package/internals/index.js +48 -0
- package/internals/index.mjs +5 -0
- package/internals/plugins/corePlugins/useChartSeriesConfig/types/tooltipGetter.types.d.mts +4 -2
- package/internals/plugins/corePlugins/useChartSeriesConfig/types/tooltipGetter.types.d.ts +4 -2
- 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/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 +6 -2
- package/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.mjs +6 -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/processLineLikeSeries.d.mts +6 -0
- package/internals/processLineLikeSeries.d.ts +6 -0
- package/internals/processLineLikeSeries.js +145 -0
- package/internals/processLineLikeSeries.mjs +138 -0
- package/internals/resolveColorProcessor.d.mts +11 -0
- package/internals/resolveColorProcessor.d.ts +11 -0
- package/internals/resolveColorProcessor.js +62 -0
- package/internals/resolveColorProcessor.mjs +56 -0
- 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/line.d.mts +5 -2
- package/models/seriesType/line.d.ts +5 -2
- package/models/seriesType/scatter.d.mts +34 -2
- package/models/seriesType/scatter.d.ts +34 -2
- 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 +6 -6
|
@@ -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
|
@@ -61,10 +61,13 @@ export interface CommonLineSeriesType {
|
|
|
61
61
|
strictStepCurve?: boolean;
|
|
62
62
|
/**
|
|
63
63
|
* Define which items of the series should display a mark.
|
|
64
|
-
*
|
|
64
|
+
* It can be a boolean that applies to all items.
|
|
65
|
+
* It can be `'start'` or `'end'` to only display a mark on the first or last item. Such marks reuse
|
|
66
|
+
* the line highlight element, so they are replaced by the highlighted item when the pointer
|
|
67
|
+
* highlights a value.
|
|
65
68
|
* Or a callback that gets some item properties and returns true if the item should be displayed.
|
|
66
69
|
*/
|
|
67
|
-
showMark?: boolean | ((params: ShowMarkParams) => boolean);
|
|
70
|
+
showMark?: boolean | 'start' | 'end' | ((params: ShowMarkParams) => boolean);
|
|
68
71
|
/**
|
|
69
72
|
* The shape of the mark elements.
|
|
70
73
|
* Using 'circle' renders a `<circle />` element, while all other options render a `<path />` instead. The path causes a small decrease in performance.
|
|
@@ -61,10 +61,13 @@ export interface CommonLineSeriesType {
|
|
|
61
61
|
strictStepCurve?: boolean;
|
|
62
62
|
/**
|
|
63
63
|
* Define which items of the series should display a mark.
|
|
64
|
-
*
|
|
64
|
+
* It can be a boolean that applies to all items.
|
|
65
|
+
* It can be `'start'` or `'end'` to only display a mark on the first or last item. Such marks reuse
|
|
66
|
+
* the line highlight element, so they are replaced by the highlighted item when the pointer
|
|
67
|
+
* highlights a value.
|
|
65
68
|
* Or a callback that gets some item properties and returns true if the item should be displayed.
|
|
66
69
|
*/
|
|
67
|
-
showMark?: boolean | ((params: ShowMarkParams) => boolean);
|
|
70
|
+
showMark?: boolean | 'start' | 'end' | ((params: ShowMarkParams) => boolean);
|
|
68
71
|
/**
|
|
69
72
|
* The shape of the mark elements.
|
|
70
73
|
* Using 'circle' renders a `<circle />` element, while all other options render a `<path />` instead. The path causes a small decrease in performance.
|
|
@@ -4,6 +4,18 @@ import { type DatasetElementType } from "./config.mjs";
|
|
|
4
4
|
export type ScatterValueType = {
|
|
5
5
|
x: number;
|
|
6
6
|
y: number;
|
|
7
|
+
/**
|
|
8
|
+
* The value used to compute the color of the scatter point through a color axis.
|
|
9
|
+
*/
|
|
10
|
+
colorValue?: any;
|
|
11
|
+
/**
|
|
12
|
+
* The value used to compute the size of the scatter point through a size axis.
|
|
13
|
+
*/
|
|
14
|
+
sizeValue?: any;
|
|
15
|
+
/**
|
|
16
|
+
* The value used to compute the color of the scatter point through a color axis.
|
|
17
|
+
* @deprecated Use `colorValue` instead.
|
|
18
|
+
*/
|
|
7
19
|
z?: any;
|
|
8
20
|
/**
|
|
9
21
|
* A unique identifier for the scatter point
|
|
@@ -21,8 +33,19 @@ export interface ScatterSeriesType extends CommonSeriesType<ScatterValueType | n
|
|
|
21
33
|
* The label to display on the tooltip or the legend. It can be a string or a function.
|
|
22
34
|
*/
|
|
23
35
|
label?: string | ((location: 'tooltip' | 'legend') => string);
|
|
36
|
+
/**
|
|
37
|
+
* The id of the color axis used to compute the color of the scatter points.
|
|
38
|
+
* It points to the id of an axis defined with the `zAxis` prop.
|
|
39
|
+
*/
|
|
40
|
+
colorAxisId?: string;
|
|
41
|
+
/**
|
|
42
|
+
* The id of the size axis used to compute the size of the scatter points.
|
|
43
|
+
* It points to the id of an axis defined with the `zAxis` prop.
|
|
44
|
+
*/
|
|
45
|
+
sizeAxisId?: string;
|
|
24
46
|
/**
|
|
25
47
|
* The id of the z-axis used to render the series.
|
|
48
|
+
* @deprecated Use `colorAxisId` instead.
|
|
26
49
|
*/
|
|
27
50
|
zAxisId?: string;
|
|
28
51
|
/**
|
|
@@ -36,8 +59,8 @@ export interface ScatterSeriesType extends CommonSeriesType<ScatterValueType | n
|
|
|
36
59
|
/**
|
|
37
60
|
* The keys used to retrieve data from the dataset.
|
|
38
61
|
*
|
|
39
|
-
* When this prop is provided,
|
|
40
|
-
* While `
|
|
62
|
+
* When this prop is provided, both `x` and `y` must be provided.
|
|
63
|
+
* While `color`, `size`, and `id` are optional.
|
|
41
64
|
*/
|
|
42
65
|
datasetKeys?: {
|
|
43
66
|
/**
|
|
@@ -48,8 +71,17 @@ export interface ScatterSeriesType extends CommonSeriesType<ScatterValueType | n
|
|
|
48
71
|
* The key used to retrieve data from the dataset for the Y axis.
|
|
49
72
|
*/
|
|
50
73
|
y: string;
|
|
74
|
+
/**
|
|
75
|
+
* The key used to retrieve data from the dataset for the color value.
|
|
76
|
+
*/
|
|
77
|
+
colorValue?: string;
|
|
78
|
+
/**
|
|
79
|
+
* The key used to retrieve data from the dataset for the size value.
|
|
80
|
+
*/
|
|
81
|
+
sizeValue?: string;
|
|
51
82
|
/**
|
|
52
83
|
* The key used to retrieve data from the dataset for the Z axis.
|
|
84
|
+
* @deprecated Use `colorValue` instead.
|
|
53
85
|
*/
|
|
54
86
|
z?: string;
|
|
55
87
|
/**
|
|
@@ -4,6 +4,18 @@ import { type DatasetElementType } from "./config.js";
|
|
|
4
4
|
export type ScatterValueType = {
|
|
5
5
|
x: number;
|
|
6
6
|
y: number;
|
|
7
|
+
/**
|
|
8
|
+
* The value used to compute the color of the scatter point through a color axis.
|
|
9
|
+
*/
|
|
10
|
+
colorValue?: any;
|
|
11
|
+
/**
|
|
12
|
+
* The value used to compute the size of the scatter point through a size axis.
|
|
13
|
+
*/
|
|
14
|
+
sizeValue?: any;
|
|
15
|
+
/**
|
|
16
|
+
* The value used to compute the color of the scatter point through a color axis.
|
|
17
|
+
* @deprecated Use `colorValue` instead.
|
|
18
|
+
*/
|
|
7
19
|
z?: any;
|
|
8
20
|
/**
|
|
9
21
|
* A unique identifier for the scatter point
|
|
@@ -21,8 +33,19 @@ export interface ScatterSeriesType extends CommonSeriesType<ScatterValueType | n
|
|
|
21
33
|
* The label to display on the tooltip or the legend. It can be a string or a function.
|
|
22
34
|
*/
|
|
23
35
|
label?: string | ((location: 'tooltip' | 'legend') => string);
|
|
36
|
+
/**
|
|
37
|
+
* The id of the color axis used to compute the color of the scatter points.
|
|
38
|
+
* It points to the id of an axis defined with the `zAxis` prop.
|
|
39
|
+
*/
|
|
40
|
+
colorAxisId?: string;
|
|
41
|
+
/**
|
|
42
|
+
* The id of the size axis used to compute the size of the scatter points.
|
|
43
|
+
* It points to the id of an axis defined with the `zAxis` prop.
|
|
44
|
+
*/
|
|
45
|
+
sizeAxisId?: string;
|
|
24
46
|
/**
|
|
25
47
|
* The id of the z-axis used to render the series.
|
|
48
|
+
* @deprecated Use `colorAxisId` instead.
|
|
26
49
|
*/
|
|
27
50
|
zAxisId?: string;
|
|
28
51
|
/**
|
|
@@ -36,8 +59,8 @@ export interface ScatterSeriesType extends CommonSeriesType<ScatterValueType | n
|
|
|
36
59
|
/**
|
|
37
60
|
* The keys used to retrieve data from the dataset.
|
|
38
61
|
*
|
|
39
|
-
* When this prop is provided,
|
|
40
|
-
* While `
|
|
62
|
+
* When this prop is provided, both `x` and `y` must be provided.
|
|
63
|
+
* While `color`, `size`, and `id` are optional.
|
|
41
64
|
*/
|
|
42
65
|
datasetKeys?: {
|
|
43
66
|
/**
|
|
@@ -48,8 +71,17 @@ export interface ScatterSeriesType extends CommonSeriesType<ScatterValueType | n
|
|
|
48
71
|
* The key used to retrieve data from the dataset for the Y axis.
|
|
49
72
|
*/
|
|
50
73
|
y: string;
|
|
74
|
+
/**
|
|
75
|
+
* The key used to retrieve data from the dataset for the color value.
|
|
76
|
+
*/
|
|
77
|
+
colorValue?: string;
|
|
78
|
+
/**
|
|
79
|
+
* The key used to retrieve data from the dataset for the size value.
|
|
80
|
+
*/
|
|
81
|
+
sizeValue?: string;
|
|
51
82
|
/**
|
|
52
83
|
* The key used to retrieve data from the dataset for the Z axis.
|
|
84
|
+
* @deprecated Use `colorValue` instead.
|
|
53
85
|
*/
|
|
54
86
|
z?: string;
|
|
55
87
|
/**
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
type SharedContinuousSizeConfig<Value> = {
|
|
2
|
+
type: 'continuous';
|
|
3
|
+
/**
|
|
4
|
+
* The minimal value of the size scale.
|
|
5
|
+
* @default 0
|
|
6
|
+
*/
|
|
7
|
+
min?: Value;
|
|
8
|
+
/**
|
|
9
|
+
* The maximal value of the size scale.
|
|
10
|
+
* @default 100
|
|
11
|
+
*/
|
|
12
|
+
max?: Value;
|
|
13
|
+
};
|
|
14
|
+
type ContinuousSizeConfigWithNamedInterpolator<Value = number | Date> = SharedContinuousSizeConfig<Value> & {
|
|
15
|
+
/**
|
|
16
|
+
* The sizes to render. It can be an array with the extremum sizes, or an interpolation function.
|
|
17
|
+
*/
|
|
18
|
+
size: readonly [number, number];
|
|
19
|
+
/**
|
|
20
|
+
* The interpolator to use when `size` is an array of two numbers. It defines how the size should interpolate between the minimum and maximum values.
|
|
21
|
+
* Default is set to 'sqrt' to map values to surfaces instead of radii.
|
|
22
|
+
* @default 'sqrt'
|
|
23
|
+
*/
|
|
24
|
+
interpolator?: 'sqrt' | 'linear' | 'log';
|
|
25
|
+
};
|
|
26
|
+
export type ContinuousSizeConfigWithFunctionInterpolator<Value = number | Date> = SharedContinuousSizeConfig<Value> & {
|
|
27
|
+
/**
|
|
28
|
+
* The sizes to render. It can be an array with the extremum sizes, or an interpolation function.
|
|
29
|
+
* @param {number} t the interpolation factor. Varies from 0 to 1 when values are from min to max.
|
|
30
|
+
* @returns {number} The size to render for the interpolation factor `t`.
|
|
31
|
+
*/
|
|
32
|
+
size: (t: number) => number;
|
|
33
|
+
};
|
|
34
|
+
export type ContinuousSizeConfig<Value = number | Date> = ContinuousSizeConfigWithNamedInterpolator<Value> | ContinuousSizeConfigWithFunctionInterpolator<Value>;
|
|
35
|
+
export interface PiecewiseSizeConfig<Value = number | Date> {
|
|
36
|
+
type: 'piecewise';
|
|
37
|
+
/**
|
|
38
|
+
* The thresholds where size should change from one category to another.
|
|
39
|
+
*/
|
|
40
|
+
thresholds: Value[];
|
|
41
|
+
/**
|
|
42
|
+
* The sizes used for each band defined by `thresholds`.
|
|
43
|
+
* Should contain N+1 sizes, where N is the number of thresholds.
|
|
44
|
+
*/
|
|
45
|
+
sizes: number[];
|
|
46
|
+
}
|
|
47
|
+
export interface OrdinalSizeConfig<Value = number | Date | string> {
|
|
48
|
+
type: 'ordinal';
|
|
49
|
+
/**
|
|
50
|
+
* The value to map.
|
|
51
|
+
* If undefined, it will be integers from 0 to the number of sizes.
|
|
52
|
+
*/
|
|
53
|
+
values?: readonly Value[];
|
|
54
|
+
/**
|
|
55
|
+
* The size palette.
|
|
56
|
+
* Items equal to `values[k]` will get the size of `sizes[k]`.
|
|
57
|
+
*/
|
|
58
|
+
sizes: number[];
|
|
59
|
+
/**
|
|
60
|
+
* The size to use when an element is not part of the values.
|
|
61
|
+
*/
|
|
62
|
+
unknownSize?: number;
|
|
63
|
+
}
|
|
64
|
+
export {};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
type SharedContinuousSizeConfig<Value> = {
|
|
2
|
+
type: 'continuous';
|
|
3
|
+
/**
|
|
4
|
+
* The minimal value of the size scale.
|
|
5
|
+
* @default 0
|
|
6
|
+
*/
|
|
7
|
+
min?: Value;
|
|
8
|
+
/**
|
|
9
|
+
* The maximal value of the size scale.
|
|
10
|
+
* @default 100
|
|
11
|
+
*/
|
|
12
|
+
max?: Value;
|
|
13
|
+
};
|
|
14
|
+
type ContinuousSizeConfigWithNamedInterpolator<Value = number | Date> = SharedContinuousSizeConfig<Value> & {
|
|
15
|
+
/**
|
|
16
|
+
* The sizes to render. It can be an array with the extremum sizes, or an interpolation function.
|
|
17
|
+
*/
|
|
18
|
+
size: readonly [number, number];
|
|
19
|
+
/**
|
|
20
|
+
* The interpolator to use when `size` is an array of two numbers. It defines how the size should interpolate between the minimum and maximum values.
|
|
21
|
+
* Default is set to 'sqrt' to map values to surfaces instead of radii.
|
|
22
|
+
* @default 'sqrt'
|
|
23
|
+
*/
|
|
24
|
+
interpolator?: 'sqrt' | 'linear' | 'log';
|
|
25
|
+
};
|
|
26
|
+
export type ContinuousSizeConfigWithFunctionInterpolator<Value = number | Date> = SharedContinuousSizeConfig<Value> & {
|
|
27
|
+
/**
|
|
28
|
+
* The sizes to render. It can be an array with the extremum sizes, or an interpolation function.
|
|
29
|
+
* @param {number} t the interpolation factor. Varies from 0 to 1 when values are from min to max.
|
|
30
|
+
* @returns {number} The size to render for the interpolation factor `t`.
|
|
31
|
+
*/
|
|
32
|
+
size: (t: number) => number;
|
|
33
|
+
};
|
|
34
|
+
export type ContinuousSizeConfig<Value = number | Date> = ContinuousSizeConfigWithNamedInterpolator<Value> | ContinuousSizeConfigWithFunctionInterpolator<Value>;
|
|
35
|
+
export interface PiecewiseSizeConfig<Value = number | Date> {
|
|
36
|
+
type: 'piecewise';
|
|
37
|
+
/**
|
|
38
|
+
* The thresholds where size should change from one category to another.
|
|
39
|
+
*/
|
|
40
|
+
thresholds: Value[];
|
|
41
|
+
/**
|
|
42
|
+
* The sizes used for each band defined by `thresholds`.
|
|
43
|
+
* Should contain N+1 sizes, where N is the number of thresholds.
|
|
44
|
+
*/
|
|
45
|
+
sizes: number[];
|
|
46
|
+
}
|
|
47
|
+
export interface OrdinalSizeConfig<Value = number | Date | string> {
|
|
48
|
+
type: 'ordinal';
|
|
49
|
+
/**
|
|
50
|
+
* The value to map.
|
|
51
|
+
* If undefined, it will be integers from 0 to the number of sizes.
|
|
52
|
+
*/
|
|
53
|
+
values?: readonly Value[];
|
|
54
|
+
/**
|
|
55
|
+
* The size palette.
|
|
56
|
+
* Items equal to `values[k]` will get the size of `sizes[k]`.
|
|
57
|
+
*/
|
|
58
|
+
sizes: number[];
|
|
59
|
+
/**
|
|
60
|
+
* The size to use when an element is not part of the values.
|
|
61
|
+
*/
|
|
62
|
+
unknownSize?: number;
|
|
63
|
+
}
|
|
64
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import type * as React from 'react';
|
|
2
2
|
import { type ChartBaseButtonProps, type ChartBaseIconButtonProps, type ChartBaseToggleButtonProps, type ChartBaseToggleButtonGroupProps } from "./chartsBaseSlotProps.mjs";
|
|
3
|
+
import type { BaseButtonPropsOverrides, BaseIconButtonPropsOverrides, BaseToggleButtonPropsOverrides, BaseToggleButtonGroupPropsOverrides } from "../chartsSlotsComponentsProps.mjs";
|
|
3
4
|
export interface ChartsBaseSlots {
|
|
4
|
-
baseButton: React.ComponentType<ChartBaseButtonProps>;
|
|
5
|
-
baseIconButton: React.ComponentType<ChartBaseIconButtonProps>;
|
|
5
|
+
baseButton: React.ComponentType<ChartBaseButtonProps & BaseButtonPropsOverrides>;
|
|
6
|
+
baseIconButton: React.ComponentType<ChartBaseIconButtonProps & BaseIconButtonPropsOverrides>;
|
|
6
7
|
/**
|
|
7
8
|
* Note: MUI's `ToggleButton` has an incompatible `href` prop, so it must be cast:
|
|
8
|
-
* `ToggleButton as unknown as React.ComponentType<ChartBaseToggleButtonProps>`.
|
|
9
|
+
* `ToggleButton as unknown as React.ComponentType<ChartBaseToggleButtonProps & BaseToggleButtonPropsOverrides>`.
|
|
9
10
|
*/
|
|
10
|
-
baseToggleButton: React.ComponentType<ChartBaseToggleButtonProps>;
|
|
11
|
-
baseToggleButtonGroup: React.ComponentType<ChartBaseToggleButtonGroupProps>;
|
|
11
|
+
baseToggleButton: React.ComponentType<ChartBaseToggleButtonProps & BaseToggleButtonPropsOverrides>;
|
|
12
|
+
baseToggleButtonGroup: React.ComponentType<ChartBaseToggleButtonGroupProps & BaseToggleButtonGroupPropsOverrides>;
|
|
12
13
|
}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import type * as React from 'react';
|
|
2
2
|
import { type ChartBaseButtonProps, type ChartBaseIconButtonProps, type ChartBaseToggleButtonProps, type ChartBaseToggleButtonGroupProps } from "./chartsBaseSlotProps.js";
|
|
3
|
+
import type { BaseButtonPropsOverrides, BaseIconButtonPropsOverrides, BaseToggleButtonPropsOverrides, BaseToggleButtonGroupPropsOverrides } from "../chartsSlotsComponentsProps.js";
|
|
3
4
|
export interface ChartsBaseSlots {
|
|
4
|
-
baseButton: React.ComponentType<ChartBaseButtonProps>;
|
|
5
|
-
baseIconButton: React.ComponentType<ChartBaseIconButtonProps>;
|
|
5
|
+
baseButton: React.ComponentType<ChartBaseButtonProps & BaseButtonPropsOverrides>;
|
|
6
|
+
baseIconButton: React.ComponentType<ChartBaseIconButtonProps & BaseIconButtonPropsOverrides>;
|
|
6
7
|
/**
|
|
7
8
|
* Note: MUI's `ToggleButton` has an incompatible `href` prop, so it must be cast:
|
|
8
|
-
* `ToggleButton as unknown as React.ComponentType<ChartBaseToggleButtonProps>`.
|
|
9
|
+
* `ToggleButton as unknown as React.ComponentType<ChartBaseToggleButtonProps & BaseToggleButtonPropsOverrides>`.
|
|
9
10
|
*/
|
|
10
|
-
baseToggleButton: React.ComponentType<ChartBaseToggleButtonProps>;
|
|
11
|
-
baseToggleButtonGroup: React.ComponentType<ChartBaseToggleButtonGroupProps>;
|
|
11
|
+
baseToggleButton: React.ComponentType<ChartBaseToggleButtonProps & BaseToggleButtonPropsOverrides>;
|
|
12
|
+
baseToggleButtonGroup: React.ComponentType<ChartBaseToggleButtonGroupProps & BaseToggleButtonGroupPropsOverrides>;
|
|
12
13
|
}
|