@mui/x-charts 7.5.0 → 7.6.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 +30 -3
- package/BarChart/BarElement.d.ts +0 -3
- package/BarChart/BarElement.js +8 -19
- package/BarChart/BarLabel/BarLabel.d.ts +1342 -0
- package/BarChart/BarLabel/BarLabel.js +60 -0
- package/BarChart/BarLabel/BarLabel.types.d.ts +39 -0
- package/BarChart/BarLabel/BarLabel.types.js +5 -0
- package/BarChart/BarLabel/BarLabelItem.d.ts +53 -0
- package/BarChart/BarLabel/BarLabelItem.js +127 -0
- package/BarChart/BarLabel/BarLabelPlot.d.ts +16 -0
- package/BarChart/BarLabel/BarLabelPlot.js +106 -0
- package/BarChart/BarLabel/barLabelClasses.d.ts +13 -0
- package/BarChart/BarLabel/barLabelClasses.js +29 -0
- package/BarChart/BarLabel/getBarLabel.d.ts +10 -0
- package/BarChart/BarLabel/getBarLabel.js +31 -0
- package/BarChart/BarLabel/index.d.ts +6 -0
- package/BarChart/BarLabel/index.js +25 -0
- package/BarChart/BarPlot.d.ts +15 -4
- package/BarChart/BarPlot.js +22 -34
- package/BarChart/checkScaleErrors.d.ts +11 -0
- package/BarChart/checkScaleErrors.js +33 -0
- package/BarChart/index.d.ts +1 -0
- package/BarChart/index.js +11 -0
- package/BarChart/types.d.ts +0 -2
- package/CHANGELOG.md +148 -5418
- package/ChartContainer/ChartContainer.d.ts +3 -2
- package/ChartContainer/ChartContainer.js +20 -3
- package/ChartsAxis/ChartsAxis.js +1 -1
- package/ChartsAxisHighlight/ChartsAxisHighlight.js +1 -1
- package/ChartsClipPath/ChartsClipPath.js +1 -1
- package/ChartsGrid/ChartsGrid.js +1 -1
- package/ChartsLegend/ChartsLegend.js +1 -1
- package/ChartsLegend/DefaultChartsLegend.js +1 -1
- package/ChartsOnAxisClickHandler/ChartsOnAxisClickHandler.js +1 -1
- package/ChartsReferenceLine/ChartsReferenceLine.js +1 -1
- package/ChartsSurface.js +1 -1
- package/ChartsText/ChartsText.js +1 -1
- package/ChartsTooltip/ChartsAxisTooltipContent.js +1 -1
- package/ChartsTooltip/ChartsItemTooltipContent.js +1 -1
- package/ChartsTooltip/ChartsTooltip.js +1 -1
- package/ChartsTooltip/DefaultChartsAxisTooltipContent.js +1 -1
- package/ChartsTooltip/DefaultChartsItemTooltipContent.js +1 -1
- package/ChartsVoronoiHandler/ChartsVoronoiHandler.js +14 -2
- package/ChartsXAxis/ChartsXAxis.js +1 -1
- package/ChartsYAxis/ChartsYAxis.js +1 -1
- package/Gauge/Gauge.js +1 -1
- package/Gauge/GaugeContainer.js +1 -1
- package/Gauge/GaugeValueText.js +1 -1
- package/LineChart/AnimatedArea.js +1 -1
- package/LineChart/AnimatedLine.js +1 -1
- package/LineChart/AreaElement.d.ts +0 -2
- package/LineChart/AreaElement.js +8 -18
- package/LineChart/AreaPlot.js +1 -3
- package/LineChart/LineChart.js +19 -2
- package/LineChart/LineElement.d.ts +0 -2
- package/LineChart/LineElement.js +8 -18
- package/LineChart/LineHighlightElement.js +1 -1
- package/LineChart/LineHighlightPlot.js +1 -1
- package/LineChart/LinePlot.js +1 -3
- package/LineChart/MarkElement.d.ts +0 -2
- package/LineChart/MarkElement.js +11 -33
- package/LineChart/MarkPlot.js +1 -2
- package/PieChart/PieArc.d.ts +4 -1
- package/PieChart/PieArc.js +8 -4
- package/PieChart/PieArcLabel.js +1 -1
- package/PieChart/PieArcLabelPlot.d.ts +1 -1
- package/PieChart/PieArcLabelPlot.js +2 -8
- package/PieChart/PieArcPlot.d.ts +1 -1
- package/PieChart/PieArcPlot.js +6 -8
- package/PieChart/PieChart.js +19 -2
- package/PieChart/PiePlot.js +3 -7
- package/PieChart/dataTransform/useTransformData.d.ts +1 -1
- package/PieChart/dataTransform/useTransformData.js +10 -25
- package/ResponsiveChartContainer/ResponsiveChartContainer.js +14 -1
- package/ScatterChart/Scatter.js +15 -11
- package/ScatterChart/ScatterChart.js +19 -2
- package/ScatterChart/ScatterPlot.js +1 -1
- package/SparkLineChart/SparkLineChart.d.ts +1 -1
- package/SparkLineChart/SparkLineChart.js +14 -1
- package/context/HighlightedProvider/HighlightedContext.d.ts +65 -0
- package/context/HighlightedProvider/HighlightedContext.js +36 -0
- package/context/HighlightedProvider/HighlightedProvider.d.ts +20 -0
- package/context/HighlightedProvider/HighlightedProvider.js +97 -0
- package/context/HighlightedProvider/createIsFaded.d.ts +2 -0
- package/context/HighlightedProvider/createIsFaded.js +19 -0
- package/context/HighlightedProvider/createIsHighlighted.d.ts +2 -0
- package/context/HighlightedProvider/createIsHighlighted.js +19 -0
- package/context/HighlightedProvider/index.d.ts +4 -0
- package/context/HighlightedProvider/index.js +49 -0
- package/context/HighlightedProvider/useHighlighted.d.ts +9 -0
- package/context/HighlightedProvider/useHighlighted.js +24 -0
- package/context/HighlightedProvider/useItemHighlighted.d.ts +21 -0
- package/context/HighlightedProvider/useItemHighlighted.js +37 -0
- package/context/ZAxisContextProvider.js +1 -1
- package/context/index.d.ts +1 -1
- package/context/index.js +15 -0
- package/esm/BarChart/BarChart.js +30 -3
- package/esm/BarChart/BarElement.js +9 -20
- package/esm/BarChart/BarLabel/BarLabel.js +51 -0
- package/esm/BarChart/BarLabel/BarLabel.types.js +1 -0
- package/esm/BarChart/BarLabel/BarLabelItem.js +119 -0
- package/esm/BarChart/BarLabel/BarLabelPlot.js +98 -0
- package/esm/BarChart/BarLabel/barLabelClasses.js +19 -0
- package/esm/BarChart/BarLabel/getBarLabel.js +24 -0
- package/esm/BarChart/BarLabel/index.js +2 -0
- package/esm/BarChart/BarPlot.js +22 -34
- package/esm/BarChart/checkScaleErrors.js +27 -0
- package/esm/BarChart/index.js +2 -1
- package/esm/ChartContainer/ChartContainer.js +20 -3
- package/esm/ChartsAxis/ChartsAxis.js +1 -1
- package/esm/ChartsAxisHighlight/ChartsAxisHighlight.js +1 -1
- package/esm/ChartsClipPath/ChartsClipPath.js +1 -1
- package/esm/ChartsGrid/ChartsGrid.js +1 -1
- package/esm/ChartsLegend/ChartsLegend.js +1 -1
- package/esm/ChartsLegend/DefaultChartsLegend.js +1 -1
- package/esm/ChartsOnAxisClickHandler/ChartsOnAxisClickHandler.js +1 -1
- package/esm/ChartsReferenceLine/ChartsReferenceLine.js +1 -1
- package/esm/ChartsSurface.js +1 -1
- package/esm/ChartsText/ChartsText.js +1 -1
- package/esm/ChartsTooltip/ChartsAxisTooltipContent.js +1 -1
- package/esm/ChartsTooltip/ChartsItemTooltipContent.js +1 -1
- package/esm/ChartsTooltip/ChartsTooltip.js +1 -1
- package/esm/ChartsTooltip/DefaultChartsAxisTooltipContent.js +1 -1
- package/esm/ChartsTooltip/DefaultChartsItemTooltipContent.js +1 -1
- package/esm/ChartsVoronoiHandler/ChartsVoronoiHandler.js +14 -2
- package/esm/ChartsXAxis/ChartsXAxis.js +1 -1
- package/esm/ChartsYAxis/ChartsYAxis.js +1 -1
- package/esm/Gauge/Gauge.js +1 -1
- package/esm/Gauge/GaugeContainer.js +1 -1
- package/esm/Gauge/GaugeValueText.js +1 -1
- package/esm/LineChart/AnimatedArea.js +1 -1
- package/esm/LineChart/AnimatedLine.js +1 -1
- package/esm/LineChart/AreaElement.js +9 -19
- package/esm/LineChart/AreaPlot.js +1 -3
- package/esm/LineChart/LineChart.js +19 -2
- package/esm/LineChart/LineElement.js +9 -19
- package/esm/LineChart/LineHighlightElement.js +1 -1
- package/esm/LineChart/LineHighlightPlot.js +1 -1
- package/esm/LineChart/LinePlot.js +1 -3
- package/esm/LineChart/MarkElement.js +12 -34
- package/esm/LineChart/MarkPlot.js +1 -2
- package/esm/PieChart/PieArc.js +8 -4
- package/esm/PieChart/PieArcLabel.js +1 -1
- package/esm/PieChart/PieArcLabelPlot.js +2 -8
- package/esm/PieChart/PieArcPlot.js +6 -8
- package/esm/PieChart/PieChart.js +19 -2
- package/esm/PieChart/PiePlot.js +3 -7
- package/esm/PieChart/dataTransform/useTransformData.js +10 -25
- package/esm/ResponsiveChartContainer/ResponsiveChartContainer.js +14 -1
- package/esm/ScatterChart/Scatter.js +16 -12
- package/esm/ScatterChart/ScatterChart.js +19 -2
- package/esm/ScatterChart/ScatterPlot.js +1 -1
- package/esm/SparkLineChart/SparkLineChart.js +14 -1
- package/esm/context/HighlightedProvider/HighlightedContext.js +29 -0
- package/esm/context/HighlightedProvider/HighlightedProvider.js +89 -0
- package/esm/context/HighlightedProvider/createIsFaded.js +12 -0
- package/esm/context/HighlightedProvider/createIsHighlighted.js +12 -0
- package/esm/context/HighlightedProvider/index.js +4 -0
- package/esm/context/HighlightedProvider/useHighlighted.js +17 -0
- package/esm/context/HighlightedProvider/useItemHighlighted.js +29 -0
- package/esm/context/ZAxisContextProvider.js +1 -1
- package/esm/context/index.js +1 -0
- package/esm/hooks/useInteractionItemProps.js +9 -41
- package/hooks/useInteractionItemProps.d.ts +1 -4
- package/hooks/useInteractionItemProps.js +11 -45
- package/index.js +1 -1
- package/internals/colorScale.d.ts +1 -1
- package/internals/defaultizeColor.d.ts +13 -13
- package/models/seriesType/common.d.ts +4 -1
- package/modern/BarChart/BarChart.js +30 -3
- package/modern/BarChart/BarElement.js +9 -20
- package/modern/BarChart/BarLabel/BarLabel.js +51 -0
- package/modern/BarChart/BarLabel/BarLabel.types.js +1 -0
- package/modern/BarChart/BarLabel/BarLabelItem.js +119 -0
- package/modern/BarChart/BarLabel/BarLabelPlot.js +98 -0
- package/modern/BarChart/BarLabel/barLabelClasses.js +19 -0
- package/modern/BarChart/BarLabel/getBarLabel.js +24 -0
- package/modern/BarChart/BarLabel/index.js +2 -0
- package/modern/BarChart/BarPlot.js +22 -34
- package/modern/BarChart/checkScaleErrors.js +27 -0
- package/modern/BarChart/index.js +2 -1
- package/modern/ChartContainer/ChartContainer.js +20 -3
- package/modern/ChartsAxis/ChartsAxis.js +1 -1
- package/modern/ChartsAxisHighlight/ChartsAxisHighlight.js +1 -1
- package/modern/ChartsClipPath/ChartsClipPath.js +1 -1
- package/modern/ChartsGrid/ChartsGrid.js +1 -1
- package/modern/ChartsLegend/ChartsLegend.js +1 -1
- package/modern/ChartsLegend/DefaultChartsLegend.js +1 -1
- package/modern/ChartsOnAxisClickHandler/ChartsOnAxisClickHandler.js +1 -1
- package/modern/ChartsReferenceLine/ChartsReferenceLine.js +1 -1
- package/modern/ChartsSurface.js +1 -1
- package/modern/ChartsText/ChartsText.js +1 -1
- package/modern/ChartsTooltip/ChartsAxisTooltipContent.js +1 -1
- package/modern/ChartsTooltip/ChartsItemTooltipContent.js +1 -1
- package/modern/ChartsTooltip/ChartsTooltip.js +1 -1
- package/modern/ChartsTooltip/DefaultChartsAxisTooltipContent.js +1 -1
- package/modern/ChartsTooltip/DefaultChartsItemTooltipContent.js +1 -1
- package/modern/ChartsVoronoiHandler/ChartsVoronoiHandler.js +14 -2
- package/modern/ChartsXAxis/ChartsXAxis.js +1 -1
- package/modern/ChartsYAxis/ChartsYAxis.js +1 -1
- package/modern/Gauge/Gauge.js +1 -1
- package/modern/Gauge/GaugeContainer.js +1 -1
- package/modern/Gauge/GaugeValueText.js +1 -1
- package/modern/LineChart/AnimatedArea.js +1 -1
- package/modern/LineChart/AnimatedLine.js +1 -1
- package/modern/LineChart/AreaElement.js +9 -19
- package/modern/LineChart/AreaPlot.js +1 -3
- package/modern/LineChart/LineChart.js +19 -2
- package/modern/LineChart/LineElement.js +9 -19
- package/modern/LineChart/LineHighlightElement.js +1 -1
- package/modern/LineChart/LineHighlightPlot.js +1 -1
- package/modern/LineChart/LinePlot.js +1 -3
- package/modern/LineChart/MarkElement.js +12 -34
- package/modern/LineChart/MarkPlot.js +1 -2
- package/modern/PieChart/PieArc.js +8 -4
- package/modern/PieChart/PieArcLabel.js +1 -1
- package/modern/PieChart/PieArcLabelPlot.js +2 -8
- package/modern/PieChart/PieArcPlot.js +6 -8
- package/modern/PieChart/PieChart.js +19 -2
- package/modern/PieChart/PiePlot.js +3 -7
- package/modern/PieChart/dataTransform/useTransformData.js +10 -25
- package/modern/ResponsiveChartContainer/ResponsiveChartContainer.js +14 -1
- package/modern/ScatterChart/Scatter.js +16 -12
- package/modern/ScatterChart/ScatterChart.js +19 -2
- package/modern/ScatterChart/ScatterPlot.js +1 -1
- package/modern/SparkLineChart/SparkLineChart.js +14 -1
- package/modern/context/HighlightedProvider/HighlightedContext.js +29 -0
- package/modern/context/HighlightedProvider/HighlightedProvider.js +89 -0
- package/modern/context/HighlightedProvider/createIsFaded.js +12 -0
- package/modern/context/HighlightedProvider/createIsHighlighted.js +12 -0
- package/modern/context/HighlightedProvider/index.js +4 -0
- package/modern/context/HighlightedProvider/useHighlighted.js +17 -0
- package/modern/context/HighlightedProvider/useItemHighlighted.js +29 -0
- package/modern/context/ZAxisContextProvider.js +1 -1
- package/modern/context/index.js +1 -0
- package/modern/hooks/useInteractionItemProps.js +9 -41
- package/modern/index.js +1 -1
- package/package.json +3 -3
- package/themeAugmentation/components.d.ts +4 -0
- package/themeAugmentation/overrides.d.ts +3 -0
- package/themeAugmentation/props.d.ts +2 -0
- package/context/HighlightProvider.d.ts +0 -45
- package/context/HighlightProvider.js +0 -60
- package/esm/context/HighlightProvider.js +0 -51
- package/modern/context/HighlightProvider.js +0 -51
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.BarLabel = BarLabel;
|
|
8
|
+
exports.BarLabelComponent = void 0;
|
|
9
|
+
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
10
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
|
+
var React = _interopRequireWildcard(require("react"));
|
|
12
|
+
var _styles = require("@mui/material/styles");
|
|
13
|
+
var _web = require("@react-spring/web");
|
|
14
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
15
|
+
var _barLabelClasses = require("./barLabelClasses");
|
|
16
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
17
|
+
const _excluded = ["seriesId", "dataIndex", "color", "isFaded", "isHighlighted", "classes"];
|
|
18
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
19
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
20
|
+
const BarLabelComponent = exports.BarLabelComponent = (0, _styles.styled)(_web.animated.text, {
|
|
21
|
+
name: 'MuiBarLabel',
|
|
22
|
+
slot: 'Root',
|
|
23
|
+
overridesResolver: (_, styles) => [{
|
|
24
|
+
[`&.${_barLabelClasses.barLabelClasses.faded}`]: styles.faded
|
|
25
|
+
}, {
|
|
26
|
+
[`&.${_barLabelClasses.barLabelClasses.highlighted}`]: styles.highlighted
|
|
27
|
+
}, styles.root]
|
|
28
|
+
})(({
|
|
29
|
+
theme
|
|
30
|
+
}) => (0, _extends2.default)({}, theme?.typography?.body2, {
|
|
31
|
+
stroke: 'none',
|
|
32
|
+
fill: (theme.vars || theme)?.palette?.text?.primary,
|
|
33
|
+
transition: 'opacity 0.2s ease-in, fill 0.2s ease-in',
|
|
34
|
+
textAnchor: 'middle',
|
|
35
|
+
dominantBaseline: 'central',
|
|
36
|
+
pointerEvents: 'none',
|
|
37
|
+
opacity: 1,
|
|
38
|
+
[`&.${_barLabelClasses.barLabelClasses.faded}`]: {
|
|
39
|
+
opacity: 0.3
|
|
40
|
+
}
|
|
41
|
+
}));
|
|
42
|
+
function BarLabel(props) {
|
|
43
|
+
const themeProps = (0, _styles.useThemeProps)({
|
|
44
|
+
props,
|
|
45
|
+
name: 'MuiBarLabel'
|
|
46
|
+
});
|
|
47
|
+
const otherProps = (0, _objectWithoutPropertiesLoose2.default)(themeProps, _excluded);
|
|
48
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(BarLabelComponent, (0, _extends2.default)({}, otherProps));
|
|
49
|
+
}
|
|
50
|
+
process.env.NODE_ENV !== "production" ? BarLabel.propTypes = {
|
|
51
|
+
// ----------------------------- Warning --------------------------------
|
|
52
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
53
|
+
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
54
|
+
// ----------------------------------------------------------------------
|
|
55
|
+
classes: _propTypes.default.object,
|
|
56
|
+
dataIndex: _propTypes.default.number.isRequired,
|
|
57
|
+
isFaded: _propTypes.default.bool.isRequired,
|
|
58
|
+
isHighlighted: _propTypes.default.bool.isRequired,
|
|
59
|
+
seriesId: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]).isRequired
|
|
60
|
+
} : void 0;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { SeriesId } from '../../models/seriesType/common';
|
|
2
|
+
import type { BarLabelClasses } from './barLabelClasses';
|
|
3
|
+
export interface BarLabelOwnerState {
|
|
4
|
+
seriesId: SeriesId;
|
|
5
|
+
dataIndex: number;
|
|
6
|
+
color: string;
|
|
7
|
+
isFaded: boolean;
|
|
8
|
+
isHighlighted: boolean;
|
|
9
|
+
classes?: Partial<BarLabelClasses>;
|
|
10
|
+
}
|
|
11
|
+
export type BarItem = {
|
|
12
|
+
/**
|
|
13
|
+
* The series id of the bar.
|
|
14
|
+
*/
|
|
15
|
+
seriesId: SeriesId;
|
|
16
|
+
/**
|
|
17
|
+
* The index of the data point in the series.
|
|
18
|
+
*/
|
|
19
|
+
dataIndex: number;
|
|
20
|
+
/**
|
|
21
|
+
* The value of the data point.
|
|
22
|
+
*/
|
|
23
|
+
value: number | null;
|
|
24
|
+
};
|
|
25
|
+
export type BarLabelContext = {
|
|
26
|
+
bar: {
|
|
27
|
+
/**
|
|
28
|
+
* The height of the bar.
|
|
29
|
+
* It could be used to control the label based on the bar size.
|
|
30
|
+
*/
|
|
31
|
+
height: number;
|
|
32
|
+
/**
|
|
33
|
+
* The width of the bar.
|
|
34
|
+
* It could be used to control the label based on the bar size.
|
|
35
|
+
*/
|
|
36
|
+
width: number;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
export type BarLabelFunction = (item: BarItem, context: BarLabelContext) => string | null | undefined;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { BarLabelOwnerState, BarItem, BarLabelContext } from './BarLabel.types';
|
|
3
|
+
import { BarLabelProps } from './BarLabel';
|
|
4
|
+
export interface BarLabelSlots {
|
|
5
|
+
/**
|
|
6
|
+
* The component that renders the bar label.
|
|
7
|
+
* @default BarLabel
|
|
8
|
+
*/
|
|
9
|
+
barLabel?: React.JSXElementConstructor<BarLabelProps>;
|
|
10
|
+
}
|
|
11
|
+
export interface BarLabelSlotProps {
|
|
12
|
+
barLabel?: Partial<BarLabelProps>;
|
|
13
|
+
}
|
|
14
|
+
export type BarLabelItemProps = Omit<BarLabelOwnerState, 'isFaded' | 'isHighlighted'> & Pick<BarLabelProps, 'style'> & {
|
|
15
|
+
/**
|
|
16
|
+
* The props used for each component slot.
|
|
17
|
+
* @default {}
|
|
18
|
+
*/
|
|
19
|
+
slotProps?: BarLabelSlotProps;
|
|
20
|
+
/**
|
|
21
|
+
* Overridable component slots.
|
|
22
|
+
* @default {}
|
|
23
|
+
*/
|
|
24
|
+
slots?: BarLabelSlots;
|
|
25
|
+
/**
|
|
26
|
+
* The height of the bar.
|
|
27
|
+
*/
|
|
28
|
+
height: number;
|
|
29
|
+
/**
|
|
30
|
+
* The width of the bar.
|
|
31
|
+
*/
|
|
32
|
+
width: number;
|
|
33
|
+
/**
|
|
34
|
+
* The value of the data point.
|
|
35
|
+
*/
|
|
36
|
+
value: number | null;
|
|
37
|
+
/**
|
|
38
|
+
* If provided, the function will be used to format the label of the bar.
|
|
39
|
+
* It can be set to 'value' to display the current value.
|
|
40
|
+
* @param {BarItem} item The item to format.
|
|
41
|
+
* @param {BarLabelContext} context data about the bar.
|
|
42
|
+
* @returns {string} The formatted label.
|
|
43
|
+
*/
|
|
44
|
+
barLabel?: 'value' | ((item: BarItem, context: BarLabelContext) => string | null | undefined);
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* @ignore - internal component.
|
|
48
|
+
*/
|
|
49
|
+
declare function BarLabelItem(props: BarLabelItemProps): React.JSX.Element | null;
|
|
50
|
+
declare namespace BarLabelItem {
|
|
51
|
+
var propTypes: any;
|
|
52
|
+
}
|
|
53
|
+
export { BarLabelItem };
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.BarLabelItem = BarLabelItem;
|
|
8
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
|
+
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
10
|
+
var React = _interopRequireWildcard(require("react"));
|
|
11
|
+
var _utils = require("@mui/base/utils");
|
|
12
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
|
+
var _barLabelClasses = require("./barLabelClasses");
|
|
14
|
+
var _getBarLabel = require("./getBarLabel");
|
|
15
|
+
var _BarLabel = require("./BarLabel");
|
|
16
|
+
var _context = require("../../context");
|
|
17
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
18
|
+
const _excluded = ["seriesId", "classes", "color", "style", "dataIndex", "barLabel", "slots", "slotProps", "height", "width", "value"],
|
|
19
|
+
_excluded2 = ["ownerState"];
|
|
20
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
21
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
22
|
+
/**
|
|
23
|
+
* @ignore - internal component.
|
|
24
|
+
*/
|
|
25
|
+
function BarLabelItem(props) {
|
|
26
|
+
const {
|
|
27
|
+
seriesId,
|
|
28
|
+
classes: innerClasses,
|
|
29
|
+
color,
|
|
30
|
+
style,
|
|
31
|
+
dataIndex,
|
|
32
|
+
barLabel,
|
|
33
|
+
slots,
|
|
34
|
+
slotProps,
|
|
35
|
+
height,
|
|
36
|
+
width,
|
|
37
|
+
value
|
|
38
|
+
} = props,
|
|
39
|
+
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
40
|
+
const {
|
|
41
|
+
isFaded,
|
|
42
|
+
isHighlighted
|
|
43
|
+
} = (0, _context.useItemHighlighted)({
|
|
44
|
+
seriesId,
|
|
45
|
+
dataIndex
|
|
46
|
+
});
|
|
47
|
+
const ownerState = {
|
|
48
|
+
seriesId,
|
|
49
|
+
classes: innerClasses,
|
|
50
|
+
color,
|
|
51
|
+
isFaded,
|
|
52
|
+
isHighlighted,
|
|
53
|
+
dataIndex
|
|
54
|
+
};
|
|
55
|
+
const classes = (0, _barLabelClasses.useUtilityClasses)(ownerState);
|
|
56
|
+
const Component = slots?.barLabel ?? _BarLabel.BarLabel;
|
|
57
|
+
const _useSlotProps = (0, _utils.useSlotProps)({
|
|
58
|
+
elementType: Component,
|
|
59
|
+
externalSlotProps: slotProps?.barLabel,
|
|
60
|
+
additionalProps: (0, _extends2.default)({}, other, {
|
|
61
|
+
style,
|
|
62
|
+
className: classes.root
|
|
63
|
+
}),
|
|
64
|
+
ownerState
|
|
65
|
+
}),
|
|
66
|
+
{
|
|
67
|
+
ownerState: barLabelOwnerState
|
|
68
|
+
} = _useSlotProps,
|
|
69
|
+
barLabelProps = (0, _objectWithoutPropertiesLoose2.default)(_useSlotProps, _excluded2);
|
|
70
|
+
if (!barLabel) {
|
|
71
|
+
return null;
|
|
72
|
+
}
|
|
73
|
+
const formattedLabelText = (0, _getBarLabel.getBarLabel)({
|
|
74
|
+
barLabel,
|
|
75
|
+
value,
|
|
76
|
+
dataIndex,
|
|
77
|
+
seriesId,
|
|
78
|
+
height,
|
|
79
|
+
width
|
|
80
|
+
});
|
|
81
|
+
if (!formattedLabelText) {
|
|
82
|
+
return null;
|
|
83
|
+
}
|
|
84
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Component, (0, _extends2.default)({}, barLabelProps, barLabelOwnerState, {
|
|
85
|
+
children: formattedLabelText
|
|
86
|
+
}));
|
|
87
|
+
}
|
|
88
|
+
process.env.NODE_ENV !== "production" ? BarLabelItem.propTypes = {
|
|
89
|
+
// ----------------------------- Warning --------------------------------
|
|
90
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
91
|
+
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
92
|
+
// ----------------------------------------------------------------------
|
|
93
|
+
/**
|
|
94
|
+
* If provided, the function will be used to format the label of the bar.
|
|
95
|
+
* It can be set to 'value' to display the current value.
|
|
96
|
+
* @param {BarItem} item The item to format.
|
|
97
|
+
* @param {BarLabelContext} context data about the bar.
|
|
98
|
+
* @returns {string} The formatted label.
|
|
99
|
+
*/
|
|
100
|
+
barLabel: _propTypes.default.oneOfType([_propTypes.default.oneOf(['value']), _propTypes.default.func]),
|
|
101
|
+
classes: _propTypes.default.object,
|
|
102
|
+
color: _propTypes.default.string.isRequired,
|
|
103
|
+
dataIndex: _propTypes.default.number.isRequired,
|
|
104
|
+
/**
|
|
105
|
+
* The height of the bar.
|
|
106
|
+
*/
|
|
107
|
+
height: _propTypes.default.number.isRequired,
|
|
108
|
+
seriesId: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]).isRequired,
|
|
109
|
+
/**
|
|
110
|
+
* The props used for each component slot.
|
|
111
|
+
* @default {}
|
|
112
|
+
*/
|
|
113
|
+
slotProps: _propTypes.default.object,
|
|
114
|
+
/**
|
|
115
|
+
* Overridable component slots.
|
|
116
|
+
* @default {}
|
|
117
|
+
*/
|
|
118
|
+
slots: _propTypes.default.object,
|
|
119
|
+
/**
|
|
120
|
+
* The value of the data point.
|
|
121
|
+
*/
|
|
122
|
+
value: _propTypes.default.number,
|
|
123
|
+
/**
|
|
124
|
+
* The width of the bar.
|
|
125
|
+
*/
|
|
126
|
+
width: _propTypes.default.number.isRequired
|
|
127
|
+
} : void 0;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { CompletedBarData } from '../types';
|
|
3
|
+
import { BarLabelItemProps } from './BarLabelItem';
|
|
4
|
+
type BarLabelPlotProps = {
|
|
5
|
+
bars: CompletedBarData[];
|
|
6
|
+
skipAnimation?: boolean;
|
|
7
|
+
barLabel?: BarLabelItemProps['barLabel'];
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* @ignore - internal component.
|
|
11
|
+
*/
|
|
12
|
+
declare function BarLabelPlot(props: BarLabelPlotProps): React.JSX.Element;
|
|
13
|
+
declare namespace BarLabelPlot {
|
|
14
|
+
var propTypes: any;
|
|
15
|
+
}
|
|
16
|
+
export { BarLabelPlot };
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.BarLabelPlot = BarLabelPlot;
|
|
8
|
+
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
9
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
|
+
var React = _interopRequireWildcard(require("react"));
|
|
11
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
12
|
+
var _web = require("@react-spring/web");
|
|
13
|
+
var _BarLabelItem = require("./BarLabelItem");
|
|
14
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
|
+
const _excluded = ["bars", "skipAnimation"];
|
|
16
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
17
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
18
|
+
const leaveStyle = ({
|
|
19
|
+
layout,
|
|
20
|
+
yOrigin,
|
|
21
|
+
x,
|
|
22
|
+
width,
|
|
23
|
+
y,
|
|
24
|
+
xOrigin,
|
|
25
|
+
height
|
|
26
|
+
}) => (0, _extends2.default)({}, layout === 'vertical' ? {
|
|
27
|
+
y: yOrigin,
|
|
28
|
+
x: x + width / 2,
|
|
29
|
+
height: 0,
|
|
30
|
+
width
|
|
31
|
+
} : {
|
|
32
|
+
y: y + height / 2,
|
|
33
|
+
x: xOrigin,
|
|
34
|
+
height,
|
|
35
|
+
width: 0
|
|
36
|
+
});
|
|
37
|
+
const enterStyle = ({
|
|
38
|
+
x,
|
|
39
|
+
width,
|
|
40
|
+
y,
|
|
41
|
+
height
|
|
42
|
+
}) => ({
|
|
43
|
+
x: x + width / 2,
|
|
44
|
+
y: y + height / 2,
|
|
45
|
+
height,
|
|
46
|
+
width
|
|
47
|
+
});
|
|
48
|
+
/**
|
|
49
|
+
* @ignore - internal component.
|
|
50
|
+
*/
|
|
51
|
+
function BarLabelPlot(props) {
|
|
52
|
+
const {
|
|
53
|
+
bars,
|
|
54
|
+
skipAnimation
|
|
55
|
+
} = props,
|
|
56
|
+
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
57
|
+
const barLabelTransition = (0, _web.useTransition)(bars, {
|
|
58
|
+
keys: bar => `${bar.seriesId}-${bar.dataIndex}`,
|
|
59
|
+
from: leaveStyle,
|
|
60
|
+
leave: null,
|
|
61
|
+
enter: enterStyle,
|
|
62
|
+
update: enterStyle,
|
|
63
|
+
immediate: skipAnimation
|
|
64
|
+
});
|
|
65
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(React.Fragment, {
|
|
66
|
+
children: barLabelTransition((style, {
|
|
67
|
+
seriesId,
|
|
68
|
+
dataIndex,
|
|
69
|
+
color,
|
|
70
|
+
value,
|
|
71
|
+
width,
|
|
72
|
+
height
|
|
73
|
+
}) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_BarLabelItem.BarLabelItem, (0, _extends2.default)({
|
|
74
|
+
seriesId: seriesId,
|
|
75
|
+
dataIndex: dataIndex,
|
|
76
|
+
value: value,
|
|
77
|
+
color: color,
|
|
78
|
+
width: width,
|
|
79
|
+
height: height
|
|
80
|
+
}, other, {
|
|
81
|
+
style: style
|
|
82
|
+
})))
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
process.env.NODE_ENV !== "production" ? BarLabelPlot.propTypes = {
|
|
86
|
+
// ----------------------------- Warning --------------------------------
|
|
87
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
88
|
+
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
89
|
+
// ----------------------------------------------------------------------
|
|
90
|
+
barLabel: _propTypes.default.oneOfType([_propTypes.default.oneOf(['value']), _propTypes.default.func]),
|
|
91
|
+
bars: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
92
|
+
color: _propTypes.default.string.isRequired,
|
|
93
|
+
dataIndex: _propTypes.default.number.isRequired,
|
|
94
|
+
height: _propTypes.default.number.isRequired,
|
|
95
|
+
layout: _propTypes.default.oneOf(['horizontal', 'vertical']),
|
|
96
|
+
maskId: _propTypes.default.string.isRequired,
|
|
97
|
+
seriesId: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]).isRequired,
|
|
98
|
+
value: _propTypes.default.number,
|
|
99
|
+
width: _propTypes.default.number.isRequired,
|
|
100
|
+
x: _propTypes.default.number.isRequired,
|
|
101
|
+
xOrigin: _propTypes.default.number.isRequired,
|
|
102
|
+
y: _propTypes.default.number.isRequired,
|
|
103
|
+
yOrigin: _propTypes.default.number.isRequired
|
|
104
|
+
})).isRequired,
|
|
105
|
+
skipAnimation: _propTypes.default.bool
|
|
106
|
+
} : void 0;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { BarLabelOwnerState } from './BarLabel.types';
|
|
2
|
+
export interface BarLabelClasses {
|
|
3
|
+
/** Styles applied to the root element. */
|
|
4
|
+
root: string;
|
|
5
|
+
/** Styles applied to the root element if it is highlighted. */
|
|
6
|
+
highlighted: string;
|
|
7
|
+
/** Styles applied to the root element if it is faded. */
|
|
8
|
+
faded: string;
|
|
9
|
+
}
|
|
10
|
+
export type BarLabelClassKey = keyof BarLabelClasses;
|
|
11
|
+
export declare function getBarLabelUtilityClass(slot: string): string;
|
|
12
|
+
export declare const barLabelClasses: Record<"root" | "highlighted" | "faded", string>;
|
|
13
|
+
export declare const useUtilityClasses: (ownerState: BarLabelOwnerState) => Record<"root", string>;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.barLabelClasses = void 0;
|
|
8
|
+
exports.getBarLabelUtilityClass = getBarLabelUtilityClass;
|
|
9
|
+
exports.useUtilityClasses = void 0;
|
|
10
|
+
var _generateUtilityClass = _interopRequireDefault(require("@mui/utils/generateUtilityClass"));
|
|
11
|
+
var _generateUtilityClasses = _interopRequireDefault(require("@mui/utils/generateUtilityClasses"));
|
|
12
|
+
var _composeClasses = _interopRequireDefault(require("@mui/utils/composeClasses"));
|
|
13
|
+
function getBarLabelUtilityClass(slot) {
|
|
14
|
+
return (0, _generateUtilityClass.default)('MuiBarLabel', slot);
|
|
15
|
+
}
|
|
16
|
+
const barLabelClasses = exports.barLabelClasses = (0, _generateUtilityClasses.default)('MuiBarLabel', ['root', 'highlighted', 'faded']);
|
|
17
|
+
const useUtilityClasses = ownerState => {
|
|
18
|
+
const {
|
|
19
|
+
classes,
|
|
20
|
+
seriesId,
|
|
21
|
+
isFaded,
|
|
22
|
+
isHighlighted
|
|
23
|
+
} = ownerState;
|
|
24
|
+
const slots = {
|
|
25
|
+
root: ['root', `series-${seriesId}`, isHighlighted && 'highlighted', isFaded && 'faded']
|
|
26
|
+
};
|
|
27
|
+
return (0, _composeClasses.default)(slots, getBarLabelUtilityClass, classes);
|
|
28
|
+
};
|
|
29
|
+
exports.useUtilityClasses = useUtilityClasses;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { SeriesId } from '../../models/seriesType/common';
|
|
2
|
+
import { BarLabelFunction } from './BarLabel.types';
|
|
3
|
+
export declare const getBarLabel: (options: {
|
|
4
|
+
barLabel: 'value' | BarLabelFunction;
|
|
5
|
+
value: number | null;
|
|
6
|
+
dataIndex: number;
|
|
7
|
+
seriesId: SeriesId;
|
|
8
|
+
height: number;
|
|
9
|
+
width: number;
|
|
10
|
+
}) => string | null | undefined;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getBarLabel = void 0;
|
|
7
|
+
const getBarLabel = options => {
|
|
8
|
+
const {
|
|
9
|
+
barLabel,
|
|
10
|
+
value,
|
|
11
|
+
dataIndex,
|
|
12
|
+
seriesId,
|
|
13
|
+
height,
|
|
14
|
+
width
|
|
15
|
+
} = options;
|
|
16
|
+
if (barLabel === 'value') {
|
|
17
|
+
// We don't want to show the label if the value is 0
|
|
18
|
+
return value ? value?.toString() : null;
|
|
19
|
+
}
|
|
20
|
+
return barLabel({
|
|
21
|
+
seriesId,
|
|
22
|
+
dataIndex,
|
|
23
|
+
value
|
|
24
|
+
}, {
|
|
25
|
+
bar: {
|
|
26
|
+
height,
|
|
27
|
+
width
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
};
|
|
31
|
+
exports.getBarLabel = getBarLabel;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { BarLabel } from './BarLabel';
|
|
2
|
+
export type { BarLabelProps } from './BarLabel';
|
|
3
|
+
export { barLabelClasses, getBarLabelUtilityClass } from './barLabelClasses';
|
|
4
|
+
export type { BarLabelSlotProps, BarLabelSlots } from './BarLabelItem';
|
|
5
|
+
export type { BarLabelOwnerState, BarItem, BarLabelContext } from './BarLabel.types';
|
|
6
|
+
export type { BarLabelClasses, BarLabelClassKey } from './barLabelClasses';
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "BarLabel", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _BarLabel.BarLabel;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "barLabelClasses", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return _barLabelClasses.barLabelClasses;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
Object.defineProperty(exports, "getBarLabelUtilityClass", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function () {
|
|
21
|
+
return _barLabelClasses.getBarLabelUtilityClass;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
var _BarLabel = require("./BarLabel");
|
|
25
|
+
var _barLabelClasses = require("./barLabelClasses");
|
package/BarChart/BarPlot.d.ts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { BarElementSlotProps, BarElementSlots } from './BarElement';
|
|
3
3
|
import { BarItemIdentifier } from '../models';
|
|
4
|
-
|
|
4
|
+
import { BarLabelItemProps, BarLabelSlotProps, BarLabelSlots } from './BarLabel/BarLabelItem';
|
|
5
|
+
export interface BarPlotSlots extends BarElementSlots, BarLabelSlots {
|
|
5
6
|
}
|
|
6
|
-
export interface BarPlotSlotProps extends BarElementSlotProps {
|
|
7
|
+
export interface BarPlotSlotProps extends BarElementSlotProps, BarLabelSlotProps {
|
|
7
8
|
}
|
|
8
|
-
export interface BarPlotProps extends Pick<
|
|
9
|
+
export interface BarPlotProps extends Pick<BarLabelItemProps, 'barLabel'> {
|
|
9
10
|
/**
|
|
10
11
|
* If `true`, animations are skipped.
|
|
11
12
|
* @default false
|
|
@@ -21,6 +22,16 @@ export interface BarPlotProps extends Pick<BarElementProps, 'slots' | 'slotProps
|
|
|
21
22
|
* Defines the border radius of the bar element.
|
|
22
23
|
*/
|
|
23
24
|
borderRadius?: number;
|
|
25
|
+
/**
|
|
26
|
+
* The props used for each component slot.
|
|
27
|
+
* @default {}
|
|
28
|
+
*/
|
|
29
|
+
slotProps?: BarPlotSlotProps;
|
|
30
|
+
/**
|
|
31
|
+
* Overridable component slots.
|
|
32
|
+
* @default {}
|
|
33
|
+
*/
|
|
34
|
+
slots?: BarPlotSlots;
|
|
24
35
|
}
|
|
25
36
|
/**
|
|
26
37
|
* Demos:
|