UNPKG

@mui/x-charts

Version:

The community edition of MUI X Charts components.

56 lines 2.13 kB
import * as React from 'react'; import { SxProps, Theme } from '@mui/material/styles'; import { AppendKeys } from '@mui/x-internals/types'; import { ColorLegendSelector } from "./colorLegend.types.js"; import { ChartsLabelGradientProps } from "../ChartsLabel/ChartsLabelGradient.js"; import { Direction } from "./direction.js"; import { ContinuousColorLegendClasses } from "./continuousColorLegendClasses.js"; type LabelFormatter = (params: { value: number | Date; formattedValue: string; }) => string; export interface ContinuousColorLegendProps extends ColorLegendSelector, AppendKeys<Pick<ChartsLabelGradientProps, 'rotate'>, 'gradient'>, Pick<ChartsLabelGradientProps, 'thickness'> { /** * The direction of the legend layout. * @default 'horizontal' */ direction?: Direction; /** * The label to display at the minimum side of the gradient. * Can either be a string, or a function. * @default formattedValue */ minLabel?: string | LabelFormatter; /** * The label to display at the maximum side of the gradient. * Can either be a string, or a function. * If not defined, the formatted maximal value is display. * @default formattedValue */ maxLabel?: string | LabelFormatter; /** * The id for the gradient to use. * If not provided, it will use the generated gradient from the axis configuration. * The `gradientId` will be used as `fill="url(#gradientId)"`. * @default auto-generated id */ gradientId?: string; /** * Where to position the labels relative to the gradient. * @default 'end' */ labelPosition?: 'start' | 'end' | 'extremes'; /** * If `true`, the gradient and labels will be reversed. * @default false */ reverse?: boolean; /** * Override or extend the styles applied to the component. */ classes?: Partial<ContinuousColorLegendClasses>; className?: string; sx?: SxProps<Theme>; } declare const ContinuousColorLegend: React.ForwardRefExoticComponent<ContinuousColorLegendProps & import("./chartsLegend.types.js").ChartsLegendSlotExtension & React.RefAttributes<{}>>; export { ContinuousColorLegend };