UNPKG

@patternfly/react-charts

Version:

This library provides a set of React chart components for use with the PatternFly reference implementation.

104 lines 4.03 kB
import { PaddingProps } from 'victory-core'; import { ChartLegendProps } from '../ChartLegend'; import { ChartThemeDefinition } from '../ChartTheme'; import * as React from 'react'; interface ChartLegendInterface { allowWrap?: boolean; chartType?: string; colorScale?: any; dx?: number; dy?: number; height: number; legendComponent: React.ReactElement<any>; orientation?: 'horizontal' | 'vertical'; padding: PaddingProps; patternScale?: string[]; position: 'bottom' | 'bottom-left' | 'right'; theme: ChartThemeDefinition; width: number; } interface ChartLegendDimensionsInterface { legendData: any[]; legendOrientation: 'horizontal' | 'vertical'; legendProps: ChartLegendProps; theme: ChartThemeDefinition; } interface ChartLegendPositionInterface { chartType?: string; dx?: number; dy?: number; height?: number; legendData: any[]; legendOrientation: 'horizontal' | 'vertical'; legendPosition: 'bottom' | 'bottom-left' | 'right'; legendProps: any; padding?: PaddingProps; theme: ChartThemeDefinition; width?: number; } interface ChartLegendTextMaxSizeInterface { legendData: any[]; theme: ChartThemeDefinition; } /** * Returns a legend which has been positioned per the given chart properties * @private */ export declare const getComputedLegend: ({ allowWrap, chartType, colorScale, dx, dy, height, legendComponent, padding, patternScale, position, theme, width, orientation }: ChartLegendInterface) => React.ReactElement<any, string | React.JSXElementConstructor<any>>; /** * Returns legend dimensions * @private */ export declare const getLegendDimensions: ({ legendData, legendOrientation, legendProps, theme }: ChartLegendDimensionsInterface) => any; /** * Returns true if the legend is smaller than its container * @private */ export declare const doesLegendFit: ({ dx, height, legendPosition, legendData, legendOrientation, legendProps, padding, theme, width }: ChartLegendPositionInterface) => boolean; /** * Returns the number of legend items per row * @private */ export declare const getLegendItemsPerRow: ({ dx, height, legendPosition, legendData, legendOrientation, legendProps, padding, theme, width }: ChartLegendPositionInterface) => number; /** * Returns x coordinate for legend * @private */ export declare const getLegendX: ({ chartType, ...rest }: ChartLegendPositionInterface) => any; /** * Returns y coordinate for legend * @private */ export declare const getLegendY: ({ chartType, ...rest }: ChartLegendPositionInterface) => any; /** * Returns y coordinate for bullet legends * @private */ export declare const getBulletLegendY: ({ dy, height, legendPosition, legendData, legendOrientation, legendProps, padding, theme, width }: ChartLegendPositionInterface) => number; /** * Returns x coordinate for chart legends * @private */ export declare const getChartLegendX: ({ dx, height, legendData, legendOrientation, legendPosition, legendProps, padding, theme, width }: ChartLegendPositionInterface) => any; /** * Returns y coordinate for chart legends * @private */ export declare const getChartLegendY: ({ dy, height, legendPosition, legendData, legendOrientation, legendProps, padding, theme, width }: ChartLegendPositionInterface) => any; /** * Returns x coordinate for pie legends * @private */ export declare const getPieLegendX: ({ dx, height, legendData, legendOrientation, legendPosition, legendProps, padding, theme, width }: ChartLegendPositionInterface) => any; /** * Returns y coordinate for pie legends * @private */ export declare const getPieLegendY: ({ dy, height, legendPosition, legendData, legendOrientation, legendProps, padding, theme, width }: ChartLegendPositionInterface) => any; /** * Returns an approximation of longest text width based on legend styles * @private */ export declare const getMaxLegendTextSize: ({ legendData, theme }: ChartLegendTextMaxSizeInterface) => any; export {}; //# sourceMappingURL=chart-legend.d.ts.map