@mui/x-charts 7.18.0 → 7.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/BarChart/BarElement.d.ts +1 -1
- package/BarChart/BarLabel/BarLabel.d.ts +1 -1
- package/BarChart/formatter.js +5 -4
- package/CHANGELOG.md +110 -0
- package/ChartContainer/useDefaultizeAxis.d.ts +4 -4
- package/ChartContainer/useDefaultizeAxis.js +1 -1
- package/ChartsAxis/ChartsAxis.js +4 -4
- package/ChartsAxisHighlight/ChartsAxisHighlight.d.ts +1 -1
- package/ChartsGrid/styledCommonents.d.ts +2 -2
- package/ChartsLegend/DefaultChartsLegend.js +1 -1
- package/ChartsLegend/LegendPerItem.d.ts +1 -1
- package/ChartsLegend/LegendPerItem.js +1 -1
- package/ChartsLegend/PiecewiseColorLegend.js +1 -1
- package/ChartsReferenceLine/common.d.ts +1 -1
- package/ChartsTooltip/ChartsTooltipTable.d.ts +5 -5
- package/LineChart/AnimatedArea.d.ts +1 -1
- package/LineChart/AnimatedArea.js +9 -45
- package/LineChart/AnimatedLine.d.ts +1 -1
- package/LineChart/AnimatedLine.js +9 -36
- package/LineChart/AppearingMask.d.ts +12 -0
- package/LineChart/AppearingMask.js +42 -0
- package/LineChart/formatter.js +5 -5
- package/ResponsiveChartContainer/ResizableContainer.d.ts +1 -1
- package/ResponsiveChartContainer/useResponsiveChartContainerProps.d.ts +1 -1
- package/SparkLineChart/SparkLineChart.d.ts +1 -1
- package/context/CartesianProvider/defaultizeAxis.d.ts +4 -4
- package/context/PluginProvider/mergePlugins.d.ts +6 -6
- package/context/ZAxisContextProvider.js +1 -1
- package/hooks/useReducedMotion.js +2 -2
- package/hooks/useSeries.d.ts +4 -4
- package/hooks/useSeries.js +4 -4
- package/index.js +1 -1
- package/internals/components/AxisSharedComponents.d.ts +1 -1
- package/internals/configInit.d.ts +1 -1
- package/internals/defaultizeColor.d.ts +8 -8
- package/internals/domUtils.js +1 -1
- package/internals/geometry.js +3 -5
- package/internals/getPercentageValue.js +1 -1
- package/models/seriesType/line.d.ts +5 -0
- package/modern/BarChart/formatter.js +5 -4
- package/modern/ChartContainer/useDefaultizeAxis.js +1 -1
- package/modern/ChartsAxis/ChartsAxis.js +4 -4
- package/modern/ChartsLegend/DefaultChartsLegend.js +1 -1
- package/modern/ChartsLegend/LegendPerItem.js +1 -1
- package/modern/ChartsLegend/PiecewiseColorLegend.js +1 -1
- package/modern/LineChart/AnimatedArea.js +9 -45
- package/modern/LineChart/AnimatedLine.js +9 -36
- package/modern/LineChart/AppearingMask.js +42 -0
- package/modern/LineChart/formatter.js +5 -5
- package/modern/context/ZAxisContextProvider.js +1 -1
- package/modern/hooks/useReducedMotion.js +2 -2
- package/modern/hooks/useSeries.js +4 -4
- package/modern/index.js +1 -1
- package/modern/internals/domUtils.js +1 -1
- package/modern/internals/geometry.js +3 -5
- package/modern/internals/getPercentageValue.js +1 -1
- package/node/BarChart/formatter.js +5 -4
- package/node/ChartContainer/useDefaultizeAxis.js +1 -1
- package/node/ChartsAxis/ChartsAxis.js +4 -4
- package/node/ChartsLegend/DefaultChartsLegend.js +1 -1
- package/node/ChartsLegend/LegendPerItem.js +1 -1
- package/node/ChartsLegend/PiecewiseColorLegend.js +1 -1
- package/node/LineChart/AnimatedArea.js +8 -44
- package/node/LineChart/AnimatedLine.js +8 -35
- package/node/LineChart/AppearingMask.js +48 -0
- package/node/LineChart/formatter.js +5 -5
- package/node/context/ZAxisContextProvider.js +1 -1
- package/node/hooks/useReducedMotion.js +2 -2
- package/node/hooks/useSeries.js +4 -4
- package/node/index.js +1 -1
- package/node/internals/domUtils.js +1 -1
- package/node/internals/geometry.js +3 -5
- package/node/internals/getPercentageValue.js +1 -1
- package/package.json +2 -2
|
@@ -1330,7 +1330,7 @@ export declare const LineElementPath: import("@emotion/styled").StyledComponent<
|
|
|
1330
1330
|
scrollTop?: number | import("@react-spring/shared").FluidValue<number, any> | undefined;
|
|
1331
1331
|
scrollLeft?: number | import("@react-spring/shared").FluidValue<number, any> | undefined;
|
|
1332
1332
|
viewBox?: string | import("@react-spring/shared").FluidValue<string, any> | undefined;
|
|
1333
|
-
}, "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" | "suppressHydrationWarning" | "className" | "id" | "lang" | "max" | "media" | "method" | "min" | "name" | "target" | "type" | "role" | "tabIndex" | "crossOrigin" | "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" | "href" | "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" | "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" | "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" | "onPointerLeave" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "key" | "scrollTop" | "scrollLeft"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material
|
|
1333
|
+
}, "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" | "suppressHydrationWarning" | "className" | "id" | "lang" | "max" | "media" | "method" | "min" | "name" | "target" | "type" | "role" | "tabIndex" | "crossOrigin" | "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" | "href" | "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" | "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" | "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" | "onPointerLeave" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "key" | "scrollTop" | "scrollLeft"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
|
|
1334
1334
|
ownerState: LineElementOwnerState;
|
|
1335
1335
|
}, {}, {}>;
|
|
1336
1336
|
export interface AnimatedLineProps extends React.ComponentPropsWithoutRef<'path'> {
|
|
@@ -8,11 +8,9 @@ import PropTypes from 'prop-types';
|
|
|
8
8
|
import { animated, useTransition } from '@react-spring/web';
|
|
9
9
|
import { color as d3Color } from '@mui/x-charts-vendor/d3-color';
|
|
10
10
|
import { styled } from '@mui/material/styles';
|
|
11
|
-
import { cleanId } from "../internals/cleanId.js";
|
|
12
|
-
import { useChartId } from "../hooks/useChartId.js";
|
|
13
|
-
import { useDrawingArea } from "../hooks/useDrawingArea.js";
|
|
14
11
|
import { useStringInterpolator } from "../internals/useStringInterpolator.js";
|
|
15
|
-
import {
|
|
12
|
+
import { AppearingMask } from "./AppearingMask.js";
|
|
13
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
16
14
|
export const LineElementPath = styled(animated.path, {
|
|
17
15
|
name: 'MuiLineElement',
|
|
18
16
|
slot: 'Root',
|
|
@@ -44,22 +42,7 @@ function AnimatedLine(props) {
|
|
|
44
42
|
ownerState
|
|
45
43
|
} = props,
|
|
46
44
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
47
|
-
const drawingArea = useDrawingArea();
|
|
48
|
-
const chartId = useChartId();
|
|
49
45
|
const stringInterpolator = useStringInterpolator(d);
|
|
50
|
-
const transitionAppear = useTransition([drawingArea], {
|
|
51
|
-
from: v => ({
|
|
52
|
-
animatedWidth: v.left
|
|
53
|
-
}),
|
|
54
|
-
enter: v => ({
|
|
55
|
-
animatedWidth: v.width + v.left + v.right
|
|
56
|
-
}),
|
|
57
|
-
leave: v => ({
|
|
58
|
-
animatedWidth: v.width + v.left + v.right
|
|
59
|
-
}),
|
|
60
|
-
reset: false,
|
|
61
|
-
immediate: skipAnimation
|
|
62
|
-
});
|
|
63
46
|
const transitionChange = useTransition([stringInterpolator], {
|
|
64
47
|
from: {
|
|
65
48
|
value: 0
|
|
@@ -73,23 +56,13 @@ function AnimatedLine(props) {
|
|
|
73
56
|
reset: false,
|
|
74
57
|
immediate: skipAnimation
|
|
75
58
|
});
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
width: style.animatedWidth,
|
|
84
|
-
height: drawingArea.top + drawingArea.height + drawingArea.bottom
|
|
85
|
-
}))
|
|
86
|
-
}), /*#__PURE__*/_jsx("g", {
|
|
87
|
-
clipPath: `url(#${clipId})`,
|
|
88
|
-
children: transitionChange((style, interpolator) => /*#__PURE__*/_jsx(LineElementPath, _extends({}, other, {
|
|
89
|
-
ownerState: ownerState,
|
|
90
|
-
d: style.value.to(interpolator)
|
|
91
|
-
})))
|
|
92
|
-
})]
|
|
59
|
+
return /*#__PURE__*/_jsx(AppearingMask, {
|
|
60
|
+
skipAnimation: skipAnimation,
|
|
61
|
+
id: `${ownerState.id}-line-clip`,
|
|
62
|
+
children: transitionChange((style, interpolator) => /*#__PURE__*/_jsx(LineElementPath, _extends({}, other, {
|
|
63
|
+
ownerState: ownerState,
|
|
64
|
+
d: style.value.to(interpolator)
|
|
65
|
+
})))
|
|
93
66
|
});
|
|
94
67
|
}
|
|
95
68
|
process.env.NODE_ENV !== "production" ? AnimatedLine.propTypes = {
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { SeriesId } from '../models/seriesType/common';
|
|
3
|
+
interface AppearingMaskProps {
|
|
4
|
+
id: SeriesId;
|
|
5
|
+
skipAnimation?: boolean;
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* @ignore - internal component.
|
|
10
|
+
*/
|
|
11
|
+
export declare function AppearingMask(props: AppearingMaskProps): React.JSX.Element;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { animated, useTransition } from '@react-spring/web';
|
|
5
|
+
import { cleanId } from "../internals/cleanId.js";
|
|
6
|
+
import { useChartId, useDrawingArea } from "../hooks/index.js";
|
|
7
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
8
|
+
/**
|
|
9
|
+
* @ignore - internal component.
|
|
10
|
+
*/
|
|
11
|
+
export function AppearingMask(props) {
|
|
12
|
+
const drawingArea = useDrawingArea();
|
|
13
|
+
const chartId = useChartId();
|
|
14
|
+
const transitionAppear = useTransition([drawingArea], {
|
|
15
|
+
from: v => ({
|
|
16
|
+
animatedWidth: v.left
|
|
17
|
+
}),
|
|
18
|
+
enter: v => ({
|
|
19
|
+
animatedWidth: v.width + v.left + v.right
|
|
20
|
+
}),
|
|
21
|
+
leave: v => ({
|
|
22
|
+
animatedWidth: v.width + v.left + v.right
|
|
23
|
+
}),
|
|
24
|
+
reset: false,
|
|
25
|
+
immediate: props.skipAnimation
|
|
26
|
+
});
|
|
27
|
+
const clipId = cleanId(`${chartId}-${props.id}`);
|
|
28
|
+
return /*#__PURE__*/_jsxs(React.Fragment, {
|
|
29
|
+
children: [/*#__PURE__*/_jsx("clipPath", {
|
|
30
|
+
id: clipId,
|
|
31
|
+
children: transitionAppear(style => /*#__PURE__*/_jsx(animated.rect, {
|
|
32
|
+
x: 0,
|
|
33
|
+
y: 0,
|
|
34
|
+
width: style.animatedWidth,
|
|
35
|
+
height: drawingArea.top + drawingArea.height + drawingArea.bottom
|
|
36
|
+
}))
|
|
37
|
+
}), /*#__PURE__*/_jsx("g", {
|
|
38
|
+
clipPath: `url(#${clipId})`,
|
|
39
|
+
children: props.children
|
|
40
|
+
})]
|
|
41
|
+
});
|
|
42
|
+
}
|
package/LineChart/formatter.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import { stack as d3Stack } from '@mui/x-charts-vendor/d3-shape';
|
|
3
|
+
import { warnOnce } from '@mui/x-internals/warning';
|
|
3
4
|
import { getStackingGroups } from "../internals/stackSeries.js";
|
|
4
5
|
import { defaultizeValueFormatter } from "../internals/defaultizeValueFormatter.js";
|
|
5
|
-
let warnedOnce = false;
|
|
6
|
-
|
|
7
6
|
// For now it's a copy past of bar charts formatter, but maybe will diverge later
|
|
8
7
|
const formatter = (params, dataset) => {
|
|
9
8
|
const {
|
|
@@ -54,9 +53,10 @@ const formatter = (params, dataset) => {
|
|
|
54
53
|
data: dataKey ? dataset.map(data => {
|
|
55
54
|
const value = data[dataKey];
|
|
56
55
|
if (typeof value !== 'number') {
|
|
57
|
-
if (process.env.NODE_ENV !== 'production'
|
|
58
|
-
|
|
59
|
-
|
|
56
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
57
|
+
if (value !== null) {
|
|
58
|
+
warnOnce([`MUI X: Your dataset key "${dataKey}" is used for plotting line, but contains nonnumerical elements.`, 'Line plots only support numbers and null values.']);
|
|
59
|
+
}
|
|
60
60
|
}
|
|
61
61
|
return null;
|
|
62
62
|
}
|
|
@@ -4,6 +4,6 @@ import type { ResponsiveChartContainerProps } from './ResponsiveChartContainer';
|
|
|
4
4
|
*
|
|
5
5
|
* @ignore - do not document.
|
|
6
6
|
*/
|
|
7
|
-
export declare const ResizableContainer: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material
|
|
7
|
+
export declare const ResizableContainer: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
|
|
8
8
|
ownerState: Pick<ResponsiveChartContainerProps, "width" | "height">;
|
|
9
9
|
}, Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import("react").ClassAttributes<HTMLDivElement> | keyof import("react").HTMLAttributes<HTMLDivElement>>, {}>;
|
|
@@ -4,7 +4,7 @@ export declare const useResponsiveChartContainerProps: (props: ResponsiveChartCo
|
|
|
4
4
|
chartContainerProps: Omit<import("..").ChartsSurfaceProps & Omit<import("../internals").SeriesProviderProps, "seriesFormatters"> & Omit<import("../internals").DrawingProviderProps, "svgRef"> & Pick<import("../internals").CartesianProviderProps, "dataset"> & import("..").ZAxisContextProviderProps & import("..").HighlightedProviderProps & import("../internals").PluginProviderProps, "children"> & {
|
|
5
5
|
xAxis?: import("../internals").MakeOptional<import("..").AxisConfig<import("..").ScaleName, any, import("..").ChartsXAxisProps>, "id">[];
|
|
6
6
|
yAxis?: import("../internals").MakeOptional<import("..").AxisConfig<import("..").ScaleName, any, import("..").ChartsYAxisProps>, "id">[];
|
|
7
|
-
children?:
|
|
7
|
+
children?: React.ReactNode;
|
|
8
8
|
} & {
|
|
9
9
|
ref: React.ForwardedRef<unknown>;
|
|
10
10
|
};
|
|
@@ -4,7 +4,7 @@ import { ChartsTooltipProps, ChartsTooltipSlotProps, ChartsTooltipSlots } from '
|
|
|
4
4
|
import { ChartsAxisHighlightProps } from '../ChartsAxisHighlight';
|
|
5
5
|
import { AxisConfig, ChartsXAxisProps, ChartsYAxisProps, ScaleName } from '../models/axis';
|
|
6
6
|
import { MakeOptional } from '../models/helpers';
|
|
7
|
-
import { LineSeriesType } from '../models/seriesType
|
|
7
|
+
import { LineSeriesType } from '../models/seriesType';
|
|
8
8
|
import { CardinalDirections } from '../models/layout';
|
|
9
9
|
import { AreaPlotSlots, AreaPlotSlotProps } from '../LineChart/AreaPlot';
|
|
10
10
|
import { LinePlotSlots, LinePlotSlotProps } from '../LineChart/LinePlot';
|
|
@@ -9,7 +9,7 @@ export declare const defaultizeAxis: (inAxis: MakeOptional<AxisConfig<ScaleName,
|
|
|
9
9
|
label?: string | undefined;
|
|
10
10
|
max?: (number | Date) | undefined;
|
|
11
11
|
min?: (number | Date) | undefined;
|
|
12
|
-
valueFormatter?: ((value: any, context: import("../../
|
|
12
|
+
valueFormatter?: ((value: any, context: import("../../internals").AxisValueFormatterContext) => string) | undefined;
|
|
13
13
|
dataKey?: string | undefined;
|
|
14
14
|
sx?: import("@mui/system").SxProps | undefined;
|
|
15
15
|
classes?: Partial<import("../..").ChartsAxisClasses> | undefined;
|
|
@@ -24,13 +24,13 @@ export declare const defaultizeAxis: (inAxis: MakeOptional<AxisConfig<ScaleName,
|
|
|
24
24
|
tickLabelInterval?: ("auto" | ((value: any, index: number) => boolean)) | undefined;
|
|
25
25
|
labelFontSize?: number | undefined;
|
|
26
26
|
tickSize?: number | undefined;
|
|
27
|
-
slots?: Partial<import("../../
|
|
28
|
-
slotProps?: Partial<import("../../
|
|
27
|
+
slots?: Partial<import("../../internals").ChartsAxisSlots> | undefined;
|
|
28
|
+
slotProps?: Partial<import("../../internals").ChartsAxisSlotProps> | undefined;
|
|
29
29
|
tickInterval?: ("auto" | ((value: any, index: number) => boolean) | any[]) | undefined;
|
|
30
30
|
tickPlacement?: ("start" | "end" | "middle" | "extremities") | undefined;
|
|
31
31
|
tickLabelPlacement?: ("middle" | "tick") | undefined;
|
|
32
32
|
scaleType?: "linear" | "time" | "log" | "band" | "point" | "pow" | "sqrt" | "utc" | undefined;
|
|
33
33
|
colorMap?: import("../../models/colorMapping").ContinuousColorConfig<number | Date> | import("../../models/colorMapping").PiecewiseColorConfig<number | Date> | import("../../models/colorMapping").OrdinalColorConfig<string | number | Date> | undefined;
|
|
34
34
|
hideTooltip?: boolean | undefined;
|
|
35
|
-
id: import("../../
|
|
35
|
+
id: import("../../internals").AxisId;
|
|
36
36
|
}[];
|
|
@@ -37,10 +37,10 @@ export declare const defaultPlugins: ({
|
|
|
37
37
|
radiusExtremumGetter?: ExtremumGetter<"pie"> | undefined;
|
|
38
38
|
})[];
|
|
39
39
|
export declare function mergePlugins(plugins?: ChartsPlugin<ChartSeriesType>[]): {
|
|
40
|
-
seriesFormatters: SeriesFormatterConfig<keyof import("../../
|
|
41
|
-
colorProcessors: ColorProcessorsConfig<keyof import("../../
|
|
42
|
-
xExtremumGetters: ExtremumGettersConfig<keyof import("../../
|
|
43
|
-
yExtremumGetters: ExtremumGettersConfig<keyof import("../../
|
|
44
|
-
rotationExtremumGetters: ExtremumGettersConfig<keyof import("../../
|
|
45
|
-
radiusExtremumGetters: ExtremumGettersConfig<keyof import("../../
|
|
40
|
+
seriesFormatters: SeriesFormatterConfig<keyof import("../../internals").ChartsSeriesConfig>;
|
|
41
|
+
colorProcessors: ColorProcessorsConfig<keyof import("../../internals").ChartsSeriesConfig>;
|
|
42
|
+
xExtremumGetters: ExtremumGettersConfig<keyof import("../../internals").ChartsSeriesConfig>;
|
|
43
|
+
yExtremumGetters: ExtremumGettersConfig<keyof import("../../internals").ChartsSeriesConfig>;
|
|
44
|
+
rotationExtremumGetters: ExtremumGettersConfig<keyof import("../../internals").ChartsSeriesConfig>;
|
|
45
|
+
radiusExtremumGetters: ExtremumGettersConfig<keyof import("../../internals").ChartsSeriesConfig>;
|
|
46
46
|
};
|
|
@@ -24,7 +24,7 @@ function ZAxisContextProvider(props) {
|
|
|
24
24
|
return axisConfig;
|
|
25
25
|
}
|
|
26
26
|
if (dataset === undefined) {
|
|
27
|
-
throw Error('MUI X: z-axis uses `dataKey` but no `dataset` is provided.');
|
|
27
|
+
throw new Error('MUI X: z-axis uses `dataKey` but no `dataset` is provided.');
|
|
28
28
|
}
|
|
29
29
|
return _extends({}, axisConfig, {
|
|
30
30
|
data: dataset.map(d => d[dataKey])
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import { useIsomorphicLayoutEffect, Globals } from '@react-spring/web';
|
|
4
|
-
const handleMediaChange =
|
|
4
|
+
const handleMediaChange = event => {
|
|
5
5
|
Globals.assign({
|
|
6
6
|
// Modification such the react-spring implementation such that this hook can remove animation but never activate animation.
|
|
7
|
-
skipAnimation:
|
|
7
|
+
skipAnimation: event.matches || undefined
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
10
|
|
package/hooks/useSeries.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ export declare function useSeries(): FormattedSeries;
|
|
|
11
11
|
* The returned object contains:
|
|
12
12
|
* - series: a mapping from ids to series attributes.
|
|
13
13
|
* - seriesOrder: the array of series ids.
|
|
14
|
-
* @returns { series: Record<SeriesId, DefaultizedPieSeriesType>; seriesOrder: SeriesId[]; } | undefined
|
|
14
|
+
* @returns {{ series: Record<SeriesId, DefaultizedPieSeriesType>; seriesOrder: SeriesId[]; } | undefined} pieSeries
|
|
15
15
|
*/
|
|
16
16
|
export declare function usePieSeries(): FormattedSeries['pie'];
|
|
17
17
|
/**
|
|
@@ -19,7 +19,7 @@ export declare function usePieSeries(): FormattedSeries['pie'];
|
|
|
19
19
|
* The returned object contains:
|
|
20
20
|
* - series: a mapping from ids to series attributes.
|
|
21
21
|
* - seriesOrder: the array of series ids.
|
|
22
|
-
* @returns { series: Record<SeriesId, DefaultizedLineSeriesType>; seriesOrder: SeriesId[]; } | undefined
|
|
22
|
+
* @returns {{ series: Record<SeriesId, DefaultizedLineSeriesType>; seriesOrder: SeriesId[]; } | undefined} lineSeries
|
|
23
23
|
*/
|
|
24
24
|
export declare function useLineSeries(): FormattedSeries['line'];
|
|
25
25
|
/**
|
|
@@ -27,7 +27,7 @@ export declare function useLineSeries(): FormattedSeries['line'];
|
|
|
27
27
|
* The returned object contains:
|
|
28
28
|
* - series: a mapping from ids to series attributes.
|
|
29
29
|
* - seriesOrder: the array of series ids.
|
|
30
|
-
* @returns { series: Record<SeriesId, DefaultizedBarSeriesType>; seriesOrder: SeriesId[]; } | undefined
|
|
30
|
+
* @returns {{ series: Record<SeriesId, DefaultizedBarSeriesType>; seriesOrder: SeriesId[]; } | undefined} barSeries
|
|
31
31
|
*/
|
|
32
32
|
export declare function useBarSeries(): FormattedSeries['bar'];
|
|
33
33
|
/**
|
|
@@ -35,6 +35,6 @@ export declare function useBarSeries(): FormattedSeries['bar'];
|
|
|
35
35
|
* The returned object contains:
|
|
36
36
|
* - series: a mapping from ids to series attributes.
|
|
37
37
|
* - seriesOrder: the array of series ids.
|
|
38
|
-
* @returns { series: Record<SeriesId, DefaultizedScatterSeriesType>; seriesOrder: SeriesId[]; } | undefined
|
|
38
|
+
* @returns {{ series: Record<SeriesId, DefaultizedScatterSeriesType>; seriesOrder: SeriesId[]; } | undefined} scatterSeries
|
|
39
39
|
*/
|
|
40
40
|
export declare function useScatterSeries(): FormattedSeries['scatter'];
|
package/hooks/useSeries.js
CHANGED
|
@@ -25,7 +25,7 @@ export function useSeries() {
|
|
|
25
25
|
* The returned object contains:
|
|
26
26
|
* - series: a mapping from ids to series attributes.
|
|
27
27
|
* - seriesOrder: the array of series ids.
|
|
28
|
-
* @returns { series: Record<SeriesId, DefaultizedPieSeriesType>; seriesOrder: SeriesId[]; } | undefined
|
|
28
|
+
* @returns {{ series: Record<SeriesId, DefaultizedPieSeriesType>; seriesOrder: SeriesId[]; } | undefined} pieSeries
|
|
29
29
|
*/
|
|
30
30
|
export function usePieSeries() {
|
|
31
31
|
const series = useSeries();
|
|
@@ -37,7 +37,7 @@ export function usePieSeries() {
|
|
|
37
37
|
* The returned object contains:
|
|
38
38
|
* - series: a mapping from ids to series attributes.
|
|
39
39
|
* - seriesOrder: the array of series ids.
|
|
40
|
-
* @returns { series: Record<SeriesId, DefaultizedLineSeriesType>; seriesOrder: SeriesId[]; } | undefined
|
|
40
|
+
* @returns {{ series: Record<SeriesId, DefaultizedLineSeriesType>; seriesOrder: SeriesId[]; } | undefined} lineSeries
|
|
41
41
|
*/
|
|
42
42
|
export function useLineSeries() {
|
|
43
43
|
const series = useSeries();
|
|
@@ -49,7 +49,7 @@ export function useLineSeries() {
|
|
|
49
49
|
* The returned object contains:
|
|
50
50
|
* - series: a mapping from ids to series attributes.
|
|
51
51
|
* - seriesOrder: the array of series ids.
|
|
52
|
-
* @returns { series: Record<SeriesId, DefaultizedBarSeriesType>; seriesOrder: SeriesId[]; } | undefined
|
|
52
|
+
* @returns {{ series: Record<SeriesId, DefaultizedBarSeriesType>; seriesOrder: SeriesId[]; } | undefined} barSeries
|
|
53
53
|
*/
|
|
54
54
|
export function useBarSeries() {
|
|
55
55
|
const series = useSeries();
|
|
@@ -61,7 +61,7 @@ export function useBarSeries() {
|
|
|
61
61
|
* The returned object contains:
|
|
62
62
|
* - series: a mapping from ids to series attributes.
|
|
63
63
|
* - seriesOrder: the array of series ids.
|
|
64
|
-
* @returns { series: Record<SeriesId, DefaultizedScatterSeriesType>; seriesOrder: SeriesId[]; } | undefined
|
|
64
|
+
* @returns {{ series: Record<SeriesId, DefaultizedScatterSeriesType>; seriesOrder: SeriesId[]; } | undefined} scatterSeries
|
|
65
65
|
*/
|
|
66
66
|
export function useScatterSeries() {
|
|
67
67
|
const series = useSeries();
|
package/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const AxisRoot: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material
|
|
1
|
+
export declare const AxisRoot: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, Pick<import("react").SVGProps<SVGGElement>, keyof import("react").SVGProps<SVGGElement>>, {}>;
|
|
@@ -3,7 +3,7 @@ declare class CartesianSeriesTypes {
|
|
|
3
3
|
types: Set<ChartSeriesType>;
|
|
4
4
|
constructor();
|
|
5
5
|
addType(value: ChartSeriesType): void;
|
|
6
|
-
getTypes(): Set<keyof import("
|
|
6
|
+
getTypes(): Set<keyof import(".").ChartsSeriesConfig>;
|
|
7
7
|
}
|
|
8
8
|
export declare const cartesianSeriesTypes: CartesianSeriesTypes;
|
|
9
9
|
export {};
|
|
@@ -4,7 +4,7 @@ export declare function defaultizeColor(series: AllSeriesType, seriesIndex: numb
|
|
|
4
4
|
color: string;
|
|
5
5
|
label?: (string | ((location: "tooltip" | "legend" | "arc") => string)) | undefined;
|
|
6
6
|
value: number;
|
|
7
|
-
id?: import("
|
|
7
|
+
id?: import("..").PieItemId | undefined;
|
|
8
8
|
}[];
|
|
9
9
|
type: "pie";
|
|
10
10
|
innerRadius?: number | string;
|
|
@@ -14,8 +14,8 @@ export declare function defaultizeColor(series: AllSeriesType, seriesIndex: numb
|
|
|
14
14
|
startAngle?: number;
|
|
15
15
|
endAngle?: number;
|
|
16
16
|
paddingAngle?: number;
|
|
17
|
-
sortingValues?: import("
|
|
18
|
-
arcLabel?: "formattedValue" | "label" | "value" | ((item: Omit<import("
|
|
17
|
+
sortingValues?: import("..").ChartsPieSorting;
|
|
18
|
+
arcLabel?: "formattedValue" | "label" | "value" | ((item: Omit<import("..").DefaultizedPieValueType, "label"> & {
|
|
19
19
|
label?: string;
|
|
20
20
|
}) => string);
|
|
21
21
|
arcLabelMinAngle?: number;
|
|
@@ -41,7 +41,7 @@ export declare function defaultizeColor(series: AllSeriesType, seriesIndex: numb
|
|
|
41
41
|
};
|
|
42
42
|
id?: import(".").SeriesId;
|
|
43
43
|
color?: string;
|
|
44
|
-
valueFormatter?: import(".").SeriesValueFormatter<import(".").MakeOptional<import("
|
|
44
|
+
valueFormatter?: import(".").SeriesValueFormatter<import(".").MakeOptional<import("..").PieValueType, "id">> | undefined;
|
|
45
45
|
highlightScope?: Partial<import("..").HighlightScope>;
|
|
46
46
|
} | {
|
|
47
47
|
type: "bar";
|
|
@@ -62,7 +62,7 @@ export declare function defaultizeColor(series: AllSeriesType, seriesIndex: numb
|
|
|
62
62
|
stackOrder?: import("..").StackOrderType;
|
|
63
63
|
} | {
|
|
64
64
|
type: "scatter";
|
|
65
|
-
data: import("
|
|
65
|
+
data: import("..").ScatterValueType[];
|
|
66
66
|
markerSize?: number;
|
|
67
67
|
label?: string | ((location: "tooltip" | "legend") => string);
|
|
68
68
|
disableHover?: boolean;
|
|
@@ -70,7 +70,7 @@ export declare function defaultizeColor(series: AllSeriesType, seriesIndex: numb
|
|
|
70
70
|
zAxisId?: string;
|
|
71
71
|
id?: import(".").SeriesId;
|
|
72
72
|
color: string;
|
|
73
|
-
valueFormatter?: import(".").SeriesValueFormatter<import("
|
|
73
|
+
valueFormatter?: import(".").SeriesValueFormatter<import("..").ScatterValueType> | undefined;
|
|
74
74
|
highlightScope?: Partial<import("..").HighlightScope>;
|
|
75
75
|
xAxisKey?: string;
|
|
76
76
|
yAxisKey?: string;
|
|
@@ -83,8 +83,8 @@ export declare function defaultizeColor(series: AllSeriesType, seriesIndex: numb
|
|
|
83
83
|
stack?: string;
|
|
84
84
|
area?: boolean;
|
|
85
85
|
label?: string | ((location: "tooltip" | "legend") => string);
|
|
86
|
-
curve?: import("
|
|
87
|
-
showMark?: boolean | ((params: import("
|
|
86
|
+
curve?: import("..").CurveType;
|
|
87
|
+
showMark?: boolean | ((params: import("..").ShowMarkParams) => boolean);
|
|
88
88
|
disableHighlight?: boolean;
|
|
89
89
|
connectNulls?: boolean;
|
|
90
90
|
stackOffset?: import("..").StackOffsetType;
|
package/internals/domUtils.js
CHANGED
package/internals/geometry.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
+
import { warnOnce } from '@mui/x-internals/warning';
|
|
1
2
|
const ANGLE_APPROX = 5; // Angle (in deg) for which we approximate the rectangle as perfectly horizontal/vertical
|
|
2
3
|
|
|
3
|
-
let warnedOnce = false;
|
|
4
|
-
|
|
5
4
|
/**
|
|
6
5
|
* Return the minimal translation along the x-axis to avoid overflow of a rectangle of a given width, height, and rotation.
|
|
7
6
|
* This assumes that all rectangles have the same height and angle between -90 and 90.
|
|
@@ -12,9 +11,8 @@ let warnedOnce = false;
|
|
|
12
11
|
*/
|
|
13
12
|
export function getMinXTranslation(width, height, angle = 0) {
|
|
14
13
|
if (process.env.NODE_ENV !== 'production') {
|
|
15
|
-
if (
|
|
16
|
-
|
|
17
|
-
console.warn([`MUI X: It seems you applied an angle larger than 90° or smaller than -90° to an axis text.`, `This could cause some text overlapping.`, `If you encounter a use case where it's needed, please open an issue.`].join('\n'));
|
|
14
|
+
if (angle > 90 && angle < -90) {
|
|
15
|
+
warnOnce([`MUI X: It seems you applied an angle larger than 90° or smaller than -90° to an axis text.`, `This could cause some text overlapping.`, `If you encounter a use case where it's needed, please open an issue.`]);
|
|
18
16
|
}
|
|
19
17
|
}
|
|
20
18
|
const standardAngle = Math.min(Math.abs(angle) % 180, Math.abs(Math.abs(angle) % 180 - 180) % 180); // Map from R to [0, 90]
|
|
@@ -24,5 +24,5 @@ export function getPercentageValue(value, refValue) {
|
|
|
24
24
|
return val;
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
|
-
throw Error(`MUI X: Received an unknown value "${value}". It should be a number, or a string with a percentage value.`);
|
|
27
|
+
throw new Error(`MUI X: Received an unknown value "${value}". It should be a number, or a string with a percentage value.`);
|
|
28
28
|
}
|
|
@@ -40,6 +40,11 @@ export interface LineSeriesType extends CommonSeriesType<number | null>, Cartesi
|
|
|
40
40
|
* The label to display on the tooltip or the legend. It can be a string or a function.
|
|
41
41
|
*/
|
|
42
42
|
label?: string | ((location: 'tooltip' | 'legend') => string);
|
|
43
|
+
/**
|
|
44
|
+
* The type of curve to use for the line.
|
|
45
|
+
* Read more about curves at [line interpolation](https://mui.com/x/react-charts/lines/#interpolation).
|
|
46
|
+
* @default 'monotoneX'
|
|
47
|
+
*/
|
|
43
48
|
curve?: CurveType;
|
|
44
49
|
/**
|
|
45
50
|
* Define which items of the series should display a mark.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import { stack as d3Stack } from '@mui/x-charts-vendor/d3-shape';
|
|
3
|
+
import { warnOnce } from '@mui/x-internals/warning';
|
|
3
4
|
import { getStackingGroups } from "../internals/stackSeries.js";
|
|
4
5
|
import { defaultizeValueFormatter } from "../internals/defaultizeValueFormatter.js";
|
|
5
|
-
let warnOnce = false;
|
|
6
6
|
const formatter = (params, dataset) => {
|
|
7
7
|
const {
|
|
8
8
|
seriesOrder,
|
|
@@ -50,9 +50,10 @@ const formatter = (params, dataset) => {
|
|
|
50
50
|
data: dataKey ? dataset.map(data => {
|
|
51
51
|
const value = data[dataKey];
|
|
52
52
|
if (typeof value !== 'number') {
|
|
53
|
-
if (process.env.NODE_ENV !== 'production'
|
|
54
|
-
|
|
55
|
-
|
|
53
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
54
|
+
if (value !== null) {
|
|
55
|
+
warnOnce([`MUI X: your dataset key "${dataKey}" is used for plotting bars, but contains nonnumerical elements.`, 'Bar plots only support numbers and null values.']);
|
|
56
|
+
}
|
|
56
57
|
}
|
|
57
58
|
return 0;
|
|
58
59
|
}
|
|
@@ -18,7 +18,7 @@ const defaultizeAxis = (inAxis, dataset, axisName) => {
|
|
|
18
18
|
return axisConfig;
|
|
19
19
|
}
|
|
20
20
|
if (dataset === undefined) {
|
|
21
|
-
throw Error(`MUI X: ${axisName}-axis uses \`dataKey\` but no \`dataset\` is provided.`);
|
|
21
|
+
throw new Error(`MUI X: ${axisName}-axis uses \`dataKey\` but no \`dataset\` is provided.`);
|
|
22
22
|
}
|
|
23
23
|
return _extends({}, axisConfig, {
|
|
24
24
|
data: dataset.map(d => d[dataKey])
|
|
@@ -59,16 +59,16 @@ function ChartsAxis(props) {
|
|
|
59
59
|
const topId = getAxisId(topAxis, xAxisIds[0]);
|
|
60
60
|
const rightId = getAxisId(rightAxis, yAxisIds[0]);
|
|
61
61
|
if (topId !== null && !xAxis[topId]) {
|
|
62
|
-
throw Error([`MUI X: id used for top axis "${topId}" is not defined.`, `Available ids are: ${xAxisIds.join(', ')}.`].join('\n'));
|
|
62
|
+
throw new Error([`MUI X: id used for top axis "${topId}" is not defined.`, `Available ids are: ${xAxisIds.join(', ')}.`].join('\n'));
|
|
63
63
|
}
|
|
64
64
|
if (leftId !== null && !yAxis[leftId]) {
|
|
65
|
-
throw Error([`MUI X: id used for left axis "${leftId}" is not defined.`, `Available ids are: ${yAxisIds.join(', ')}.`].join('\n'));
|
|
65
|
+
throw new Error([`MUI X: id used for left axis "${leftId}" is not defined.`, `Available ids are: ${yAxisIds.join(', ')}.`].join('\n'));
|
|
66
66
|
}
|
|
67
67
|
if (rightId !== null && !yAxis[rightId]) {
|
|
68
|
-
throw Error([`MUI X: id used for right axis "${rightId}" is not defined.`, `Available ids are: ${yAxisIds.join(', ')}.`].join('\n'));
|
|
68
|
+
throw new Error([`MUI X: id used for right axis "${rightId}" is not defined.`, `Available ids are: ${yAxisIds.join(', ')}.`].join('\n'));
|
|
69
69
|
}
|
|
70
70
|
if (bottomId !== null && !xAxis[bottomId]) {
|
|
71
|
-
throw Error([`MUI X: id used for bottom axis "${bottomId}" is not defined.`, `Available ids are: ${xAxisIds.join(', ')}.`].join('\n'));
|
|
71
|
+
throw new Error([`MUI X: id used for bottom axis "${bottomId}" is not defined.`, `Available ids are: ${xAxisIds.join(', ')}.`].join('\n'));
|
|
72
72
|
}
|
|
73
73
|
const topAxisProps = mergeProps(topAxis, slots, slotProps);
|
|
74
74
|
const bottomAxisProps = mergeProps(bottomAxis, slots, slotProps);
|
|
@@ -26,7 +26,7 @@ function DefaultChartsLegend(props) {
|
|
|
26
26
|
}
|
|
27
27
|
return /*#__PURE__*/_jsx(LegendPerItem, _extends({}, other, {
|
|
28
28
|
itemsToDisplay: seriesToDisplay,
|
|
29
|
-
onItemClick: onItemClick ? (
|
|
29
|
+
onItemClick: onItemClick ? (event, i) => onItemClick(event, seriesContextBuilder(seriesToDisplay[i]), i) : undefined
|
|
30
30
|
}));
|
|
31
31
|
}
|
|
32
32
|
process.env.NODE_ENV !== "production" ? DefaultChartsLegend.propTypes = {
|
|
@@ -122,7 +122,7 @@ export function LegendPerItem(props) {
|
|
|
122
122
|
markGap: markGap,
|
|
123
123
|
labelStyle: labelStyle,
|
|
124
124
|
classes: classes,
|
|
125
|
-
onClick: onItemClick ?
|
|
125
|
+
onClick: onItemClick ? event => onItemClick(event, i) : undefined
|
|
126
126
|
})))
|
|
127
127
|
})
|
|
128
128
|
});
|
|
@@ -80,7 +80,7 @@ function PiecewiseColorLegend(props) {
|
|
|
80
80
|
}).filter(notNull);
|
|
81
81
|
return /*#__PURE__*/_jsx(LegendPerItem, _extends({}, other, {
|
|
82
82
|
itemsToDisplay: itemsToDisplay,
|
|
83
|
-
onItemClick: onItemClick ? (
|
|
83
|
+
onItemClick: onItemClick ? (event, i) => onItemClick(event, piecewiseColorContextBuilder(itemsToDisplay[i]), i) : undefined
|
|
84
84
|
}));
|
|
85
85
|
}
|
|
86
86
|
process.env.NODE_ENV !== "production" ? PiecewiseColorLegend.propTypes = {
|