refactor(FE): Use chart_data for Uniformity and add week nav

This commit is contained in:
rstubryan
2026-01-08 10:17:31 +07:00
parent 662dec38bc
commit b3c4a438ad
3 changed files with 88 additions and 102 deletions
+19 -13
View File
@@ -2,26 +2,32 @@ import { BaseMetadata } from '@/types/api/api-general';
import { BaseApproval } from '@/types/api/approval/approval';
// ==================== CHART DATA TYPES ====================
export type WeightDistributionData = {
weight: number;
count: number;
export type WeightDistributionRange = {
range: string;
min_weight: number;
max_weight: number;
bird_count: number;
is_ideal_range: boolean;
};
export type IdealRange = {
min_weight: number;
max_weight: number;
total_ideal_birds: number;
};
export type StatisticsData = {
mean: number;
standardDeviation: number;
min: number;
max: number;
min_weight: number;
max_weight: number;
average_weight: number;
total_birds_measured: number;
};
export type WeekBarChartData = {
has_data: boolean;
weight_distribution: WeightDistributionData[];
ideal_range: {
min: number;
max: number;
} | null;
statistics: StatisticsData | null;
weight_distribution: WeightDistributionRange[];
ideal_range: IdealRange;
statistics: StatisticsData;
};
export type BarChart = {