UNPKG

@mui/x-charts

Version:

The community edition of the charts components (MUI X).

58 lines (57 loc) 1.89 kB
import * as React from 'react'; import { AxisConfig, AxisDefaultized } from '../models/axis'; import { DEFAULT_X_AXIS_KEY } from '../constants'; import { DatasetType } from '../models/seriesType/config'; import { MakeOptional } from '../models/helpers'; export type CartesianContextProviderProps = { /** * The configuration of the x-axes. * If not provided, a default axis config is used with id set to `DEFAULT_X_AXIS_KEY`. */ xAxis?: MakeOptional<AxisConfig, 'id'>[]; /** * The configuration of the y-axes. * If not provided, a default axis config is used with id set to `DEFAULT_Y_AXIS_KEY`. */ yAxis?: MakeOptional<AxisConfig, 'id'>[]; /** * An array of objects that can be used to populate series and axes data using their `dataKey` property. */ dataset?: DatasetType; children: React.ReactNode; }; type DefaultizedAxisConfig = { [axisKey: string]: AxisDefaultized; }; export declare const CartesianContext: React.Context<{ /** * Mapping from x-axis key to scaling configuration. */ xAxis: { DEFAULT_X_AXIS_KEY: AxisDefaultized; } & DefaultizedAxisConfig; /** * Mapping from y-axis key to scaling configuration. */ yAxis: { DEFAULT_X_AXIS_KEY: AxisDefaultized; } & DefaultizedAxisConfig; /** * The x-axes IDs sorted by order they got provided. */ xAxisIds: string[]; /** * The y-axes IDs sorted by order they got provided. */ yAxisIds: string[]; }>; /** * API: * * - [CartesianContextProvider API](https://mui.com/x/api/charts/cartesian-context-provider/) */ declare function CartesianContextProvider({ xAxis: inXAxis, yAxis: inYAxis, dataset, children, }: CartesianContextProviderProps): React.JSX.Element; declare namespace CartesianContextProvider { var propTypes: any; } export { CartesianContextProvider };