@pagamio/frontend-commons-lib
Version:
Pagamio library for Frontend reusable components like the form engine and table container
80 lines (79 loc) • 2.73 kB
TypeScript
import type { QueryProps } from 'src/shared/types';
import type { ChartToolTipProps, DistributionQueryProps, StatisticsQueryProps, TableColumn } from '../types';
interface HeatmapChartProps<TData extends {
id: string | number;
}> {
title?: string;
url?: string;
query: QueryProps;
xAxisKey: string;
yAxisKey: string;
valueKey: string;
colorRange?: [string, string];
tooltipTitle?: string;
tooltipUnit?: string;
visualMapLabels?: [string, string];
visualMapRange?: [number, number];
visualMapConfig?: {
min?: number;
max?: number;
calculable?: boolean;
orient?: 'horizontal' | 'vertical';
left?: string | number;
right?: string | number;
top?: string | number;
bottom?: string | number;
show?: boolean;
precision?: number;
text?: [string, string];
textStyle?: {
color?: string;
fontSize?: number;
};
inRange?: {
color?: string[];
opacity?: number[];
};
};
grid?: {
top?: number | string;
bottom?: number | string;
left?: number | string;
right?: number | string;
};
showSplitArea?: boolean;
splitAreaConfig?: {
show?: boolean;
areaStyle?: {
color?: string[];
opacity?: number;
};
};
xAxisLabelFormatter?: (label: string) => string;
yAxisLabelFormatter?: (label: string) => string;
transformData?: (data: any[], xAxisKey: string, yAxisKey: string, valueKey: string) => {
xAxis: string[];
yAxis: string[];
data: [number, number, number][];
};
metricDetailData?: {
statisticsUrl?: string;
title: string;
itemStatisticsQuery: StatisticsQueryProps;
valueMetricsQuery: StatisticsQueryProps;
averageMetricsQuery: StatisticsQueryProps;
distributionMetricsQuery: DistributionQueryProps;
nameKey: string;
valueKey: string;
dataGridSearchKey: string;
dataGridColumns: TableColumn<TData>[];
dataSearchInputPlaceHolder: string;
chartToolTip?: ChartToolTipProps;
detailsTableTitle?: string;
};
showDetailsModal?: boolean;
}
declare const HeatmapChart: <TData extends {
id: string | number;
}>({ title, url, query, xAxisKey, yAxisKey, valueKey, colorRange, tooltipTitle, tooltipUnit, visualMapLabels, visualMapRange, visualMapConfig, grid, showSplitArea, splitAreaConfig, xAxisLabelFormatter, yAxisLabelFormatter, transformData, metricDetailData, showDetailsModal, }: HeatmapChartProps<TData>) => import("react/jsx-runtime").JSX.Element;
export default HeatmapChart;