UNPKG

recharts

Version:
30 lines (29 loc) • 1.83 kB
import { DataKey } from '../util/types'; import { RechartsTheme } from './RechartsTheme'; import { ColorGraphicalItemStyle } from './themeFill'; import type { RechartsFill } from '../fill/RechartsFill'; type GraphicalItemThemeSelector = (theme: RechartsTheme) => ColorGraphicalItemStyle | undefined; /** * Creates a theme selector for a graphical item using all dataKeys registered in the current chart. * * Theme colors never mix with user-provided colors. * If the graphical item sets its own fill or stroke, the selector returns the theme entry without its fill and stroke. * The item keeps the rest of its theme entry, including the `active` and `label` styles. * The `active` styles keep their colors here, `useThemedActiveStyles` removes them. * * A fill object in the theme entry counts by its `color`. Graphical items that draw the fill object * read it with {@link useGraphicalItemThemeFill}. * * @param dataKey effective dataKey of the graphical item, see {@link useEffectiveDataKey} * @param explicitProps props as provided by the user, before merging with theme or defaults */ export declare function useGraphicalItemIdentity(dataKey: DataKey<unknown> | undefined, explicitProps: object): GraphicalItemThemeSelector; /** * Returns the fill object of the theme entry of a graphical item, or undefined if the theme entry fills with a color. * A graphical item that sets its own fill or stroke gets undefined, the same as with {@link useGraphicalItemIdentity}. * * @param dataKey effective dataKey of the graphical item, see {@link useEffectiveDataKey} * @param explicitProps props as provided by the user, before merging with theme or defaults */ export declare function useGraphicalItemThemeFill(dataKey: DataKey<unknown> | undefined, explicitProps: object): RechartsFill | undefined; export {};