UNPKG

@patternfly/react-charts

Version:

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

182 lines • 7.49 kB
/// <reference types="react" /> import { OrientationTypes, StringOrNumberOrCallback } from 'victory-core'; import { ChartLegendProps } from '../ChartLegend/ChartLegend'; import { ChartThemeDefinition } from '../ChartTheme/ChartTheme'; interface ChartCursorTooltipCenterOffsetInterface { offsetCursorDimensionX?: boolean; offsetCursorDimensionY?: boolean; theme?: ChartThemeDefinition; } interface ChartCursorTooltipPoniterOrientationInterface { horizontal?: boolean; theme?: ChartThemeDefinition; } interface ChartLegendTooltipFlyoutInterface { legendData: any; legendOrientation?: 'horizontal' | 'vertical'; legendProps?: any; minSpacing?: number; text?: StringOrNumberOrCallback | string[] | number[]; theme: ChartThemeDefinition; } interface ChartLegendTooltipVisibleDataInterface { activePoints?: any[]; colorScale?: string[]; legendData: any; patternScale?: string[]; text?: StringOrNumberOrCallback | string[] | number[]; textAsLegendData?: boolean; theme: ChartThemeDefinition; } interface ChartLegendTooltipVisibleTextInterface { activePoints?: any[]; legendData: any; text: StringOrNumberOrCallback | string[] | number[]; } /** * When using a cursor container, the tooltip can be offset from the cursor point. If offsetCursorDimensionX is true, * the tooltip will appear to the right the vertical cursor. If offsetCursorDimensionY is true, the tooltip will appear * above the vertical cursor. * * @private Not intended as public API and subject to change */ export declare const getCursorTooltipCenterOffset: ({ offsetCursorDimensionX, offsetCursorDimensionY, theme }: ChartCursorTooltipCenterOffsetInterface) => { x: number | (({ center, flyoutWidth, width }: any) => number); y: number | (({ center, flyoutHeight, width }: any) => number); }; /** * When using a cursor container, the tooltip pointer orientation can be adjusted as the cursor approaches the edge of * the chart. If horizontal is true, the tooltip pointer will either be 'left' or 'right'. If horizontal is true, the * tooltip pointer will either be 'top' or 'bottom'. * * @private Not intended as public API and subject to change */ export declare const getCursorTooltipPoniterOrientation: ({ horizontal, theme }: ChartCursorTooltipPoniterOrientationInterface) => ((props: any) => OrientationTypes); /** * Returns props associated with legend data * * @private Not intended as public API and subject to change */ export declare const getLegendTooltipDataProps: (props: ChartLegendProps) => { borderPadding: number; gutter: number; orientation: string; padding: number; rowGutter: number; style: { labels: { fill: any; lineHeight: number; padding: number; }; title: { fill: any; padding: number; }; }; } & { borderComponent?: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>; borderPadding?: import("victory-core").PaddingProps; centerTitle?: boolean; colorScale?: string[]; containerComponent?: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>; data?: { name?: string; labels?: { fill?: string; }; symbol?: { fill?: string; type?: string; }; }[]; dataComponent?: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>; eventKey?: string[] | StringOrNumberOrCallback; events?: import("victory-core").EventPropTypeInterface<import("victory-legend").VictoryLegendTTargetType, StringOrNumberOrCallback>[]; externalEventMutations?: import("victory-core").EventCallbackInterface<string | string[], import("victory-core").StringOrNumberOrList>[]; groupComponent?: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>; gutter?: number | { left: number; right: number; }; itemsPerRow?: number; labelComponent?: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>; name?: string; orientation?: import("victory-legend").VictoryLegendOrientationType; padding?: import("victory-core").PaddingProps; patternScale?: string[]; responsive?: boolean; rowGutter?: number | Omit<import("victory-core").BlockProps, "left" | "right">; sharedEvents?: { events: any[]; getEventState: Function; }; standalone?: boolean; style?: import("victory-core").VictoryStyleInterface & { title?: import("victory-core").VictoryLabelStyleObject | import("victory-core").VictoryLabelStyleObject[]; }; symbolSpacer?: number; theme?: import("../ChartTheme/ChartTheme").ChartThemeDefinitionInterface; themeColor?: string; title?: string | string[]; titleComponent?: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>; titleOrientation?: OrientationTypes; width?: number; x?: number; y?: number; animate?: boolean | import("victory-core").AnimatePropTypeInterface; disableInlineStyles?: boolean; domainPadding?: import("victory-core").ForAxes<import("victory-core").PaddingType>; height?: number; horizontal?: boolean; maxDomain?: number | { x?: number; y?: number; }; minDomain?: number | { x?: number; y?: number; }; origin?: import("victory-core").OriginType; polar?: boolean; range?: import("victory-core").ForAxes<import("victory-core").RangeTuple>; scale?: import("victory-core").ScaleName | import("victory-core").D3Scale<any> | { x?: import("victory-core").ScaleName | import("victory-core").D3Scale<any>; y?: import("victory-core").ScaleName | import("victory-core").D3Scale<any>; }; singleQuadrantDomainPadding?: boolean | { x?: boolean; y?: boolean; }; categories?: import("victory-core").CategoryPropType; domain?: import("victory-core").ForAxes<import("victory-core").DomainTuple>; samples?: number; sortKey?: import("victory-core").DataGetterPropType; sortOrder?: import("victory-core").SortOrderPropType; y0?: import("victory-core").DataGetterPropType; label?: string | ((data: any) => string | number); }; /** * Returns the legend height and width * * @private Not intended as public API and subject to change */ export declare const getLegendTooltipSize: ({ legendData, legendOrientation, legendProps, minSpacing, text, theme }: ChartLegendTooltipFlyoutInterface) => { height: any; width: any; }; /** * Returns visible legend data, while syncing color scale. If textAsLegendData is true, the text prop is used as * legend data so y values can be passed individually to the label component * * @private Not intended as public API and subject to change */ export declare const getLegendTooltipVisibleData: ({ activePoints, colorScale, legendData, patternScale, text, textAsLegendData, theme }: ChartLegendTooltipVisibleDataInterface) => any[]; /** * Returns visible text for interactive legends * * @private Not intended as public API and subject to change */ export declare const getLegendTooltipVisibleText: ({ activePoints, legendData, text }: ChartLegendTooltipVisibleTextInterface) => string[] | number[]; export {}; //# sourceMappingURL=chart-tooltip.d.ts.map