@mui/x-charts 7.0.0-beta.1 → 7.0.0-beta.2

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.
Files changed (152) hide show
  1. package/BarChart/BarChart.js +10 -8
  2. package/BarChart/BarElement.d.ts +20 -13
  3. package/BarChart/BarElement.js +1 -0
  4. package/BarChart/BarPlot.d.ts +3 -5
  5. package/BarChart/BarPlot.js +9 -10
  6. package/CHANGELOG.md +159 -1
  7. package/ChartContainer/ChartContainer.js +6 -4
  8. package/ChartsAxis/ChartsAxis.js +4 -4
  9. package/ChartsLegend/ChartsLegend.d.ts +5 -54
  10. package/ChartsLegend/ChartsLegend.js +2 -307
  11. package/ChartsLegend/DefaultChartsLegend.d.ts +60 -0
  12. package/ChartsLegend/DefaultChartsLegend.js +294 -0
  13. package/ChartsLegend/index.d.ts +1 -0
  14. package/ChartsLegend/index.js +11 -0
  15. package/ChartsReferenceLine/ChartsReferenceLine.js +2 -2
  16. package/ChartsReferenceLine/common.d.ts +2 -1
  17. package/ChartsTooltip/ChartsItemTooltipContent.js +2 -2
  18. package/ChartsTooltip/DefaultChartsAxisTooltipContent.js +1 -1
  19. package/ChartsTooltip/DefaultChartsItemTooltipContent.js +1 -1
  20. package/ChartsTooltip/utils.d.ts +1 -0
  21. package/ChartsTooltip/utils.js +7 -0
  22. package/ChartsXAxis/ChartsXAxis.js +13 -9
  23. package/ChartsYAxis/ChartsYAxis.js +1 -1
  24. package/LineChart/AnimatedArea.js +1 -1
  25. package/LineChart/AnimatedLine.js +1 -1
  26. package/LineChart/AreaElement.d.ts +2 -1
  27. package/LineChart/AreaElement.js +1 -1
  28. package/LineChart/LineChart.js +10 -8
  29. package/LineChart/LineElement.d.ts +2 -1
  30. package/LineChart/LineElement.js +1 -1
  31. package/LineChart/LineHighlightElement.d.ts +3 -2
  32. package/LineChart/LineHighlightElement.js +2 -1
  33. package/LineChart/MarkElement.d.ts +3 -2
  34. package/LineChart/MarkElement.js +1 -0
  35. package/PieChart/PieArc.d.ts +3 -2
  36. package/PieChart/PieArc.js +1 -0
  37. package/PieChart/PieArcLabel.d.ts +3 -2
  38. package/PieChart/PieArcLabel.js +1 -0
  39. package/PieChart/PieArcLabelPlot.js +1 -1
  40. package/PieChart/PieArcPlot.js +1 -1
  41. package/PieChart/PieChart.js +10 -8
  42. package/ResponsiveChartContainer/ResponsiveChartContainer.js +6 -4
  43. package/ScatterChart/ScatterChart.js +10 -8
  44. package/SparkLineChart/SparkLineChart.d.ts +1 -1
  45. package/SparkLineChart/SparkLineChart.js +5 -4
  46. package/context/CartesianContextProvider.js +8 -6
  47. package/esm/BarChart/BarChart.js +10 -8
  48. package/esm/BarChart/BarElement.js +1 -0
  49. package/esm/BarChart/BarPlot.js +8 -10
  50. package/esm/ChartContainer/ChartContainer.js +6 -4
  51. package/esm/ChartsAxis/ChartsAxis.js +4 -4
  52. package/esm/ChartsLegend/ChartsLegend.js +2 -307
  53. package/esm/ChartsLegend/DefaultChartsLegend.js +286 -0
  54. package/esm/ChartsLegend/index.js +1 -0
  55. package/esm/ChartsReferenceLine/ChartsReferenceLine.js +2 -2
  56. package/esm/ChartsTooltip/ChartsItemTooltipContent.js +2 -2
  57. package/esm/ChartsTooltip/DefaultChartsAxisTooltipContent.js +2 -2
  58. package/esm/ChartsTooltip/DefaultChartsItemTooltipContent.js +1 -1
  59. package/esm/ChartsTooltip/utils.js +6 -0
  60. package/esm/ChartsXAxis/ChartsXAxis.js +13 -9
  61. package/esm/ChartsYAxis/ChartsYAxis.js +1 -1
  62. package/esm/LineChart/AnimatedArea.js +1 -1
  63. package/esm/LineChart/AnimatedLine.js +1 -1
  64. package/esm/LineChart/AreaElement.js +1 -1
  65. package/esm/LineChart/LineChart.js +10 -8
  66. package/esm/LineChart/LineElement.js +1 -1
  67. package/esm/LineChart/LineHighlightElement.js +2 -1
  68. package/esm/LineChart/MarkElement.js +1 -0
  69. package/esm/PieChart/PieArc.js +1 -0
  70. package/esm/PieChart/PieArcLabel.js +1 -0
  71. package/esm/PieChart/PieArcLabelPlot.js +1 -1
  72. package/esm/PieChart/PieArcPlot.js +1 -1
  73. package/esm/PieChart/PieChart.js +10 -8
  74. package/esm/ResponsiveChartContainer/ResponsiveChartContainer.js +6 -4
  75. package/esm/ScatterChart/ScatterChart.js +10 -8
  76. package/esm/SparkLineChart/SparkLineChart.js +5 -4
  77. package/esm/context/CartesianContextProvider.js +8 -6
  78. package/index.js +1 -1
  79. package/internals/defaultizeColor.d.ts +16 -16
  80. package/internals/defaultizeValueFormatter.d.ts +4 -7
  81. package/internals/stackSeries.d.ts +4 -7
  82. package/legacy/BarChart/BarChart.js +10 -8
  83. package/legacy/BarChart/BarElement.js +1 -0
  84. package/legacy/BarChart/BarPlot.js +10 -10
  85. package/legacy/ChartContainer/ChartContainer.js +6 -4
  86. package/legacy/ChartsAxis/ChartsAxis.js +4 -4
  87. package/legacy/ChartsLegend/ChartsLegend.js +2 -323
  88. package/legacy/ChartsLegend/DefaultChartsLegend.js +302 -0
  89. package/legacy/ChartsLegend/index.js +1 -0
  90. package/legacy/ChartsReferenceLine/ChartsReferenceLine.js +2 -2
  91. package/legacy/ChartsTooltip/ChartsItemTooltipContent.js +2 -2
  92. package/legacy/ChartsTooltip/DefaultChartsAxisTooltipContent.js +2 -2
  93. package/legacy/ChartsTooltip/DefaultChartsItemTooltipContent.js +1 -1
  94. package/legacy/ChartsTooltip/utils.js +6 -0
  95. package/legacy/ChartsXAxis/ChartsXAxis.js +12 -8
  96. package/legacy/ChartsYAxis/ChartsYAxis.js +1 -1
  97. package/legacy/LineChart/AnimatedArea.js +1 -1
  98. package/legacy/LineChart/AnimatedLine.js +1 -1
  99. package/legacy/LineChart/AreaElement.js +1 -1
  100. package/legacy/LineChart/LineChart.js +10 -8
  101. package/legacy/LineChart/LineElement.js +1 -1
  102. package/legacy/LineChart/LineHighlightElement.js +2 -1
  103. package/legacy/LineChart/MarkElement.js +1 -0
  104. package/legacy/PieChart/PieArc.js +1 -0
  105. package/legacy/PieChart/PieArcLabel.js +1 -0
  106. package/legacy/PieChart/PieArcLabelPlot.js +1 -1
  107. package/legacy/PieChart/PieArcPlot.js +1 -1
  108. package/legacy/PieChart/PieChart.js +10 -8
  109. package/legacy/ResponsiveChartContainer/ResponsiveChartContainer.js +6 -4
  110. package/legacy/ScatterChart/ScatterChart.js +10 -8
  111. package/legacy/SparkLineChart/SparkLineChart.js +6 -5
  112. package/legacy/context/CartesianContextProvider.js +8 -6
  113. package/legacy/index.js +1 -1
  114. package/models/axis.d.ts +7 -2
  115. package/models/seriesType/common.d.ts +2 -1
  116. package/models/seriesType/config.d.ts +7 -12
  117. package/models/seriesType/line.d.ts +2 -2
  118. package/models/seriesType/pie.d.ts +7 -3
  119. package/models/seriesType/scatter.d.ts +5 -2
  120. package/modern/BarChart/BarChart.js +10 -8
  121. package/modern/BarChart/BarElement.js +1 -0
  122. package/modern/BarChart/BarPlot.js +8 -10
  123. package/modern/ChartContainer/ChartContainer.js +6 -4
  124. package/modern/ChartsAxis/ChartsAxis.js +4 -4
  125. package/modern/ChartsLegend/ChartsLegend.js +2 -307
  126. package/modern/ChartsLegend/DefaultChartsLegend.js +286 -0
  127. package/modern/ChartsLegend/index.js +1 -0
  128. package/modern/ChartsReferenceLine/ChartsReferenceLine.js +2 -2
  129. package/modern/ChartsTooltip/ChartsItemTooltipContent.js +2 -2
  130. package/modern/ChartsTooltip/DefaultChartsAxisTooltipContent.js +2 -2
  131. package/modern/ChartsTooltip/DefaultChartsItemTooltipContent.js +1 -1
  132. package/modern/ChartsTooltip/utils.js +6 -0
  133. package/modern/ChartsXAxis/ChartsXAxis.js +13 -9
  134. package/modern/ChartsYAxis/ChartsYAxis.js +1 -1
  135. package/modern/LineChart/AnimatedArea.js +1 -1
  136. package/modern/LineChart/AnimatedLine.js +1 -1
  137. package/modern/LineChart/AreaElement.js +1 -1
  138. package/modern/LineChart/LineChart.js +10 -8
  139. package/modern/LineChart/LineElement.js +1 -1
  140. package/modern/LineChart/LineHighlightElement.js +2 -1
  141. package/modern/LineChart/MarkElement.js +1 -0
  142. package/modern/PieChart/PieArc.js +1 -0
  143. package/modern/PieChart/PieArcLabel.js +1 -0
  144. package/modern/PieChart/PieArcLabelPlot.js +1 -1
  145. package/modern/PieChart/PieArcPlot.js +1 -1
  146. package/modern/PieChart/PieChart.js +10 -8
  147. package/modern/ResponsiveChartContainer/ResponsiveChartContainer.js +6 -4
  148. package/modern/ScatterChart/ScatterChart.js +10 -8
  149. package/modern/SparkLineChart/SparkLineChart.js +5 -4
  150. package/modern/context/CartesianContextProvider.js +8 -6
  151. package/modern/index.js +1 -1
  152. package/package.json +1 -1
