import { Dataset } from "../core/dataset"; import { IAccessor } from "../core/interfaces"; import { MemoizedFunction } from "lodash"; import * as Utils from "./"; export declare type GenericStackedDatum = { value: number; offset: number; axisValue: D; originalDatum: any; originalIndex: number; originalDataset: Dataset; }; export declare type StackExtent = { extent: number; axisValue: D; stackedDatum: GenericStackedDatum; }; export declare type StackedDatum = GenericStackedDatum; /** * Option type for stacking direction. By default, stacked bar and area charts * put the first data series at the bottom of the axis ("bottomup"), but this * can be reversed with the "topdown" option, which produces a stacking order * that matches the order of series in the legend. */ export declare const IStackingOrder: { topdown: "topdown"; bottomup: "bottomup"; }; export declare type IStackingOrder = keyof typeof IStackingOrder; export declare type GenericStackingResult = Utils.Map>>; /** * Map of Dataset to stacks. * @deprecated */ export declare type StackingResult = GenericStackingResult; /** * Computes the StackingResult (value and offset) for each data point in each Dataset. * * @param {Dataset[]} datasets The Datasets to be stacked on top of each other in the order of stacking * @param {Accessor} keyAccessor Accessor for the key of the data * @param {Accessor} valueAccessor Accessor for the value of the data * @param {IStackingOrder} stackingOrder The order of stacking (default "bottomup") * @return {StackingResult} value and offset for each datapoint in each Dataset */ export declare function stack(datasets: Dataset[], keyAccessor: IAccessor, valueAccessor: IAccessor, stackingOrder?: IStackingOrder): StackingResult; /** * Computes the maximum and minimum extents of each stack individually. * * @param {GenericStackingResult} stackingResult The value and offset information for each datapoint in each dataset * @return { { maximumExtents: Utils.Map, minimumExtents: Utils.Map } } The maximum and minimum extents * of each individual stack. */ export declare function stackedExtents(stackingResult: GenericStackingResult): { maximumExtents: Utils.Map>; minimumExtents: Utils.Map>; }; /** * Computes the total extent over all data points in all Datasets, taking stacking into consideration. * * @param {StackingResult} stackingResult The value and offset information for each datapoint in each dataset * @param {Accessor} keyAccessor Accessor for the key of the data existent in the stackingResult * @param {Accessor} filter A filter for data to be considered when computing the total extent * @return {[number, number]} The total extent */ export declare function stackedExtent(stackingResult: StackingResult, keyAccessor: IAccessor, filter: IAccessor): number[]; /** * Normalizes a key used for stacking * * @param {any} key The key to be normalized * @return {string} The stringified key */ export declare const normalizeKey: ((key: any) => string) & MemoizedFunction;