@mui/x-charts 6.0.0-alpha.9 → 6.18.1
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 +26 -5
- package/BarChart/BarChart.js +93 -17
- package/BarChart/BarElement.d.ts +1319 -4
- package/BarChart/BarElement.js +10 -10
- package/BarChart/BarPlot.d.ts +17 -1
- package/BarChart/BarPlot.js +152 -66
- package/BarChart/formatter.js +2 -3
- package/BarChart/legend.js +1 -2
- package/CHANGELOG.md +797 -59
- package/ChartContainer/index.js +7 -5
- package/ChartsAxis/ChartsAxis.d.ts +9 -0
- package/ChartsAxis/ChartsAxis.js +33 -7
- package/ChartsAxis/axisClasses.d.ts +3 -3
- package/ChartsAxis/axisClasses.js +1 -2
- package/ChartsAxisHighlight/ChartsAxisHighlight.d.ts +21 -0
- package/ChartsAxisHighlight/ChartsAxisHighlight.js +61 -22
- package/ChartsClipPath/ChartsClipPath.d.ts +5 -0
- package/ChartsClipPath/ChartsClipPath.js +7 -2
- package/ChartsLegend/ChartsLegend.d.ts +45 -24
- package/ChartsLegend/ChartsLegend.js +193 -151
- package/ChartsLegend/chartsLegendClasses.d.ts +1 -1
- package/ChartsLegend/chartsLegendClasses.js +3 -4
- package/ChartsLegend/utils.d.ts +1 -6
- package/ChartsReferenceLine/ChartsReferenceLine.d.ts +10 -0
- package/ChartsReferenceLine/ChartsReferenceLine.js +78 -0
- package/ChartsReferenceLine/ChartsXReferenceLine.d.ts +13 -0
- package/ChartsReferenceLine/ChartsXReferenceLine.js +112 -0
- package/ChartsReferenceLine/ChartsYReferenceLine.d.ts +13 -0
- package/ChartsReferenceLine/ChartsYReferenceLine.js +112 -0
- package/ChartsReferenceLine/chartsReferenceLineClasses.d.ts +15 -0
- package/ChartsReferenceLine/chartsReferenceLineClasses.js +14 -0
- package/ChartsReferenceLine/common.d.ts +41 -0
- package/ChartsReferenceLine/common.js +27 -0
- package/ChartsReferenceLine/index.d.ts +2 -0
- package/ChartsReferenceLine/index.js +27 -0
- package/ChartsReferenceLine/package.json +6 -0
- package/ChartsSurface.d.ts +12 -1
- package/ChartsSurface.js +9 -18
- package/ChartsTooltip/ChartsAxisTooltipContent.d.ts +1 -0
- package/ChartsTooltip/ChartsAxisTooltipContent.js +46 -32
- package/ChartsTooltip/ChartsItemTooltipContent.d.ts +3 -2
- package/ChartsTooltip/ChartsItemTooltipContent.js +18 -9
- package/ChartsTooltip/ChartsTooltip.d.ts +32 -0
- package/ChartsTooltip/ChartsTooltip.js +62 -18
- package/ChartsTooltip/ChartsTooltipTable.d.ts +3 -10
- package/ChartsTooltip/ChartsTooltipTable.js +22 -20
- package/ChartsTooltip/tooltipClasses.js +1 -2
- package/ChartsTooltip/utils.js +2 -2
- package/ChartsXAxis/ChartsXAxis.d.ts +9 -0
- package/ChartsXAxis/ChartsXAxis.js +170 -45
- package/ChartsYAxis/ChartsYAxis.d.ts +9 -0
- package/ChartsYAxis/ChartsYAxis.js +95 -38
- package/LineChart/AreaElement.d.ts +11 -1
- package/LineChart/AreaElement.js +14 -6
- package/LineChart/AreaPlot.d.ts +11 -0
- package/LineChart/AreaPlot.js +27 -8
- package/LineChart/LineChart.d.ts +23 -3
- package/LineChart/LineChart.js +89 -17
- package/LineChart/LineElement.d.ts +11 -1
- package/LineChart/LineElement.js +14 -6
- package/LineChart/LineHighlightElement.d.ts +10 -0
- package/LineChart/LineHighlightElement.js +13 -4
- package/LineChart/LineHighlightPlot.d.ts +10 -0
- package/LineChart/LineHighlightPlot.js +15 -4
- package/LineChart/LinePlot.d.ts +10 -0
- package/LineChart/LinePlot.js +25 -12
- package/LineChart/MarkElement.d.ts +10 -0
- package/LineChart/MarkElement.js +14 -5
- package/LineChart/MarkPlot.d.ts +10 -0
- package/LineChart/MarkPlot.js +42 -10
- package/LineChart/formatter.js +5 -5
- package/LineChart/legend.js +1 -2
- package/PieChart/PieArc.d.ts +11 -13
- package/PieChart/PieArc.js +28 -60
- package/PieChart/PieArcLabel.d.ts +8 -9
- package/PieChart/PieArcLabel.js +46 -38
- package/PieChart/PieArcLabelPlot.d.ts +28 -0
- package/PieChart/PieArcLabelPlot.js +99 -0
- package/PieChart/PieArcPlot.d.ts +35 -0
- package/PieChart/PieArcPlot.js +92 -0
- package/PieChart/PieChart.d.ts +19 -5
- package/PieChart/PieChart.js +95 -18
- package/PieChart/PiePlot.d.ts +15 -9
- package/PieChart/PiePlot.js +77 -55
- package/PieChart/dataTransform/transition.d.ts +4 -0
- package/PieChart/dataTransform/transition.js +136 -0
- package/PieChart/dataTransform/useTransformData.d.ts +15 -0
- package/PieChart/dataTransform/useTransformData.js +67 -0
- package/PieChart/formatter.js +1 -2
- package/PieChart/legend.js +1 -2
- package/README.md +8 -14
- package/ResponsiveChartContainer/index.d.ts +13 -3
- package/ResponsiveChartContainer/index.js +7 -8
- package/ScatterChart/Scatter.d.ts +10 -0
- package/ScatterChart/Scatter.js +12 -2
- package/ScatterChart/ScatterChart.d.ts +16 -3
- package/ScatterChart/ScatterChart.js +77 -16
- package/ScatterChart/ScatterPlot.d.ts +10 -0
- package/ScatterChart/ScatterPlot.js +12 -2
- package/ScatterChart/formatter.js +1 -2
- package/ScatterChart/legend.js +1 -2
- package/SparkLineChart/SparkLineChart.d.ts +12 -3
- package/SparkLineChart/SparkLineChart.js +50 -7
- package/colorPalettes/colorPalettes.js +6 -12
- package/constants.js +5 -8
- package/context/CartesianContextProvider.d.ts +26 -1
- package/context/CartesianContextProvider.js +42 -16
- package/context/DrawingProvider.d.ts +25 -0
- package/context/DrawingProvider.js +18 -6
- package/context/HighlightProvider.d.ts +17 -0
- package/context/HighlightProvider.js +3 -4
- package/context/InteractionProvider.d.ts +6 -0
- package/context/InteractionProvider.js +3 -4
- package/context/SeriesContextProvider.d.ts +5 -0
- package/context/SeriesContextProvider.js +3 -4
- package/esm/BarChart/BarChart.js +90 -13
- package/esm/BarChart/BarElement.js +7 -4
- package/esm/BarChart/BarPlot.js +152 -67
- package/esm/BarChart/formatter.js +1 -1
- package/esm/ChartContainer/index.js +3 -0
- package/esm/ChartsAxis/ChartsAxis.js +32 -5
- package/esm/ChartsAxisHighlight/ChartsAxisHighlight.js +57 -20
- package/esm/ChartsClipPath/ChartsClipPath.js +5 -0
- package/esm/ChartsLegend/ChartsLegend.js +190 -144
- package/esm/ChartsLegend/chartsLegendClasses.js +1 -1
- package/esm/ChartsReferenceLine/ChartsReferenceLine.js +70 -0
- package/esm/ChartsReferenceLine/ChartsXReferenceLine.js +105 -0
- package/esm/ChartsReferenceLine/ChartsYReferenceLine.js +105 -0
- package/esm/ChartsReferenceLine/chartsReferenceLineClasses.js +6 -0
- package/esm/ChartsReferenceLine/common.js +20 -0
- package/esm/ChartsReferenceLine/index.js +2 -0
- package/esm/ChartsSurface.js +4 -12
- package/esm/ChartsTooltip/ChartsAxisTooltipContent.js +44 -30
- package/esm/ChartsTooltip/ChartsItemTooltipContent.js +15 -7
- package/esm/ChartsTooltip/ChartsTooltip.js +59 -14
- package/esm/ChartsTooltip/ChartsTooltipTable.js +17 -10
- package/esm/ChartsXAxis/ChartsXAxis.js +168 -43
- package/esm/ChartsYAxis/ChartsYAxis.js +93 -36
- package/esm/LineChart/AreaElement.js +10 -0
- package/esm/LineChart/AreaPlot.js +26 -6
- package/esm/LineChart/LineChart.js +86 -13
- package/esm/LineChart/LineElement.js +10 -0
- package/esm/LineChart/LineHighlightElement.js +10 -0
- package/esm/LineChart/LineHighlightPlot.js +13 -2
- package/esm/LineChart/LinePlot.js +25 -14
- package/esm/LineChart/MarkElement.js +11 -1
- package/esm/LineChart/MarkPlot.js +40 -8
- package/esm/LineChart/formatter.js +7 -3
- package/esm/PieChart/PieArc.js +26 -58
- package/esm/PieChart/PieArcLabel.js +43 -34
- package/esm/PieChart/PieArcLabelPlot.js +92 -0
- package/esm/PieChart/PieArcPlot.js +84 -0
- package/esm/PieChart/PieChart.js +93 -16
- package/esm/PieChart/PiePlot.js +76 -57
- package/esm/PieChart/dataTransform/transition.js +130 -0
- package/esm/PieChart/dataTransform/useTransformData.js +59 -0
- package/esm/ResponsiveChartContainer/index.js +3 -3
- package/esm/ScatterChart/Scatter.js +10 -0
- package/esm/ScatterChart/ScatterChart.js +74 -12
- package/esm/ScatterChart/ScatterPlot.js +10 -0
- package/esm/SparkLineChart/SparkLineChart.js +47 -3
- package/esm/constants.js +1 -1
- package/esm/context/CartesianContextProvider.js +41 -14
- package/esm/context/DrawingProvider.js +14 -0
- package/esm/hooks/useChartDimensions.js +2 -0
- package/esm/hooks/useMounted.js +16 -0
- package/esm/hooks/useReducedMotion.js +27 -0
- package/esm/hooks/useTicks.js +15 -9
- package/esm/index.js +1 -0
- package/esm/internals/components/AxisSharedComponents.js +15 -70
- package/esm/internals/components/ChartsText.js +77 -0
- package/esm/internals/domUtils.js +113 -0
- package/esm/internals/geometry.js +36 -0
- package/hooks/useAxisEvents.js +2 -2
- package/hooks/useChartDimensions.d.ts +2 -0
- package/hooks/useChartDimensions.js +5 -4
- package/hooks/useDrawingArea.js +2 -2
- package/hooks/useInteractionItemProps.js +2 -2
- package/hooks/useMounted.d.ts +1 -0
- package/hooks/useMounted.js +25 -0
- package/hooks/useReducedMotion.d.ts +8 -0
- package/hooks/useReducedMotion.js +33 -0
- package/hooks/useScale.d.ts +2 -2
- package/hooks/useScale.js +2 -2
- package/hooks/useTicks.d.ts +19 -11
- package/hooks/useTicks.js +19 -14
- package/index.d.ts +1 -0
- package/index.js +12 -1
- package/internals/components/AxisSharedComponents.d.ts +0 -4
- package/internals/components/AxisSharedComponents.js +18 -78
- package/internals/components/ChartsText.d.ts +35 -0
- package/internals/components/ChartsText.js +87 -0
- package/internals/defaultizeColor.d.ts +7 -2
- package/internals/defaultizeValueFormatter.js +1 -2
- package/internals/domUtils.d.ts +13 -0
- package/internals/domUtils.js +122 -0
- package/internals/geometry.d.ts +9 -0
- package/internals/geometry.js +42 -0
- package/internals/isBandScale.d.ts +3 -1
- package/internals/stackSeries.js +2 -4
- package/internals/utils.d.ts +5 -0
- package/legacy/BarChart/BarChart.js +90 -13
- package/legacy/BarChart/BarElement.js +6 -3
- package/legacy/BarChart/BarPlot.js +151 -63
- package/legacy/BarChart/formatter.js +1 -1
- package/legacy/ChartContainer/index.js +3 -0
- package/legacy/ChartsAxis/ChartsAxis.js +32 -5
- package/legacy/ChartsAxisHighlight/ChartsAxisHighlight.js +60 -20
- package/legacy/ChartsClipPath/ChartsClipPath.js +5 -0
- package/legacy/ChartsLegend/ChartsLegend.js +205 -142
- package/legacy/ChartsLegend/chartsLegendClasses.js +1 -1
- package/legacy/ChartsReferenceLine/ChartsReferenceLine.js +70 -0
- package/legacy/ChartsReferenceLine/ChartsXReferenceLine.js +105 -0
- package/legacy/ChartsReferenceLine/ChartsYReferenceLine.js +105 -0
- package/legacy/ChartsReferenceLine/chartsReferenceLineClasses.js +6 -0
- package/legacy/ChartsReferenceLine/common.js +20 -0
- package/legacy/ChartsReferenceLine/index.js +2 -0
- package/legacy/ChartsSurface.js +3 -12
- package/legacy/ChartsTooltip/ChartsAxisTooltipContent.js +22 -10
- package/legacy/ChartsTooltip/ChartsItemTooltipContent.js +15 -7
- package/legacy/ChartsTooltip/ChartsTooltip.js +62 -14
- package/legacy/ChartsTooltip/ChartsTooltipTable.js +34 -26
- package/legacy/ChartsXAxis/ChartsXAxis.js +176 -50
- package/legacy/ChartsYAxis/ChartsYAxis.js +97 -41
- package/legacy/LineChart/AreaElement.js +10 -0
- package/legacy/LineChart/AreaPlot.js +31 -7
- package/legacy/LineChart/LineChart.js +86 -13
- package/legacy/LineChart/LineElement.js +10 -0
- package/legacy/LineChart/LineHighlightElement.js +10 -0
- package/legacy/LineChart/LineHighlightPlot.js +13 -2
- package/legacy/LineChart/LinePlot.js +29 -12
- package/legacy/LineChart/MarkElement.js +11 -1
- package/legacy/LineChart/MarkPlot.js +39 -8
- package/legacy/LineChart/formatter.js +7 -3
- package/legacy/PieChart/PieArc.js +30 -62
- package/legacy/PieChart/PieArcLabel.js +48 -34
- package/legacy/PieChart/PieArcLabelPlot.js +93 -0
- package/legacy/PieChart/PieArcPlot.js +84 -0
- package/legacy/PieChart/PieChart.js +93 -16
- package/legacy/PieChart/PiePlot.js +76 -59
- package/legacy/PieChart/dataTransform/transition.js +142 -0
- package/legacy/PieChart/dataTransform/useTransformData.js +60 -0
- package/legacy/ResponsiveChartContainer/index.js +3 -3
- package/legacy/ScatterChart/Scatter.js +10 -0
- package/legacy/ScatterChart/ScatterChart.js +74 -12
- package/legacy/ScatterChart/ScatterPlot.js +10 -0
- package/legacy/SparkLineChart/SparkLineChart.js +47 -3
- package/legacy/constants.js +1 -1
- package/legacy/context/CartesianContextProvider.js +41 -14
- package/legacy/context/DrawingProvider.js +14 -0
- package/legacy/hooks/useChartDimensions.js +2 -0
- package/legacy/hooks/useMounted.js +21 -0
- package/legacy/hooks/useReducedMotion.js +27 -0
- package/legacy/hooks/useTicks.js +16 -9
- package/legacy/index.js +2 -1
- package/legacy/internals/components/AxisSharedComponents.js +11 -65
- package/legacy/internals/components/ChartsText.js +79 -0
- package/legacy/internals/domUtils.js +121 -0
- package/legacy/internals/geometry.js +37 -0
- package/models/axis.d.ts +58 -20
- package/models/layout.d.ts +13 -6
- package/models/seriesType/common.d.ts +16 -0
- package/models/seriesType/line.d.ts +8 -3
- package/models/seriesType/pie.d.ts +5 -1
- package/modern/BarChart/BarChart.js +90 -13
- package/modern/BarChart/BarElement.js +7 -4
- package/modern/BarChart/BarPlot.js +149 -65
- package/modern/BarChart/formatter.js +1 -1
- package/modern/ChartContainer/index.js +3 -0
- package/modern/ChartsAxis/ChartsAxis.js +31 -5
- package/modern/ChartsAxisHighlight/ChartsAxisHighlight.js +57 -20
- package/modern/ChartsClipPath/ChartsClipPath.js +5 -0
- package/modern/ChartsLegend/ChartsLegend.js +190 -144
- package/modern/ChartsLegend/chartsLegendClasses.js +1 -1
- package/modern/ChartsReferenceLine/ChartsReferenceLine.js +70 -0
- package/modern/ChartsReferenceLine/ChartsXReferenceLine.js +104 -0
- package/modern/ChartsReferenceLine/ChartsYReferenceLine.js +104 -0
- package/modern/ChartsReferenceLine/chartsReferenceLineClasses.js +6 -0
- package/modern/ChartsReferenceLine/common.js +20 -0
- package/modern/ChartsReferenceLine/index.js +2 -0
- package/modern/ChartsSurface.js +4 -12
- package/modern/ChartsTooltip/ChartsAxisTooltipContent.js +44 -30
- package/modern/ChartsTooltip/ChartsItemTooltipContent.js +15 -7
- package/modern/ChartsTooltip/ChartsTooltip.js +58 -14
- package/modern/ChartsTooltip/ChartsTooltipTable.js +17 -10
- package/modern/ChartsXAxis/ChartsXAxis.js +167 -42
- package/modern/ChartsYAxis/ChartsYAxis.js +92 -35
- package/modern/LineChart/AreaElement.js +10 -0
- package/modern/LineChart/AreaPlot.js +25 -6
- package/modern/LineChart/LineChart.js +86 -13
- package/modern/LineChart/LineElement.js +10 -0
- package/modern/LineChart/LineHighlightElement.js +10 -0
- package/modern/LineChart/LineHighlightPlot.js +13 -2
- package/modern/LineChart/LinePlot.js +23 -10
- package/modern/LineChart/MarkElement.js +11 -1
- package/modern/LineChart/MarkPlot.js +40 -8
- package/modern/LineChart/formatter.js +4 -3
- package/modern/PieChart/PieArc.js +26 -57
- package/modern/PieChart/PieArcLabel.js +43 -34
- package/modern/PieChart/PieArcLabelPlot.js +90 -0
- package/modern/PieChart/PieArcPlot.js +83 -0
- package/modern/PieChart/PieChart.js +93 -16
- package/modern/PieChart/PiePlot.js +76 -55
- package/modern/PieChart/dataTransform/transition.js +130 -0
- package/modern/PieChart/dataTransform/useTransformData.js +58 -0
- package/modern/ResponsiveChartContainer/index.js +3 -3
- package/modern/ScatterChart/Scatter.js +10 -0
- package/modern/ScatterChart/ScatterChart.js +74 -12
- package/modern/ScatterChart/ScatterPlot.js +10 -0
- package/modern/SparkLineChart/SparkLineChart.js +47 -3
- package/modern/constants.js +1 -1
- package/modern/context/CartesianContextProvider.js +40 -13
- package/modern/context/DrawingProvider.js +14 -0
- package/modern/hooks/useChartDimensions.js +2 -0
- package/modern/hooks/useMounted.js +16 -0
- package/modern/hooks/useReducedMotion.js +27 -0
- package/modern/hooks/useTicks.js +15 -9
- package/modern/index.js +2 -1
- package/modern/internals/components/AxisSharedComponents.js +15 -70
- package/modern/internals/components/ChartsText.js +77 -0
- package/modern/internals/domUtils.js +113 -0
- package/modern/internals/geometry.js +36 -0
- package/package.json +9 -6
- package/themeAugmentation/components.d.ts +1 -0
- package/themeAugmentation/overrides.d.ts +2 -0
|
@@ -15,9 +15,19 @@ var _ChartsTooltip = require("../ChartsTooltip");
|
|
|
15
15
|
var _ChartsLegend = require("../ChartsLegend");
|
|
16
16
|
var _ChartsAxisHighlight = require("../ChartsAxisHighlight");
|
|
17
17
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
18
|
-
function _getRequireWildcardCache(
|
|
19
|
-
function _interopRequireWildcard(
|
|
20
|
-
|
|
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 && Object.prototype.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
|
+
/**
|
|
21
|
+
* Demos:
|
|
22
|
+
*
|
|
23
|
+
* - [Scatter](https://mui.com/x/react-charts/scatter/)
|
|
24
|
+
* - [Scatter demonstration](https://mui.com/x/react-charts/scatter-demo/)
|
|
25
|
+
*
|
|
26
|
+
* API:
|
|
27
|
+
*
|
|
28
|
+
* - [ScatterChart API](https://mui.com/x/api/charts/scatter-chart/)
|
|
29
|
+
*/
|
|
30
|
+
const ScatterChart = exports.ScatterChart = /*#__PURE__*/React.forwardRef(function ScatterChart(props, ref) {
|
|
21
31
|
const {
|
|
22
32
|
xAxis,
|
|
23
33
|
yAxis,
|
|
@@ -71,7 +81,6 @@ const ScatterChart = /*#__PURE__*/React.forwardRef(function ScatterChart(props,
|
|
|
71
81
|
}, tooltip)), children]
|
|
72
82
|
});
|
|
73
83
|
});
|
|
74
|
-
exports.ScatterChart = ScatterChart;
|
|
75
84
|
process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
|
|
76
85
|
// ----------------------------- Warning --------------------------------
|
|
77
86
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
@@ -87,18 +96,22 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
|
|
|
87
96
|
* @default xAxisIds[0] The id of the first provided axis
|
|
88
97
|
*/
|
|
89
98
|
bottomAxis: _propTypes.default.oneOfType([_propTypes.default.shape({
|
|
90
|
-
axisId: _propTypes.default.string
|
|
99
|
+
axisId: _propTypes.default.string,
|
|
91
100
|
classes: _propTypes.default.object,
|
|
92
101
|
disableLine: _propTypes.default.bool,
|
|
93
102
|
disableTicks: _propTypes.default.bool,
|
|
94
103
|
fill: _propTypes.default.string,
|
|
95
104
|
label: _propTypes.default.string,
|
|
96
105
|
labelFontSize: _propTypes.default.number,
|
|
106
|
+
labelStyle: _propTypes.default.object,
|
|
97
107
|
position: _propTypes.default.oneOf(['bottom', 'top']),
|
|
98
108
|
slotProps: _propTypes.default.object,
|
|
99
109
|
slots: _propTypes.default.object,
|
|
100
110
|
stroke: _propTypes.default.string,
|
|
101
111
|
tickFontSize: _propTypes.default.number,
|
|
112
|
+
tickInterval: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto']), _propTypes.default.array, _propTypes.default.func]),
|
|
113
|
+
tickLabelInterval: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto']), _propTypes.default.func]),
|
|
114
|
+
tickLabelStyle: _propTypes.default.object,
|
|
102
115
|
tickMaxStep: _propTypes.default.number,
|
|
103
116
|
tickMinStep: _propTypes.default.number,
|
|
104
117
|
tickNumber: _propTypes.default.number,
|
|
@@ -110,9 +123,21 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
|
|
|
110
123
|
* Color palette used to colorize multiple series.
|
|
111
124
|
*/
|
|
112
125
|
colors: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.string), _propTypes.default.func]),
|
|
126
|
+
/**
|
|
127
|
+
* An array of objects that can be used to populate series and axes data using their `dataKey` property.
|
|
128
|
+
*/
|
|
113
129
|
dataset: _propTypes.default.arrayOf(_propTypes.default.object),
|
|
114
130
|
desc: _propTypes.default.string,
|
|
131
|
+
/**
|
|
132
|
+
* If `true`, the charts will not listen to the mouse move event.
|
|
133
|
+
* It might break interactive features, but will improve performance.
|
|
134
|
+
* @default false
|
|
135
|
+
*/
|
|
115
136
|
disableAxisListener: _propTypes.default.bool,
|
|
137
|
+
/**
|
|
138
|
+
* The height of the chart in px. If not defined, it takes the height of the parent element.
|
|
139
|
+
* @default undefined
|
|
140
|
+
*/
|
|
116
141
|
height: _propTypes.default.number,
|
|
117
142
|
/**
|
|
118
143
|
* Indicate which axis to display the left of the charts.
|
|
@@ -120,41 +145,47 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
|
|
|
120
145
|
* @default yAxisIds[0] The id of the first provided axis
|
|
121
146
|
*/
|
|
122
147
|
leftAxis: _propTypes.default.oneOfType([_propTypes.default.shape({
|
|
123
|
-
axisId: _propTypes.default.string
|
|
148
|
+
axisId: _propTypes.default.string,
|
|
124
149
|
classes: _propTypes.default.object,
|
|
125
150
|
disableLine: _propTypes.default.bool,
|
|
126
151
|
disableTicks: _propTypes.default.bool,
|
|
127
152
|
fill: _propTypes.default.string,
|
|
128
153
|
label: _propTypes.default.string,
|
|
129
154
|
labelFontSize: _propTypes.default.number,
|
|
155
|
+
labelStyle: _propTypes.default.object,
|
|
130
156
|
position: _propTypes.default.oneOf(['left', 'right']),
|
|
131
157
|
slotProps: _propTypes.default.object,
|
|
132
158
|
slots: _propTypes.default.object,
|
|
133
159
|
stroke: _propTypes.default.string,
|
|
134
160
|
tickFontSize: _propTypes.default.number,
|
|
161
|
+
tickInterval: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto']), _propTypes.default.array, _propTypes.default.func]),
|
|
162
|
+
tickLabelInterval: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto']), _propTypes.default.func]),
|
|
163
|
+
tickLabelStyle: _propTypes.default.object,
|
|
135
164
|
tickMaxStep: _propTypes.default.number,
|
|
136
165
|
tickMinStep: _propTypes.default.number,
|
|
137
166
|
tickNumber: _propTypes.default.number,
|
|
138
167
|
tickSize: _propTypes.default.number
|
|
139
168
|
}), _propTypes.default.string]),
|
|
169
|
+
/**
|
|
170
|
+
* @deprecated Consider using `slotProps.legend` instead.
|
|
171
|
+
*/
|
|
140
172
|
legend: _propTypes.default.shape({
|
|
141
173
|
classes: _propTypes.default.object,
|
|
142
174
|
direction: _propTypes.default.oneOf(['column', 'row']),
|
|
143
175
|
hidden: _propTypes.default.bool,
|
|
144
|
-
itemWidth: _propTypes.default.number,
|
|
145
|
-
markSize: _propTypes.default.number,
|
|
146
|
-
offset: _propTypes.default.shape({
|
|
147
|
-
x: _propTypes.default.number,
|
|
148
|
-
y: _propTypes.default.number
|
|
149
|
-
}),
|
|
150
176
|
position: _propTypes.default.shape({
|
|
151
177
|
horizontal: _propTypes.default.oneOf(['left', 'middle', 'right']).isRequired,
|
|
152
178
|
vertical: _propTypes.default.oneOf(['bottom', 'middle', 'top']).isRequired
|
|
153
179
|
}),
|
|
154
180
|
slotProps: _propTypes.default.object,
|
|
155
|
-
slots: _propTypes.default.object
|
|
156
|
-
spacing: _propTypes.default.number
|
|
181
|
+
slots: _propTypes.default.object
|
|
157
182
|
}),
|
|
183
|
+
/**
|
|
184
|
+
* The margin between the SVG and the drawing area.
|
|
185
|
+
* It's used for leaving some space for extra information such as the x- and y-axis or legend.
|
|
186
|
+
* Accepts an object with the optional properties: `top`, `bottom`, `left`, and `right`.
|
|
187
|
+
* @default object Depends on the charts type.
|
|
188
|
+
*/
|
|
158
189
|
margin: _propTypes.default.shape({
|
|
159
190
|
bottom: _propTypes.default.number,
|
|
160
191
|
left: _propTypes.default.number,
|
|
@@ -167,18 +198,22 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
|
|
|
167
198
|
* @default null
|
|
168
199
|
*/
|
|
169
200
|
rightAxis: _propTypes.default.oneOfType([_propTypes.default.shape({
|
|
170
|
-
axisId: _propTypes.default.string
|
|
201
|
+
axisId: _propTypes.default.string,
|
|
171
202
|
classes: _propTypes.default.object,
|
|
172
203
|
disableLine: _propTypes.default.bool,
|
|
173
204
|
disableTicks: _propTypes.default.bool,
|
|
174
205
|
fill: _propTypes.default.string,
|
|
175
206
|
label: _propTypes.default.string,
|
|
176
207
|
labelFontSize: _propTypes.default.number,
|
|
208
|
+
labelStyle: _propTypes.default.object,
|
|
177
209
|
position: _propTypes.default.oneOf(['left', 'right']),
|
|
178
210
|
slotProps: _propTypes.default.object,
|
|
179
211
|
slots: _propTypes.default.object,
|
|
180
212
|
stroke: _propTypes.default.string,
|
|
181
213
|
tickFontSize: _propTypes.default.number,
|
|
214
|
+
tickInterval: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto']), _propTypes.default.array, _propTypes.default.func]),
|
|
215
|
+
tickLabelInterval: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto']), _propTypes.default.func]),
|
|
216
|
+
tickLabelStyle: _propTypes.default.object,
|
|
182
217
|
tickMaxStep: _propTypes.default.number,
|
|
183
218
|
tickMinStep: _propTypes.default.number,
|
|
184
219
|
tickNumber: _propTypes.default.number,
|
|
@@ -219,6 +254,8 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
|
|
|
219
254
|
axisContent: _propTypes.default.elementType,
|
|
220
255
|
classes: _propTypes.default.object,
|
|
221
256
|
itemContent: _propTypes.default.elementType,
|
|
257
|
+
slotProps: _propTypes.default.object,
|
|
258
|
+
slots: _propTypes.default.object,
|
|
222
259
|
trigger: _propTypes.default.oneOf(['axis', 'item', 'none'])
|
|
223
260
|
}),
|
|
224
261
|
/**
|
|
@@ -227,18 +264,22 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
|
|
|
227
264
|
* @default null
|
|
228
265
|
*/
|
|
229
266
|
topAxis: _propTypes.default.oneOfType([_propTypes.default.shape({
|
|
230
|
-
axisId: _propTypes.default.string
|
|
267
|
+
axisId: _propTypes.default.string,
|
|
231
268
|
classes: _propTypes.default.object,
|
|
232
269
|
disableLine: _propTypes.default.bool,
|
|
233
270
|
disableTicks: _propTypes.default.bool,
|
|
234
271
|
fill: _propTypes.default.string,
|
|
235
272
|
label: _propTypes.default.string,
|
|
236
273
|
labelFontSize: _propTypes.default.number,
|
|
274
|
+
labelStyle: _propTypes.default.object,
|
|
237
275
|
position: _propTypes.default.oneOf(['bottom', 'top']),
|
|
238
276
|
slotProps: _propTypes.default.object,
|
|
239
277
|
slots: _propTypes.default.object,
|
|
240
278
|
stroke: _propTypes.default.string,
|
|
241
279
|
tickFontSize: _propTypes.default.number,
|
|
280
|
+
tickInterval: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto']), _propTypes.default.array, _propTypes.default.func]),
|
|
281
|
+
tickLabelInterval: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto']), _propTypes.default.func]),
|
|
282
|
+
tickLabelStyle: _propTypes.default.object,
|
|
242
283
|
tickMaxStep: _propTypes.default.number,
|
|
243
284
|
tickMinStep: _propTypes.default.number,
|
|
244
285
|
tickNumber: _propTypes.default.number,
|
|
@@ -250,7 +291,15 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
|
|
|
250
291
|
x: _propTypes.default.number,
|
|
251
292
|
y: _propTypes.default.number
|
|
252
293
|
}),
|
|
294
|
+
/**
|
|
295
|
+
* The width of the chart in px. If not defined, it takes the width of the parent element.
|
|
296
|
+
* @default undefined
|
|
297
|
+
*/
|
|
253
298
|
width: _propTypes.default.number,
|
|
299
|
+
/**
|
|
300
|
+
* The configuration of the x-axes.
|
|
301
|
+
* If not provided, a default axis config is used with id set to `DEFAULT_X_AXIS_KEY`.
|
|
302
|
+
*/
|
|
254
303
|
xAxis: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
255
304
|
axisId: _propTypes.default.string,
|
|
256
305
|
classes: _propTypes.default.object,
|
|
@@ -263,6 +312,7 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
|
|
|
263
312
|
id: _propTypes.default.string,
|
|
264
313
|
label: _propTypes.default.string,
|
|
265
314
|
labelFontSize: _propTypes.default.number,
|
|
315
|
+
labelStyle: _propTypes.default.object,
|
|
266
316
|
max: _propTypes.default.oneOfType([_propTypes.default.instanceOf(Date), _propTypes.default.number]),
|
|
267
317
|
min: _propTypes.default.oneOfType([_propTypes.default.instanceOf(Date), _propTypes.default.number]),
|
|
268
318
|
position: _propTypes.default.oneOf(['bottom', 'left', 'right', 'top']),
|
|
@@ -271,12 +321,19 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
|
|
|
271
321
|
slots: _propTypes.default.object,
|
|
272
322
|
stroke: _propTypes.default.string,
|
|
273
323
|
tickFontSize: _propTypes.default.number,
|
|
324
|
+
tickInterval: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto']), _propTypes.default.array, _propTypes.default.func]),
|
|
325
|
+
tickLabelInterval: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto']), _propTypes.default.func]),
|
|
326
|
+
tickLabelStyle: _propTypes.default.object,
|
|
274
327
|
tickMaxStep: _propTypes.default.number,
|
|
275
328
|
tickMinStep: _propTypes.default.number,
|
|
276
329
|
tickNumber: _propTypes.default.number,
|
|
277
330
|
tickSize: _propTypes.default.number,
|
|
278
331
|
valueFormatter: _propTypes.default.func
|
|
279
332
|
})),
|
|
333
|
+
/**
|
|
334
|
+
* The configuration of the y-axes.
|
|
335
|
+
* If not provided, a default axis config is used with id set to `DEFAULT_Y_AXIS_KEY`.
|
|
336
|
+
*/
|
|
280
337
|
yAxis: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
281
338
|
axisId: _propTypes.default.string,
|
|
282
339
|
classes: _propTypes.default.object,
|
|
@@ -289,6 +346,7 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
|
|
|
289
346
|
id: _propTypes.default.string,
|
|
290
347
|
label: _propTypes.default.string,
|
|
291
348
|
labelFontSize: _propTypes.default.number,
|
|
349
|
+
labelStyle: _propTypes.default.object,
|
|
292
350
|
max: _propTypes.default.oneOfType([_propTypes.default.instanceOf(Date), _propTypes.default.number]),
|
|
293
351
|
min: _propTypes.default.oneOfType([_propTypes.default.instanceOf(Date), _propTypes.default.number]),
|
|
294
352
|
position: _propTypes.default.oneOf(['bottom', 'left', 'right', 'top']),
|
|
@@ -297,6 +355,9 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
|
|
|
297
355
|
slots: _propTypes.default.object,
|
|
298
356
|
stroke: _propTypes.default.string,
|
|
299
357
|
tickFontSize: _propTypes.default.number,
|
|
358
|
+
tickInterval: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto']), _propTypes.default.array, _propTypes.default.func]),
|
|
359
|
+
tickLabelInterval: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto']), _propTypes.default.func]),
|
|
360
|
+
tickLabelStyle: _propTypes.default.object,
|
|
300
361
|
tickMaxStep: _propTypes.default.number,
|
|
301
362
|
tickMinStep: _propTypes.default.number,
|
|
302
363
|
tickNumber: _propTypes.default.number,
|
|
@@ -18,6 +18,16 @@ export interface ScatterPlotProps {
|
|
|
18
18
|
*/
|
|
19
19
|
slotProps?: ScatterPlotSlotComponentProps;
|
|
20
20
|
}
|
|
21
|
+
/**
|
|
22
|
+
* Demos:
|
|
23
|
+
*
|
|
24
|
+
* - [Scatter](https://mui.com/x/react-charts/scatter/)
|
|
25
|
+
* - [Scatter demonstration](https://mui.com/x/react-charts/scatter-demo/)
|
|
26
|
+
*
|
|
27
|
+
* API:
|
|
28
|
+
*
|
|
29
|
+
* - [ScatterPlot API](https://mui.com/x/api/charts/scatter-plot/)
|
|
30
|
+
*/
|
|
21
31
|
declare function ScatterPlot(props: ScatterPlotProps): React.JSX.Element | null;
|
|
22
32
|
declare namespace ScatterPlot {
|
|
23
33
|
var propTypes: any;
|
|
@@ -12,8 +12,18 @@ var _Scatter = require("./Scatter");
|
|
|
12
12
|
var _SeriesContextProvider = require("../context/SeriesContextProvider");
|
|
13
13
|
var _CartesianContextProvider = require("../context/CartesianContextProvider");
|
|
14
14
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
|
-
function _getRequireWildcardCache(
|
|
16
|
-
function _interopRequireWildcard(
|
|
15
|
+
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); }
|
|
16
|
+
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 && Object.prototype.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; }
|
|
17
|
+
/**
|
|
18
|
+
* Demos:
|
|
19
|
+
*
|
|
20
|
+
* - [Scatter](https://mui.com/x/react-charts/scatter/)
|
|
21
|
+
* - [Scatter demonstration](https://mui.com/x/react-charts/scatter-demo/)
|
|
22
|
+
*
|
|
23
|
+
* API:
|
|
24
|
+
*
|
|
25
|
+
* - [ScatterPlot API](https://mui.com/x/api/charts/scatter-plot/)
|
|
26
|
+
*/
|
|
17
27
|
function ScatterPlot(props) {
|
|
18
28
|
const {
|
|
19
29
|
slots,
|
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
|
/**
|
|
@@ -70,5 +70,14 @@ export interface SparkLineChartProps extends Omit<ResponsiveChartContainerProps,
|
|
|
70
70
|
*/
|
|
71
71
|
slotProps?: SparkLineChartSlotComponentProps;
|
|
72
72
|
}
|
|
73
|
+
/**
|
|
74
|
+
* Demos:
|
|
75
|
+
*
|
|
76
|
+
* - [SparkLine](https://mui.com/x/react-charts/sparkline/)
|
|
77
|
+
*
|
|
78
|
+
* API:
|
|
79
|
+
*
|
|
80
|
+
* - [SparkLineChart API](https://mui.com/x/api/charts/spark-line-chart/)
|
|
81
|
+
*/
|
|
73
82
|
declare const SparkLineChart: React.ForwardRefExoticComponent<SparkLineChartProps & React.RefAttributes<unknown>>;
|
|
74
83
|
export { SparkLineChart };
|
|
@@ -15,15 +15,25 @@ var _constants = require("../constants");
|
|
|
15
15
|
var _ChartsTooltip = require("../ChartsTooltip");
|
|
16
16
|
var _ChartsAxisHighlight = require("../ChartsAxisHighlight");
|
|
17
17
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
18
|
-
function _getRequireWildcardCache(
|
|
19
|
-
function _interopRequireWildcard(
|
|
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 && Object.prototype.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
20
|
const SPARKLINE_DEFAULT_MARGIN = {
|
|
21
21
|
top: 5,
|
|
22
22
|
bottom: 5,
|
|
23
23
|
left: 5,
|
|
24
24
|
right: 5
|
|
25
25
|
};
|
|
26
|
-
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Demos:
|
|
29
|
+
*
|
|
30
|
+
* - [SparkLine](https://mui.com/x/react-charts/sparkline/)
|
|
31
|
+
*
|
|
32
|
+
* API:
|
|
33
|
+
*
|
|
34
|
+
* - [SparkLineChart API](https://mui.com/x/api/charts/spark-line-chart/)
|
|
35
|
+
*/
|
|
36
|
+
const SparkLineChart = exports.SparkLineChart = /*#__PURE__*/React.forwardRef(function SparkLineChart(props, ref) {
|
|
27
37
|
const {
|
|
28
38
|
xAxis,
|
|
29
39
|
width,
|
|
@@ -66,7 +76,7 @@ const SparkLineChart = /*#__PURE__*/React.forwardRef(function SparkLineChart(pro
|
|
|
66
76
|
margin: margin,
|
|
67
77
|
xAxis: [(0, _extends2.default)({
|
|
68
78
|
id: _constants.DEFAULT_X_AXIS_KEY,
|
|
69
|
-
scaleType: plotType === 'bar' ? 'band' : '
|
|
79
|
+
scaleType: plotType === 'bar' ? 'band' : 'point',
|
|
70
80
|
data: Array.from({
|
|
71
81
|
length: data.length
|
|
72
82
|
}, (_, index) => index),
|
|
@@ -77,7 +87,10 @@ const SparkLineChart = /*#__PURE__*/React.forwardRef(function SparkLineChart(pro
|
|
|
77
87
|
disableAxisListener: (!showTooltip || tooltip?.trigger !== 'axis') && axisHighlight?.x === 'none' && axisHighlight?.y === 'none',
|
|
78
88
|
children: [plotType === 'bar' && /*#__PURE__*/(0, _jsxRuntime.jsx)(_BarChart.BarPlot, {
|
|
79
89
|
slots: slots,
|
|
80
|
-
slotProps: slotProps
|
|
90
|
+
slotProps: slotProps,
|
|
91
|
+
sx: {
|
|
92
|
+
shapeRendering: 'auto'
|
|
93
|
+
}
|
|
81
94
|
}), plotType === 'line' && /*#__PURE__*/(0, _jsxRuntime.jsxs)(React.Fragment, {
|
|
82
95
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_LineChart.AreaPlot, {
|
|
83
96
|
slots: slots,
|
|
@@ -89,10 +102,12 @@ const SparkLineChart = /*#__PURE__*/React.forwardRef(function SparkLineChart(pro
|
|
|
89
102
|
slots: slots,
|
|
90
103
|
slotProps: slotProps
|
|
91
104
|
})]
|
|
92
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsAxisHighlight.ChartsAxisHighlight, (0, _extends2.default)({}, axisHighlight)), showTooltip && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsTooltip.ChartsTooltip, (0, _extends2.default)({}, tooltip
|
|
105
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsAxisHighlight.ChartsAxisHighlight, (0, _extends2.default)({}, axisHighlight)), showTooltip && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsTooltip.ChartsTooltip, (0, _extends2.default)({}, tooltip, {
|
|
106
|
+
slotProps: slotProps,
|
|
107
|
+
slots: slots
|
|
108
|
+
})), children]
|
|
93
109
|
});
|
|
94
110
|
});
|
|
95
|
-
exports.SparkLineChart = SparkLineChart;
|
|
96
111
|
process.env.NODE_ENV !== "production" ? SparkLineChart.propTypes = {
|
|
97
112
|
// ----------------------------- Warning --------------------------------
|
|
98
113
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
@@ -122,10 +137,28 @@ process.env.NODE_ENV !== "production" ? SparkLineChart.propTypes = {
|
|
|
122
137
|
* Data to plot.
|
|
123
138
|
*/
|
|
124
139
|
data: _propTypes.default.arrayOf(_propTypes.default.number).isRequired,
|
|
140
|
+
/**
|
|
141
|
+
* An array of objects that can be used to populate series and axes data using their `dataKey` property.
|
|
142
|
+
*/
|
|
125
143
|
dataset: _propTypes.default.arrayOf(_propTypes.default.object),
|
|
126
144
|
desc: _propTypes.default.string,
|
|
145
|
+
/**
|
|
146
|
+
* If `true`, the charts will not listen to the mouse move event.
|
|
147
|
+
* It might break interactive features, but will improve performance.
|
|
148
|
+
* @default false
|
|
149
|
+
*/
|
|
127
150
|
disableAxisListener: _propTypes.default.bool,
|
|
151
|
+
/**
|
|
152
|
+
* The height of the chart in px. If not defined, it takes the height of the parent element.
|
|
153
|
+
* @default undefined
|
|
154
|
+
*/
|
|
128
155
|
height: _propTypes.default.number,
|
|
156
|
+
/**
|
|
157
|
+
* The margin between the SVG and the drawing area.
|
|
158
|
+
* It's used for leaving some space for extra information such as the x- and y-axis or legend.
|
|
159
|
+
* Accepts an object with the optional properties: `top`, `bottom`, `left`, and `right`.
|
|
160
|
+
* @default object Depends on the charts type.
|
|
161
|
+
*/
|
|
129
162
|
margin: _propTypes.default.shape({
|
|
130
163
|
bottom: _propTypes.default.number,
|
|
131
164
|
left: _propTypes.default.number,
|
|
@@ -165,6 +198,8 @@ process.env.NODE_ENV !== "production" ? SparkLineChart.propTypes = {
|
|
|
165
198
|
axisContent: _propTypes.default.elementType,
|
|
166
199
|
classes: _propTypes.default.object,
|
|
167
200
|
itemContent: _propTypes.default.elementType,
|
|
201
|
+
slotProps: _propTypes.default.object,
|
|
202
|
+
slots: _propTypes.default.object,
|
|
168
203
|
trigger: _propTypes.default.oneOf(['axis', 'item', 'none'])
|
|
169
204
|
}),
|
|
170
205
|
/**
|
|
@@ -179,6 +214,10 @@ process.env.NODE_ENV !== "production" ? SparkLineChart.propTypes = {
|
|
|
179
214
|
x: _propTypes.default.number,
|
|
180
215
|
y: _propTypes.default.number
|
|
181
216
|
}),
|
|
217
|
+
/**
|
|
218
|
+
* The width of the chart in px. If not defined, it takes the width of the parent element.
|
|
219
|
+
* @default undefined
|
|
220
|
+
*/
|
|
182
221
|
width: _propTypes.default.number,
|
|
183
222
|
/**
|
|
184
223
|
* The xAxis configuration.
|
|
@@ -196,6 +235,7 @@ process.env.NODE_ENV !== "production" ? SparkLineChart.propTypes = {
|
|
|
196
235
|
id: _propTypes.default.string,
|
|
197
236
|
label: _propTypes.default.string,
|
|
198
237
|
labelFontSize: _propTypes.default.number,
|
|
238
|
+
labelStyle: _propTypes.default.object,
|
|
199
239
|
max: _propTypes.default.oneOfType([_propTypes.default.instanceOf(Date), _propTypes.default.number]),
|
|
200
240
|
min: _propTypes.default.oneOfType([_propTypes.default.instanceOf(Date), _propTypes.default.number]),
|
|
201
241
|
position: _propTypes.default.oneOf(['bottom', 'left', 'right', 'top']),
|
|
@@ -204,6 +244,9 @@ process.env.NODE_ENV !== "production" ? SparkLineChart.propTypes = {
|
|
|
204
244
|
slots: _propTypes.default.object,
|
|
205
245
|
stroke: _propTypes.default.string,
|
|
206
246
|
tickFontSize: _propTypes.default.number,
|
|
247
|
+
tickInterval: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto']), _propTypes.default.array, _propTypes.default.func]),
|
|
248
|
+
tickLabelInterval: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto']), _propTypes.default.func]),
|
|
249
|
+
tickLabelStyle: _propTypes.default.object,
|
|
207
250
|
tickMaxStep: _propTypes.default.number,
|
|
208
251
|
tickMinStep: _propTypes.default.number,
|
|
209
252
|
tickNumber: _propTypes.default.number,
|
|
@@ -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
|
-
|
|
11
|
-
const DEFAULT_MARGINS = {
|
|
12
|
-
top: 100,
|
|
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 = {
|
|
10
|
+
top: 50,
|
|
13
11
|
bottom: 50,
|
|
14
12
|
left: 50,
|
|
15
13
|
right: 50
|
|
16
|
-
};
|
|
17
|
-
exports.DEFAULT_MARGINS = DEFAULT_MARGINS;
|
|
14
|
+
};
|
|
@@ -4,8 +4,19 @@ import { DEFAULT_X_AXIS_KEY } from '../constants';
|
|
|
4
4
|
import { DatasetType } from '../models/seriesType/config';
|
|
5
5
|
import { MakeOptional } from '../models/helpers';
|
|
6
6
|
export type CartesianContextProviderProps = {
|
|
7
|
+
/**
|
|
8
|
+
* The configuration of the x-axes.
|
|
9
|
+
* If not provided, a default axis config is used with id set to `DEFAULT_X_AXIS_KEY`.
|
|
10
|
+
*/
|
|
7
11
|
xAxis?: MakeOptional<AxisConfig, 'id'>[];
|
|
12
|
+
/**
|
|
13
|
+
* The configuration of the y-axes.
|
|
14
|
+
* If not provided, a default axis config is used with id set to `DEFAULT_Y_AXIS_KEY`.
|
|
15
|
+
*/
|
|
8
16
|
yAxis?: MakeOptional<AxisConfig, 'id'>[];
|
|
17
|
+
/**
|
|
18
|
+
* An array of objects that can be used to populate series and axes data using their `dataKey` property.
|
|
19
|
+
*/
|
|
9
20
|
dataset?: DatasetType;
|
|
10
21
|
children: React.ReactNode;
|
|
11
22
|
};
|
|
@@ -14,17 +25,31 @@ type DefaultizedAxisConfig = {
|
|
|
14
25
|
};
|
|
15
26
|
export declare const CartesianContext: React.Context<{
|
|
16
27
|
/**
|
|
17
|
-
* Mapping from axis key to scaling
|
|
28
|
+
* Mapping from x-axis key to scaling configuration.
|
|
18
29
|
*/
|
|
19
30
|
xAxis: {
|
|
20
31
|
DEFAULT_X_AXIS_KEY: AxisDefaultized;
|
|
21
32
|
} & DefaultizedAxisConfig;
|
|
33
|
+
/**
|
|
34
|
+
* Mapping from y-axis key to scaling configuration.
|
|
35
|
+
*/
|
|
22
36
|
yAxis: {
|
|
23
37
|
DEFAULT_X_AXIS_KEY: AxisDefaultized;
|
|
24
38
|
} & DefaultizedAxisConfig;
|
|
39
|
+
/**
|
|
40
|
+
* The x-axes IDs sorted by order they got provided.
|
|
41
|
+
*/
|
|
25
42
|
xAxisIds: string[];
|
|
43
|
+
/**
|
|
44
|
+
* The y-axes IDs sorted by order they got provided.
|
|
45
|
+
*/
|
|
26
46
|
yAxisIds: string[];
|
|
27
47
|
}>;
|
|
48
|
+
/**
|
|
49
|
+
* API:
|
|
50
|
+
*
|
|
51
|
+
* - [CartesianContextProvider API](https://mui.com/x/api/charts/cartesian-context-provider/)
|
|
52
|
+
*/
|
|
28
53
|
declare function CartesianContextProvider({ xAxis: inXAxis, yAxis: inYAxis, dataset, children, }: CartesianContextProviderProps): React.JSX.Element;
|
|
29
54
|
declare namespace CartesianContextProvider {
|
|
30
55
|
var propTypes: any;
|