@ansible/react-json-chart-builder
Version:
A chart builder component in react, which uses JSON for schema.
23 lines (22 loc) • 1.24 kB
TypeScript
import { ChartTooltipProps } from '@patternfly/react-charts/victory';
import React, { SyntheticEvent, FunctionComponent } from 'react';
export { ChartLabelFormatFunctionNames } from './labelFormat';
export { ChartAxisFormatFunctionNames } from './axisFormat';
export { ChartOnClickFunctionNames } from './onClick';
export { ChartTooltipComponentFunctionNames } from './tooltip';
export type ChartOnClickFunction = (event: SyntheticEvent<any, Event>, props: Record<string, any>) => any;
export type ChartAxisFormatFunction = (tick: string | number) => string;
export type ChartLabelFormatFunction = (data: {
datum: Record<string, any>;
}) => string;
export type ChartTooltipComponentFunction = FunctionComponent<ChartTooltipProps>;
export type ChartStyleFunction = (props: any) => any;
export type ChartDataComponentFunction = React.ElementType;
export interface ChartFunctions {
onClick?: Record<string, ChartOnClickFunction>;
axisFormat?: Record<string, ChartAxisFormatFunction>;
labelFormat?: Record<string, ChartLabelFormatFunction>;
tooltipComponent?: Record<string, ChartTooltipComponentFunction>;
style?: Record<string, ChartStyleFunction>;
dataComponent?: Record<string, ChartDataComponentFunction>;
}