@@ -142,7 +142,7 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
142
142
  * @default xAxisIds[0] The id of the first provided axis
143
143
  */
144
144
  bottomAxis: _propTypes.default.oneOfType([_propTypes.default.shape({
145
- axisId: _propTypes.default.string,
145
+ axisId: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
146
146
  classes: _propTypes.default.object,
147
147
  disableLine: _propTypes.default.bool,
148
148
  disableTicks: _propTypes.default.bool,
@@ -193,7 +193,7 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
193
193
  * @default yAxisIds[0] The id of the first provided axis
194
194
  */
195
195
  leftAxis: _propTypes.default.oneOfType([_propTypes.default.shape({
196
- axisId: _propTypes.default.string,
196
+ axisId: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
197
197
  classes: _propTypes.default.object,
198
198
  disableLine: _propTypes.default.bool,
199
199
  disableTicks: _propTypes.default.bool,
@@ -259,7 +259,7 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
259
259
  * @default null
260
260
  */
261
261
  rightAxis: _propTypes.default.oneOfType([_propTypes.default.shape({
262
- axisId: _propTypes.default.string,
262
+ axisId: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
263
263
  classes: _propTypes.default.object,
264
264
  disableLine: _propTypes.default.bool,
265
265
  disableTicks: _propTypes.default.bool,
@@ -312,7 +312,7 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
312
312
  * @default null
313
313
  */
314
314
  topAxis: _propTypes.default.oneOfType([_propTypes.default.shape({
315
- axisId: _propTypes.default.string,
315
+ axisId: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
316
316
  classes: _propTypes.default.object,
317
317
  disableLine: _propTypes.default.bool,
318
318
  disableTicks: _propTypes.default.bool,
@@ -349,7 +349,7 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
349
349
  * If not provided, a default axis config is used with id set to `DEFAULT_X_AXIS_KEY`.
350
350
  */
351
351
  xAxis: _propTypes.default.arrayOf(_propTypes.default.shape({
352
- axisId: _propTypes.default.string,
352
+ axisId: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
353
353
  classes: _propTypes.default.object,
354
354
  data: _propTypes.default.array,
355
355
  dataKey: _propTypes.default.string,
@@ -357,13 +357,14 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
357
357
  disableTicks: _propTypes.default.bool,
358
358
  fill: _propTypes.default.string,
359
359
  hideTooltip: _propTypes.default.bool,
360
- id: _propTypes.default.string,
360
+ id: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
361
361
  label: _propTypes.default.string,
362
362
  labelFontSize: _propTypes.default.number,
363
363
  labelStyle: _propTypes.default.object,
364
364
  max: _propTypes.default.oneOfType([_propTypes.default.instanceOf(Date), _propTypes.default.number]),
365
365
  min: _propTypes.default.oneOfType([_propTypes.default.instanceOf(Date), _propTypes.default.number]),
366
366
  position: _propTypes.default.oneOf(['bottom', 'left', 'right', 'top']),
367
+ reverse: _propTypes.default.bool,
367
368
  scaleType: _propTypes.default.oneOf(['band', 'linear', 'log', 'point', 'pow', 'sqrt', 'time', 'utc']),
368
369
  slotProps: _propTypes.default.object,
369
370
  slots: _propTypes.default.object,
@@ -383,7 +384,7 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
383
384
  * If not provided, a default axis config is used with id set to `DEFAULT_Y_AXIS_KEY`.
384
385
  */
385
386
  yAxis: _propTypes.default.arrayOf(_propTypes.default.shape({
386
- axisId: _propTypes.default.string,
387
+ axisId: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
387
388
  classes: _propTypes.default.object,
388
389
  data: _propTypes.default.array,
389
390
  dataKey: _propTypes.default.string,
@@ -391,13 +392,14 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
391
392
  disableTicks: _propTypes.default.bool,
392
393
  fill: _propTypes.default.string,
393
394
  hideTooltip: _propTypes.default.bool,
394
- id: _propTypes.default.string,
395
+ id: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
395
396
  label: _propTypes.default.string,
396
397
  labelFontSize: _propTypes.default.number,
397
398
  labelStyle: _propTypes.default.object,
398
399
  max: _propTypes.default.oneOfType([_propTypes.default.instanceOf(Date), _propTypes.default.number]),
399
400
  min: _propTypes.default.oneOfType([_propTypes.default.instanceOf(Date), _propTypes.default.number]),
400
401
  position: _propTypes.default.oneOf(['bottom', 'left', 'right', 'top']),
402
+ reverse: _propTypes.default.bool,
401
403
  scaleType: _propTypes.default.oneOf(['band', 'linear', 'log', 'point', 'pow', 'sqrt', 'time', 'utc']),
402
404
  slotProps: _propTypes.default.object,
403
405
  slots: _propTypes.default.object,
@@ -1,13 +1,13 @@
1
1
  import * as React from 'react';
2
- import { SlotComponentProps } from '@mui/base/utils';
3
2
  import { HighlightScope } from '../context/HighlightProvider';
3
+ import { SeriesId } from '../models/seriesType/common';
4
4
  export interface BarElementClasses {
5
5
  /** Styles applied to the root element. */
6
6
  root: string;
7
7
  }
8
8
  export type BarElementClassKey = keyof BarElementClasses;
9
9
  export interface BarElementOwnerState {
10
- id: string;
10
+ id: SeriesId;
11
11
  dataIndex: number;
12
12
  color: string;
13
13
  isFaded: boolean;
@@ -1351,26 +1351,33 @@ export declare const BarElementPath: import("@emotion/styled").StyledComponent<P
1351
1351
  }, "string" | "end" | "accumulate" | "local" | "color" | "clip" | "style" | "unicode" | "fill" | "stroke" | "x" | "y" | "clipPath" | "cursor" | "direction" | "display" | "filter" | "fontFamily" | "fontSize" | "fontSizeAdjust" | "fontStretch" | "fontStyle" | "fontVariant" | "fontWeight" | "height" | "imageRendering" | "letterSpacing" | "opacity" | "order" | "paintOrder" | "pointerEvents" | "rotate" | "scale" | "textRendering" | "transform" | "unicodeBidi" | "visibility" | "width" | "wordSpacing" | "writingMode" | "alphabetic" | "hanging" | "ideographic" | "mathematical" | "mask" | "offset" | "overflow" | "textDecoration" | "azimuth" | "alignmentBaseline" | "baselineShift" | "clipRule" | "colorInterpolation" | "colorRendering" | "dominantBaseline" | "fillOpacity" | "fillRule" | "floodColor" | "floodOpacity" | "glyphOrientationVertical" | "lightingColor" | "markerEnd" | "markerMid" | "markerStart" | "shapeRendering" | "stopColor" | "stopOpacity" | "strokeDasharray" | "strokeDashoffset" | "strokeLinecap" | "strokeLinejoin" | "strokeMiterlimit" | "strokeOpacity" | "strokeWidth" | "textAnchor" | "vectorEffect" | "additive" | "path" | "ref" | "key" | "crossOrigin" | "href" | "max" | "media" | "method" | "min" | "name" | "target" | "type" | "suppressHydrationWarning" | "className" | "id" | "lang" | "tabIndex" | "role" | "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" | "accentHeight" | "allowReorder" | "amplitude" | "arabicForm" | "ascent" | "attributeName" | "attributeType" | "autoReverse" | "baseFrequency" | "baseProfile" | "bbox" | "begin" | "bias" | "by" | "calcMode" | "capHeight" | "clipPathUnits" | "colorInterpolationFilters" | "colorProfile" | "contentScriptType" | "contentStyleType" | "cx" | "cy" | "d" | "decelerate" | "descent" | "diffuseConstant" | "divisor" | "dur" | "dx" | "dy" | "edgeMode" | "elevation" | "enableBackground" | "exponent" | "externalResourcesRequired" | "filterRes" | "filterUnits" | "focusable" | "format" | "fr" | "from" | "fx" | "fy" | "g1" | "g2" | "glyphName" | "glyphOrientationHorizontal" | "glyphRef" | "gradientTransform" | "gradientUnits" | "horizAdvX" | "horizOriginX" | "in2" | "in" | "intercept" | "k1" | "k2" | "k3" | "k4" | "k" | "kernelMatrix" | "kernelUnitLength" | "kerning" | "keyPoints" | "keySplines" | "keyTimes" | "lengthAdjust" | "limitingConeAngle" | "markerHeight" | "markerUnits" | "markerWidth" | "maskContentUnits" | "maskUnits" | "mode" | "numOctaves" | "operator" | "orient" | "orientation" | "origin" | "overlinePosition" | "overlineThickness" | "panose1" | "pathLength" | "patternContentUnits" | "patternTransform" | "patternUnits" | "points" | "pointsAtX" | "pointsAtY" | "pointsAtZ" | "preserveAlpha" | "preserveAspectRatio" | "primitiveUnits" | "r" | "radius" | "refX" | "refY" | "renderingIntent" | "repeatCount" | "repeatDur" | "requiredExtensions" | "requiredFeatures" | "restart" | "result" | "rx" | "ry" | "seed" | "slope" | "spacing" | "specularConstant" | "specularExponent" | "speed" | "spreadMethod" | "startOffset" | "stdDeviation" | "stemh" | "stemv" | "stitchTiles" | "strikethroughPosition" | "strikethroughThickness" | "surfaceScale" | "systemLanguage" | "tableValues" | "targetX" | "targetY" | "textLength" | "to" | "u1" | "u2" | "underlinePosition" | "underlineThickness" | "unicodeRange" | "unitsPerEm" | "vAlphabetic" | "values" | "version" | "vertAdvY" | "vertOriginX" | "vertOriginY" | "vHanging" | "vIdeographic" | "viewBox" | "viewTarget" | "vMathematical" | "widths" | "x1" | "x2" | "xChannelSelector" | "xHeight" | "xlinkActuate" | "xlinkArcrole" | "xlinkHref" | "xlinkRole" | "xlinkShow" | "xlinkTitle" | "xlinkType" | "xmlBase" | "xmlLang" | "xmlns" | "xmlnsXlink" | "xmlSpace" | "y1" | "y2" | "yChannelSelector" | "z" | "zoomAndPan" | "children" | "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" | "scrollTop" | "scrollLeft"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme> & {
1352
1352
  ownerState: BarElementOwnerState;
1353
1353
  }, {}, {}>;
1354
- export type BarElementProps = Omit<BarElementOwnerState, 'isFaded' | 'isHighlighted'> & React.ComponentPropsWithoutRef<'path'> & {
1354
+ interface BarProps extends Omit<React.ComponentPropsWithoutRef<'path'>, 'id' | 'color'> {
1355
+ highlightScope?: Partial<HighlightScope>;
1356
+ onClick?: (event: React.MouseEvent<SVGPathElement, MouseEvent>) => void;
1357
+ ownerState: BarElementOwnerState;
1358
+ }
1359
+ export interface BarElementSlots {
1360
+ /**
1361
+ * The component that renders the bar.
1362
+ * @default BarElementPath
1363
+ */
1364
+ bar?: React.JSXElementConstructor<BarProps>;
1365
+ }
1366
+ export interface BarElementSlotProps {
1367
+ bar?: Partial<BarProps>;
1368
+ }
1369
+ export type BarElementProps = Omit<BarElementOwnerState, 'isFaded' | 'isHighlighted'> & Omit<React.ComponentPropsWithoutRef<'path'>, 'id'> & {
1355
1370
  highlightScope?: Partial<HighlightScope>;
1356
1371
  /**
1357
1372
  * The props used for each component slot.
1358
1373
  * @default {}
1359
1374
  */
1360
- slotProps?: {
1361
- bar?: SlotComponentProps<'path', {}, BarElementOwnerState>;
1362
- };
1375
+ slotProps?: BarElementSlotProps;
1363
1376
  /**
1364
1377
  * Overridable component slots.
1365
1378
  * @default {}
1366
1379
  */
1367
- slots?: {
1368
- /**
1369
- * The component that renders the bar.
1370
- * @default BarElementPath
1371
- */
1372
- bar?: React.ElementType;
1373
- };
1380
+ slots?: BarElementSlots;
1374
1381
  };
1375
1382
  declare function BarElement(props: BarElementProps): React.JSX.Element;
1376
1383
  declare namespace BarElement {
@@ -116,6 +116,7 @@ process.env.NODE_ENV !== "production" ? BarElement.propTypes = {
116
116
  faded: _propTypes.default.oneOf(['global', 'none', 'series']),
117
117
  highlighted: _propTypes.default.oneOf(['item', 'none', 'series'])
118
118
  }),
119
+ id: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]).isRequired,
119
120
  /**
120
121
  * The props used for each component slot.
121
122
  * @default {}
@@ -1,11 +1,9 @@
1
1
  import * as React from 'react';
2
- import { BarElementProps } from './BarElement';
2
+ import { BarElementProps, BarElementSlotProps, BarElementSlots } from './BarElement';
3
3
  import { BarItemIdentifier } from '../models';
4
- export interface BarPlotSlots {
5
- bar?: React.JSXElementConstructor<BarElementProps>;
4
+ export interface BarPlotSlots extends BarElementSlots {
6
5
  }
7
- export interface BarPlotSlotProps {
8
- bar?: Partial<BarElementProps>;
6
+ export interface BarPlotSlotProps extends BarElementSlotProps {
9
7
  }
10
8
  export interface BarPlotProps extends Pick<BarElementProps, 'slots' | 'slotProps'> {
11
9
  /**
@@ -17,6 +17,8 @@ var _axis = require("../models/axis");
17
17
  var _constants = require("../constants");
18
18
  var _jsxRuntime = require("react/jsx-runtime");
19
19
  const _excluded = ["skipAnimation", "onItemClick"];
20
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
21
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && 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
22
  /**
21
23
  * Solution of the equations
22
24
  * W = barWidth * N + offset * (N-1)
@@ -26,8 +28,6 @@ const _excluded = ["skipAnimation", "onItemClick"];
26
28
  * @param gapRatio The ratio of the gap between bars over the bar width.
27
29
  * @returns The bar width and the offset between bars.
28
30
  */
29
- 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); }
30
- 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; }
31
31
  function getBandSize({
32
32
  bandWidth: W,
33
33
  numberOfGroups: N,
@@ -109,20 +109,19 @@ const useAggregatedData = () => {
109
109
  color
110
110
  } = series[seriesId];
111
111
  return stackedData.map((values, dataIndex) => {
112
- const bottom = Math.min(...values);
113
- const top = Math.max(...values);
112
+ const valueCoordinates = values.map(v => verticalLayout ? yScale(v) : xScale(v));
113
+ const minValueCoord = Math.min(...valueCoordinates);
114
+ const maxValueCoord = Math.max(...valueCoordinates);
114
115
  return {
115
- bottom,
116
- top,
117
116
  seriesId,
118
117
  dataIndex,
119
118
  layout: series[seriesId].layout,
120
- x: verticalLayout ? xScale(xAxis[xAxisKey].data?.[dataIndex]) + barOffset : xScale(bottom),
121
- y: verticalLayout ? yScale(top) : yScale(yAxis[yAxisKey].data?.[dataIndex]) + barOffset,
119
+ x: verticalLayout ? xScale(xAxis[xAxisKey].data?.[dataIndex]) + barOffset : minValueCoord,
120
+ y: verticalLayout ? minValueCoord : yScale(yAxis[yAxisKey].data?.[dataIndex]) + barOffset,
122
121
  xOrigin: xScale(0),
123
122
  yOrigin: yScale(0),
124
- height: verticalLayout ? Math.abs(yScale(bottom) - yScale(top)) : barWidth,
125
- width: verticalLayout ? barWidth : Math.abs(xScale(bottom) - xScale(top)),
123
+ height: verticalLayout ? maxValueCoord - minValueCoord : barWidth,
124
+ width: verticalLayout ? barWidth : maxValueCoord - minValueCoord,
126
125
  color,
127
126
  highlightScope: series[seriesId].highlightScope
128
127
  };
package/CHANGELOG.md CHANGED
@@ -3,6 +3,108 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## v7.0.0-beta.2
7
+
8
+ _Feb 9, 2024_
9
+
10
+ We'd like to offer a big thanks to the 15 contributors who made this release possible. Here are some highlights ✨:
11
+
12
+ - 🚀 Add slot typings on the Data Grid components (#11795) @romgrk
13
+ - 🎁 Support UTC date formatting in Charts tooltip (#11943) @shaharyar-shamshi
14
+ - 🌍 Improve Danish (da-DK) locale Data Grid (#11877) @ShahrazH
15
+ - 🐞 Bugfixes
16
+ - 📚 Documentation improvements
17
+
18
+ ### Data Grid
19
+
20
+ #### `@mui/x-data-grid@v7.0.0-beta.2`
21
+
22
+ - [DataGrid] Add `removeAllFilterItems` as a reason of `onFilterModelChange` callback (#11911) @shaharyar-shamshi
23
+ - [DataGrid] Add slot typings (#11795) @romgrk
24
+ - [DataGrid] Add support for dialogs in menu actions (#11909) @cherniavskii
25
+ - [DataGrid] Allow passing readonly arrays to `pageSizeOptions` prop (#11609) @pcorpet
26
+ - [DataGrid] Fix incorrect computation of `lastPage` in `GridPagination` (#11958) @MBilalShafi
27
+ - [DataGrid] Improve vertical scrolling performance (#11924) @romgrk
28
+ - [l10n] Improve Danish (da-DK) locale (#11877) @ShahrazH
29
+
30
+ #### `@mui/x-data-grid-pro@v7.0.0-beta.2` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
31
+
32
+ Same changes as in `@mui/x-data-grid@v7.0.0-beta.2`.
33
+
34
+ #### `@mui/x-data-grid-premium@v7.0.0-beta.2` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link 'Premium plan')
35
+
36
+ Same changes as in `@mui/x-data-grid-pro@v7.0.0-beta.2`, plus:
37
+
38
+ - [DataGridPremium] Fix autosize grouping cell (#11870) @romgrk
39
+ - [DataGridPremium] Fix clipboard paste not working with Caps Lock enabled (#11965) @shaharyar-shamshi
40
+
41
+ ### Date Pickers
42
+
43
+ #### `@mui/x-date-pickers@v7.0.0-beta.2`
44
+
45
+ - [pickers] Avoid relying on locale in Luxon `isWithinRange` method (#11936) @LukasTy
46
+ - [pickers] Limit the valid values of `TDate` (#11791) @flaviendelangle
47
+
48
+ #### `@mui/x-date-pickers-pro@v7.0.0-beta.2` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
49
+
50
+ Same changes as in `@mui/x-date-pickers@v7.0.0-beta.2`.
51
+
52
+ ### Charts / `@mui/x-charts@v7.0.0-beta.2`
53
+
54
+ - [charts] Add `reverse` property to axes (#11899) @alexfauquette
55
+ - [charts] Allow series ids to be numbers (#11941) @alexfauquette
56
+ - [charts] Support UTC date formatting in tooltip (#11943) @shaharyar-shamshi
57
+
58
+ ### Tree View / `@mui/x-tree-view@v7.0.0-beta.2`
59
+
60
+ - [TreeView] Correctly detect if an item is expandable (#11963) @swalker326
61
+ - [TreeView] Polish the default design & revise the simple version pages (#11529) @danilo-leal
62
+
63
+ ### License
64
+
65
+ #### Breaking changes
66
+
67
+ - If you're using the [commercial license](https://next.mui.com/x/introduction/licensing), you need to update the import path:
68
+
69
+ ```diff
70
+ -import { LicenseInfo } from '@mui/x-license-pro';
71
+ +import { LicenseInfo } from '@mui/x-license';
72
+ ```
73
+
74
+ `@mui/x-license@v7.0.0-beta.2`
75
+
76
+ - [license] Rename `@mui/x-license-pro` to `@mui/x-license` (#11938) @cherniavskii
77
+
78
+ ### Docs
79
+
80
+ - [docs] Add a note about `AdapterDateFnsV3` on the Getting Started page (#11985) @flaviendelangle
81
+ - [docs] Add missing `Charts` breaking change steps (#11971) @alexfauquette
82
+ - [docs] Fix `ChartsTooltip` typo (#11961) @thisisharsh7
83
+ - [docs] Refactor `Localization` documentation sections (#11989) @LukasTy
84
+ - [docs] Use "cannot" instead of "can't" or "can not" (#11986) @flaviendelangle
85
+ - [docs] Add quick fixes to the migration guide (#11806) @danilo-leal
86
+ - [docs] Avoid use of shorthand (#12000) @oliviertassinari
87
+ - [docs] Avoid the use of MUI Core @oliviertassinari
88
+ - [docs] Fix image size and dark mode @oliviertassinari
89
+ - [docs] Follow blank line convention with use client @oliviertassinari
90
+ - [docs] Stable layout between light and dark mode @oliviertassinari
91
+
92
+ ### Core
93
+
94
+ - [core] Add `docs:serve` script (#11935) @cherniavskii
95
+ - [core] Bump monorepo (#12001) @cherniavskii
96
+ - [core] Deprecate `LicenseInfo` re-exports (#11956) @cherniavskii
97
+ - [core] Fix `test_types` failing on the `next` branch (#11944) @cherniavskii
98
+ - [core] Fix failing `test_static` on the next branch (#11977) @cherniavskii
99
+ - [core] Flatten grid packages folder (#11946) @cherniavskii
100
+ - [core] Improve license info deprecation message (#11974) @cherniavskii
101
+ - [core] Integrate changes from Core #40842 PR (#11801) @michaldudak
102
+ - [core] Move next config to ESM (#11882) @Janpot
103
+ - [core] Add auto-message on closed issues (#11805) @michelengelen
104
+ - [core] Simplify bug reproduction (#11849) @oliviertassinari
105
+ - [core] Fix npm reference @oliviertassinari
106
+ - [core] Normalize issue template @oliviertassinari
107
+
6
108
  ## 7.0.0-beta.1
7
109
 
8
110
  _Feb 1, 2024_
@@ -2036,6 +2138,62 @@ Here is an example of the renaming for the `<ChartsTooltip />` component.
2036
2138
  - [core] Update release instructions as per v7 configuration (#10962) @MBilalShafi
2037
2139
  - [license] Correctly throw errors (#10924) @oliviertassinari
2038
2140
 
2141
+ ## v6.19.4
2142
+
2143
+ _Feb 9, 2024_
2144
+
2145
+ We'd like to offer a big thanks to the 10 contributors who made this release possible. Here are some highlights ✨:
2146
+
2147
+ - 🌍 Improve Danish (da-DK) locale on the Data Grid (#11972) @ShahrazH
2148
+ - 🐞 Bugfixes
2149
+ - 📚 Documentation improvements
2150
+
2151
+ ### Data Grid
2152
+
2153
+ #### `@mui/x-data-grid@v6.19.4`
2154
+
2155
+ - [DataGrid] Add support for dialogs in menu actions (#11937) @cherniavskii
2156
+ - [DataGrid] Allow passing readonly arrays to `pageSizeOptions` prop (#11992) @pcorpet
2157
+ - [DataGrid] Fix row reorder with cell selection (#11878) @PEsteves8
2158
+ - [DataGrid] Replace `eval` with `new Function` (#11962) @cherniavskii
2159
+ - [l10n] Improve Danish (da-DK) locale (#11972) @ShahrazH
2160
+
2161
+ #### `@mui/x-data-grid-pro@v6.19.4` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
2162
+
2163
+ Same changes as in `@mui/x-data-grid@v6.19.4`.
2164
+
2165
+ #### `@mui/x-data-grid-premium@v6.19.4` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link 'Premium plan')
2166
+
2167
+ Same changes as in `@mui/x-data-grid-pro@v6.19.4`, plus:
2168
+
2169
+ - [DataGridPremium] Fix autosize grouping cell (#11990) @romgrk
2170
+ - [DataGridPremium] Fix error after closing print export (#11889) @cherniavskii
2171
+
2172
+ ### Date Pickers
2173
+
2174
+ #### `@mui/x-date-pickers@v6.19.4`
2175
+
2176
+ - [pickers] Avoid relying on locale in Luxon `isWithinRange` method (#11940) @LukasTy
2177
+
2178
+ #### `@mui/x-date-pickers-pro@v6.19.4` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
2179
+
2180
+ Same changes as in `@mui/x-date-pickers@v6.19.4`.
2181
+
2182
+ ### Charts / `@mui/x-charts@v6.19.4`
2183
+
2184
+ - [charts] Add `reverse` property to axes (#11959) @alexfauquette
2185
+ - [charts] Allow series ids to be numbers (#11960) @alexfauquette
2186
+ - [charts] Fix Proptypes error by supporting string values for axes (#11953) @alexfauquette
2187
+
2188
+ ### Docs
2189
+
2190
+ - [docs] Add a note about `AdapterDateFnsV3` on the Getting Started page (#11987) @flaviendelangle
2191
+ - [docs] Avoid the use of MUI Core @oliviertassinari
2192
+ - [docs] Fix API links (#11930) @alexfauquette
2193
+ - [docs] Fix `ChartsTooltip` typo (#11967) @thisisharsh7
2194
+ - [docs] Refactor `Localization` documentation sections (#11997) @LukasTy
2195
+ - [code] Simplify bug reproduction (#11932) @alexfauquette
2196
+
2039
2197
  ## 6.19.3
2040
2198
 
2041
2199
  _Feb 1, 2024_
@@ -7123,7 +7281,7 @@ You can find more information about the new api, including how to set those tran
7123
7281
  - [core] Add link to the security page on the `README` (#6073) @oliviertassinari
7124
7282
  - [core] Fix scroll restoration in the docs (#5938) @oliviertassinari
7125
7283
  - [core] Remove the Storybook (#6099) @flaviendelangle
7126
- - [core] Tag release as `next` in NPM (#6256) @m4theushw
7284
+ - [core] Tag release as `next` in npm (#6256) @m4theushw
7127
7285
  - [core] Update monorepo (#6180) @flaviendelangle
7128
7286
  - [core] Use the `next` branch for Prettier (#6097) @flaviendelangle
7129
7287
  - [core] Use the official repository for `@mui/monorepo` instead of a fork (#6189) @oliviertassinari
@@ -131,7 +131,7 @@ process.env.NODE_ENV !== "production" ? ChartContainer.propTypes = {
131
131
  * If not provided, a default axis config is used with id set to `DEFAULT_X_AXIS_KEY`.
132
132
  */
133
133
  xAxis: _propTypes.default.arrayOf(_propTypes.default.shape({
134
- axisId: _propTypes.default.string,
134
+ axisId: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
135
135
  classes: _propTypes.default.object,
136
136
  data: _propTypes.default.array,
137
137
  dataKey: _propTypes.default.string,
@@ -139,13 +139,14 @@ process.env.NODE_ENV !== "production" ? ChartContainer.propTypes = {
139
139
  disableTicks: _propTypes.default.bool,
140
140
  fill: _propTypes.default.string,
141
141
  hideTooltip: _propTypes.default.bool,
142
- id: _propTypes.default.string,
142
+ id: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
143
143
  label: _propTypes.default.string,
144
144
  labelFontSize: _propTypes.default.number,
145
145
  labelStyle: _propTypes.default.object,
146
146
  max: _propTypes.default.oneOfType([_propTypes.default.instanceOf(Date), _propTypes.default.number]),
147
147
  min: _propTypes.default.oneOfType([_propTypes.default.instanceOf(Date), _propTypes.default.number]),
148
148
  position: _propTypes.default.oneOf(['bottom', 'left', 'right', 'top']),
149
+ reverse: _propTypes.default.bool,
149
150
  scaleType: _propTypes.default.oneOf(['band', 'linear', 'log', 'point', 'pow', 'sqrt', 'time', 'utc']),
150
151
  slotProps: _propTypes.default.object,
151
152
  slots: _propTypes.default.object,
@@ -165,7 +166,7 @@ process.env.NODE_ENV !== "production" ? ChartContainer.propTypes = {
165
166
  * If not provided, a default axis config is used with id set to `DEFAULT_Y_AXIS_KEY`.
166
167
  */
167
168
  yAxis: _propTypes.default.arrayOf(_propTypes.default.shape({
168
- axisId: _propTypes.default.string,
169
+ axisId: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
169
170
  classes: _propTypes.default.object,
170
171
  data: _propTypes.default.array,
171
172
  dataKey: _propTypes.default.string,
@@ -173,13 +174,14 @@ process.env.NODE_ENV !== "production" ? ChartContainer.propTypes = {
173
174
  disableTicks: _propTypes.default.bool,
174
175
  fill: _propTypes.default.string,
175
176
  hideTooltip: _propTypes.default.bool,
176
- id: _propTypes.default.string,
177
+ id: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
177
178
  label: _propTypes.default.string,
178
179
  labelFontSize: _propTypes.default.number,
179
180
  labelStyle: _propTypes.default.object,
180
181
  max: _propTypes.default.oneOfType([_propTypes.default.instanceOf(Date), _propTypes.default.number]),
181
182
  min: _propTypes.default.oneOfType([_propTypes.default.instanceOf(Date), _propTypes.default.number]),
182
183
  position: _propTypes.default.oneOf(['bottom', 'left', 'right', 'top']),
184
+ reverse: _propTypes.default.bool,
183
185
  scaleType: _propTypes.default.oneOf(['band', 'linear', 'log', 'point', 'pow', 'sqrt', 'time', 'utc']),
184
186
  slotProps: _propTypes.default.object,
185
187
  slots: _propTypes.default.object,
@@ -108,7 +108,7 @@ process.env.NODE_ENV !== "production" ? ChartsAxis.propTypes = {
108
108
  * @default xAxisIds[0] The id of the first provided axis
109
109
  */
110
110
  bottomAxis: _propTypes.default.oneOfType([_propTypes.default.shape({
111
- axisId: _propTypes.default.string,
111
+ axisId: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
112
112
  classes: _propTypes.default.object,
113
113
  disableLine: _propTypes.default.bool,
114
114
  disableTicks: _propTypes.default.bool,
@@ -135,7 +135,7 @@ process.env.NODE_ENV !== "production" ? ChartsAxis.propTypes = {
135
135
  * @default yAxisIds[0] The id of the first provided axis
136
136
  */
137
137
  leftAxis: _propTypes.default.oneOfType([_propTypes.default.shape({
138
- axisId: _propTypes.default.string,
138
+ axisId: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
139
139
  classes: _propTypes.default.object,
140
140
  disableLine: _propTypes.default.bool,
141
141
  disableTicks: _propTypes.default.bool,
@@ -162,7 +162,7 @@ process.env.NODE_ENV !== "production" ? ChartsAxis.propTypes = {
162
162
  * @default null
163
163
  */
164
164
  rightAxis: _propTypes.default.oneOfType([_propTypes.default.shape({
165
- axisId: _propTypes.default.string,
165
+ axisId: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
166
166
  classes: _propTypes.default.object,
167
167
  disableLine: _propTypes.default.bool,
168
168
  disableTicks: _propTypes.default.bool,
@@ -199,7 +199,7 @@ process.env.NODE_ENV !== "production" ? ChartsAxis.propTypes = {
199
199
  * @default null
200
200
  */
201
201
  topAxis: _propTypes.default.oneOfType([_propTypes.default.shape({
202
- axisId: _propTypes.default.string,
202
+ axisId: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
203
203
  classes: _propTypes.default.object,
204
204
  disableLine: _propTypes.default.bool,
205
205
  disableTicks: _propTypes.default.bool,
@@ -1,14 +1,12 @@
1
1
  import * as React from 'react';
2
- import { Theme } from '@mui/material/styles';
3
- import { DrawingArea } from '../context/DrawingProvider';
4
2
  import { AnchorPosition, Direction } from './utils';
5
- import { FormattedSeries } from '../context/SeriesContextProvider';
6
3
  import { ChartsLegendClasses } from './chartsLegendClasses';
7
- import { DefaultizedProps } from '../models/helpers';
8
- import { LegendParams } from '../models/seriesType/config';
9
- import { ChartsTextStyle } from '../ChartsText';
10
- import { CardinalDirections } from '../models/layout';
4
+ import { LegendRendererProps } from './DefaultChartsLegend';
11
5
  export interface ChartsLegendSlots {
6
+ /**
7
+ * Custom rendering of the legend.
8
+ * @default DefaultChartsLegend
9
+ */
12
10
  legend?: React.JSXElementConstructor<LegendRendererProps>;
13
11
  }
14
12
  export interface ChartsLegendSlotProps {
@@ -41,53 +39,6 @@ export type ChartsLegendProps = {
41
39
  */
42
40
  slotProps?: ChartsLegendSlotProps;
43
41
  };
44
- type DefaultizedChartsLegendProps = DefaultizedProps<ChartsLegendProps, 'direction' | 'position'>;
45
- export type ChartsLegendRootOwnerState = {
46
- position: AnchorPosition;
47
- direction: Direction;
48
- drawingArea: DrawingArea;
49
- offsetX?: number;
50
- offsetY?: number;
51
- seriesNumber: number;
52
- };
53
- export declare const ChartsLegendRoot: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<Theme>, Pick<React.SVGProps<SVGGElement>, keyof React.SVGProps<SVGGElement>>, {}>;
54
- export interface LegendRendererProps extends Omit<DefaultizedChartsLegendProps, 'slots' | 'slotProps'> {
55
- series: FormattedSeries;
56
- seriesToDisplay: LegendParams[];
57
- drawingArea: DrawingArea;
58
- classes: Record<'mark' | 'series' | 'root', string>;
59
- /**
60
- * Style applied to legend labels.
61
- * @default theme.typography.subtitle1
62
- */
63
- labelStyle?: ChartsTextStyle;
64
- /**
65
- * Width of the item mark (in px).
66
- * @default 20
67
- */
68
- itemMarkWidth?: number;
69
- /**
70
- * Height of the item mark (in px).
71
- * @default 20
72
- */
73
- itemMarkHeight?: number;
74
- /**
75
- * Space between the mark and the label (in px).
76
- * @default 5
77
- */
78
- markGap?: number;
79
- /**
80
- * Space between two legend items (in px).
81
- * @default 10
82
- */
83
- itemGap?: number;
84
- /**
85
- * Legend padding (in px).
86
- * Can either be a single number, or an object with top, left, bottom, right properties.
87
- * @default 0
88
- */
89
- padding?: number | Partial<CardinalDirections<number>>;
90
- }
91
42
  declare function ChartsLegend(inProps: ChartsLegendProps): React.JSX.Element;
92
43
  declare namespace ChartsLegend {
93
44
  var propTypes: any;