UNPKG

@mui/x-charts

Version:

The community edition of MUI X Charts components.

44 lines 2.48 kB
import { type ChartDrawingArea } from "../../../../hooks/useDrawingArea.mjs"; import { type AllSeriesType } from "../../../../models/seriesType/index.mjs"; import { type ChartSeriesType, type DatasetType } from "../../../../models/seriesType/config.mjs"; import { type ChartSeriesConfig } from "../useChartSeriesConfig/index.mjs"; import { type DefaultizedSeriesGroups, type ProcessedSeries, type SeriesIdToType, type SeriesLayout } from "./useChartSeries.types.mjs"; import type { IsItemVisibleFunction } from "../../featurePlugins/useChartVisibilityManager/index.mjs"; /** * This method groups series by type and adds defaultized values such as the ids and colors. * It does NOT apply the series processors - that happens in a selector. * @param series The array of series provided by the developer * @param colors The color palette used to defaultize series colors * @returns An object structuring all the series by type with default values. */ export declare const defaultizeSeries: <SeriesType extends ChartSeriesType>({ series, colors, theme, seriesConfig }: { series: Readonly<AllSeriesType<SeriesType>[]>; colors: readonly string[]; theme: "light" | "dark"; seriesConfig: ChartSeriesConfig<SeriesType>; }) => { defaultizedSeries: DefaultizedSeriesGroups<SeriesType>; idToType: SeriesIdToType; }; /** * Applies series processors to the defaultized series groups. * This should be called in a selector to compute processed series on-demand. * @param defaultizedSeries The defaultized series groups * @param seriesConfig The series configuration * @param dataset The optional dataset * @returns Processed series with all transformations applied */ export declare const applySeriesProcessors: <SeriesType extends ChartSeriesType>(defaultizedSeries: DefaultizedSeriesGroups<SeriesType>, seriesConfig: ChartSeriesConfig<SeriesType>, dataset?: Readonly<DatasetType>, isItemVisible?: IsItemVisibleFunction) => ProcessedSeries<SeriesType>; /** * Applies series processors with drawing area to series if defined. * @param processedSeries The processed series groups * @param seriesConfig The series configuration * @param drawingArea The drawing area * @returns Processed series with all transformations applied */ export declare const applySeriesLayout: <SeriesType extends ChartSeriesType>(processedSeries: ProcessedSeries<SeriesType>, seriesConfig: ChartSeriesConfig<SeriesType>, drawingArea: ChartDrawingArea) => SeriesLayout<SeriesType>;