@mui/x-charts 6.0.0-alpha.13 → 6.0.0-alpha.14
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.d.ts +3 -3
- package/BarChart/BarChart.js +3 -2
- package/BarChart/BarElement.js +2 -4
- package/BarChart/formatter.js +1 -2
- package/BarChart/legend.js +1 -2
- package/CHANGELOG.md +61 -1
- package/ChartContainer/index.js +2 -3
- package/ChartsAxis/axisClasses.js +1 -2
- package/ChartsLegend/ChartsLegend.js +4 -8
- package/ChartsLegend/chartsLegendClasses.js +1 -2
- package/ChartsSurface.js +2 -3
- package/ChartsTooltip/ChartsAxisTooltipContent.d.ts +1 -0
- package/ChartsTooltip/ChartsAxisTooltipContent.js +17 -8
- package/ChartsTooltip/ChartsItemTooltipContent.d.ts +3 -2
- package/ChartsTooltip/ChartsItemTooltipContent.js +16 -6
- package/ChartsTooltip/ChartsTooltip.d.ts +23 -0
- package/ChartsTooltip/ChartsTooltip.js +47 -13
- package/ChartsTooltip/ChartsTooltipTable.js +6 -11
- package/ChartsTooltip/tooltipClasses.js +1 -2
- package/LineChart/AreaElement.js +2 -4
- package/LineChart/LineChart.d.ts +3 -3
- package/LineChart/LineChart.js +7 -3
- package/LineChart/LineElement.js +2 -4
- package/LineChart/LineHighlightElement.js +1 -2
- package/LineChart/MarkElement.js +1 -2
- package/LineChart/formatter.js +1 -2
- package/LineChart/legend.js +1 -2
- package/PieChart/PieArc.d.ts +1 -0
- package/PieChart/PieArc.js +6 -4
- package/PieChart/PieArcLabel.js +1 -2
- package/PieChart/PieChart.d.ts +5 -4
- package/PieChart/PieChart.js +7 -2
- package/PieChart/PiePlot.d.ts +8 -0
- package/PieChart/PiePlot.js +21 -5
- package/PieChart/formatter.js +1 -2
- package/PieChart/legend.js +1 -2
- package/ResponsiveChartContainer/index.js +2 -3
- package/ScatterChart/ScatterChart.d.ts +3 -3
- package/ScatterChart/ScatterChart.js +3 -2
- package/ScatterChart/formatter.js +1 -2
- package/ScatterChart/legend.js +1 -2
- package/SparkLineChart/SparkLineChart.d.ts +3 -3
- package/SparkLineChart/SparkLineChart.js +7 -3
- package/colorPalettes/colorPalettes.js +6 -12
- package/constants.js +4 -7
- package/context/CartesianContextProvider.js +1 -2
- package/context/DrawingProvider.js +2 -4
- package/context/HighlightProvider.js +1 -2
- package/context/InteractionProvider.js +1 -2
- package/context/SeriesContextProvider.js +1 -2
- package/esm/BarChart/BarChart.js +2 -0
- package/esm/ChartsTooltip/ChartsAxisTooltipContent.js +17 -8
- package/esm/ChartsTooltip/ChartsItemTooltipContent.js +15 -6
- package/esm/ChartsTooltip/ChartsTooltip.js +47 -12
- package/esm/LineChart/LineChart.js +6 -1
- package/esm/PieChart/PieArc.js +5 -2
- package/esm/PieChart/PieChart.js +7 -2
- package/esm/PieChart/PiePlot.js +17 -2
- package/esm/ScatterChart/ScatterChart.js +2 -0
- package/esm/SparkLineChart/SparkLineChart.js +6 -1
- package/hooks/useChartDimensions.js +1 -2
- package/hooks/useTicks.js +1 -2
- package/index.js +1 -1
- package/internals/components/AxisSharedComponents.js +6 -11
- package/internals/defaultizeValueFormatter.js +1 -2
- package/internals/stackSeries.js +2 -4
- package/legacy/BarChart/BarChart.js +2 -0
- package/legacy/ChartsTooltip/ChartsAxisTooltipContent.js +17 -8
- package/legacy/ChartsTooltip/ChartsItemTooltipContent.js +15 -6
- package/legacy/ChartsTooltip/ChartsTooltip.js +50 -12
- package/legacy/LineChart/LineChart.js +6 -1
- package/legacy/PieChart/PieArc.js +4 -1
- package/legacy/PieChart/PieChart.js +7 -2
- package/legacy/PieChart/PiePlot.js +17 -2
- package/legacy/ScatterChart/ScatterChart.js +2 -0
- package/legacy/SparkLineChart/SparkLineChart.js +6 -1
- package/legacy/index.js +1 -1
- package/modern/BarChart/BarChart.js +2 -0
- package/modern/ChartsTooltip/ChartsAxisTooltipContent.js +17 -8
- package/modern/ChartsTooltip/ChartsItemTooltipContent.js +15 -6
- package/modern/ChartsTooltip/ChartsTooltip.js +46 -12
- package/modern/LineChart/LineChart.js +6 -1
- package/modern/PieChart/PieArc.js +5 -2
- package/modern/PieChart/PieChart.js +7 -2
- package/modern/PieChart/PiePlot.js +17 -2
- package/modern/ScatterChart/ScatterChart.js +2 -0
- package/modern/SparkLineChart/SparkLineChart.js +6 -1
- package/modern/index.js +1 -1
- package/package.json +3 -3
package/LineChart/LineChart.d.ts
CHANGED
|
@@ -6,14 +6,14 @@ import { MarkPlotSlotComponentProps, MarkPlotSlotsComponent } from './MarkPlot';
|
|
|
6
6
|
import { ChartsAxisProps } from '../ChartsAxis/ChartsAxis';
|
|
7
7
|
import { LineSeriesType } from '../models/seriesType/line';
|
|
8
8
|
import { MakeOptional } from '../models/helpers';
|
|
9
|
-
import { ChartsTooltipProps } from '../ChartsTooltip';
|
|
9
|
+
import { ChartsTooltipProps, ChartsTooltipSlotComponentProps, ChartsTooltipSlotsComponent } from '../ChartsTooltip';
|
|
10
10
|
import { ChartsLegendProps, ChartsLegendSlotComponentProps, ChartsLegendSlotsComponent } from '../ChartsLegend';
|
|
11
11
|
import { ChartsAxisHighlightProps } from '../ChartsAxisHighlight';
|
|
12
12
|
import { ChartsAxisSlotComponentProps, ChartsAxisSlotsComponent } from '../models/axis';
|
|
13
13
|
import { LineHighlightPlotSlotsComponent, LineHighlightPlotSlotComponentProps } from './LineHighlightPlot';
|
|
14
|
-
export interface LineChartSlotsComponent extends ChartsAxisSlotsComponent, AreaPlotSlotsComponent, LinePlotSlotsComponent, MarkPlotSlotsComponent, LineHighlightPlotSlotsComponent, ChartsLegendSlotsComponent {
|
|
14
|
+
export interface LineChartSlotsComponent extends ChartsAxisSlotsComponent, AreaPlotSlotsComponent, LinePlotSlotsComponent, MarkPlotSlotsComponent, LineHighlightPlotSlotsComponent, ChartsLegendSlotsComponent, ChartsTooltipSlotsComponent {
|
|
15
15
|
}
|
|
16
|
-
export interface LineChartSlotComponentProps extends ChartsAxisSlotComponentProps, AreaPlotSlotComponentProps, LinePlotSlotComponentProps, MarkPlotSlotComponentProps, LineHighlightPlotSlotComponentProps, ChartsLegendSlotComponentProps {
|
|
16
|
+
export interface LineChartSlotComponentProps extends ChartsAxisSlotComponentProps, AreaPlotSlotComponentProps, LinePlotSlotComponentProps, MarkPlotSlotComponentProps, LineHighlightPlotSlotComponentProps, ChartsLegendSlotComponentProps, ChartsTooltipSlotComponentProps {
|
|
17
17
|
}
|
|
18
18
|
export interface LineChartProps extends Omit<ResponsiveChartContainerProps, 'series'>, Omit<ChartsAxisProps, 'slots' | 'slotProps'> {
|
|
19
19
|
series: MakeOptional<LineSeriesType, 'type'>[];
|
package/LineChart/LineChart.js
CHANGED
|
@@ -23,7 +23,7 @@ var _LineHighlightPlot = require("./LineHighlightPlot");
|
|
|
23
23
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
24
24
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
25
25
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
26
|
-
const LineChart = /*#__PURE__*/React.forwardRef(function LineChart(props, ref) {
|
|
26
|
+
const LineChart = exports.LineChart = /*#__PURE__*/React.forwardRef(function LineChart(props, ref) {
|
|
27
27
|
const {
|
|
28
28
|
xAxis,
|
|
29
29
|
yAxis,
|
|
@@ -96,12 +96,14 @@ const LineChart = /*#__PURE__*/React.forwardRef(function LineChart(props, ref) {
|
|
|
96
96
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsLegend.ChartsLegend, (0, _extends2.default)({}, legend, {
|
|
97
97
|
slots: slots,
|
|
98
98
|
slotProps: slotProps
|
|
99
|
-
})), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsTooltip.ChartsTooltip, (0, _extends2.default)({}, tooltip
|
|
99
|
+
})), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsTooltip.ChartsTooltip, (0, _extends2.default)({}, tooltip, {
|
|
100
|
+
slots: slots,
|
|
101
|
+
slotProps: slotProps
|
|
102
|
+
})), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsClipPath.ChartsClipPath, {
|
|
100
103
|
id: clipPathId
|
|
101
104
|
}), children]
|
|
102
105
|
});
|
|
103
106
|
});
|
|
104
|
-
exports.LineChart = LineChart;
|
|
105
107
|
process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
|
|
106
108
|
// ----------------------------- Warning --------------------------------
|
|
107
109
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
@@ -256,6 +258,8 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
|
|
|
256
258
|
axisContent: _propTypes.default.elementType,
|
|
257
259
|
classes: _propTypes.default.object,
|
|
258
260
|
itemContent: _propTypes.default.elementType,
|
|
261
|
+
slotProps: _propTypes.default.object,
|
|
262
|
+
slots: _propTypes.default.object,
|
|
259
263
|
trigger: _propTypes.default.oneOf(['axis', 'item', 'none'])
|
|
260
264
|
}),
|
|
261
265
|
/**
|
package/LineChart/LineElement.js
CHANGED
|
@@ -27,8 +27,7 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
27
27
|
function getLineElementUtilityClass(slot) {
|
|
28
28
|
return (0, _generateUtilityClass.default)('MuiLineElement', slot);
|
|
29
29
|
}
|
|
30
|
-
const lineElementClasses = (0, _generateUtilityClasses.default)('MuiLineElement', ['root', 'highlighted', 'faded']);
|
|
31
|
-
exports.lineElementClasses = lineElementClasses;
|
|
30
|
+
const lineElementClasses = exports.lineElementClasses = (0, _generateUtilityClasses.default)('MuiLineElement', ['root', 'highlighted', 'faded']);
|
|
32
31
|
const useUtilityClasses = ownerState => {
|
|
33
32
|
const {
|
|
34
33
|
classes,
|
|
@@ -41,7 +40,7 @@ const useUtilityClasses = ownerState => {
|
|
|
41
40
|
};
|
|
42
41
|
return (0, _composeClasses.default)(slots, getLineElementUtilityClass, classes);
|
|
43
42
|
};
|
|
44
|
-
const LineElementPath = (0, _styles.styled)('path', {
|
|
43
|
+
const LineElementPath = exports.LineElementPath = (0, _styles.styled)('path', {
|
|
45
44
|
name: 'MuiLineElement',
|
|
46
45
|
slot: 'Root',
|
|
47
46
|
overridesResolver: (_, styles) => styles.root
|
|
@@ -55,7 +54,6 @@ const LineElementPath = (0, _styles.styled)('path', {
|
|
|
55
54
|
transition: 'opacity 0.2s ease-in, stroke 0.2s ease-in',
|
|
56
55
|
opacity: ownerState.isFaded ? 0.3 : 1
|
|
57
56
|
}));
|
|
58
|
-
exports.LineElementPath = LineElementPath;
|
|
59
57
|
LineElementPath.propTypes = {
|
|
60
58
|
// ----------------------------- Warning --------------------------------
|
|
61
59
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
@@ -22,8 +22,7 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
22
22
|
function getHighlightElementUtilityClass(slot) {
|
|
23
23
|
return (0, _generateUtilityClass.default)('MuiHighlightElement', slot);
|
|
24
24
|
}
|
|
25
|
-
const lineHighlightElementClasses = (0, _generateUtilityClasses.default)('MuiHighlightElement', ['root']);
|
|
26
|
-
exports.lineHighlightElementClasses = lineHighlightElementClasses;
|
|
25
|
+
const lineHighlightElementClasses = exports.lineHighlightElementClasses = (0, _generateUtilityClasses.default)('MuiHighlightElement', ['root']);
|
|
27
26
|
const useUtilityClasses = ownerState => {
|
|
28
27
|
const {
|
|
29
28
|
classes,
|
package/LineChart/MarkElement.js
CHANGED
|
@@ -26,8 +26,7 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
26
26
|
function getMarkElementUtilityClass(slot) {
|
|
27
27
|
return (0, _generateUtilityClass.default)('MuiMarkElement', slot);
|
|
28
28
|
}
|
|
29
|
-
const markElementClasses = (0, _generateUtilityClasses.default)('MuiMarkElement', ['root', 'highlighted', 'faded']);
|
|
30
|
-
exports.markElementClasses = markElementClasses;
|
|
29
|
+
const markElementClasses = exports.markElementClasses = (0, _generateUtilityClasses.default)('MuiMarkElement', ['root', 'highlighted', 'faded']);
|
|
31
30
|
const useUtilityClasses = ownerState => {
|
|
32
31
|
const {
|
|
33
32
|
classes,
|
package/LineChart/formatter.js
CHANGED
package/LineChart/legend.js
CHANGED
package/PieChart/PieArc.d.ts
CHANGED
|
@@ -28,6 +28,7 @@ export type PieArcProps = Omit<PieArcOwnerState, 'isFaded' | 'isHighlighted'> &
|
|
|
28
28
|
cornerRadius: PieSeriesType['cornerRadius'];
|
|
29
29
|
highlighted: PieSeriesType['highlighted'];
|
|
30
30
|
faded: PieSeriesType['faded'];
|
|
31
|
+
onClick?: (event: React.MouseEvent<SVGPathElement, MouseEvent>) => void;
|
|
31
32
|
};
|
|
32
33
|
declare function PieArc(props: PieArcProps): React.JSX.Element;
|
|
33
34
|
declare namespace PieArc {
|
package/PieChart/PieArc.js
CHANGED
|
@@ -19,14 +19,13 @@ var _generateUtilityClasses = _interopRequireDefault(require("@mui/utils/generat
|
|
|
19
19
|
var _InteractionProvider = require("../context/InteractionProvider");
|
|
20
20
|
var _useInteractionItemProps = require("../hooks/useInteractionItemProps");
|
|
21
21
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
22
|
-
const _excluded = ["id", "dataIndex", "classes", "color", "highlightScope", "innerRadius", "outerRadius", "cornerRadius", "highlighted", "faded"];
|
|
22
|
+
const _excluded = ["id", "dataIndex", "classes", "color", "highlightScope", "innerRadius", "outerRadius", "cornerRadius", "highlighted", "faded", "onClick"];
|
|
23
23
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
24
24
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
25
25
|
function getPieArcUtilityClass(slot) {
|
|
26
26
|
return (0, _generateUtilityClass.default)('MuiPieArc', slot);
|
|
27
27
|
}
|
|
28
|
-
const pieArcClasses = (0, _generateUtilityClasses.default)('MuiPieArc', ['root', 'highlighted', 'faded']);
|
|
29
|
-
exports.pieArcClasses = pieArcClasses;
|
|
28
|
+
const pieArcClasses = exports.pieArcClasses = (0, _generateUtilityClasses.default)('MuiPieArc', ['root', 'highlighted', 'faded']);
|
|
30
29
|
const useUtilityClasses = ownerState => {
|
|
31
30
|
const {
|
|
32
31
|
classes,
|
|
@@ -66,7 +65,8 @@ function PieArc(props) {
|
|
|
66
65
|
highlighted,
|
|
67
66
|
faded = {
|
|
68
67
|
additionalRadius: -5
|
|
69
|
-
}
|
|
68
|
+
},
|
|
69
|
+
onClick
|
|
70
70
|
} = props,
|
|
71
71
|
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
72
72
|
const getInteractionItemProps = (0, _useInteractionItemProps.useInteractionItemProps)(highlightScope);
|
|
@@ -103,6 +103,8 @@ function PieArc(props) {
|
|
|
103
103
|
innerRadius,
|
|
104
104
|
outerRadius
|
|
105
105
|
})),
|
|
106
|
+
onClick: onClick,
|
|
107
|
+
cursor: onClick ? 'pointer' : 'unset',
|
|
106
108
|
ownerState: ownerState,
|
|
107
109
|
className: classes.root
|
|
108
110
|
}, getInteractionItemProps({
|
package/PieChart/PieArcLabel.js
CHANGED
|
@@ -25,8 +25,7 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
25
25
|
function getPieArcLabelUtilityClass(slot) {
|
|
26
26
|
return (0, _generateUtilityClass.default)('MuiPieArcLabel', slot);
|
|
27
27
|
}
|
|
28
|
-
const pieArcLabelClasses = (0, _generateUtilityClasses.default)('MuiPieArcLabel', ['root', 'highlighted', 'faded']);
|
|
29
|
-
exports.pieArcLabelClasses = pieArcLabelClasses;
|
|
28
|
+
const pieArcLabelClasses = exports.pieArcLabelClasses = (0, _generateUtilityClasses.default)('MuiPieArcLabel', ['root', 'highlighted', 'faded']);
|
|
30
29
|
const useUtilityClasses = ownerState => {
|
|
31
30
|
const {
|
|
32
31
|
classes,
|
package/PieChart/PieChart.d.ts
CHANGED
|
@@ -3,21 +3,22 @@ import { ResponsiveChartContainerProps } from '../ResponsiveChartContainer';
|
|
|
3
3
|
import { ChartsAxisProps } from '../ChartsAxis/ChartsAxis';
|
|
4
4
|
import { PieSeriesType } from '../models/seriesType';
|
|
5
5
|
import { MakeOptional } from '../models/helpers';
|
|
6
|
-
import { ChartsTooltipProps } from '../ChartsTooltip';
|
|
6
|
+
import { ChartsTooltipProps, ChartsTooltipSlotComponentProps, ChartsTooltipSlotsComponent } from '../ChartsTooltip';
|
|
7
7
|
import { ChartsLegendProps, ChartsLegendSlotComponentProps, ChartsLegendSlotsComponent } from '../ChartsLegend';
|
|
8
8
|
import { ChartsAxisHighlightProps } from '../ChartsAxisHighlight';
|
|
9
|
-
import { PiePlotSlotComponentProps, PiePlotSlotsComponent } from './PiePlot';
|
|
9
|
+
import { PiePlotProps, PiePlotSlotComponentProps, PiePlotSlotsComponent } from './PiePlot';
|
|
10
10
|
import { PieValueType } from '../models/seriesType/pie';
|
|
11
11
|
import { ChartsAxisSlotsComponent, ChartsAxisSlotComponentProps } from '../models/axis';
|
|
12
|
-
export interface PieChartSlotsComponent extends ChartsAxisSlotsComponent, PiePlotSlotsComponent, ChartsLegendSlotsComponent {
|
|
12
|
+
export interface PieChartSlotsComponent extends ChartsAxisSlotsComponent, PiePlotSlotsComponent, ChartsLegendSlotsComponent, ChartsTooltipSlotsComponent {
|
|
13
13
|
}
|
|
14
|
-
export interface PieChartSlotComponentProps extends ChartsAxisSlotComponentProps, PiePlotSlotComponentProps, ChartsLegendSlotComponentProps {
|
|
14
|
+
export interface PieChartSlotComponentProps extends ChartsAxisSlotComponentProps, PiePlotSlotComponentProps, ChartsLegendSlotComponentProps, ChartsTooltipSlotComponentProps {
|
|
15
15
|
}
|
|
16
16
|
export interface PieChartProps extends Omit<ResponsiveChartContainerProps, 'series'>, Omit<ChartsAxisProps, 'slots' | 'slotProps'> {
|
|
17
17
|
series: MakeOptional<PieSeriesType<MakeOptional<PieValueType, 'id'>>, 'type'>[];
|
|
18
18
|
tooltip?: ChartsTooltipProps;
|
|
19
19
|
axisHighlight?: ChartsAxisHighlightProps;
|
|
20
20
|
legend?: ChartsLegendProps;
|
|
21
|
+
onClick?: PiePlotProps['onClick'];
|
|
21
22
|
slots?: PieChartSlotsComponent;
|
|
22
23
|
/**
|
|
23
24
|
* The props used for each component slot.
|
package/PieChart/PieChart.js
CHANGED
|
@@ -54,7 +54,8 @@ function PieChart(props) {
|
|
|
54
54
|
bottomAxis = null,
|
|
55
55
|
children,
|
|
56
56
|
slots,
|
|
57
|
-
slotProps
|
|
57
|
+
slotProps,
|
|
58
|
+
onClick
|
|
58
59
|
} = props;
|
|
59
60
|
const margin = (0, _extends2.default)({}, defaultMargin, marginProps);
|
|
60
61
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_ResponsiveChartContainer.ResponsiveChartContainer, {
|
|
@@ -82,7 +83,8 @@ function PieChart(props) {
|
|
|
82
83
|
slotProps: slotProps
|
|
83
84
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_PiePlot.PiePlot, {
|
|
84
85
|
slots: slots,
|
|
85
|
-
slotProps: slotProps
|
|
86
|
+
slotProps: slotProps,
|
|
87
|
+
onClick: onClick
|
|
86
88
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsLegend.ChartsLegend, (0, _extends2.default)({}, legend, {
|
|
87
89
|
slots: slots,
|
|
88
90
|
slotProps: slotProps
|
|
@@ -178,6 +180,7 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
|
|
|
178
180
|
right: _propTypes.default.number,
|
|
179
181
|
top: _propTypes.default.number
|
|
180
182
|
}),
|
|
183
|
+
onClick: _propTypes.default.func,
|
|
181
184
|
/**
|
|
182
185
|
* Indicate which axis to display the right of the charts.
|
|
183
186
|
* Can be a string (the id of the axis) or an object `ChartsYAxisProps`.
|
|
@@ -252,6 +255,8 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
|
|
|
252
255
|
axisContent: _propTypes.default.elementType,
|
|
253
256
|
classes: _propTypes.default.object,
|
|
254
257
|
itemContent: _propTypes.default.elementType,
|
|
258
|
+
slotProps: _propTypes.default.object,
|
|
259
|
+
slots: _propTypes.default.object,
|
|
255
260
|
trigger: _propTypes.default.oneOf(['axis', 'item', 'none'])
|
|
256
261
|
}),
|
|
257
262
|
/**
|
package/PieChart/PiePlot.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { PieArcProps } from './PieArc';
|
|
3
3
|
import { PieArcLabelProps } from './PieArcLabel';
|
|
4
|
+
import { DefaultizedPieValueType, PieItemIdentifier } from '../models/seriesType/pie';
|
|
4
5
|
export interface PiePlotSlotsComponent {
|
|
5
6
|
pieArc?: React.JSXElementConstructor<PieArcProps>;
|
|
6
7
|
pieArcLabel?: React.JSXElementConstructor<PieArcLabelProps>;
|
|
@@ -20,6 +21,13 @@ export interface PiePlotProps {
|
|
|
20
21
|
* @default {}
|
|
21
22
|
*/
|
|
22
23
|
slotProps?: PiePlotSlotComponentProps;
|
|
24
|
+
/**
|
|
25
|
+
* Callback fired when a pie item is clicked.
|
|
26
|
+
* @param {React.MouseEvent<SVGPathElement, MouseEvent>} event The event source of the callback.
|
|
27
|
+
* @param {PieItemIdentifier} pieItemIdentifier The pie item identifier.
|
|
28
|
+
* @param {DefaultizedPieValueType} item The pie item.
|
|
29
|
+
*/
|
|
30
|
+
onClick?: (event: React.MouseEvent<SVGPathElement, MouseEvent>, pieItemIdentifier: PieItemIdentifier, item: DefaultizedPieValueType) => void;
|
|
23
31
|
}
|
|
24
32
|
declare function PiePlot(props: PiePlotProps): React.JSX.Element | null;
|
|
25
33
|
declare namespace PiePlot {
|
package/PieChart/PiePlot.js
CHANGED
|
@@ -6,7 +6,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.PiePlot = PiePlot;
|
|
8
8
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
|
-
var
|
|
9
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
+
var React = _react;
|
|
10
11
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
12
|
var _SeriesContextProvider = require("../context/SeriesContextProvider");
|
|
12
13
|
var _PieArc = _interopRequireDefault(require("./PieArc"));
|
|
@@ -32,7 +33,8 @@ function getItemLabel(arcLabel, arcLabelMinAngle, item) {
|
|
|
32
33
|
function PiePlot(props) {
|
|
33
34
|
const {
|
|
34
35
|
slots,
|
|
35
|
-
slotProps
|
|
36
|
+
slotProps,
|
|
37
|
+
onClick
|
|
36
38
|
} = props;
|
|
37
39
|
const seriesData = React.useContext(_SeriesContextProvider.SeriesContext).pie;
|
|
38
40
|
const {
|
|
@@ -73,7 +75,7 @@ function PiePlot(props) {
|
|
|
73
75
|
transform: `translate(${cx === undefined ? center.x : left + cx}, ${cy === undefined ? center.y : top + cy})`,
|
|
74
76
|
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("g", {
|
|
75
77
|
children: [data.map((item, index) => {
|
|
76
|
-
return /*#__PURE__*/(0,
|
|
78
|
+
return /*#__PURE__*/(0, _react.createElement)(Arc, (0, _extends2.default)({}, item, {
|
|
77
79
|
key: item.id,
|
|
78
80
|
innerRadius: innerRadius,
|
|
79
81
|
outerRadius: outerRadius ?? availableRadius,
|
|
@@ -83,10 +85,17 @@ function PiePlot(props) {
|
|
|
83
85
|
dataIndex: index,
|
|
84
86
|
highlightScope: series[seriesId].highlightScope,
|
|
85
87
|
highlighted: highlighted,
|
|
86
|
-
faded: faded
|
|
88
|
+
faded: faded,
|
|
89
|
+
onClick: onClick && (event => {
|
|
90
|
+
onClick(event, {
|
|
91
|
+
type: 'pie',
|
|
92
|
+
seriesId,
|
|
93
|
+
dataIndex: index
|
|
94
|
+
}, item);
|
|
95
|
+
})
|
|
87
96
|
}, slotProps?.pieArc));
|
|
88
97
|
}), data.map((item, index) => {
|
|
89
|
-
return /*#__PURE__*/(0,
|
|
98
|
+
return /*#__PURE__*/(0, _react.createElement)(ArcLabel, (0, _extends2.default)({}, item, {
|
|
90
99
|
key: item.id,
|
|
91
100
|
innerRadius: innerRadius,
|
|
92
101
|
outerRadius: outerRadius ?? availableRadius,
|
|
@@ -108,6 +117,13 @@ process.env.NODE_ENV !== "production" ? PiePlot.propTypes = {
|
|
|
108
117
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
109
118
|
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
110
119
|
// ----------------------------------------------------------------------
|
|
120
|
+
/**
|
|
121
|
+
* Callback fired when a pie item is clicked.
|
|
122
|
+
* @param {React.MouseEvent<SVGPathElement, MouseEvent>} event The event source of the callback.
|
|
123
|
+
* @param {PieItemIdentifier} pieItemIdentifier The pie item identifier.
|
|
124
|
+
* @param {DefaultizedPieValueType} item The pie item.
|
|
125
|
+
*/
|
|
126
|
+
onClick: _propTypes.default.func,
|
|
111
127
|
/**
|
|
112
128
|
* The props used for each component slot.
|
|
113
129
|
* @default {}
|
package/PieChart/formatter.js
CHANGED
package/PieChart/legend.js
CHANGED
|
@@ -99,7 +99,7 @@ const ResizableContainer = (0, _styles.styled)('div', {
|
|
|
99
99
|
height: '100%'
|
|
100
100
|
}
|
|
101
101
|
}));
|
|
102
|
-
const ResponsiveChartContainer = /*#__PURE__*/React.forwardRef(function ResponsiveChartContainer(props, ref) {
|
|
102
|
+
const ResponsiveChartContainer = exports.ResponsiveChartContainer = /*#__PURE__*/React.forwardRef(function ResponsiveChartContainer(props, ref) {
|
|
103
103
|
const {
|
|
104
104
|
width: inWidth,
|
|
105
105
|
height: inHeight
|
|
@@ -118,5 +118,4 @@ const ResponsiveChartContainer = /*#__PURE__*/React.forwardRef(function Responsi
|
|
|
118
118
|
ref: ref
|
|
119
119
|
}))
|
|
120
120
|
});
|
|
121
|
-
});
|
|
122
|
-
exports.ResponsiveChartContainer = ResponsiveChartContainer;
|
|
121
|
+
});
|
|
@@ -4,13 +4,13 @@ import { ResponsiveChartContainerProps } from '../ResponsiveChartContainer';
|
|
|
4
4
|
import { ChartsAxisProps } from '../ChartsAxis';
|
|
5
5
|
import { ScatterSeriesType } from '../models/seriesType/scatter';
|
|
6
6
|
import { MakeOptional } from '../models/helpers';
|
|
7
|
-
import { ChartsTooltipProps } from '../ChartsTooltip';
|
|
7
|
+
import { ChartsTooltipProps, ChartsTooltipSlotComponentProps, ChartsTooltipSlotsComponent } from '../ChartsTooltip';
|
|
8
8
|
import { ChartsLegendProps, ChartsLegendSlotComponentProps, ChartsLegendSlotsComponent } from '../ChartsLegend';
|
|
9
9
|
import { ChartsAxisHighlightProps } from '../ChartsAxisHighlight';
|
|
10
10
|
import { ChartsAxisSlotsComponent, ChartsAxisSlotComponentProps } from '../models/axis';
|
|
11
|
-
export interface ScatterChartSlotsComponent extends ChartsAxisSlotsComponent, ScatterPlotSlotsComponent, ChartsLegendSlotsComponent {
|
|
11
|
+
export interface ScatterChartSlotsComponent extends ChartsAxisSlotsComponent, ScatterPlotSlotsComponent, ChartsLegendSlotsComponent, ChartsTooltipSlotsComponent {
|
|
12
12
|
}
|
|
13
|
-
export interface ScatterChartSlotComponentProps extends ChartsAxisSlotComponentProps, ScatterPlotSlotComponentProps, ChartsLegendSlotComponentProps {
|
|
13
|
+
export interface ScatterChartSlotComponentProps extends ChartsAxisSlotComponentProps, ScatterPlotSlotComponentProps, ChartsLegendSlotComponentProps, ChartsTooltipSlotComponentProps {
|
|
14
14
|
}
|
|
15
15
|
export interface ScatterChartProps extends Omit<ResponsiveChartContainerProps, 'series'>, Omit<ChartsAxisProps, 'slots' | 'slotProps'> {
|
|
16
16
|
series: MakeOptional<ScatterSeriesType, 'type'>[];
|
|
@@ -17,7 +17,7 @@ var _ChartsAxisHighlight = require("../ChartsAxisHighlight");
|
|
|
17
17
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
18
18
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
19
19
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
20
|
-
const ScatterChart = /*#__PURE__*/React.forwardRef(function ScatterChart(props, ref) {
|
|
20
|
+
const ScatterChart = exports.ScatterChart = /*#__PURE__*/React.forwardRef(function ScatterChart(props, ref) {
|
|
21
21
|
const {
|
|
22
22
|
xAxis,
|
|
23
23
|
yAxis,
|
|
@@ -71,7 +71,6 @@ const ScatterChart = /*#__PURE__*/React.forwardRef(function ScatterChart(props,
|
|
|
71
71
|
}, tooltip)), children]
|
|
72
72
|
});
|
|
73
73
|
});
|
|
74
|
-
exports.ScatterChart = ScatterChart;
|
|
75
74
|
process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
|
|
76
75
|
// ----------------------------- Warning --------------------------------
|
|
77
76
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
@@ -219,6 +218,8 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
|
|
|
219
218
|
axisContent: _propTypes.default.elementType,
|
|
220
219
|
classes: _propTypes.default.object,
|
|
221
220
|
itemContent: _propTypes.default.elementType,
|
|
221
|
+
slotProps: _propTypes.default.object,
|
|
222
|
+
slots: _propTypes.default.object,
|
|
222
223
|
trigger: _propTypes.default.oneOf(['axis', 'item', 'none'])
|
|
223
224
|
}),
|
|
224
225
|
/**
|
package/ScatterChart/legend.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { ResponsiveChartContainerProps } from '../ResponsiveChartContainer';
|
|
3
|
-
import { ChartsTooltipProps } from '../ChartsTooltip';
|
|
3
|
+
import { ChartsTooltipProps, ChartsTooltipSlotComponentProps, ChartsTooltipSlotsComponent } from '../ChartsTooltip';
|
|
4
4
|
import { ChartsAxisHighlightProps } from '../ChartsAxisHighlight';
|
|
5
5
|
import { AxisConfig } from '../models/axis';
|
|
6
6
|
import { MakeOptional } from '../models/helpers';
|
|
@@ -10,9 +10,9 @@ import { LinePlotSlotsComponent, LinePlotSlotComponentProps } from '../LineChart
|
|
|
10
10
|
import { MarkPlotSlotsComponent, MarkPlotSlotComponentProps } from '../LineChart/MarkPlot';
|
|
11
11
|
import { LineHighlightPlotSlotsComponent, LineHighlightPlotSlotComponentProps } from '../LineChart/LineHighlightPlot';
|
|
12
12
|
import { BarPlotSlotsComponent, BarPlotSlotComponentProps } from '../BarChart/BarPlot';
|
|
13
|
-
export interface SparkLineChartSlotsComponent extends AreaPlotSlotsComponent, LinePlotSlotsComponent, MarkPlotSlotsComponent, LineHighlightPlotSlotsComponent, BarPlotSlotsComponent {
|
|
13
|
+
export interface SparkLineChartSlotsComponent extends AreaPlotSlotsComponent, LinePlotSlotsComponent, MarkPlotSlotsComponent, LineHighlightPlotSlotsComponent, BarPlotSlotsComponent, ChartsTooltipSlotsComponent {
|
|
14
14
|
}
|
|
15
|
-
export interface SparkLineChartSlotComponentProps extends AreaPlotSlotComponentProps, LinePlotSlotComponentProps, MarkPlotSlotComponentProps, LineHighlightPlotSlotComponentProps, BarPlotSlotComponentProps {
|
|
15
|
+
export interface SparkLineChartSlotComponentProps extends AreaPlotSlotComponentProps, LinePlotSlotComponentProps, MarkPlotSlotComponentProps, LineHighlightPlotSlotComponentProps, BarPlotSlotComponentProps, ChartsTooltipSlotComponentProps {
|
|
16
16
|
}
|
|
17
17
|
export interface SparkLineChartProps extends Omit<ResponsiveChartContainerProps, 'series' | 'xAxis' | 'yAxis'> {
|
|
18
18
|
/**
|
|
@@ -23,7 +23,7 @@ const SPARKLINE_DEFAULT_MARGIN = {
|
|
|
23
23
|
left: 5,
|
|
24
24
|
right: 5
|
|
25
25
|
};
|
|
26
|
-
const SparkLineChart = /*#__PURE__*/React.forwardRef(function SparkLineChart(props, ref) {
|
|
26
|
+
const SparkLineChart = exports.SparkLineChart = /*#__PURE__*/React.forwardRef(function SparkLineChart(props, ref) {
|
|
27
27
|
const {
|
|
28
28
|
xAxis,
|
|
29
29
|
width,
|
|
@@ -92,10 +92,12 @@ const SparkLineChart = /*#__PURE__*/React.forwardRef(function SparkLineChart(pro
|
|
|
92
92
|
slots: slots,
|
|
93
93
|
slotProps: slotProps
|
|
94
94
|
})]
|
|
95
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsAxisHighlight.ChartsAxisHighlight, (0, _extends2.default)({}, axisHighlight)), showTooltip && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsTooltip.ChartsTooltip, (0, _extends2.default)({}, tooltip
|
|
95
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsAxisHighlight.ChartsAxisHighlight, (0, _extends2.default)({}, axisHighlight)), showTooltip && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsTooltip.ChartsTooltip, (0, _extends2.default)({}, tooltip, {
|
|
96
|
+
slotProps: slotProps,
|
|
97
|
+
slots: slots
|
|
98
|
+
})), children]
|
|
96
99
|
});
|
|
97
100
|
});
|
|
98
|
-
exports.SparkLineChart = SparkLineChart;
|
|
99
101
|
process.env.NODE_ENV !== "production" ? SparkLineChart.propTypes = {
|
|
100
102
|
// ----------------------------- Warning --------------------------------
|
|
101
103
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
@@ -168,6 +170,8 @@ process.env.NODE_ENV !== "production" ? SparkLineChart.propTypes = {
|
|
|
168
170
|
axisContent: _propTypes.default.elementType,
|
|
169
171
|
classes: _propTypes.default.object,
|
|
170
172
|
itemContent: _propTypes.default.elementType,
|
|
173
|
+
slotProps: _propTypes.default.object,
|
|
174
|
+
slots: _propTypes.default.object,
|
|
171
175
|
trigger: _propTypes.default.oneOf(['axis', 'item', 'none'])
|
|
172
176
|
}),
|
|
173
177
|
/**
|
|
@@ -4,21 +4,15 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.mangoFusionPaletteLight = exports.mangoFusionPaletteDark = exports.mangoFusionPalette = exports.cheerfulFiestaPaletteLight = exports.cheerfulFiestaPaletteDark = exports.cheerfulFiestaPalette = exports.blueberryTwilightPaletteLight = exports.blueberryTwilightPaletteDark = exports.blueberryTwilightPalette = void 0;
|
|
7
|
-
const blueberryTwilightPaletteLight = ['#02B2AF', '#2E96FF', '#B800D8', '#60009B', '#2731C8', '#03008D'];
|
|
8
|
-
exports.
|
|
9
|
-
const blueberryTwilightPaletteDark = ['#02B2AF', '#72CCFF', '#DA00FF', '#9001CB', '#2E96FF', '#3B48E0'];
|
|
10
|
-
exports.blueberryTwilightPaletteDark = blueberryTwilightPaletteDark;
|
|
7
|
+
const blueberryTwilightPaletteLight = exports.blueberryTwilightPaletteLight = ['#02B2AF', '#2E96FF', '#B800D8', '#60009B', '#2731C8', '#03008D'];
|
|
8
|
+
const blueberryTwilightPaletteDark = exports.blueberryTwilightPaletteDark = ['#02B2AF', '#72CCFF', '#DA00FF', '#9001CB', '#2E96FF', '#3B48E0'];
|
|
11
9
|
const blueberryTwilightPalette = mode => mode === 'dark' ? blueberryTwilightPaletteDark : blueberryTwilightPaletteLight;
|
|
12
10
|
exports.blueberryTwilightPalette = blueberryTwilightPalette;
|
|
13
|
-
const mangoFusionPaletteLight = ['#173A5E', '#00A3A0', '#C91B63', '#EF5350', '#FFA726', '#B800D8', '#60009B', '#2E96FF', '#2731C8', '#03008D'];
|
|
14
|
-
exports.
|
|
15
|
-
const mangoFusionPaletteDark = ['#41698F', '#19D0CD', '#DE196B', '#FC5F5C', '#FFD771', '#DA00FF', '#9001CB', '#72CCFF', '#2E96FF', '#3B48E0'];
|
|
16
|
-
exports.mangoFusionPaletteDark = mangoFusionPaletteDark;
|
|
11
|
+
const mangoFusionPaletteLight = exports.mangoFusionPaletteLight = ['#173A5E', '#00A3A0', '#C91B63', '#EF5350', '#FFA726', '#B800D8', '#60009B', '#2E96FF', '#2731C8', '#03008D'];
|
|
12
|
+
const mangoFusionPaletteDark = exports.mangoFusionPaletteDark = ['#41698F', '#19D0CD', '#DE196B', '#FC5F5C', '#FFD771', '#DA00FF', '#9001CB', '#72CCFF', '#2E96FF', '#3B48E0'];
|
|
17
13
|
const mangoFusionPalette = mode => mode === 'dark' ? mangoFusionPaletteDark : mangoFusionPaletteLight;
|
|
18
14
|
exports.mangoFusionPalette = mangoFusionPalette;
|
|
19
|
-
const cheerfulFiestaPaletteDark = ['#0059B2', '#2E96FF', '#FFC24C', '#FF9F0E', '#F38200', '#2ABFDE', '#1F94AD', '#BD2C38', '#FF3143', '#FF8282'];
|
|
20
|
-
exports.
|
|
21
|
-
const cheerfulFiestaPaletteLight = ['#003A75', '#007FFF', '#FFC24C', '#FF9D09', '#CA6C00', '#127D94', '#1F94AD', '#C82634', '#FF3143', '#FF7E7E'];
|
|
22
|
-
exports.cheerfulFiestaPaletteLight = cheerfulFiestaPaletteLight;
|
|
15
|
+
const cheerfulFiestaPaletteDark = exports.cheerfulFiestaPaletteDark = ['#0059B2', '#2E96FF', '#FFC24C', '#FF9F0E', '#F38200', '#2ABFDE', '#1F94AD', '#BD2C38', '#FF3143', '#FF8282'];
|
|
16
|
+
const cheerfulFiestaPaletteLight = exports.cheerfulFiestaPaletteLight = ['#003A75', '#007FFF', '#FFC24C', '#FF9D09', '#CA6C00', '#127D94', '#1F94AD', '#C82634', '#FF3143', '#FF7E7E'];
|
|
23
17
|
const cheerfulFiestaPalette = mode => mode === 'dark' ? cheerfulFiestaPaletteDark : cheerfulFiestaPaletteLight;
|
|
24
18
|
exports.cheerfulFiestaPalette = cheerfulFiestaPalette;
|
package/constants.js
CHANGED
|
@@ -4,14 +4,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.DEFAULT_Y_AXIS_KEY = exports.DEFAULT_X_AXIS_KEY = exports.DEFAULT_MARGINS = void 0;
|
|
7
|
-
const DEFAULT_X_AXIS_KEY = 'DEFAULT_X_AXIS_KEY';
|
|
8
|
-
exports.
|
|
9
|
-
const
|
|
10
|
-
exports.DEFAULT_Y_AXIS_KEY = DEFAULT_Y_AXIS_KEY;
|
|
11
|
-
const DEFAULT_MARGINS = {
|
|
7
|
+
const DEFAULT_X_AXIS_KEY = exports.DEFAULT_X_AXIS_KEY = 'DEFAULT_X_AXIS_KEY';
|
|
8
|
+
const DEFAULT_Y_AXIS_KEY = exports.DEFAULT_Y_AXIS_KEY = 'DEFAULT_Y_AXIS_KEY';
|
|
9
|
+
const DEFAULT_MARGINS = exports.DEFAULT_MARGINS = {
|
|
12
10
|
top: 100,
|
|
13
11
|
bottom: 50,
|
|
14
12
|
left: 50,
|
|
15
13
|
right: 50
|
|
16
|
-
};
|
|
17
|
-
exports.DEFAULT_MARGINS = DEFAULT_MARGINS;
|
|
14
|
+
};
|
|
@@ -36,13 +36,12 @@ const yExtremumGetters = {
|
|
|
36
36
|
scatter: _extremums2.getExtremumY,
|
|
37
37
|
line: _extremums3.getExtremumY
|
|
38
38
|
};
|
|
39
|
-
const CartesianContext = /*#__PURE__*/React.createContext({
|
|
39
|
+
const CartesianContext = exports.CartesianContext = /*#__PURE__*/React.createContext({
|
|
40
40
|
xAxis: {},
|
|
41
41
|
yAxis: {},
|
|
42
42
|
xAxisIds: [],
|
|
43
43
|
yAxisIds: []
|
|
44
44
|
});
|
|
45
|
-
exports.CartesianContext = CartesianContext;
|
|
46
45
|
function CartesianContextProvider({
|
|
47
46
|
xAxis: inXAxis,
|
|
48
47
|
yAxis: inYAxis,
|
|
@@ -17,17 +17,15 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
17
17
|
* Defines the area in which it is possible to draw the charts.
|
|
18
18
|
*/
|
|
19
19
|
|
|
20
|
-
const DrawingContext = /*#__PURE__*/React.createContext({
|
|
20
|
+
const DrawingContext = exports.DrawingContext = /*#__PURE__*/React.createContext({
|
|
21
21
|
top: 0,
|
|
22
22
|
left: 0,
|
|
23
23
|
height: 300,
|
|
24
24
|
width: 400
|
|
25
25
|
});
|
|
26
|
-
exports.
|
|
27
|
-
const SVGContext = /*#__PURE__*/React.createContext({
|
|
26
|
+
const SVGContext = exports.SVGContext = /*#__PURE__*/React.createContext({
|
|
28
27
|
current: null
|
|
29
28
|
});
|
|
30
|
-
exports.SVGContext = SVGContext;
|
|
31
29
|
function DrawingProvider({
|
|
32
30
|
width,
|
|
33
31
|
height,
|
|
@@ -15,12 +15,11 @@ const defaultScope = {
|
|
|
15
15
|
highlighted: 'none',
|
|
16
16
|
faded: 'none'
|
|
17
17
|
};
|
|
18
|
-
const HighlighContext = /*#__PURE__*/React.createContext({
|
|
18
|
+
const HighlighContext = exports.HighlighContext = /*#__PURE__*/React.createContext({
|
|
19
19
|
item: null,
|
|
20
20
|
scope: defaultScope,
|
|
21
21
|
dispatch: () => null
|
|
22
22
|
});
|
|
23
|
-
exports.HighlighContext = HighlighContext;
|
|
24
23
|
const dataReducer = (prevState, action) => {
|
|
25
24
|
switch (action.type) {
|
|
26
25
|
case 'enterItem':
|
|
@@ -11,7 +11,7 @@ var React = _interopRequireWildcard(require("react"));
|
|
|
11
11
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
12
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
13
13
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
14
|
-
const InteractionContext = /*#__PURE__*/React.createContext({
|
|
14
|
+
const InteractionContext = exports.InteractionContext = /*#__PURE__*/React.createContext({
|
|
15
15
|
item: null,
|
|
16
16
|
axis: {
|
|
17
17
|
x: null,
|
|
@@ -19,7 +19,6 @@ const InteractionContext = /*#__PURE__*/React.createContext({
|
|
|
19
19
|
},
|
|
20
20
|
dispatch: () => null
|
|
21
21
|
});
|
|
22
|
-
exports.InteractionContext = InteractionContext;
|
|
23
22
|
const dataReducer = (prevState, action) => {
|
|
24
23
|
switch (action.type) {
|
|
25
24
|
case 'enterItem':
|
|
@@ -18,8 +18,7 @@ var _colorPalettes = require("../colorPalettes");
|
|
|
18
18
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
19
19
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
20
20
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
21
|
-
const SeriesContext = /*#__PURE__*/React.createContext({});
|
|
22
|
-
exports.SeriesContext = SeriesContext;
|
|
21
|
+
const SeriesContext = exports.SeriesContext = /*#__PURE__*/React.createContext({});
|
|
23
22
|
const seriesTypeFormatter = {
|
|
24
23
|
bar: _formatter.default,
|
|
25
24
|
scatter: _formatter2.default,
|
package/esm/BarChart/BarChart.js
CHANGED
|
@@ -244,6 +244,8 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
|
|
|
244
244
|
axisContent: PropTypes.elementType,
|
|
245
245
|
classes: PropTypes.object,
|
|
246
246
|
itemContent: PropTypes.elementType,
|
|
247
|
+
slotProps: PropTypes.object,
|
|
248
|
+
slots: PropTypes.object,
|
|
247
249
|
trigger: PropTypes.oneOf(['axis', 'item', 'none'])
|
|
248
250
|
}),
|
|
249
251
|
/**
|