@mui/x-charts 6.19.1 → 6.19.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/BarChart/BarChart.js +1 -0
- package/BarChart/BarElement.d.ts +37 -20
- package/CHANGELOG.md +84 -0
- package/ChartsLegend/ChartsLegend.d.ts +5 -2
- package/ChartsLegend/ChartsLegend.js +137 -1
- package/ChartsReferenceLine/ChartsReferenceLine.js +7 -3
- package/ChartsSurface.d.ts +2 -2
- package/ChartsSurface.js +33 -1
- package/ChartsTooltip/ChartsAxisTooltipContent.js +2 -54
- package/ChartsTooltip/ChartsItemTooltipContent.js +15 -1
- package/ChartsTooltip/ChartsTooltipTable.d.ts +1 -1
- package/ChartsTooltip/ChartsTooltipTable.js +2 -0
- package/ChartsTooltip/DefaultChartsAxisTooltipContent.js +2 -54
- package/ChartsTooltip/DefaultChartsItemTooltipContent.js +15 -1
- package/LineChart/LineChart.d.ts +1 -0
- package/LineChart/LineChart.js +2 -0
- package/PieChart/PieArcLabelPlot.d.ts +5 -0
- package/PieChart/PieArcLabelPlot.js +2 -0
- package/PieChart/PieArcPlot.d.ts +5 -0
- package/PieChart/PieArcPlot.js +1 -0
- package/PieChart/PieChart.d.ts +14 -2
- package/PieChart/PieChart.js +3 -2
- package/ScatterChart/ScatterChart.js +1 -0
- package/SparkLineChart/SparkLineChart.d.ts +15 -1
- package/SparkLineChart/SparkLineChart.js +8 -1
- package/context/CartesianContextProvider.d.ts +1 -1
- package/context/CartesianContextProvider.js +7 -6
- package/context/DrawingProvider.d.ts +1 -1
- package/context/DrawingProvider.js +8 -7
- package/context/HighlightProvider.d.ts +2 -2
- package/context/HighlightProvider.js +4 -3
- package/context/InteractionProvider.d.ts +2 -2
- package/context/InteractionProvider.js +4 -3
- package/context/SeriesContextProvider.d.ts +3 -1
- package/context/SeriesContextProvider.js +7 -6
- package/esm/BarChart/BarChart.js +1 -0
- package/esm/ChartsLegend/ChartsLegend.js +139 -2
- package/esm/ChartsReferenceLine/ChartsReferenceLine.js +7 -3
- package/esm/ChartsSurface.js +35 -2
- package/esm/ChartsTooltip/ChartsAxisTooltipContent.js +2 -54
- package/esm/ChartsTooltip/ChartsItemTooltipContent.js +15 -1
- package/esm/ChartsTooltip/ChartsTooltipTable.js +2 -0
- package/esm/ChartsTooltip/DefaultChartsAxisTooltipContent.js +2 -54
- package/esm/ChartsTooltip/DefaultChartsItemTooltipContent.js +15 -1
- package/esm/LineChart/LineChart.js +2 -0
- package/esm/PieChart/PieArcLabelPlot.js +2 -0
- package/esm/PieChart/PieArcPlot.js +1 -0
- package/esm/PieChart/PieChart.js +3 -2
- package/esm/ScatterChart/ScatterChart.js +1 -0
- package/esm/SparkLineChart/SparkLineChart.js +8 -1
- package/esm/context/CartesianContextProvider.js +7 -6
- package/esm/context/DrawingProvider.js +8 -7
- package/esm/context/HighlightProvider.js +6 -4
- package/esm/context/InteractionProvider.js +6 -4
- package/esm/context/SeriesContextProvider.js +9 -7
- package/esm/hooks/useDrawingArea.js +7 -3
- package/esm/index.js +2 -0
- package/hooks/useDrawingArea.d.ts +2 -0
- package/hooks/useDrawingArea.js +7 -3
- package/index.d.ts +2 -0
- package/index.js +23 -1
- package/legacy/BarChart/BarChart.js +1 -0
- package/legacy/ChartsLegend/ChartsLegend.js +139 -2
- package/legacy/ChartsReferenceLine/ChartsReferenceLine.js +5 -3
- package/legacy/ChartsReferenceLine/common.js +3 -4
- package/legacy/ChartsSurface.js +35 -2
- package/legacy/ChartsTooltip/ChartsAxisTooltipContent.js +2 -54
- package/legacy/ChartsTooltip/ChartsItemTooltipContent.js +15 -1
- package/legacy/ChartsTooltip/ChartsTooltipTable.js +8 -7
- package/legacy/ChartsTooltip/DefaultChartsAxisTooltipContent.js +2 -54
- package/legacy/ChartsTooltip/DefaultChartsItemTooltipContent.js +15 -1
- package/legacy/LineChart/LineChart.js +2 -0
- package/legacy/PieChart/PieArcLabelPlot.js +2 -0
- package/legacy/PieChart/PieArcPlot.js +1 -0
- package/legacy/PieChart/PieChart.js +3 -2
- package/legacy/ScatterChart/ScatterChart.js +1 -0
- package/legacy/SparkLineChart/SparkLineChart.js +8 -1
- package/legacy/context/CartesianContextProvider.js +15 -15
- package/legacy/context/DrawingProvider.js +6 -6
- package/legacy/context/HighlightProvider.js +4 -3
- package/legacy/context/InteractionProvider.js +4 -3
- package/legacy/context/SeriesContextProvider.js +8 -7
- package/legacy/hooks/useDrawingArea.js +7 -3
- package/legacy/index.js +3 -1
- package/legacy/internals/components/AxisSharedComponents.js +5 -6
- package/models/seriesType/pie.d.ts +1 -0
- package/modern/BarChart/BarChart.js +1 -0
- package/modern/ChartsLegend/ChartsLegend.js +139 -2
- package/modern/ChartsReferenceLine/ChartsReferenceLine.js +7 -3
- package/modern/ChartsSurface.js +35 -2
- package/modern/ChartsTooltip/ChartsAxisTooltipContent.js +2 -54
- package/modern/ChartsTooltip/ChartsItemTooltipContent.js +15 -1
- package/modern/ChartsTooltip/ChartsTooltipTable.js +2 -0
- package/modern/ChartsTooltip/DefaultChartsAxisTooltipContent.js +2 -54
- package/modern/ChartsTooltip/DefaultChartsItemTooltipContent.js +15 -1
- package/modern/LineChart/LineChart.js +2 -0
- package/modern/PieChart/PieArcLabelPlot.js +2 -0
- package/modern/PieChart/PieArcPlot.js +1 -0
- package/modern/PieChart/PieChart.js +3 -2
- package/modern/ScatterChart/ScatterChart.js +1 -0
- package/modern/SparkLineChart/SparkLineChart.js +8 -1
- package/modern/context/CartesianContextProvider.js +7 -6
- package/modern/context/DrawingProvider.js +8 -7
- package/modern/context/HighlightProvider.js +6 -4
- package/modern/context/InteractionProvider.js +6 -4
- package/modern/context/SeriesContextProvider.js +9 -7
- package/modern/hooks/useDrawingArea.js +7 -3
- package/modern/index.js +3 -1
- package/package.json +1 -1
|
@@ -85,37 +85,7 @@ process.env.NODE_ENV !== "production" ? ChartsAxisTooltipContent.propTypes = {
|
|
|
85
85
|
classes: _propTypes.default.object.isRequired,
|
|
86
86
|
content: _propTypes.default.elementType,
|
|
87
87
|
contentProps: _propTypes.default.shape({
|
|
88
|
-
axis: _propTypes.default.
|
|
89
|
-
axisId: _propTypes.default.string,
|
|
90
|
-
classes: _propTypes.default.object,
|
|
91
|
-
data: _propTypes.default.array,
|
|
92
|
-
dataKey: _propTypes.default.string,
|
|
93
|
-
disableLine: _propTypes.default.bool,
|
|
94
|
-
disableTicks: _propTypes.default.bool,
|
|
95
|
-
fill: _propTypes.default.string,
|
|
96
|
-
hideTooltip: _propTypes.default.bool,
|
|
97
|
-
id: _propTypes.default.string.isRequired,
|
|
98
|
-
label: _propTypes.default.string,
|
|
99
|
-
labelFontSize: _propTypes.default.number,
|
|
100
|
-
labelStyle: _propTypes.default.object,
|
|
101
|
-
max: _propTypes.default.oneOfType([_propTypes.default.instanceOf(Date), _propTypes.default.number]),
|
|
102
|
-
min: _propTypes.default.oneOfType([_propTypes.default.instanceOf(Date), _propTypes.default.number]),
|
|
103
|
-
position: _propTypes.default.oneOf(['bottom', 'left', 'right', 'top']),
|
|
104
|
-
scale: _propTypes.default.func.isRequired,
|
|
105
|
-
scaleType: _propTypes.default.oneOf(['time']).isRequired,
|
|
106
|
-
slotProps: _propTypes.default.object,
|
|
107
|
-
slots: _propTypes.default.object,
|
|
108
|
-
stroke: _propTypes.default.string,
|
|
109
|
-
tickFontSize: _propTypes.default.number,
|
|
110
|
-
tickInterval: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto']), _propTypes.default.array, _propTypes.default.func]),
|
|
111
|
-
tickLabelInterval: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto']), _propTypes.default.func]),
|
|
112
|
-
tickLabelStyle: _propTypes.default.object,
|
|
113
|
-
tickMaxStep: _propTypes.default.number,
|
|
114
|
-
tickMinStep: _propTypes.default.number,
|
|
115
|
-
tickNumber: _propTypes.default.number.isRequired,
|
|
116
|
-
tickSize: _propTypes.default.number,
|
|
117
|
-
valueFormatter: _propTypes.default.func
|
|
118
|
-
}),
|
|
88
|
+
axis: _propTypes.default.object,
|
|
119
89
|
axisData: _propTypes.default.shape({
|
|
120
90
|
x: _propTypes.default.shape({
|
|
121
91
|
index: _propTypes.default.number,
|
|
@@ -129,29 +99,7 @@ process.env.NODE_ENV !== "production" ? ChartsAxisTooltipContent.propTypes = {
|
|
|
129
99
|
axisValue: _propTypes.default.any,
|
|
130
100
|
classes: _propTypes.default.object,
|
|
131
101
|
dataIndex: _propTypes.default.number,
|
|
132
|
-
series: _propTypes.default.arrayOf(_propTypes.default.
|
|
133
|
-
area: _propTypes.default.bool,
|
|
134
|
-
color: _propTypes.default.string.isRequired,
|
|
135
|
-
connectNulls: _propTypes.default.bool,
|
|
136
|
-
curve: _propTypes.default.oneOf(['catmullRom', 'linear', 'monotoneX', 'monotoneY', 'natural', 'step', 'stepAfter', 'stepBefore']),
|
|
137
|
-
data: _propTypes.default.arrayOf(_propTypes.default.number).isRequired,
|
|
138
|
-
dataKey: _propTypes.default.string,
|
|
139
|
-
disableHighlight: _propTypes.default.bool,
|
|
140
|
-
highlightScope: _propTypes.default.shape({
|
|
141
|
-
faded: _propTypes.default.oneOf(['global', 'none', 'series']),
|
|
142
|
-
highlighted: _propTypes.default.oneOf(['item', 'none', 'series'])
|
|
143
|
-
}),
|
|
144
|
-
id: _propTypes.default.string.isRequired,
|
|
145
|
-
label: _propTypes.default.string,
|
|
146
|
-
showMark: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.bool]),
|
|
147
|
-
stack: _propTypes.default.string,
|
|
148
|
-
stackOffset: _propTypes.default.oneOf(['diverging', 'expand', 'none', 'silhouette', 'wiggle']),
|
|
149
|
-
stackOrder: _propTypes.default.oneOf(['appearance', 'ascending', 'descending', 'insideOut', 'none', 'reverse']),
|
|
150
|
-
type: _propTypes.default.oneOf(['line']).isRequired,
|
|
151
|
-
valueFormatter: _propTypes.default.func.isRequired,
|
|
152
|
-
xAxisKey: _propTypes.default.string,
|
|
153
|
-
yAxisKey: _propTypes.default.string
|
|
154
|
-
})),
|
|
102
|
+
series: _propTypes.default.arrayOf(_propTypes.default.object),
|
|
155
103
|
sx: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object, _propTypes.default.bool])), _propTypes.default.func, _propTypes.default.object])
|
|
156
104
|
}),
|
|
157
105
|
sx: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object, _propTypes.default.bool])), _propTypes.default.func, _propTypes.default.object])
|
|
@@ -53,7 +53,21 @@ process.env.NODE_ENV !== "production" ? ChartsItemTooltipContent.propTypes = {
|
|
|
53
53
|
}),
|
|
54
54
|
series: _propTypes.default.shape({
|
|
55
55
|
color: _propTypes.default.string,
|
|
56
|
-
data: _propTypes.default.arrayOf(_propTypes.default.number).
|
|
56
|
+
data: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.number), _propTypes.default.arrayOf(_propTypes.default.number), _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
57
|
+
id: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]).isRequired,
|
|
58
|
+
x: _propTypes.default.number.isRequired,
|
|
59
|
+
y: _propTypes.default.number.isRequired
|
|
60
|
+
})), _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
61
|
+
color: _propTypes.default.string.isRequired,
|
|
62
|
+
endAngle: _propTypes.default.number.isRequired,
|
|
63
|
+
formattedValue: _propTypes.default.string.isRequired,
|
|
64
|
+
id: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]).isRequired,
|
|
65
|
+
index: _propTypes.default.number.isRequired,
|
|
66
|
+
label: _propTypes.default.string,
|
|
67
|
+
padAngle: _propTypes.default.number.isRequired,
|
|
68
|
+
startAngle: _propTypes.default.number.isRequired,
|
|
69
|
+
value: _propTypes.default.number.isRequired
|
|
70
|
+
}))]).isRequired,
|
|
57
71
|
highlightScope: _propTypes.default.shape({
|
|
58
72
|
faded: _propTypes.default.oneOf(['global', 'none', 'series']),
|
|
59
73
|
highlighted: _propTypes.default.oneOf(['item', 'none', 'series'])
|
|
@@ -5,7 +5,7 @@ export declare const ChartsTooltipRow: import("@emotion/styled").StyledComponent
|
|
|
5
5
|
export declare const ChartsTooltipCell: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, Pick<import("react").DetailedHTMLProps<import("react").TdHTMLAttributes<HTMLTableDataCellElement>, HTMLTableDataCellElement>, keyof import("react").ClassAttributes<HTMLTableDataCellElement> | keyof import("react").TdHTMLAttributes<HTMLTableDataCellElement>>, {}>;
|
|
6
6
|
export declare const ChartsTooltipMark: import("@emotion/styled").StyledComponent<Pick<import("@mui/system/Box").BoxOwnProps<import("@mui/system").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
7
7
|
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
8
|
-
}, keyof import("@mui/system/Box").BoxOwnProps<import("@mui/system").Theme>>, "hidden" | "content" | "style" | "translate" | "slot" | "title" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "autoFocus" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "id" | "lang" | "nonce" | "
|
|
8
|
+
}, keyof import("@mui/system/Box").BoxOwnProps<import("@mui/system").Theme>>, "hidden" | "content" | "style" | "translate" | "slot" | "title" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "autoFocus" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "id" | "lang" | "nonce" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "rel" | "resource" | "rev" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-braillelabel" | "aria-brailleroledescription" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colindextext" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-description" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowindextext" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onResize" | "onResizeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | keyof import("@mui/system/Box").BoxOwnProps<import("@mui/system").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme> & {
|
|
9
9
|
ownerState: {
|
|
10
10
|
color: string;
|
|
11
11
|
};
|
|
@@ -66,6 +66,8 @@ const ChartsTooltipCell = exports.ChartsTooltipCell = (0, _styles.styled)('td',
|
|
|
66
66
|
paddingRight: theme.spacing(2)
|
|
67
67
|
}
|
|
68
68
|
}));
|
|
69
|
+
|
|
70
|
+
// eslint-disable-next-line material-ui/no-styled-box
|
|
69
71
|
const ChartsTooltipMark = exports.ChartsTooltipMark = (0, _styles.styled)(_Box.default, {
|
|
70
72
|
name: 'MuiChartsTooltip',
|
|
71
73
|
slot: 'Mark'
|
|
@@ -88,37 +88,7 @@ process.env.NODE_ENV !== "production" ? DefaultChartsAxisTooltipContent.propType
|
|
|
88
88
|
/**
|
|
89
89
|
* The properties of the triggered axis.
|
|
90
90
|
*/
|
|
91
|
-
axis: _propTypes.default.
|
|
92
|
-
axisId: _propTypes.default.string,
|
|
93
|
-
classes: _propTypes.default.object,
|
|
94
|
-
data: _propTypes.default.array,
|
|
95
|
-
dataKey: _propTypes.default.string,
|
|
96
|
-
disableLine: _propTypes.default.bool,
|
|
97
|
-
disableTicks: _propTypes.default.bool,
|
|
98
|
-
fill: _propTypes.default.string,
|
|
99
|
-
hideTooltip: _propTypes.default.bool,
|
|
100
|
-
id: _propTypes.default.string.isRequired,
|
|
101
|
-
label: _propTypes.default.string,
|
|
102
|
-
labelFontSize: _propTypes.default.number,
|
|
103
|
-
labelStyle: _propTypes.default.object,
|
|
104
|
-
max: _propTypes.default.oneOfType([_propTypes.default.instanceOf(Date), _propTypes.default.number]),
|
|
105
|
-
min: _propTypes.default.oneOfType([_propTypes.default.instanceOf(Date), _propTypes.default.number]),
|
|
106
|
-
position: _propTypes.default.oneOf(['bottom', 'left', 'right', 'top']),
|
|
107
|
-
scale: _propTypes.default.func.isRequired,
|
|
108
|
-
scaleType: _propTypes.default.oneOf(['time']).isRequired,
|
|
109
|
-
slotProps: _propTypes.default.object,
|
|
110
|
-
slots: _propTypes.default.object,
|
|
111
|
-
stroke: _propTypes.default.string,
|
|
112
|
-
tickFontSize: _propTypes.default.number,
|
|
113
|
-
tickInterval: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto']), _propTypes.default.array, _propTypes.default.func]),
|
|
114
|
-
tickLabelInterval: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto']), _propTypes.default.func]),
|
|
115
|
-
tickLabelStyle: _propTypes.default.object,
|
|
116
|
-
tickMaxStep: _propTypes.default.number,
|
|
117
|
-
tickMinStep: _propTypes.default.number,
|
|
118
|
-
tickNumber: _propTypes.default.number.isRequired,
|
|
119
|
-
tickSize: _propTypes.default.number,
|
|
120
|
-
valueFormatter: _propTypes.default.func
|
|
121
|
-
}).isRequired,
|
|
91
|
+
axis: _propTypes.default.object.isRequired,
|
|
122
92
|
/**
|
|
123
93
|
* Data identifying the triggered axis.
|
|
124
94
|
*/
|
|
@@ -147,28 +117,6 @@ process.env.NODE_ENV !== "production" ? DefaultChartsAxisTooltipContent.propType
|
|
|
147
117
|
/**
|
|
148
118
|
* The series linked to the triggered axis.
|
|
149
119
|
*/
|
|
150
|
-
series: _propTypes.default.arrayOf(_propTypes.default.
|
|
151
|
-
area: _propTypes.default.bool,
|
|
152
|
-
color: _propTypes.default.string.isRequired,
|
|
153
|
-
connectNulls: _propTypes.default.bool,
|
|
154
|
-
curve: _propTypes.default.oneOf(['catmullRom', 'linear', 'monotoneX', 'monotoneY', 'natural', 'step', 'stepAfter', 'stepBefore']),
|
|
155
|
-
data: _propTypes.default.arrayOf(_propTypes.default.number).isRequired,
|
|
156
|
-
dataKey: _propTypes.default.string,
|
|
157
|
-
disableHighlight: _propTypes.default.bool,
|
|
158
|
-
highlightScope: _propTypes.default.shape({
|
|
159
|
-
faded: _propTypes.default.oneOf(['global', 'none', 'series']),
|
|
160
|
-
highlighted: _propTypes.default.oneOf(['item', 'none', 'series'])
|
|
161
|
-
}),
|
|
162
|
-
id: _propTypes.default.string.isRequired,
|
|
163
|
-
label: _propTypes.default.string,
|
|
164
|
-
showMark: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.bool]),
|
|
165
|
-
stack: _propTypes.default.string,
|
|
166
|
-
stackOffset: _propTypes.default.oneOf(['diverging', 'expand', 'none', 'silhouette', 'wiggle']),
|
|
167
|
-
stackOrder: _propTypes.default.oneOf(['appearance', 'ascending', 'descending', 'insideOut', 'none', 'reverse']),
|
|
168
|
-
type: _propTypes.default.oneOf(['line']).isRequired,
|
|
169
|
-
valueFormatter: _propTypes.default.func.isRequired,
|
|
170
|
-
xAxisKey: _propTypes.default.string,
|
|
171
|
-
yAxisKey: _propTypes.default.string
|
|
172
|
-
})).isRequired,
|
|
120
|
+
series: _propTypes.default.arrayOf(_propTypes.default.object).isRequired,
|
|
173
121
|
sx: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object, _propTypes.default.bool])), _propTypes.default.func, _propTypes.default.object])
|
|
174
122
|
} : void 0;
|
|
@@ -86,7 +86,21 @@ process.env.NODE_ENV !== "production" ? DefaultChartsItemTooltipContent.propType
|
|
|
86
86
|
*/
|
|
87
87
|
series: _propTypes.default.shape({
|
|
88
88
|
color: _propTypes.default.string,
|
|
89
|
-
data: _propTypes.default.arrayOf(_propTypes.default.number).
|
|
89
|
+
data: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.number), _propTypes.default.arrayOf(_propTypes.default.number), _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
90
|
+
id: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]).isRequired,
|
|
91
|
+
x: _propTypes.default.number.isRequired,
|
|
92
|
+
y: _propTypes.default.number.isRequired
|
|
93
|
+
})), _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
94
|
+
color: _propTypes.default.string.isRequired,
|
|
95
|
+
endAngle: _propTypes.default.number.isRequired,
|
|
96
|
+
formattedValue: _propTypes.default.string.isRequired,
|
|
97
|
+
id: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]).isRequired,
|
|
98
|
+
index: _propTypes.default.number.isRequired,
|
|
99
|
+
label: _propTypes.default.string,
|
|
100
|
+
padAngle: _propTypes.default.number.isRequired,
|
|
101
|
+
startAngle: _propTypes.default.number.isRequired,
|
|
102
|
+
value: _propTypes.default.number.isRequired
|
|
103
|
+
}))]).isRequired,
|
|
90
104
|
highlightScope: _propTypes.default.shape({
|
|
91
105
|
faded: _propTypes.default.oneOf(['global', 'none', 'series']),
|
|
92
106
|
highlighted: _propTypes.default.oneOf(['item', 'none', 'series'])
|
package/LineChart/LineChart.d.ts
CHANGED
|
@@ -24,6 +24,7 @@ export interface LineChartProps extends Omit<ResponsiveChartContainerProps, 'ser
|
|
|
24
24
|
* - 'none': display nothing.
|
|
25
25
|
* - 'line': display a line at the current mouse position.
|
|
26
26
|
* - 'band': display a band at the current mouse position. Only available with band scale.
|
|
27
|
+
* @default { x: 'line' }
|
|
27
28
|
*/
|
|
28
29
|
axisHighlight?: ChartsAxisHighlightProps;
|
|
29
30
|
/**
|
package/LineChart/LineChart.js
CHANGED
|
@@ -125,6 +125,7 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
|
|
|
125
125
|
* - 'none': display nothing.
|
|
126
126
|
* - 'line': display a line at the current mouse position.
|
|
127
127
|
* - 'band': display a band at the current mouse position. Only available with band scale.
|
|
128
|
+
* @default { x: 'line' }
|
|
128
129
|
*/
|
|
129
130
|
axisHighlight: _propTypes.default.shape({
|
|
130
131
|
x: _propTypes.default.oneOf(['band', 'line', 'none']),
|
|
@@ -161,6 +162,7 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
|
|
|
161
162
|
className: _propTypes.default.string,
|
|
162
163
|
/**
|
|
163
164
|
* Color palette used to colorize multiple series.
|
|
165
|
+
* @default blueberryTwilightPalette
|
|
164
166
|
*/
|
|
165
167
|
colors: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.string), _propTypes.default.func]),
|
|
166
168
|
/**
|
|
@@ -8,6 +8,11 @@ export interface PieArcLabelPlotSlotComponentProps {
|
|
|
8
8
|
pieArcLabel?: Partial<PieArcLabelProps>;
|
|
9
9
|
}
|
|
10
10
|
export interface PieArcLabelPlotProps extends Pick<DefaultizedPieSeriesType, 'data' | 'faded' | 'highlighted' | 'cornerRadius' | 'paddingAngle' | 'arcLabel' | 'arcLabelMinAngle' | 'id' | 'highlightScope'>, ComputedPieRadius {
|
|
11
|
+
/**
|
|
12
|
+
* Override the arc attibutes when it is faded.
|
|
13
|
+
* @default { additionalRadius: -5 }
|
|
14
|
+
*/
|
|
15
|
+
faded?: DefaultizedPieSeriesType['faded'];
|
|
11
16
|
/**
|
|
12
17
|
* Overridable component slots.
|
|
13
18
|
* @default {}
|
|
@@ -113,6 +113,7 @@ process.env.NODE_ENV !== "production" ? PieArcLabelPlot.propTypes = {
|
|
|
113
113
|
arcLabel: _propTypes.default.oneOfType([_propTypes.default.oneOf(['formattedValue', 'label', 'value']), _propTypes.default.func]),
|
|
114
114
|
/**
|
|
115
115
|
* The minimal angle required to display the arc label.
|
|
116
|
+
* @default 0
|
|
116
117
|
*/
|
|
117
118
|
arcLabelMinAngle: _propTypes.default.number,
|
|
118
119
|
/**
|
|
@@ -138,6 +139,7 @@ process.env.NODE_ENV !== "production" ? PieArcLabelPlot.propTypes = {
|
|
|
138
139
|
})).isRequired,
|
|
139
140
|
/**
|
|
140
141
|
* Override the arc attibutes when it is faded.
|
|
142
|
+
* @default { additionalRadius: -5 }
|
|
141
143
|
*/
|
|
142
144
|
faded: _propTypes.default.shape({
|
|
143
145
|
additionalRadius: _propTypes.default.number,
|
package/PieChart/PieArcPlot.d.ts
CHANGED
|
@@ -8,6 +8,11 @@ export interface PieArcPlotSlotComponentProps {
|
|
|
8
8
|
pieArc?: Partial<PieArcProps>;
|
|
9
9
|
}
|
|
10
10
|
export interface PieArcPlotProps extends Pick<DefaultizedPieSeriesType, 'data' | 'faded' | 'highlighted' | 'cornerRadius' | 'paddingAngle' | 'id' | 'highlightScope'>, ComputedPieRadius {
|
|
11
|
+
/**
|
|
12
|
+
* Override the arc attibutes when it is faded.
|
|
13
|
+
* @default { additionalRadius: -5 }
|
|
14
|
+
*/
|
|
15
|
+
faded?: DefaultizedPieSeriesType['faded'];
|
|
11
16
|
/**
|
|
12
17
|
* Overridable component slots.
|
|
13
18
|
* @default {}
|
package/PieChart/PieArcPlot.js
CHANGED
|
@@ -119,6 +119,7 @@ process.env.NODE_ENV !== "production" ? PieArcPlot.propTypes = {
|
|
|
119
119
|
})).isRequired,
|
|
120
120
|
/**
|
|
121
121
|
* Override the arc attibutes when it is faded.
|
|
122
|
+
* @default { additionalRadius: -5 }
|
|
122
123
|
*/
|
|
123
124
|
faded: _propTypes.default.shape({
|
|
124
125
|
additionalRadius: _propTypes.default.number,
|
package/PieChart/PieChart.d.ts
CHANGED
|
@@ -8,12 +8,24 @@ import { ChartsLegendProps, ChartsLegendSlotComponentProps, ChartsLegendSlotsCom
|
|
|
8
8
|
import { ChartsAxisHighlightProps } from '../ChartsAxisHighlight';
|
|
9
9
|
import { PiePlotProps, PiePlotSlotComponentProps, PiePlotSlotsComponent } from './PiePlot';
|
|
10
10
|
import { PieValueType } from '../models/seriesType/pie';
|
|
11
|
-
import { ChartsAxisSlotsComponent, ChartsAxisSlotComponentProps } from '../models/axis';
|
|
11
|
+
import { ChartsAxisSlotsComponent, ChartsAxisSlotComponentProps, ChartsXAxisProps, ChartsYAxisProps } from '../models/axis';
|
|
12
12
|
export interface PieChartSlotsComponent extends ChartsAxisSlotsComponent, PiePlotSlotsComponent, ChartsLegendSlotsComponent, ChartsTooltipSlotsComponent {
|
|
13
13
|
}
|
|
14
14
|
export interface PieChartSlotComponentProps extends ChartsAxisSlotComponentProps, PiePlotSlotComponentProps, ChartsLegendSlotComponentProps, ChartsTooltipSlotComponentProps {
|
|
15
15
|
}
|
|
16
|
-
export interface PieChartProps extends Omit<ResponsiveChartContainerProps, 'series'>, Omit<ChartsAxisProps, 'slots' | 'slotProps'>, Pick<PiePlotProps, 'skipAnimation'> {
|
|
16
|
+
export interface PieChartProps extends Omit<ResponsiveChartContainerProps, 'series' | 'leftAxis' | 'bottomAxis'>, Omit<ChartsAxisProps, 'slots' | 'slotProps'>, Pick<PiePlotProps, 'skipAnimation'> {
|
|
17
|
+
/**
|
|
18
|
+
* Indicate which axis to display the bottom of the charts.
|
|
19
|
+
* Can be a string (the id of the axis) or an object `ChartsXAxisProps`.
|
|
20
|
+
* @default null
|
|
21
|
+
*/
|
|
22
|
+
bottomAxis?: null | string | ChartsXAxisProps;
|
|
23
|
+
/**
|
|
24
|
+
* Indicate which axis to display the left of the charts.
|
|
25
|
+
* Can be a string (the id of the axis) or an object `ChartsYAxisProps`.
|
|
26
|
+
* @default null
|
|
27
|
+
*/
|
|
28
|
+
leftAxis?: null | string | ChartsYAxisProps;
|
|
17
29
|
series: MakeOptional<PieSeriesType<MakeOptional<PieValueType, 'id'>>, 'type'>[];
|
|
18
30
|
tooltip?: ChartsTooltipProps;
|
|
19
31
|
axisHighlight?: ChartsAxisHighlightProps;
|
package/PieChart/PieChart.js
CHANGED
|
@@ -116,7 +116,7 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
|
|
|
116
116
|
/**
|
|
117
117
|
* Indicate which axis to display the bottom of the charts.
|
|
118
118
|
* Can be a string (the id of the axis) or an object `ChartsXAxisProps`.
|
|
119
|
-
* @default
|
|
119
|
+
* @default null
|
|
120
120
|
*/
|
|
121
121
|
bottomAxis: _propTypes.default.oneOfType([_propTypes.default.shape({
|
|
122
122
|
axisId: _propTypes.default.string,
|
|
@@ -144,6 +144,7 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
|
|
|
144
144
|
className: _propTypes.default.string,
|
|
145
145
|
/**
|
|
146
146
|
* Color palette used to colorize multiple series.
|
|
147
|
+
* @default blueberryTwilightPalette
|
|
147
148
|
*/
|
|
148
149
|
colors: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.string), _propTypes.default.func]),
|
|
149
150
|
/**
|
|
@@ -165,7 +166,7 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
|
|
|
165
166
|
/**
|
|
166
167
|
* Indicate which axis to display the left of the charts.
|
|
167
168
|
* Can be a string (the id of the axis) or an object `ChartsYAxisProps`.
|
|
168
|
-
* @default
|
|
169
|
+
* @default null
|
|
169
170
|
*/
|
|
170
171
|
leftAxis: _propTypes.default.oneOfType([_propTypes.default.shape({
|
|
171
172
|
axisId: _propTypes.default.string,
|
|
@@ -121,6 +121,7 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
|
|
|
121
121
|
className: _propTypes.default.string,
|
|
122
122
|
/**
|
|
123
123
|
* Color palette used to colorize multiple series.
|
|
124
|
+
* @default blueberryTwilightPalette
|
|
124
125
|
*/
|
|
125
126
|
colors: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.string), _propTypes.default.func]),
|
|
126
127
|
/**
|
|
@@ -10,11 +10,12 @@ 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
|
+
import { CardinalDirections } from '../models/layout';
|
|
13
14
|
export interface SparkLineChartSlotsComponent extends AreaPlotSlotsComponent, LinePlotSlotsComponent, MarkPlotSlotsComponent, LineHighlightPlotSlotsComponent, BarPlotSlotsComponent, ChartsTooltipSlotsComponent {
|
|
14
15
|
}
|
|
15
16
|
export interface SparkLineChartSlotComponentProps extends AreaPlotSlotComponentProps, LinePlotSlotComponentProps, MarkPlotSlotComponentProps, LineHighlightPlotSlotComponentProps, BarPlotSlotComponentProps, ChartsTooltipSlotComponentProps {
|
|
16
17
|
}
|
|
17
|
-
export interface SparkLineChartProps extends Omit<ResponsiveChartContainerProps, 'series' | 'xAxis' | 'yAxis'> {
|
|
18
|
+
export interface SparkLineChartProps extends Omit<ResponsiveChartContainerProps, 'series' | 'xAxis' | 'yAxis' | 'margin'> {
|
|
18
19
|
/**
|
|
19
20
|
* The xAxis configuration.
|
|
20
21
|
* Notice it is a single configuration object, not an array of configuration.
|
|
@@ -35,6 +36,7 @@ export interface SparkLineChartProps extends Omit<ResponsiveChartContainerProps,
|
|
|
35
36
|
* Formatter used by the tooltip.
|
|
36
37
|
* @param {number} value The value to format.
|
|
37
38
|
* @returns {string} the formatted value.
|
|
39
|
+
* @default (v: number) => v.toString()
|
|
38
40
|
*/
|
|
39
41
|
valueFormatter?: (value: number) => string;
|
|
40
42
|
/**
|
|
@@ -59,6 +61,18 @@ export interface SparkLineChartProps extends Omit<ResponsiveChartContainerProps,
|
|
|
59
61
|
* @default 'linear'
|
|
60
62
|
*/
|
|
61
63
|
curve?: LineSeriesType['curve'];
|
|
64
|
+
/**
|
|
65
|
+
* The margin between the SVG and the drawing area.
|
|
66
|
+
* It's used for leaving some space for extra information such as the x- and y-axis or legend.
|
|
67
|
+
* Accepts an object with the optional properties: `top`, `bottom`, `left`, and `right`.
|
|
68
|
+
* @default {
|
|
69
|
+
* top: 5,
|
|
70
|
+
* bottom: 5,
|
|
71
|
+
* left: 5,
|
|
72
|
+
* right: 5,
|
|
73
|
+
* }
|
|
74
|
+
*/
|
|
75
|
+
margin?: Partial<CardinalDirections<number>>;
|
|
62
76
|
/**
|
|
63
77
|
* Overridable component slots.
|
|
64
78
|
* @default {}
|
|
@@ -127,6 +127,7 @@ process.env.NODE_ENV !== "production" ? SparkLineChart.propTypes = {
|
|
|
127
127
|
className: _propTypes.default.string,
|
|
128
128
|
/**
|
|
129
129
|
* Color palette used to colorize multiple series.
|
|
130
|
+
* @default blueberryTwilightPalette
|
|
130
131
|
*/
|
|
131
132
|
colors: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.string), _propTypes.default.func]),
|
|
132
133
|
/**
|
|
@@ -157,7 +158,12 @@ process.env.NODE_ENV !== "production" ? SparkLineChart.propTypes = {
|
|
|
157
158
|
* The margin between the SVG and the drawing area.
|
|
158
159
|
* It's used for leaving some space for extra information such as the x- and y-axis or legend.
|
|
159
160
|
* Accepts an object with the optional properties: `top`, `bottom`, `left`, and `right`.
|
|
160
|
-
* @default
|
|
161
|
+
* @default {
|
|
162
|
+
* top: 5,
|
|
163
|
+
* bottom: 5,
|
|
164
|
+
* left: 5,
|
|
165
|
+
* right: 5,
|
|
166
|
+
* }
|
|
161
167
|
*/
|
|
162
168
|
margin: _propTypes.default.shape({
|
|
163
169
|
bottom: _propTypes.default.number,
|
|
@@ -206,6 +212,7 @@ process.env.NODE_ENV !== "production" ? SparkLineChart.propTypes = {
|
|
|
206
212
|
* Formatter used by the tooltip.
|
|
207
213
|
* @param {number} value The value to format.
|
|
208
214
|
* @returns {string} the formatted value.
|
|
215
|
+
* @default (v: number) => v.toString()
|
|
209
216
|
*/
|
|
210
217
|
valueFormatter: _propTypes.default.func,
|
|
211
218
|
viewBox: _propTypes.default.shape({
|
|
@@ -50,7 +50,7 @@ export declare const CartesianContext: React.Context<{
|
|
|
50
50
|
*
|
|
51
51
|
* - [CartesianContextProvider API](https://mui.com/x/api/charts/cartesian-context-provider/)
|
|
52
52
|
*/
|
|
53
|
-
declare function CartesianContextProvider(
|
|
53
|
+
declare function CartesianContextProvider(props: CartesianContextProviderProps): React.JSX.Element;
|
|
54
54
|
declare namespace CartesianContextProvider {
|
|
55
55
|
var propTypes: any;
|
|
56
56
|
}
|
|
@@ -48,12 +48,13 @@ const CartesianContext = exports.CartesianContext = /*#__PURE__*/React.createCon
|
|
|
48
48
|
*
|
|
49
49
|
* - [CartesianContextProvider API](https://mui.com/x/api/charts/cartesian-context-provider/)
|
|
50
50
|
*/
|
|
51
|
-
function CartesianContextProvider({
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
51
|
+
function CartesianContextProvider(props) {
|
|
52
|
+
const {
|
|
53
|
+
xAxis: inXAxis,
|
|
54
|
+
yAxis: inYAxis,
|
|
55
|
+
dataset,
|
|
56
|
+
children
|
|
57
|
+
} = props;
|
|
57
58
|
const formattedSeries = React.useContext(_SeriesContextProvider.SeriesContext);
|
|
58
59
|
const drawingArea = React.useContext(_DrawingProvider.DrawingContext);
|
|
59
60
|
const xAxis = React.useMemo(() => inXAxis?.map(axisConfig => {
|
|
@@ -40,7 +40,7 @@ export declare const SVGContext: React.Context<React.RefObject<SVGSVGElement>>;
|
|
|
40
40
|
*
|
|
41
41
|
* - [DrawingProvider API](https://mui.com/x/api/charts/drawing-provider/)
|
|
42
42
|
*/
|
|
43
|
-
declare function DrawingProvider(
|
|
43
|
+
declare function DrawingProvider(props: DrawingProviderProps): React.JSX.Element;
|
|
44
44
|
declare namespace DrawingProvider {
|
|
45
45
|
var propTypes: any;
|
|
46
46
|
}
|
|
@@ -34,13 +34,14 @@ const SVGContext = exports.SVGContext = /*#__PURE__*/React.createContext({
|
|
|
34
34
|
*
|
|
35
35
|
* - [DrawingProvider API](https://mui.com/x/api/charts/drawing-provider/)
|
|
36
36
|
*/
|
|
37
|
-
function DrawingProvider({
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
37
|
+
function DrawingProvider(props) {
|
|
38
|
+
const {
|
|
39
|
+
width,
|
|
40
|
+
height,
|
|
41
|
+
margin,
|
|
42
|
+
svgRef,
|
|
43
|
+
children
|
|
44
|
+
} = props;
|
|
44
45
|
const drawingArea = (0, _useChartDimensions.default)(width, height, margin);
|
|
45
46
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(SVGContext.Provider, {
|
|
46
47
|
value: svgRef,
|
|
@@ -41,5 +41,5 @@ type HighlighState = {
|
|
|
41
41
|
dispatch: React.Dispatch<HighlighActions>;
|
|
42
42
|
};
|
|
43
43
|
export declare const HighlighContext: React.Context<HighlighState>;
|
|
44
|
-
|
|
45
|
-
export {};
|
|
44
|
+
declare function HighlightProvider(props: HighlightProviderProps): React.JSX.Element;
|
|
45
|
+
export { HighlightProvider };
|
|
@@ -39,9 +39,10 @@ const dataReducer = (prevState, action) => {
|
|
|
39
39
|
return prevState;
|
|
40
40
|
}
|
|
41
41
|
};
|
|
42
|
-
function HighlightProvider({
|
|
43
|
-
|
|
44
|
-
|
|
42
|
+
function HighlightProvider(props) {
|
|
43
|
+
const {
|
|
44
|
+
children
|
|
45
|
+
} = props;
|
|
45
46
|
const [data, dispatch] = React.useReducer(dataReducer, {
|
|
46
47
|
item: null,
|
|
47
48
|
scope: defaultScope
|
|
@@ -36,5 +36,5 @@ type InteractionState = {
|
|
|
36
36
|
dispatch: React.Dispatch<InteractionActions>;
|
|
37
37
|
};
|
|
38
38
|
export declare const InteractionContext: React.Context<InteractionState>;
|
|
39
|
-
|
|
40
|
-
export {};
|
|
39
|
+
declare function InteractionProvider(props: InteractionProviderProps): React.JSX.Element;
|
|
40
|
+
export { InteractionProvider };
|
|
@@ -41,9 +41,10 @@ const dataReducer = (prevState, action) => {
|
|
|
41
41
|
return prevState;
|
|
42
42
|
}
|
|
43
43
|
};
|
|
44
|
-
function InteractionProvider({
|
|
45
|
-
|
|
46
|
-
|
|
44
|
+
function InteractionProvider(props) {
|
|
45
|
+
const {
|
|
46
|
+
children
|
|
47
|
+
} = props;
|
|
47
48
|
const [data, dispatch] = React.useReducer(dataReducer, {
|
|
48
49
|
item: null,
|
|
49
50
|
axis: {
|
|
@@ -12,6 +12,7 @@ export type SeriesContextProviderProps = {
|
|
|
12
12
|
series: AllSeriesType[];
|
|
13
13
|
/**
|
|
14
14
|
* Color palette used to colorize multiple series.
|
|
15
|
+
* @default blueberryTwilightPalette
|
|
15
16
|
*/
|
|
16
17
|
colors?: ChartsColorPalette;
|
|
17
18
|
children: React.ReactNode;
|
|
@@ -20,4 +21,5 @@ export type FormattedSeries = {
|
|
|
20
21
|
[type in ChartSeriesType]?: FormatterResult<type>;
|
|
21
22
|
};
|
|
22
23
|
export declare const SeriesContext: React.Context<FormattedSeries>;
|
|
23
|
-
|
|
24
|
+
declare function SeriesContextProvider(props: SeriesContextProviderProps): React.JSX.Element;
|
|
25
|
+
export { SeriesContextProvider };
|
|
@@ -65,12 +65,13 @@ const formatSeries = (series, colors, dataset) => {
|
|
|
65
65
|
});
|
|
66
66
|
return formattedSeries;
|
|
67
67
|
};
|
|
68
|
-
function SeriesContextProvider({
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
68
|
+
function SeriesContextProvider(props) {
|
|
69
|
+
const {
|
|
70
|
+
series,
|
|
71
|
+
dataset,
|
|
72
|
+
colors = _colorPalettes.blueberryTwilightPalette,
|
|
73
|
+
children
|
|
74
|
+
} = props;
|
|
74
75
|
const theme = (0, _styles.useTheme)();
|
|
75
76
|
const formattedSeries = React.useMemo(() => formatSeries(series, typeof colors === 'function' ? colors(theme.palette.mode) : colors, dataset), [series, colors, theme.palette.mode, dataset]);
|
|
76
77
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(SeriesContext.Provider, {
|
package/esm/BarChart/BarChart.js
CHANGED
|
@@ -156,6 +156,7 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
|
|
|
156
156
|
className: PropTypes.string,
|
|
157
157
|
/**
|
|
158
158
|
* Color palette used to colorize multiple series.
|
|
159
|
+
* @default blueberryTwilightPalette
|
|
159
160
|
*/
|
|
160
161
|
colors: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.string), PropTypes.func]),
|
|
161
162
|
/**
|