pagamio-frontend-commons-lib
Version:
Pagamio library for Frontend reusable components like the form engine and table container
60 lines (59 loc) • 2.17 kB
TypeScript
import type { QueryProps } from 'src/shared/types';
import type { ColumnProps } from '../components/ChartDetailsModal';
import type { ChartToolTipProps, DistributionChartTooltip, DistributionQueryProps, TableColumn, TooltipField } from '../types';
interface StatisticsQueryData {
query: QueryProps;
valueKey: string;
previousValueKey?: string;
changeKey: string;
title: string;
format?: string;
}
interface PieChartProps<TData extends {
id: string | number;
}> {
options?: Record<string, unknown>;
title: string;
colors?: string[];
chartDetails?: {
columns: ColumnProps[];
data: Record<string, unknown>[];
};
url?: string;
query: QueryProps;
nameKey: string;
valueKey: string;
otherKey?: string;
chartToolTip?: ChartToolTipProps;
tooltipValueFormat: string;
tooltipTitle?: string;
tooltipUnit?: string;
tooltipAdditionalFields?: (string | TooltipField)[];
currencyDisplaySymbol?: string;
metricDetailData: {
title: string;
statisticsUrl?: string;
topFiveChartTitle: string;
bottomFiveChartTitle: string;
itemStatisticsQuery: StatisticsQueryData;
valueMetricsQuery: StatisticsQueryData;
averageMetricsQuery: StatisticsQueryData;
distributionMetricsQuery: DistributionQueryProps;
yAxisDataNameKey: string;
xAxisNameKey: string;
xAxisLabel: string;
yAxisLabel: string;
nameKey: string;
valueKey: string;
dataGridSearchKey: string;
dataGridColumns: TableColumn<TData>[];
dataSearchInputPlaceHolder: string;
detailsTableTitle?: string;
distributionChartTooltip: DistributionChartTooltip;
};
showDetailsModal?: boolean;
}
declare const PieChart: <TData extends {
id: string | number;
}>({ url, metricDetailData, nameKey, valueKey, query, otherKey, options, title, colors, tooltipValueFormat, tooltipTitle, tooltipUnit, tooltipAdditionalFields, currencyDisplaySymbol, chartToolTip, showDetailsModal, ...props }: PieChartProps<TData>) => import("react/jsx-runtime").JSX.Element;
export default PieChart;