diff --git a/package-lock.json b/package-lock.json index a20c8c4d..0bf597f2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4506,7 +4506,6 @@ "resolved": "https://registry.npmjs.org/@types/react/-/react-19.2.2.tgz", "integrity": "sha512-6mDvHUFSjyT2B2yeNx2nUgMxh9LtOWvkhIU3uePn2I2oyNymUAX1NIsdgviM4CH+JSrp2D2hsMvJOkxY+0wNRA==", "license": "MIT", - "peer": true, "dependencies": { "csstype": "^3.0.2" } @@ -4517,7 +4516,6 @@ "integrity": "sha512-9KQPoO6mZCi7jcIStSnlOWn2nEF3mNmyr3rIAsGnAbQKYbRLyqmeSc39EVgtxXVia+LMT8j3knZLAZAh+xLmrw==", "devOptional": true, "license": "MIT", - "peer": true, "peerDependencies": { "@types/react": "^19.2.0" } @@ -4599,7 +4597,6 @@ "integrity": "sha512-BnOroVl1SgrPLywqxyqdJ4l3S2MsKVLDVxZvjI1Eoe8ev2r3kGDo+PcMihNmDE+6/KjkTubSJnmqGZZjQSBq/g==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@typescript-eslint/scope-manager": "8.46.2", "@typescript-eslint/types": "8.46.2", @@ -5123,7 +5120,6 @@ "integrity": "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==", "dev": true, "license": "MIT", - "peer": true, "bin": { "acorn": "bin/acorn" }, @@ -5829,8 +5825,7 @@ "version": "3.1.3", "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.3.tgz", "integrity": "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==", - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/d3-array": { "version": "3.2.4", @@ -6206,8 +6201,7 @@ "version": "8.6.0", "resolved": "https://registry.npmjs.org/embla-carousel/-/embla-carousel-8.6.0.tgz", "integrity": "sha512-SjWyZBHJPbqxHOzckOfo8lHisEaJWmwd23XppYFYVh10bU66/Pn5tkVkbkCMZVdbUE5eTCI2nD8OyIP4Z+uwkA==", - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/embla-carousel-react": { "version": "8.6.0", @@ -6468,7 +6462,6 @@ "integrity": "sha512-t5aPOpmtJcZcz5UJyY2GbvpDlsK5E8JqRqoKtfiKE3cNh437KIqfJr3A3AKf5k64NPx6d0G3dno6XDY05PqPtw==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@eslint-community/eslint-utils": "^4.8.0", "@eslint-community/regexpp": "^4.12.1", @@ -6642,7 +6635,6 @@ "integrity": "sha512-whOE1HFo/qJDyX4SnXzP4N6zOWn79WhnCUY/iDR0mPfQZO8wcYE4JClzI2oZrhBnnMUCBCHZhO6VQyoBU95mZA==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@rtsao/scc": "^1.1.0", "array-includes": "^3.1.9", @@ -8160,7 +8152,6 @@ "resolved": "https://registry.npmjs.org/jspdf/-/jspdf-3.0.4.tgz", "integrity": "sha512-dc6oQ8y37rRcHn316s4ngz/nOjayLF/FFxBF4V9zamQKRqXxyiH1zagkCdktdWhtoQId5K20xt1lB90XzkB+hQ==", "license": "MIT", - "peer": true, "dependencies": { "@babel/runtime": "^7.28.4", "fast-png": "^6.2.0", @@ -9380,7 +9371,6 @@ "resolved": "https://registry.npmjs.org/react/-/react-19.2.3.tgz", "integrity": "sha512-Ku/hhYbVjOQnXDZFv2+RibmLFGwFdeeKHFcOTlrt7xplBnya5OGn/hIRDsqDiSUcfORsDC7MPxwork8jBwsIWA==", "license": "MIT", - "peer": true, "engines": { "node": ">=0.10.0" } @@ -9411,7 +9401,6 @@ "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-19.2.3.tgz", "integrity": "sha512-yELu4WmLPw5Mr/lmeEpox5rw3RETacE++JgHqQzd2dg+YbJuat3jH4ingc+WPZhxaoFzdv9y33G+F7Nl5O0GBg==", "license": "MIT", - "peer": true, "dependencies": { "scheduler": "^0.27.0" }, @@ -9479,8 +9468,7 @@ "version": "16.13.1", "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==", - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/react-number-format": { "version": "5.4.4", @@ -9497,7 +9485,6 @@ "resolved": "https://registry.npmjs.org/react-redux/-/react-redux-9.2.0.tgz", "integrity": "sha512-ROY9fvHhwOD9ySfrF0wmvu//bKCQ6AeZZq1nJNtbDC+kk5DuSuNX/n6YWYF/SYy7bSba4D4FSz8DJeKY/S/r+g==", "license": "MIT", - "peer": true, "dependencies": { "@types/use-sync-external-store": "^0.0.6", "use-sync-external-store": "^1.4.0" @@ -9666,8 +9653,7 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/redux/-/redux-5.0.1.tgz", "integrity": "sha512-M9/ELqF6fy8FwmkpnF0S3YKOqMyoWJ4+CS5Efg2ct3oY9daQvd/Pc71FpGZsVsbl3Cpb+IIcjBDUnnyBdQbq4w==", - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/redux-thunk": { "version": "3.1.0", @@ -10533,7 +10519,6 @@ "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=12" }, @@ -10701,7 +10686,6 @@ "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", "dev": true, "license": "Apache-2.0", - "peer": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" diff --git a/src/components/pages/dashboard/DashboardProduction.tsx b/src/components/pages/dashboard/DashboardProduction.tsx index fb8190aa..5ee4ea4e 100644 --- a/src/components/pages/dashboard/DashboardProduction.tsx +++ b/src/components/pages/dashboard/DashboardProduction.tsx @@ -3,61 +3,92 @@ import Button from '@/components/Button'; import Card from '@/components/Card'; import { Icon } from '@iconify/react'; -import ProductionLineChart from '@/components/pages/dashboard/chart/ProductionLineChart'; -import StandardLineChart from '@/components/pages/dashboard/chart/StandardLineChart'; -import EggWeightBarChart from '@/components/pages/dashboard/chart/EggWeightBarChart'; -import FCRBarChart from '@/components/pages/dashboard/chart/FCRBarChart'; -import ProductionStat from '@/components/pages/dashboard/chart/ProductionStat'; import Modal, { useModal } from '@/components/Modal'; import DateInput from '@/components/input/DateInput'; import SelectInput, { OptionType, useSelect, } from '@/components/input/SelectInput'; -import { RadioGroup } from '@/components/input/RadioInput'; import { useState } from 'react'; import useSWR from 'swr'; import { DashboardApi } from '@/services/api/dashboard'; import { useFormik } from 'formik'; -import dashboardProductionFilterSchema from '@/components/pages/dashboard/filter/DashboardProductionFilter.schema'; import { ProjectFlockApi } from '@/services/api/production'; -import { ProductionStandardApi } from '@/services/api/master-data'; +import { KandangApi, LocationApi } from '@/services/api/master-data'; +import Alert from '@/components/Alert'; + +import { + DashboardFilterSchema, + DashboardFilterType, + getDashboardFilterSchema, +} from '@/components/pages/dashboard/filter/DashboardProductionFilter.schema'; +import DashboardLineChart from '@/components/pages/dashboard/chart/DashboardLineChart'; +import DashboardLineChartSkeleton from '@/components/pages/dashboard/skeleton/DashboardLineChartSkeleton'; +import { RadioGroup, RadioGroupItem } from '@/components/input/RadioInput'; +import { + DashboardFilter, + DashboardMeta, +} from '@/types/api/dashboard/dashboard'; +import DashboardStats from '@/components/pages/dashboard/chart/DashboardStats'; +import { isResponseSuccess } from '@/lib/api-helper'; +import AlertErrorList from '@/components/helper/form/FormErrors'; +import { getUniqueFormikErrors } from '@/lib/formik-helper'; + +// Helper function to normalize values to array +const normalizeToArray = ( + value: OptionType | OptionType[] | null | undefined +): number[] => { + if (!value) return []; + if (Array.isArray(value)) { + return value.map((v) => Number(v.value)); + } + return [Number(value.value)]; +}; const DashboardProduction = () => { const filterModal = useModal(); - const [selectedPeriod, setSelectedPeriod] = useState('daily'); - const [selectedStandards, setSelectedStandards] = useState([ - 'hen_day', - 'hen_house', - ]); + const [analysisMode, setAnalysisMode] = useState<'OVERVIEW' | 'COMPARISON'>( + 'OVERVIEW' + ); const [endpointUrl, setEndpointUrl] = useState('/dashboard'); + const [selectedLocationIds, setSelectedLocationIds] = useState([]); + const [formErrorList, setFormErrorList] = useState([]); // ===== FETCH DATA ===== const { data: dashboardProductionResponse, isLoading: isLoadingDashboardProductionData, - error: dashboardProductionError, + mutate: refreshDashboardProductionData, } = useSWR(endpointUrl, () => DashboardApi.getDashboardProductionFetcher(endpointUrl) ); - const dashboardProductionData = - dashboardProductionResponse?.status === 'success' - ? dashboardProductionResponse.data - : undefined; + const dashboardProductionData = isResponseSuccess(dashboardProductionResponse) + ? dashboardProductionResponse.data + : undefined; // ===== SELECT ===== const { options: flockOptions, isLoadingOptions: isLoadingFlockOptions } = useSelect(ProjectFlockApi.basePath, 'id', 'flock_name', '', { limit: 'limit', - category: 'LAYING', + location_id: selectedLocationIds ? selectedLocationIds.toString() : '', }); const { - options: standardProductionOptions, - isLoadingOptions: isLoadingStandardProductionOptions, - } = useSelect(ProductionStandardApi.basePath, 'id', 'name', '', { + options: locationOptions, + isLoadingOptions: isLoadingLocationOptions, + } = useSelect(LocationApi.basePath, 'id', 'name', '', { limit: 'limit', }); + const { options: kandangOptions, isLoadingOptions: isLoadingKandangOptions } = + useSelect(KandangApi.basePath, 'id', 'name', '', { + limit: 'limit', + location_id: selectedLocationIds ? selectedLocationIds.toString() : '', + }); + const comparedByOptions = [ + { value: 'LOCATION', label: 'Farm' }, + { value: 'FLOCK', label: 'Flock' }, + { value: 'KANDANG', label: 'Kandang' }, + ]; // ===== FORMIK ===== const formik = useFormik({ @@ -65,57 +96,75 @@ const DashboardProduction = () => { startDate: '', endDate: '', flock: [] as OptionType[], - standard_production_id: [] as OptionType[], - standard_productions: [] as OptionType[], - period: selectedPeriod, - }, - validationSchema: dashboardProductionFilterSchema, + location: [] as OptionType[], + kandang: [] as OptionType[], + analysisMode: analysisMode, + comparedBy: '', + lokasiIds: [], + flockIds: [], + kandangIds: [], + } as DashboardFilterType, + validationSchema: getDashboardFilterSchema(analysisMode), onSubmit: (values) => { console.log(values); - // Build URL with query parameters - const params = new URLSearchParams(); - if (values.startDate) params.set('startDate', values.startDate); - if (values.endDate) params.set('endDate', values.endDate); - - if (values.flock && values.flock.length > 0) { - const flockIds = values.flock - .map((f: OptionType) => f.value || f) - .join(','); - params.set('flock', flockIds); - } - - if ( - values.standard_production_id && - values.standard_production_id.length > 0 - ) { - const standardIds = values.standard_production_id - .map((s: OptionType) => s.value || s) - .join(','); - params.set('standard_production_id', standardIds); - } - - if (selectedStandards.length > 0) { - params.set('standards', selectedStandards.join(',')); - } - - params.set('period', selectedPeriod); - - const newUrl = `/dashboard?${params.toString()}`; - setEndpointUrl(newUrl); - - // Close modal after applying filter - filterModal.closeModal(); + handleApplyFilter({ + start_date: values.startDate || '', + end_date: values.endDate || '', + analysis_mode: values.analysisMode as 'OVERVIEW' | 'COMPARISON', + location_ids: normalizeToArray(values.location), + flock_ids: normalizeToArray(values.flock), + kandang_ids: normalizeToArray(values.kandang), + }); }, }); const handleResetFilter = () => { formik.resetForm(); - setSelectedPeriod('daily'); - setSelectedStandards(['hen_day', 'hen_house']); + setAnalysisMode('OVERVIEW'); setEndpointUrl('/dashboard'); }; + const handleApplyFilter = (values: DashboardFilter) => { + console.log(values); + + // Build query params object, only include non-empty values + const params: Record = {}; + + if (values.start_date) params.start_date = values.start_date; + if (values.end_date) params.end_date = values.end_date; + if (values.analysis_mode) params.analysis_mode = values.analysis_mode; + if (values.location_ids.length > 0) + params.location_ids = values.location_ids.toString(); + if (values.flock_ids.length > 0) + params.flock_ids = values.flock_ids.toString(); + if (values.kandang_ids.length > 0) + params.kandang_ids = values.kandang_ids.toString(); + + setEndpointUrl(`/dashboard?${new URLSearchParams(params).toString()}`); + console.log(endpointUrl); + filterModal.closeModal(); + refreshDashboardProductionData(); + formik.resetForm(); + }; + + const handleValidateForm = async () => { + const errors = await formik.validateForm(); + + if (Object.keys(errors).length > 0) { + // Parse and display errors + const errorMessages = getUniqueFormikErrors(errors); + setFormErrorList(errorMessages); + return; // Stop submission + } + }; + + const handleFormSubmit = (e: React.FormEvent) => { + e.preventDefault(); + handleValidateForm(); + formik.handleSubmit(); + }; + if (isLoadingDashboardProductionData) { return (
@@ -127,15 +176,57 @@ const DashboardProduction = () => { <>
-

Dashboard

+
- {/* Dashboard Statistics */} - + {/* Dashboard Stats */} + - {/* Charts Grid */} -
- {/* Production Line Chart */} - - - - - {/* Standard Line Chart */} - - - - - {/* Bar Charts Grid - 2 columns */} -
- {/* FCR Bar Chart */} - - - - - {/* Egg Weight Bar Chart */} - - - -
-
+ {/* Use DashboardLineChart component or skeleton */} + {isLoadingDashboardProductionData ? ( + + ) : dashboardProductionData && + dashboardProductionData.charts && + Object.keys(dashboardProductionData.charts).length > 0 ? ( + + ) : ( + + )}
+ {
-
+ {/* Rentang Waktu */}
- +
{
- {/* Flock */} + {/* Analysis Mode */}
- formik.setFieldValue('flock', selected)} - errorMessage={formik.errors.flock as string} - options={flockOptions} - isLoading={isLoadingFlockOptions} - isMulti - isError={ - Boolean(formik.errors.flock) && Boolean(formik.touched.flock) - } - /> -
- - {/* Production */} -
- - formik.setFieldValue('standard_production_id', selected) - } - errorMessage={formik.errors.standard_production_id as string} - options={standardProductionOptions} - isLoading={isLoadingStandardProductionOptions} - isMulti - isError={ - Boolean(formik.errors.standard_production_id) && - Boolean(formik.touched.standard_production_id) - } - /> -
- - {/* Standard */} -
- ({ - value: s, - label: - s === 'hen_day' - ? 'Hen Day' - : s === 'hen_house' - ? 'Hen House' - : s === 'uniformity' - ? 'Uniformity' - : s === 'egg_weight' - ? 'Egg Weight' - : 'Egg Mass', - }))} - options={[ - { value: 'hen_day', label: 'Hen Day' }, - { value: 'hen_house', label: 'Hen House' }, - { value: 'uniformity', label: 'Uniformity' }, - { value: 'egg_weight', label: 'Egg Weight' }, - { value: 'egg_mass', label: 'Egg Mass' }, - ]} - isMulti - onChange={(selected: OptionType | OptionType[] | null) => { - const values = Array.isArray(selected) - ? selected.map((item) => String(item.value)) - : []; - setSelectedStandards( - values.length > 0 ? values : ['hen_day'] - ); + + { + formik.handleChange(e); + setAnalysisMode(e.target.value as 'OVERVIEW' | 'COMPARISON'); + // Reset all dependent fields when analysis mode changes + formik.setFieldValue('location', []); + formik.setFieldValue('flock', []); + formik.setFieldValue('kandang', []); + formik.setFieldValue('comparedBy', ''); + setSelectedLocationIds([]); }} + color='primary' + className={{ + wrapper: 'w-full my-6 font-semibold text-neutral-500', + }} + > + + + +
+ + {formik.values.analysisMode === 'COMPARISON' && ( +
+ option.value === formik.values.comparedBy + )} + onChange={(selected) => + formik.setFieldValue( + 'comparedBy', + selected ? (selected as OptionType).value : '' + ) + } + errorMessage={formik.errors.comparedBy as string} + options={comparedByOptions} + isLoading={isLoadingLocationOptions} + isError={ + Boolean(formik.errors.comparedBy) && + Boolean(formik.touched.comparedBy) + } + /> +
+ )} + + {/* Location */} +
+ { + formik.setFieldValue('location', selected); + // Update selectedLocationIds for kandang filter + setSelectedLocationIds(normalizeToArray(selected)); + // Reset dependent fields when location changes + formik.setFieldValue('flock', []); + formik.setFieldValue('kandang', []); + }} + errorMessage={formik.errors.location as string} + options={locationOptions} + isLoading={isLoadingLocationOptions} + isMulti={ + comparedByOptions.find( + (option) => option.value === formik.values.comparedBy + )?.value === 'LOCATION' + } isError={ - Boolean(formik.errors.standard_productions) && - Boolean(formik.touched.standard_productions) + Boolean(formik.errors.location) && + Boolean(formik.touched.location) } />
- {/* Periode Perbandingan */} -
- -
- - - - + {/* Flock */} + {!( + formik.values.analysisMode === 'COMPARISON' && + !( + formik.values.comparedBy === 'FLOCK' || + formik.values.comparedBy === 'KANDANG' + ) + ) && ( +
+ + formik.setFieldValue('flock', selected) + } + errorMessage={formik.errors.flock as string} + options={flockOptions} + isLoading={isLoadingFlockOptions} + isMulti={ + comparedByOptions.find( + (option) => option.value === formik.values.comparedBy + )?.value === 'FLOCK' + } + isError={ + Boolean(formik.errors.flock) && + Boolean(formik.touched.flock) + } + />
-
+ )} + + {/* Kandang */} + {!( + formik.values.analysisMode === 'COMPARISON' && + !(formik.values.comparedBy === 'KANDANG') + ) && ( +
+ + formik.setFieldValue('kandang', selected) + } + errorMessage={formik.errors.kandang as string} + options={kandangOptions} + isLoading={isLoadingKandangOptions} + isMulti={ + comparedByOptions.find( + (option) => option.value === formik.values.comparedBy + )?.value === 'KANDANG' + } + isError={ + Boolean(formik.errors.kandang) && + Boolean(formik.touched.kandang) + } + /> +
+ )} + + {/* Error List Alert */} + {formErrorList.length > 0 && ( + setFormErrorList([])} + /> + )} {/* Action Buttons */}
diff --git a/src/components/pages/dashboard/chart/DashboardLineChart.tsx b/src/components/pages/dashboard/chart/DashboardLineChart.tsx new file mode 100644 index 00000000..e586b4a3 --- /dev/null +++ b/src/components/pages/dashboard/chart/DashboardLineChart.tsx @@ -0,0 +1,545 @@ +import Button from '@/components/Button'; +import Card from '@/components/Card'; +import Dropdown from '@/components/Dropdown'; +import Menu from '@/components/menu/Menu'; +import MenuItem from '@/components/menu/MenuItem'; +import { + Dashboard, + DashboardOverviewCharts, + DashboardComparisonCharts, + DashboardChartsSeries, + DashboardChartsDataset, +} from '@/types/api/dashboard/dashboard'; +import { Icon } from '@iconify/react'; +import { useState, useEffect } from 'react'; +import { + CartesianGrid, + Line, + LineChart, + ResponsiveContainer, + Tooltip, + XAxis, + YAxis, +} from 'recharts'; + +type DashboardLineChartProps = { + analysisMode: 'OVERVIEW' | 'COMPARISON'; + data: Dashboard; +}; + +// Type guard to check if charts is DashboardOverviewCharts +function isOverviewCharts( + charts: DashboardOverviewCharts | DashboardComparisonCharts +): charts is DashboardOverviewCharts { + return 'deplesi' in charts; +} + +// Type guard to check if charts is DashboardComparisonCharts +function isComparisonCharts( + charts: DashboardOverviewCharts | DashboardComparisonCharts +): charts is DashboardComparisonCharts { + return 'location' in charts || 'flock' in charts || 'kandang' in charts; +} + +const lineColors: Record = { + body_weight: '#10B981', + std_body_weight: '#10B981', + act_laying: '#1062B9', + std_laying: '#1062B9', + act_egg_weight: '#10B981', + std_egg_weight: '#10B981', + act_feed_intake: '#F52419', + std_feed_intake: '#F52419', + act_uniformity: '#F59E0B', + std_uniformity: '#F59E0B', + act_fcr: '#10B981', + std_fcr: '#10B981', + act_fcr_cum: '#F52419', + std_fcr_cum: '#10B981', + normal: '#10B981', + abnormal: '#F52419', + act_deplesi: '#10B981', + std_deplesi: '#10B981', +}; + +const defaultLineColors: string[] = [ + '#10B981', + '#1062B9', + '#F52419', + '#F59E0B', + '#7F56D9', +]; + +// Helper function to get line color +const getLineColor = ( + seriesId: string | number, + index: number, + mode: 'OVERVIEW' | 'COMPARISON' +): string => { + // For COMPARISON mode, use default colors with cycling + if (mode === 'COMPARISON') { + return defaultLineColors[index % defaultLineColors.length]; + } + + // For OVERVIEW mode, use predefined colors or fallback to default + const predefinedColor = lineColors[seriesId]; + if (predefinedColor) { + return predefinedColor; + } + + // Fallback to default colors with cycling + return defaultLineColors[index % defaultLineColors.length]; +}; + +const DashboardLineChart = ({ + analysisMode, + data, +}: DashboardLineChartProps) => { + const [chartData, setChartData] = + useState('body_weight'); + const [open, setOpen] = useState(false); + // Track which series are visible (by series id) + const [visibleSeries, setVisibleSeries] = useState>( + new Set() + ); + + // Mapping for chart type labels + const chartTypeLabels: Record = { + body_weight: 'Body Weight', + performance: 'Performance', + fcr: 'FCR', + quality_control: 'Quality Control', + deplesi: 'Deplesi', + }; + + // Initialize all series as visible when chartData changes + useEffect(() => { + let seriesData: DashboardChartsSeries[] = []; + + if (analysisMode === 'OVERVIEW' && isOverviewCharts(data.charts)) { + seriesData = data.charts[chartData]?.series || []; + } else if ( + analysisMode === 'COMPARISON' && + isComparisonCharts(data.charts) + ) { + const comparisonChart = + data.charts.location || data.charts.flock || data.charts.kandang; + seriesData = comparisonChart?.series || []; + } + + // Set all series as visible by default + const allSeriesIds = new Set(seriesData.map((s) => s.id)); + setVisibleSeries(allSeriesIds); + }, [chartData, analysisMode, data.charts]); + + return ( + +
+
+ Performance{' '} + +
+ {analysisMode == 'OVERVIEW' && ( + setOpen(!open)} + > + {chartTypeLabels[chartData]}{' '} +
+ + + } + className={{ + content: 'w-52 mt-3', + }} + controlled={open} + > + + { + setChartData('body_weight'); + setOpen(!open); + }} + /> + { + setChartData('performance'); + setOpen(!open); + }} + /> + { + setChartData('fcr'); + setOpen(!open); + }} + /> + { + setChartData('quality_control'); + setOpen(!open); + }} + /> + { + setChartData('deplesi'); + setOpen(!open); + }} + /> + +
+ )} +
+ + {/* Legend - Dynamic based on series data */} +
+ {(() => { + // Get series data based on current mode and chartData + let seriesData: DashboardChartsSeries[] = []; + + if (analysisMode === 'OVERVIEW' && isOverviewCharts(data.charts)) { + seriesData = data.charts[chartData]?.series || []; + } else if ( + analysisMode === 'COMPARISON' && + isComparisonCharts(data.charts) + ) { + const comparisonChart = + data.charts.location || data.charts.flock || data.charts.kandang; + seriesData = comparisonChart?.series || []; + } + + return seriesData.map((series, index) => { + const isVisible = visibleSeries.has(series.id); + const isStandard = series.id + .toString() + .toLowerCase() + .includes('std'); + + return ( + + ); + }); + })()} +
+ + {/* Chart */} + + { + // Transform data based on analysisMode + if (analysisMode === 'OVERVIEW') { + // For OVERVIEW mode, use the selected chart data + if (isOverviewCharts(data.charts)) { + const selectedChartData = data.charts[chartData]; + if (!selectedChartData || !selectedChartData.dataset) return []; + return selectedChartData.dataset; + } + return []; + } else { + // For COMPARISON mode, use the first available comparison chart + if (isComparisonCharts(data.charts)) { + const chartData = + data.charts.location || + data.charts.flock || + data.charts.kandang; + + if (!chartData || !chartData.dataset) return []; + return chartData.dataset; + } + return []; + } + })()} + margin={{ + top: 5, + right: 10, + left: 0, + bottom: 5, + }} + > + + + { + // Calculate dynamic domain based on visible data + let seriesData: DashboardChartsSeries[] = []; + let dataset: DashboardChartsDataset[] = []; + + if ( + analysisMode === 'OVERVIEW' && + isOverviewCharts(data.charts) + ) { + seriesData = data.charts[chartData]?.series || []; + dataset = data.charts[chartData]?.dataset || []; + } else if ( + analysisMode === 'COMPARISON' && + isComparisonCharts(data.charts) + ) { + const comparisonChart = + data.charts.location || + data.charts.flock || + data.charts.kandang; + seriesData = comparisonChart?.series || []; + dataset = comparisonChart?.dataset || []; + } + + // Get all values from visible series + const visibleSeriesIds = Array.from(visibleSeries); + const allValues: number[] = []; + + dataset.forEach((item: DashboardChartsDataset) => { + visibleSeriesIds.forEach((seriesId) => { + const value = item[seriesId]; + if (typeof value === 'number') { + allValues.push(value); + } + }); + }); + + if (allValues.length === 0) return [0, 100]; + + const minValue = Math.min(...allValues); + const maxValue = Math.max(...allValues); + + // Add padding (10% on each side) + const padding = (maxValue - minValue) * 0.1; + const domainMin = Math.floor(Math.max(0, minValue - padding)); + const domainMax = Math.ceil(maxValue + padding); + + return [domainMin, domainMax]; + })()} + ticks={(() => { + // Calculate dynamic ticks based on domain + let seriesData: DashboardChartsSeries[] = []; + let dataset: DashboardChartsDataset[] = []; + + if ( + analysisMode === 'OVERVIEW' && + isOverviewCharts(data.charts) + ) { + seriesData = data.charts[chartData]?.series || []; + dataset = data.charts[chartData]?.dataset || []; + } else if ( + analysisMode === 'COMPARISON' && + isComparisonCharts(data.charts) + ) { + const comparisonChart = + data.charts.location || + data.charts.flock || + data.charts.kandang; + seriesData = comparisonChart?.series || []; + dataset = comparisonChart?.dataset || []; + } + + const visibleSeriesIds = Array.from(visibleSeries); + const allValues: number[] = []; + + dataset.forEach((item: DashboardChartsDataset) => { + visibleSeriesIds.forEach((seriesId) => { + const value = item[seriesId]; + if (typeof value === 'number') { + allValues.push(value); + } + }); + }); + + if (allValues.length === 0) return [0, 25, 50, 75, 100]; + + const minValue = Math.min(...allValues); + const maxValue = Math.max(...allValues); + const padding = (maxValue - minValue) * 0.1; + const domainMin = Math.floor(Math.max(0, minValue - padding)); + const domainMax = Math.ceil(maxValue + padding); + + // Generate 5 evenly spaced ticks + const range = domainMax - domainMin; + const step = range / 4; + + return [ + domainMin, + Math.round(domainMin + step), + Math.round(domainMin + step * 2), + Math.round(domainMin + step * 3), + domainMax, + ]; + })()} + /> + `Week ${value}`} + formatter={( + value: number | undefined, + name: string | undefined + ) => { + if (value === undefined || name === undefined) return ['', '']; + + // Get series data to find the unit + let seriesData: DashboardChartsSeries[] = []; + if ( + analysisMode === 'OVERVIEW' && + isOverviewCharts(data.charts) + ) { + seriesData = data.charts[chartData]?.series || []; + } else if ( + analysisMode === 'COMPARISON' && + isComparisonCharts(data.charts) + ) { + const comparisonChart = + data.charts.location || + data.charts.flock || + data.charts.kandang; + seriesData = comparisonChart?.series || []; + } + + // Find the series that matches this line's name + const series = seriesData.find((s) => s.label === name); + const unit = series?.unit || ''; + + return [`${value} ${unit}`, name]; + }} + /> + {/* Dynamic Line rendering based on visible series */} + {(() => { + let seriesData: DashboardChartsSeries[] = []; + + if (analysisMode === 'OVERVIEW' && isOverviewCharts(data.charts)) { + seriesData = data.charts[chartData]?.series || []; + } else if ( + analysisMode === 'COMPARISON' && + isComparisonCharts(data.charts) + ) { + const comparisonChart = + data.charts.location || + data.charts.flock || + data.charts.kandang; + seriesData = comparisonChart?.series || []; + } + + return seriesData + .filter((series) => visibleSeries.has(series.id)) + .map((series, index) => { + const isStandard = series.id + .toString() + .toLowerCase() + .includes('std'); + // Use series.id directly as dataKey to match dataset fields + const dataKey = series.id.toString(); + + return ( + + ); + }); + })()} + + +
+ ); +}; + +export default DashboardLineChart; diff --git a/src/components/pages/dashboard/chart/DashboardStats.tsx b/src/components/pages/dashboard/chart/DashboardStats.tsx new file mode 100644 index 00000000..dcb0707f --- /dev/null +++ b/src/components/pages/dashboard/chart/DashboardStats.tsx @@ -0,0 +1,166 @@ +import Alert from '@/components/Alert'; +import Card from '@/components/Card'; +import { formatNumber } from '@/lib/helper'; +import { DashboardStatisticsData } from '@/types/api/dashboard/dashboard'; +import { Icon } from '@iconify/react'; + +interface DashboardStatsProps { + data: DashboardStatisticsData[]; +} + +// Konfigurasi untuk setiap kartu +const CARD_CONFIG = [ + { + key: 'HPP Global', + icon: 'heroicons:banknotes', + alertColor: 'warning' as const, + suffix: ' /Kg', + prefix: 'RP ', + }, + { + key: 'Avg. Selling Price', + icon: 'heroicons:document-currency-dollar', + alertColor: 'success' as const, + suffix: ' /Kg', + prefix: '', + }, + { + key: 'FCR', + icon: 'heroicons:clipboard-document-list', + alertColor: 'info' as const, + suffix: '', + prefix: '', + }, + { + key: 'Mortality', + icon: 'heroicons:exclamation-triangle', + alertColor: 'error' as const, + suffix: ' %', + prefix: '', + }, +]; + +const DashboardStats = ({ data }: DashboardStatsProps) => { + // Helper to get trend icon and color + const getTrendDisplay = (percent: number) => { + const isPositive = percent >= 0; + return { + icon: isPositive + ? 'heroicons:arrow-trending-up' + : 'heroicons:arrow-trending-down', + color: isPositive ? 'text-success' : 'text-error', + value: Math.abs(percent), + }; + }; + + // Helper to format value + const formatValue = (value: number, prefix: string, suffix: string) => { + return ( + <> + {prefix} + {formatNumber(value)} + {suffix && ( + {suffix} + )} + + ); + }; + + return ( +
+ {CARD_CONFIG.map((config) => { + // Find matching data from API + const cardData = data.find((item) => item.label === config.key); + + if (!cardData) { + // Show placeholder card for missing data (FCR & Mortality) + return ( + +
+ From last month +
+
+ Filter Required +
+
+ } + > +
+ + + +
+

+ {config.key} +

+

+ ******** +

+
+
+ + ); + } + + const trend = getTrendDisplay(cardData.percent_last_month); + + return ( + +
+ From last month +
+
+ + {trend.value}% +
+
+ } + > +
+ + + +
+

+ {cardData.label} +

+

+ {formatValue(cardData.value, config.prefix, config.suffix)} +

+
+
+ + ); + })} +
+ ); +}; + +export default DashboardStats; diff --git a/src/components/pages/dashboard/chart/EggWeightBarChart.tsx b/src/components/pages/dashboard/chart/EggWeightBarChart.tsx deleted file mode 100644 index 7a9a02c6..00000000 --- a/src/components/pages/dashboard/chart/EggWeightBarChart.tsx +++ /dev/null @@ -1,89 +0,0 @@ -'use client'; - -import { - BarChart, - Bar, - XAxis, - YAxis, - CartesianGrid, - Tooltip, - ResponsiveContainer, - Cell, -} from 'recharts'; -import { DashboardProductionEggWeights } from '@/types/api/dashboard/dashboard-production'; - -interface EggWeightBarChartProps { - data?: DashboardProductionEggWeights[]; -} - -const EggWeightBarChart = ({ data }: EggWeightBarChartProps) => { - // Show loading state if no data - if (!data || data.length === 0) { - return ( -
-

- Rata-rata Berat Telur (EW) -

-
-

Memuat data...

-
-
- ); - } - - return ( -
-

Rata-rata Berat Telur (EW)

- - - - - - - value !== undefined ? [`${value} gram`, ''] : ['', ''] - } - cursor={{ fill: 'rgba(59, 130, 246, 0.1)' }} - /> - - {data.map((entry, index) => ( - - ))} - - - -
- ); -}; - -export default EggWeightBarChart; diff --git a/src/components/pages/dashboard/chart/FCRBarChart.tsx b/src/components/pages/dashboard/chart/FCRBarChart.tsx deleted file mode 100644 index 2647c7f7..00000000 --- a/src/components/pages/dashboard/chart/FCRBarChart.tsx +++ /dev/null @@ -1,97 +0,0 @@ -'use client'; - -import { - BarChart, - Bar, - XAxis, - YAxis, - CartesianGrid, - Tooltip, - ResponsiveContainer, - Cell, -} from 'recharts'; -import { DashboardProductionFcrData } from '@/types/api/dashboard/dashboard-production'; - -interface FCRBarChartProps { - data?: DashboardProductionFcrData[]; -} - -// Alternating colors: green and red -const colors = ['#10b981', '#ef4444']; - -const FCRBarChart = ({ data }: FCRBarChartProps) => { - // Show loading state if no data - if (!data || data.length === 0) { - return ( -
-

- Feed Conversion Ratio (FCR) -

-
-

Memuat data...

-
-
- ); - } - - return ( -
-

- Feed Conversion Ratio (FCR) -

- - - - - - - value !== undefined ? [value.toFixed(2), 'FCR'] : ['', ''] - } - cursor={{ fill: 'rgba(16, 185, 129, 0.1)' }} - /> - - {data.map((entry, index) => ( - - ))} - - - -
- ); -}; - -export default FCRBarChart; diff --git a/src/components/pages/dashboard/chart/ProductionLineChart.tsx b/src/components/pages/dashboard/chart/ProductionLineChart.tsx deleted file mode 100644 index 470e09c9..00000000 --- a/src/components/pages/dashboard/chart/ProductionLineChart.tsx +++ /dev/null @@ -1,357 +0,0 @@ -'use client'; - -import { useState } from 'react'; -import { - LineChart, - Line, - XAxis, - YAxis, - CartesianGrid, - Tooltip, - Legend, - ResponsiveContainer, -} from 'recharts'; - -// Sample data in API format -const sampleApiData: ProductionChartItem[] = [ - { - date: '2025-12-01T00:00:00Z', - flocks: [ - { id: 1, name: 'Flock A-002', data: 88 }, - { id: 2, name: 'Flock A-001', data: 92 }, - { id: 3, name: 'Flock B-001', data: 90 }, - { id: 4, name: 'Flock B-002', data: 85 }, - ], - }, - { - date: '2025-12-03T00:00:00Z', - flocks: [ - { id: 1, name: 'Flock A-002', data: 85 }, - { id: 2, name: 'Flock A-001', data: 95 }, - { id: 3, name: 'Flock B-001', data: 93 }, - { id: 4, name: 'Flock B-002', data: 87 }, - ], - }, - { - date: '2025-12-05T00:00:00Z', - flocks: [ - { id: 1, name: 'Flock A-002', data: 82 }, - { id: 2, name: 'Flock A-001', data: 98 }, - { id: 3, name: 'Flock B-001', data: 91 }, - { id: 4, name: 'Flock B-002', data: 84 }, - ], - }, - { - date: '2025-12-07T00:00:00Z', - flocks: [ - { id: 1, name: 'Flock A-002', data: 80 }, - { id: 2, name: 'Flock A-001', data: 89 }, - { id: 3, name: 'Flock B-001', data: 88 }, - { id: 4, name: 'Flock B-002', data: 82 }, - ], - }, - { - date: '2025-12-08T00:00:00Z', - flocks: [ - { id: 1, name: 'Flock A-002', data: 83 }, - { id: 2, name: 'Flock A-001', data: 92 }, - { id: 3, name: 'Flock B-001', data: 95 }, - { id: 4, name: 'Flock B-002', data: 85 }, - ], - }, - { - date: '2025-12-11T00:00:00Z', - flocks: [ - { id: 1, name: 'Flock A-002', data: 81 }, - { id: 2, name: 'Flock A-001', data: 88 }, - { id: 3, name: 'Flock B-001', data: 92 }, - { id: 4, name: 'Flock B-002', data: 83 }, - ], - }, - { - date: '2025-12-13T00:00:00Z', - flocks: [ - { id: 1, name: 'Flock A-002', data: 84 }, - { id: 2, name: 'Flock A-001', data: 90 }, - { id: 3, name: 'Flock B-001', data: 89 }, - { id: 4, name: 'Flock B-002', data: 86 }, - ], - }, - { - date: '2025-12-15T00:00:00Z', - flocks: [ - { id: 1, name: 'Flock A-002', data: 82 }, - { id: 2, name: 'Flock A-001', data: 94 }, - { id: 3, name: 'Flock B-001', data: 96 }, - { id: 4, name: 'Flock B-002', data: 84 }, - ], - }, - { - date: '2025-12-17T00:00:00Z', - flocks: [ - { id: 1, name: 'Flock A-002', data: 80 }, - { id: 2, name: 'Flock A-001', data: 91 }, - { id: 3, name: 'Flock B-001', data: 93 }, - { id: 4, name: 'Flock B-002', data: 82 }, - ], - }, - { - date: '2025-12-19T00:00:00Z', - flocks: [ - { id: 1, name: 'Flock A-002', data: 79 }, - { id: 2, name: 'Flock A-001', data: 88 }, - { id: 3, name: 'Flock B-001', data: 90 }, - { id: 4, name: 'Flock B-002', data: 81 }, - ], - }, - { - date: '2025-12-21T00:00:00Z', - flocks: [ - { id: 1, name: 'Flock A-002', data: 81 }, - { id: 2, name: 'Flock A-001', data: 97 }, - { id: 3, name: 'Flock B-001', data: 92 }, - { id: 4, name: 'Flock B-002', data: 83 }, - ], - }, - { - date: '2025-12-23T00:00:00Z', - flocks: [ - { id: 1, name: 'Flock A-002', data: 83 }, - { id: 2, name: 'Flock A-001', data: 95 }, - { id: 3, name: 'Flock B-001', data: 98 }, - { id: 4, name: 'Flock B-002', data: 85 }, - ], - }, - { - date: '2025-12-25T00:00:00Z', - flocks: [ - { id: 1, name: 'Flock A-002', data: 80 }, - { id: 2, name: 'Flock A-001', data: 89 }, - { id: 3, name: 'Flock B-001', data: 94 }, - { id: 4, name: 'Flock B-002', data: 82 }, - ], - }, - { - date: '2025-12-27T00:00:00Z', - flocks: [ - { id: 1, name: 'Flock A-002', data: 82 }, - { id: 2, name: 'Flock A-001', data: 93 }, - { id: 3, name: 'Flock B-001', data: 96 }, - { id: 4, name: 'Flock B-002', data: 84 }, - ], - }, - { - date: '2025-12-28T00:00:00Z', - flocks: [ - { id: 1, name: 'Flock A-002', data: 85 }, - { id: 2, name: 'Flock A-001', data: 96 }, - { id: 3, name: 'Flock B-001', data: 95 }, - { id: 4, name: 'Flock B-002', data: 87 }, - ], - }, -]; - -// Helper function to format date based on period -const formatDateByPeriod = ( - dateString: string, - period: 'daily' | 'weekly' | 'monthly' | 'yearly' -): string => { - const date = new Date(dateString); - const monthNames = [ - 'Jan', - 'Feb', - 'Mar', - 'Apr', - 'Mei', - 'Jun', - 'Jul', - 'Agu', - 'Sep', - 'Okt', - 'Nov', - 'Des', - ]; - - switch (period) { - case 'daily': - // Format: "1 Des" - return `${date.getDate()} ${monthNames[date.getMonth()]}`; - - case 'weekly': - // Format: "Week 1 Des" - const weekNumber = Math.ceil(date.getDate() / 7); - return `Week ${weekNumber} ${monthNames[date.getMonth()]}`; - - case 'monthly': - // Format: "Des" - return monthNames[date.getMonth()]; - - case 'yearly': - // Format: "2025" - return date.getFullYear().toString(); - - default: - return dateString; - } -}; - -// Type definitions for API data -interface FlockData { - id: number; - name: string; - data: number; -} - -interface ProductionChartItem { - date: string; - flocks: FlockData[]; -} - -interface ProductionChartsData { - production_charts: ProductionChartItem[]; -} - -// Transform API data to Recharts format -const transformProductionData = (apiData: ProductionChartItem[]) => { - return apiData.map((item) => { - const transformed: Record = { - date: item.date.split('T')[0], // Extract YYYY-MM-DD from ISO string - }; - - // Add each flock's data as a property - item.flocks.forEach((flock) => { - transformed[flock.name] = flock.data; - }); - - return transformed; - }); -}; - -interface ProductionLineChartProps { - period?: 'daily' | 'weekly' | 'monthly' | 'yearly'; - data?: ProductionChartItem[]; // Optional API data -} - -const ProductionLineChart = ({ - period = 'daily', - data: apiData, -}: ProductionLineChartProps) => { - // State to track which lines are hidden - const [hiddenLines, setHiddenLines] = useState([]); - - // Use API data if provided, otherwise use sample data - const chartData = apiData - ? transformProductionData(apiData) - : transformProductionData(sampleApiData); - - // Handle legend click to show/hide lines - const handleLegendClick = (dataKey: string) => { - setHiddenLines((prev) => - prev.includes(dataKey) - ? prev.filter((key) => key !== dataKey) - : [...prev, dataKey] - ); - }; - - return ( -
-

- Performa Produksi per Flock -

- - - - formatDateByPeriod(value, period)} - /> - - - formatDateByPeriod(value as string, period) - } - /> - { - if (e.dataKey) handleLegendClick(e.dataKey as string); - }} - style={{ cursor: 'pointer' }} - /> - - - - - - -
- ); -}; - -export default ProductionLineChart; - -// Export types for external use -export type { FlockData, ProductionChartItem, ProductionChartsData }; diff --git a/src/components/pages/dashboard/chart/ProductionStat.tsx b/src/components/pages/dashboard/chart/ProductionStat.tsx deleted file mode 100644 index 7e299223..00000000 --- a/src/components/pages/dashboard/chart/ProductionStat.tsx +++ /dev/null @@ -1,107 +0,0 @@ -import Card from '@/components/Card'; -import { Icon } from '@iconify/react'; -import { DashboardProductionStatisticsData } from '@/types/api/dashboard/dashboard-production'; -import { formatCurrency } from '@/lib/helper'; - -interface ProductionStatProps { - data?: DashboardProductionStatisticsData[]; -} - -const ProductionStat = ({ data }: ProductionStatProps) => { - // Helper function to get icon based on title - const getIcon = (title: string) => { - if (title.toLowerCase().includes('keuangan')) - return 'heroicons:currency-dollar'; - if (title.toLowerCase().includes('penjualan')) - return 'heroicons:arrow-trending-up'; - if (title.toLowerCase().includes('pembelian')) - return 'heroicons:shopping-cart'; - if (title.toLowerCase().includes('overhead')) return 'heroicons:calculator'; - return 'heroicons:chart-bar'; - }; - - // Helper function to get icon background color - const getIconBgColor = (title: string) => { - if (title.toLowerCase().includes('keuangan')) return 'bg-blue-500'; - if (title.toLowerCase().includes('penjualan')) return 'bg-green-500'; - if (title.toLowerCase().includes('pembelian')) return 'bg-orange-500'; - if (title.toLowerCase().includes('overhead')) return 'bg-purple-500'; - return 'bg-gray-500'; - }; - - // Show loading state if no data - if (!data || data.length === 0) { - return ( -
- {[1, 2, 3, 4].map((i) => ( - -
-
-
-
-
-
- ))} -
- ); - } - - return ( -
- {data.map((stat, index) => ( - -
-
-

{stat.title}

-

- {formatCurrency(stat.value)} -

-

- - {stat.change > 0 ? '+' : ''} - {stat.change}% vs{' '} - {stat.period === 'monthly' ? 'bulan lalu' : 'periode lalu'} -

-
-
-
- -
-
-
-
- ))} -
- ); -}; - -export default ProductionStat; diff --git a/src/components/pages/dashboard/chart/StandardLineChart.tsx b/src/components/pages/dashboard/chart/StandardLineChart.tsx deleted file mode 100644 index 18bcabf6..00000000 --- a/src/components/pages/dashboard/chart/StandardLineChart.tsx +++ /dev/null @@ -1,691 +0,0 @@ -'use client'; - -import { useState } from 'react'; -import { - LineChart, - Line, - XAxis, - YAxis, - CartesianGrid, - Tooltip, - Legend, - ResponsiveContainer, -} from 'recharts'; - -// Type definitions for API data -interface FlockData { - id: number; - name: string; - data: number; -} - -interface StandardData { - name: string; - value: number; -} - -interface StandardChartItem { - week: number; - standards: StandardData[]; - flocks: FlockData[]; -} - -// Sample data in API format -const sampleApiData: StandardChartItem[] = [ - { - week: 18, - standards: [ - { name: 'hen_day', value: 40 }, - { name: 'hen_house', value: 38 }, - { name: 'uniformity', value: 85 }, - { name: 'egg_weight', value: 52 }, - { name: 'egg_mass', value: 20 }, - ], - flocks: [ - { id: 1, name: 'Flock A-001', data: 38 }, - { id: 2, name: 'Flock A-002', data: 37 }, - { id: 3, name: 'Flock B-001', data: 39 }, - { id: 4, name: 'Flock B-002', data: 36 }, - ], - }, - { - week: 20, - standards: [ - { name: 'hen_day', value: 45 }, - { name: 'hen_house', value: 43 }, - { name: 'uniformity', value: 86 }, - { name: 'egg_weight', value: 54 }, - { name: 'egg_mass', value: 24 }, - ], - flocks: [ - { id: 1, name: 'Flock A-001', data: 43 }, - { id: 2, name: 'Flock A-002', data: 42 }, - { id: 3, name: 'Flock B-001', data: 44 }, - { id: 4, name: 'Flock B-002', data: 41 }, - ], - }, - { - week: 22, - standards: [ - { name: 'hen_day', value: 48 }, - { name: 'hen_house', value: 46 }, - { name: 'uniformity', value: 87 }, - { name: 'egg_weight', value: 55 }, - { name: 'egg_mass', value: 26 }, - ], - flocks: [ - { id: 1, name: 'Flock A-001', data: 47 }, - { id: 2, name: 'Flock A-002', data: 46 }, - { id: 3, name: 'Flock B-001', data: 48 }, - { id: 4, name: 'Flock B-002', data: 45 }, - ], - }, - { - week: 24, - standards: [ - { name: 'hen_day', value: 50 }, - { name: 'hen_house', value: 48 }, - { name: 'uniformity', value: 88 }, - { name: 'egg_weight', value: 56 }, - { name: 'egg_mass', value: 28 }, - ], - flocks: [ - { id: 1, name: 'Flock A-001', data: 49 }, - { id: 2, name: 'Flock A-002', data: 48 }, - { id: 3, name: 'Flock B-001', data: 50 }, - { id: 4, name: 'Flock B-002', data: 47 }, - ], - }, - { - week: 26, - standards: [ - { name: 'hen_day', value: 52 }, - { name: 'hen_house', value: 50 }, - { name: 'uniformity', value: 89 }, - { name: 'egg_weight', value: 57 }, - { name: 'egg_mass', value: 30 }, - ], - flocks: [ - { id: 1, name: 'Flock A-001', data: 50 }, - { id: 2, name: 'Flock A-002', data: 49 }, - { id: 3, name: 'Flock B-001', data: 51 }, - { id: 4, name: 'Flock B-002', data: 48 }, - ], - }, - { - week: 28, - standards: [ - { name: 'hen_day', value: 55 }, - { name: 'hen_house', value: 53 }, - { name: 'uniformity', value: 90 }, - { name: 'egg_weight', value: 58 }, - { name: 'egg_mass', value: 32 }, - ], - flocks: [ - { id: 1, name: 'Flock A-001', data: 53 }, - { id: 2, name: 'Flock A-002', data: 52 }, - { id: 3, name: 'Flock B-001', data: 54 }, - { id: 4, name: 'Flock B-002', data: 51 }, - ], - }, - { - week: 30, - standards: [ - { name: 'hen_day', value: 58 }, - { name: 'hen_house', value: 56 }, - { name: 'uniformity', value: 91 }, - { name: 'egg_weight', value: 59 }, - { name: 'egg_mass', value: 34 }, - ], - flocks: [ - { id: 1, name: 'Flock A-001', data: 55 }, - { id: 2, name: 'Flock A-002', data: 54 }, - { id: 3, name: 'Flock B-001', data: 56 }, - { id: 4, name: 'Flock B-002', data: 53 }, - ], - }, - { - week: 32, - standards: [ - { name: 'hen_day', value: 60 }, - { name: 'hen_house', value: 58 }, - { name: 'uniformity', value: 92 }, - { name: 'egg_weight', value: 60 }, - { name: 'egg_mass', value: 36 }, - ], - flocks: [ - { id: 1, name: 'Flock A-001', data: 58 }, - { id: 2, name: 'Flock A-002', data: 57 }, - { id: 3, name: 'Flock B-001', data: 59 }, - { id: 4, name: 'Flock B-002', data: 56 }, - ], - }, - { - week: 34, - standards: [ - { name: 'hen_day', value: 62 }, - { name: 'hen_house', value: 60 }, - { name: 'uniformity', value: 92 }, - { name: 'egg_weight', value: 61 }, - { name: 'egg_mass', value: 38 }, - ], - flocks: [ - { id: 1, name: 'Flock A-001', data: 60 }, - { id: 2, name: 'Flock A-002', data: 59 }, - { id: 3, name: 'Flock B-001', data: 61 }, - { id: 4, name: 'Flock B-002', data: 58 }, - ], - }, - { - week: 36, - standards: [ - { name: 'hen_day', value: 64 }, - { name: 'hen_house', value: 62 }, - { name: 'uniformity', value: 93 }, - { name: 'egg_weight', value: 62 }, - { name: 'egg_mass', value: 40 }, - ], - flocks: [ - { id: 1, name: 'Flock A-001', data: 62 }, - { id: 2, name: 'Flock A-002', data: 61 }, - { id: 3, name: 'Flock B-001', data: 63 }, - { id: 4, name: 'Flock B-002', data: 60 }, - ], - }, - { - week: 38, - standards: [ - { name: 'hen_day', value: 66 }, - { name: 'hen_house', value: 64 }, - { name: 'uniformity', value: 93 }, - { name: 'egg_weight', value: 63 }, - { name: 'egg_mass', value: 42 }, - ], - flocks: [ - { id: 1, name: 'Flock A-001', data: 64 }, - { id: 2, name: 'Flock A-002', data: 63 }, - { id: 3, name: 'Flock B-001', data: 65 }, - { id: 4, name: 'Flock B-002', data: 62 }, - ], - }, - { - week: 40, - standards: [ - { name: 'hen_day', value: 68 }, - { name: 'hen_house', value: 66 }, - { name: 'uniformity', value: 94 }, - { name: 'egg_weight', value: 64 }, - { name: 'egg_mass', value: 44 }, - ], - flocks: [ - { id: 1, name: 'Flock A-001', data: 66 }, - { id: 2, name: 'Flock A-002', data: 65 }, - { id: 3, name: 'Flock B-001', data: 67 }, - { id: 4, name: 'Flock B-002', data: 64 }, - ], - }, - { - week: 42, - standards: [ - { name: 'hen_day', value: 70 }, - { name: 'hen_house', value: 68 }, - { name: 'uniformity', value: 94 }, - { name: 'egg_weight', value: 65 }, - { name: 'egg_mass', value: 46 }, - ], - flocks: [ - { id: 1, name: 'Flock A-001', data: 68 }, - { id: 2, name: 'Flock A-002', data: 67 }, - { id: 3, name: 'Flock B-001', data: 69 }, - { id: 4, name: 'Flock B-002', data: 66 }, - ], - }, - { - week: 44, - standards: [ - { name: 'hen_day', value: 72 }, - { name: 'hen_house', value: 70 }, - { name: 'uniformity', value: 95 }, - { name: 'egg_weight', value: 66 }, - { name: 'egg_mass', value: 48 }, - ], - flocks: [ - { id: 1, name: 'Flock A-001', data: 70 }, - { id: 2, name: 'Flock A-002', data: 69 }, - { id: 3, name: 'Flock B-001', data: 71 }, - { id: 4, name: 'Flock B-002', data: 68 }, - ], - }, - { - week: 46, - standards: [ - { name: 'hen_day', value: 74 }, - { name: 'hen_house', value: 72 }, - { name: 'uniformity', value: 95 }, - { name: 'egg_weight', value: 67 }, - { name: 'egg_mass', value: 50 }, - ], - flocks: [ - { id: 1, name: 'Flock A-001', data: 72 }, - { id: 2, name: 'Flock A-002', data: 71 }, - { id: 3, name: 'Flock B-001', data: 73 }, - { id: 4, name: 'Flock B-002', data: 70 }, - ], - }, - { - week: 48, - standards: [ - { name: 'hen_day', value: 76 }, - { name: 'hen_house', value: 74 }, - { name: 'uniformity', value: 95 }, - { name: 'egg_weight', value: 68 }, - { name: 'egg_mass', value: 52 }, - ], - flocks: [ - { id: 1, name: 'Flock A-001', data: 74 }, - { id: 2, name: 'Flock A-002', data: 73 }, - { id: 3, name: 'Flock B-001', data: 75 }, - { id: 4, name: 'Flock B-002', data: 72 }, - ], - }, - { - week: 50, - standards: [ - { name: 'hen_day', value: 78 }, - { name: 'hen_house', value: 76 }, - { name: 'uniformity', value: 96 }, - { name: 'egg_weight', value: 69 }, - { name: 'egg_mass', value: 54 }, - ], - flocks: [ - { id: 1, name: 'Flock A-001', data: 76 }, - { id: 2, name: 'Flock A-002', data: 75 }, - { id: 3, name: 'Flock B-001', data: 77 }, - { id: 4, name: 'Flock B-002', data: 74 }, - ], - }, - { - week: 52, - standards: [ - { name: 'hen_day', value: 80 }, - { name: 'hen_house', value: 78 }, - { name: 'uniformity', value: 96 }, - { name: 'egg_weight', value: 70 }, - { name: 'egg_mass', value: 56 }, - ], - flocks: [ - { id: 1, name: 'Flock A-001', data: 78 }, - { id: 2, name: 'Flock A-002', data: 77 }, - { id: 3, name: 'Flock B-001', data: 79 }, - { id: 4, name: 'Flock B-002', data: 76 }, - ], - }, - { - week: 54, - standards: [ - { name: 'hen_day', value: 82 }, - { name: 'hen_house', value: 80 }, - { name: 'uniformity', value: 96 }, - { name: 'egg_weight', value: 71 }, - { name: 'egg_mass', value: 58 }, - ], - flocks: [ - { id: 1, name: 'Flock A-001', data: 80 }, - { id: 2, name: 'Flock A-002', data: 79 }, - { id: 3, name: 'Flock B-001', data: 81 }, - { id: 4, name: 'Flock B-002', data: 78 }, - ], - }, - { - week: 56, - standards: [ - { name: 'hen_day', value: 84 }, - { name: 'hen_house', value: 82 }, - { name: 'uniformity', value: 97 }, - { name: 'egg_weight', value: 72 }, - { name: 'egg_mass', value: 60 }, - ], - flocks: [ - { id: 1, name: 'Flock A-001', data: 82 }, - { id: 2, name: 'Flock A-002', data: 81 }, - { id: 3, name: 'Flock B-001', data: 83 }, - { id: 4, name: 'Flock B-002', data: 80 }, - ], - }, - { - week: 58, - standards: [ - { name: 'hen_day', value: 86 }, - { name: 'hen_house', value: 84 }, - { name: 'uniformity', value: 97 }, - { name: 'egg_weight', value: 73 }, - { name: 'egg_mass', value: 62 }, - ], - flocks: [ - { id: 1, name: 'Flock A-001', data: 84 }, - { id: 2, name: 'Flock A-002', data: 83 }, - { id: 3, name: 'Flock B-001', data: 85 }, - { id: 4, name: 'Flock B-002', data: 82 }, - ], - }, - { - week: 60, - standards: [ - { name: 'hen_day', value: 88 }, - { name: 'hen_house', value: 86 }, - { name: 'uniformity', value: 97 }, - { name: 'egg_weight', value: 74 }, - { name: 'egg_mass', value: 64 }, - ], - flocks: [ - { id: 1, name: 'Flock A-001', data: 86 }, - { id: 2, name: 'Flock A-002', data: 85 }, - { id: 3, name: 'Flock B-001', data: 87 }, - { id: 4, name: 'Flock B-002', data: 84 }, - ], - }, - { - week: 62, - standards: [ - { name: 'hen_day', value: 90 }, - { name: 'hen_house', value: 88 }, - { name: 'uniformity', value: 98 }, - { name: 'egg_weight', value: 75 }, - { name: 'egg_mass', value: 66 }, - ], - flocks: [ - { id: 1, name: 'Flock A-001', data: 88 }, - { id: 2, name: 'Flock A-002', data: 87 }, - { id: 3, name: 'Flock B-001', data: 89 }, - { id: 4, name: 'Flock B-002', data: 86 }, - ], - }, - { - week: 64, - standards: [ - { name: 'hen_day', value: 92 }, - { name: 'hen_house', value: 90 }, - { name: 'uniformity', value: 98 }, - { name: 'egg_weight', value: 76 }, - { name: 'egg_mass', value: 68 }, - ], - flocks: [ - { id: 1, name: 'Flock A-001', data: 90 }, - { id: 2, name: 'Flock A-002', data: 89 }, - { id: 3, name: 'Flock B-001', data: 91 }, - { id: 4, name: 'Flock B-002', data: 88 }, - ], - }, - { - week: 66, - standards: [ - { name: 'hen_day', value: 94 }, - { name: 'hen_house', value: 92 }, - { name: 'uniformity', value: 98 }, - { name: 'egg_weight', value: 77 }, - { name: 'egg_mass', value: 70 }, - ], - flocks: [ - { id: 1, name: 'Flock A-001', data: 92 }, - { id: 2, name: 'Flock A-002', data: 91 }, - { id: 3, name: 'Flock B-001', data: 93 }, - { id: 4, name: 'Flock B-002', data: 90 }, - ], - }, - { - week: 68, - standards: [ - { name: 'hen_day', value: 95 }, - { name: 'hen_house', value: 93 }, - { name: 'uniformity', value: 98 }, - { name: 'egg_weight', value: 78 }, - { name: 'egg_mass', value: 72 }, - ], - flocks: [ - { id: 1, name: 'Flock A-001', data: 93 }, - { id: 2, name: 'Flock A-002', data: 92 }, - { id: 3, name: 'Flock B-001', data: 94 }, - { id: 4, name: 'Flock B-002', data: 91 }, - ], - }, - { - week: 70, - standards: [ - { name: 'hen_day', value: 96 }, - { name: 'hen_house', value: 94 }, - { name: 'uniformity', value: 99 }, - { name: 'egg_weight', value: 79 }, - { name: 'egg_mass', value: 74 }, - ], - flocks: [ - { id: 1, name: 'Flock A-001', data: 94 }, - { id: 2, name: 'Flock A-002', data: 93 }, - { id: 3, name: 'Flock B-001', data: 95 }, - { id: 4, name: 'Flock B-002', data: 92 }, - ], - }, - { - week: 72, - standards: [ - { name: 'hen_day', value: 97 }, - { name: 'hen_house', value: 95 }, - { name: 'uniformity', value: 99 }, - { name: 'egg_weight', value: 80 }, - { name: 'egg_mass', value: 76 }, - ], - flocks: [ - { id: 1, name: 'Flock A-001', data: 95 }, - { id: 2, name: 'Flock A-002', data: 94 }, - { id: 3, name: 'Flock B-001', data: 96 }, - { id: 4, name: 'Flock B-002', data: 93 }, - ], - }, -]; - -// Transform API data to Recharts format -const transformStandardData = ( - apiData: StandardChartItem[], - selectedStandards: string[] = [ - 'hen_day', - 'hen_house', - 'uniformity', - 'egg_weight', - 'egg_mass', - ] -) => { - return apiData.map((item) => { - const transformed: Record = { - week: item.week, - }; - - // Add selected standards as properties - selectedStandards.forEach((standardName) => { - const standardData = item.standards.find((s) => s.name === standardName); - if (standardData) { - transformed[standardName] = standardData.value; - } - }); - - // Add each flock's data as a property - item.flocks.forEach((flock) => { - transformed[flock.name] = flock.data; - }); - - return transformed; - }); -}; - -interface StandardLineChartProps { - data?: StandardChartItem[]; - selectedStandards?: string[]; -} - -const StandardLineChart = ({ - data: apiData, - selectedStandards = [ - 'hen_day', - 'hen_house', - 'uniformity', - 'egg_weight', - 'egg_mass', - ], -}: StandardLineChartProps) => { - // State to track which lines are hidden - const [hiddenLines, setHiddenLines] = useState([]); - - // Use API data if provided, otherwise use sample data - const chartData = apiData - ? transformStandardData(apiData, selectedStandards) - : transformStandardData(sampleApiData, selectedStandards); - - // Handle legend click to show/hide lines - const handleLegendClick = (dataKey: string) => { - setHiddenLines((prev) => - prev.includes(dataKey) - ? prev.filter((key) => key !== dataKey) - : [...prev, dataKey] - ); - }; - - // Standard line colors mapping - const standardColors: Record = { - hen_day: '#94a3b8', - hen_house: '#64748b', - uniformity: '#475569', - egg_weight: '#334155', - egg_mass: '#1e293b', - }; - - // Standard names mapping for display - const standardLabels: Record = { - hen_day: 'Hen Day', - hen_house: 'Hen House', - uniformity: 'Uniformity', - egg_weight: 'Egg Weight', - egg_mass: 'Egg Mass', - }; - - return ( -
-

- Perbandingan Henday per Umur -

- - - - - - - value !== undefined ? [`${value}%`, ''] : ['', ''] - } - labelFormatter={(label) => `Minggu ${label}`} - /> - { - if (e.dataKey) handleLegendClick(e.dataKey as string); - }} - style={{ cursor: 'pointer' }} - /> - {/* Dynamic Standard Lines */} - {selectedStandards.map((standardName) => ( - - ))} - {/* Flock Lines */} - - - - - - -
- ); -}; - -export default StandardLineChart; - -// Export types for external use -export type { FlockData, StandardData, StandardChartItem }; diff --git a/src/components/pages/dashboard/filter/DashboardProductionFilter.schema.ts b/src/components/pages/dashboard/filter/DashboardProductionFilter.schema.ts index 4ed86a48..2034bcd9 100644 --- a/src/components/pages/dashboard/filter/DashboardProductionFilter.schema.ts +++ b/src/components/pages/dashboard/filter/DashboardProductionFilter.schema.ts @@ -1,16 +1,117 @@ +import { OptionType } from '@/components/input/SelectInput'; import * as yup from 'yup'; -const dashboardProductionFilterSchema = yup.object({ - startDate: yup.string().optional(), - endDate: yup.string().optional(), - flock: yup.array().optional(), - standard_production_id: yup.array().optional(), - standard_productions: yup.array().optional(), - period: yup.string().optional(), -}); +export type DashboardFilterType = { + startDate: string; + endDate: string; + analysisMode: string; + comparedBy: string | undefined; + location: OptionType | OptionType[]; + lokasiIds: number[] | undefined; + flock: OptionType | OptionType[] | undefined; + flockIds: number[] | undefined; + kandang: OptionType | OptionType[] | undefined; + kandangIds: number[] | undefined; +}; -export type DashboardProductionFilterValues = yup.InferType< - typeof dashboardProductionFilterSchema ->; +// Schema untuk mode OVERVIEW - semua field required +export const DashboardFilterOverviewSchema: yup.ObjectSchema = + yup.object({ + startDate: yup.string().required('Start date is required'), + endDate: yup.string().required('End date is required'), + analysisMode: yup.string().required('Analysis mode is required'), + comparedBy: yup.string().when('analysisMode', { + is: 'COMPARISON', + then: (schema) => schema.required('Compared by is required'), + otherwise: (schema) => schema.optional(), + }), + lokasiIds: yup.array().optional(), + flockIds: yup.array().optional(), + kandangIds: yup.array().optional(), + location: yup + .mixed() + .required('Farm is required') + .test('is-not-empty', 'Farm is required', (value) => { + if (Array.isArray(value)) { + return value.length > 0; + } + return !!value; + }), + flock: yup + .mixed() + .required('Flock is required') + .test('is-not-empty', 'Flock is required', (value) => { + if (Array.isArray(value)) { + return value.length > 0; + } + return !!value; + }), + kandang: yup + .mixed() + .required('Kandang is required') + .test('is-not-empty', 'Kandang is required', (value) => { + if (Array.isArray(value)) { + return value.length > 0; + } + return !!value; + }), + }); -export default dashboardProductionFilterSchema; +// Schema untuk mode COMPARISON - conditional validation +export const DashboardFilterComparisonSchema: yup.ObjectSchema = + yup.object({ + startDate: yup.string().required('Start date is required'), + endDate: yup.string().required('End date is required'), + analysisMode: yup.string().required('Analysis mode is required'), + comparedBy: yup.string().when('analysisMode', { + is: 'COMPARISON', + then: (schema) => schema.required('Compared by is required'), + otherwise: (schema) => schema.optional(), + }), + lokasiIds: yup.array().optional(), + flockIds: yup.array().optional(), + kandangIds: yup.array().optional(), + location: yup + .mixed() + .required('Farm is required') + .test('is-not-empty', 'Farm is required', (value) => { + if (Array.isArray(value)) { + return value.length > 0; + } + return !!value; + }), + flock: yup.mixed().when('comparedBy', { + is: (value: string) => value === 'FLOCK' || value === 'KANDANG', + then: (schema) => + schema.test('is-required', 'Flock is required', (value) => { + if (Array.isArray(value)) { + return value.length > 0; + } + return !!value; + }), + otherwise: (schema) => schema.optional(), + }), + kandang: yup.mixed().when('comparedBy', { + is: 'KANDANG', + then: (schema) => + schema.test('is-required', 'Kandang is required', (value) => { + if (Array.isArray(value)) { + return value.length > 0; + } + return !!value; + }), + otherwise: (schema) => schema.optional(), + }), + }); + +// Helper function untuk mendapatkan schema yang sesuai berdasarkan analysis mode +export const getDashboardFilterSchema = (analysisMode?: string) => { + return analysisMode === 'OVERVIEW' + ? DashboardFilterOverviewSchema + : DashboardFilterComparisonSchema; +}; + +// Default schema +export const DashboardFilterSchema = DashboardFilterComparisonSchema; + +export type DashboardFilterValues = yup.InferType; diff --git a/src/components/pages/dashboard/skeleton/DashboardLineChartSkeleton.tsx b/src/components/pages/dashboard/skeleton/DashboardLineChartSkeleton.tsx new file mode 100644 index 00000000..cdd923f4 --- /dev/null +++ b/src/components/pages/dashboard/skeleton/DashboardLineChartSkeleton.tsx @@ -0,0 +1,74 @@ +import { Icon } from '@iconify/react'; + +const DashboardLineChartSkeleton = () => { + return ( +
+ {/* Header with title skeleton */} +
+ Performance{' '} + +
+ + {/* Chart area with axes skeleton */} +
+ {/* Main chart container */} +
+ {/* Y-axis skeleton (left side) */} +
+ {[1, 2, 3, 4, 5, 6].map((item) => ( +
+ ))} +
+ + {/* Chart content area */} +
+ {/* Empty state centered in chart area */} +
+ {/* Filter icon */} +
+ +
+ + {/* Empty state text */} +

+ No Filters Selected +

+

+ Please choose filters to narrow down your results and make your + search easier. +

+
+ + {/* Placeholder for chart height */} +
+ + {/* X-axis skeleton (bottom) */} +
+ {[1, 2, 3, 4, 5, 6, 7, 8, 9, 10].map((item) => ( +
+ ))} +
+
+
+
+
+ ); +}; + +export default DashboardLineChartSkeleton; diff --git a/src/dummy/dashboard/dashboard.comparasion.flock.dummy.json b/src/dummy/dashboard/dashboard.comparasion.flock.dummy.json new file mode 100644 index 00000000..a2baf621 --- /dev/null +++ b/src/dummy/dashboard/dashboard.comparasion.flock.dummy.json @@ -0,0 +1,366 @@ +{ + "code": 200, + "status": "success", + "message": "Get dashboard performance flock comparison successfully", + "meta": { + "page": 1, + "limit": 10, + "total_pages": 1, + "total_results": 1, + "filters": { + "start_date": "2025-12-01", + "end_date": "2025-12-31", + "analysis_mode": "COMPARASION", + "lokasi_ids": [1], + "flock_ids": [1, 2, 3], + "kandang_ids": [] + } + }, + "data": { + "statistics_data": [ + { + "label": "HPP Global", + "value": 16200, + "percent_last_month": 15.5 + }, + { + "label": "Avg. Selling Price", + "value": 28300, + "percent_last_month": -50 + }, + { + "label": "FCR", + "value": 24.02, + "percent_last_month": 15.5 + }, + { + "label": "Mortality", + "value": 5, + "percent_last_month": -15.5 + } + ], + "charts": { + "flock": { + "series": [ + { + "id": 1, + "label": "Flock Dago", + "unit": "%" + }, + { + "id": 2, + "label": "Flock Sulanjana", + "unit": "%" + }, + { + "id": 3, + "label": "Flock Garut 2", + "unit": "%" + } + ], + "dataset": [ + { + "week": 1, + "1": 18.5, + "2": 20.2, + "3": 17.8 + }, + { + "week": 2, + "1": 19.2, + "2": 21.5, + "3": 18.1 + }, + { + "week": 3, + "1": 20.1, + "2": 22.8, + "3": 18.5 + }, + { + "week": 4, + "1": 21.5, + "2": 24.0, + "3": 19.2 + }, + { + "week": 5, + "1": 22.8, + "2": 23.5, + "3": 20.4 + }, + { + "week": 6, + "1": 24.2, + "2": 22.1, + "3": 21.6 + }, + { + "week": 7, + "1": 25.8, + "2": 21.8, + "3": 22.9 + }, + { + "week": 8, + "1": 26.5, + "2": 22.4, + "3": 23.5 + }, + { + "week": 9, + "1": 26.2, + "2": 23.9, + "3": 24.1 + }, + { + "week": 10, + "1": 25.4, + "2": 24.8, + "3": 24.8 + }, + { + "week": 11, + "1": 24.8, + "2": 26.2, + "3": 25.4 + }, + { + "week": 12, + "1": 24.1, + "2": 27.5, + "3": 26.2 + }, + { + "week": 13, + "1": 23.5, + "2": 28.1, + "3": 27.5 + }, + { + "week": 14, + "1": 22.8, + "2": 27.4, + "3": 28.4 + }, + { + "week": 15, + "1": 21.9, + "2": 26.5, + "3": 29.1 + }, + { + "week": 16, + "1": 21.2, + "2": 25.8, + "3": 28.5 + }, + { + "week": 17, + "1": 20.8, + "2": 24.2, + "3": 27.2 + }, + { + "week": 18, + "1": 20.1, + "2": 23.1, + "3": 26.1 + }, + { + "week": 19, + "1": 19.5, + "2": 22.5, + "3": 25.8 + }, + { + "week": 20, + "1": 19.8, + "2": 21.9, + "3": 24.5 + }, + { + "week": 21, + "1": 20.5, + "2": 21.4, + "3": 23.2 + }, + { + "week": 22, + "1": 21.8, + "2": 21.0, + "3": 22.8 + }, + { + "week": 23, + "1": 22.5, + "2": 21.8, + "3": 21.9 + }, + { + "week": 24, + "1": 23.9, + "2": 22.5, + "3": 21.2 + }, + { + "week": 25, + "1": 24.5, + "2": 23.4, + "3": 20.5 + }, + { + "week": 26, + "1": 25.1, + "2": 24.8, + "3": 20.1 + }, + { + "week": 27, + "1": 26.8, + "2": 25.5, + "3": 19.8 + }, + { + "week": 28, + "1": 27.5, + "2": 26.2, + "3": 20.4 + }, + { + "week": 29, + "1": 27.2, + "2": 27.8, + "3": 21.5 + }, + { + "week": 30, + "1": 26.4, + "2": 28.5, + "3": 22.1 + }, + { + "week": 31, + "1": 25.8, + "2": 29.2, + "3": 23.4 + }, + { + "week": 32, + "1": 24.9, + "2": 28.8, + "3": 24.2 + }, + { + "week": 33, + "1": 24.2, + "2": 27.4, + "3": 25.8 + }, + { + "week": 34, + "1": 23.5, + "2": 26.5, + "3": 26.4 + }, + { + "week": 35, + "1": 22.8, + "2": 25.8, + "3": 27.1 + }, + { + "week": 36, + "1": 21.4, + "2": 24.2, + "3": 27.8 + }, + { + "week": 37, + "1": 20.5, + "2": 23.5, + "3": 28.2 + }, + { + "week": 38, + "1": 19.8, + "2": 22.8, + "3": 28.9 + }, + { + "week": 39, + "1": 19.2, + "2": 21.9, + "3": 27.5 + }, + { + "week": 40, + "1": 18.8, + "2": 21.2, + "3": 26.4 + }, + { + "week": 41, + "1": 18.5, + "2": 20.8, + "3": 25.2 + }, + { + "week": 42, + "1": 19.1, + "2": 20.5, + "3": 24.1 + }, + { + "week": 43, + "1": 20.2, + "2": 21.4, + "3": 23.5 + }, + { + "week": 44, + "1": 21.5, + "2": 22.8, + "3": 22.1 + }, + { + "week": 45, + "1": 22.8, + "2": 24.1, + "3": 21.8 + }, + { + "week": 46, + "1": 23.4, + "2": 25.2, + "3": 20.9 + }, + { + "week": 47, + "1": 24.1, + "2": 26.8, + "3": 20.1 + }, + { + "week": 48, + "1": 25.8, + "2": 27.5, + "3": 19.5 + }, + { + "week": 49, + "1": 26.2, + "2": 28.2, + "3": 19.1 + }, + { + "week": 50, + "1": 26.8, + "2": 28.8, + "3": 18.8 + } + ] + } + } + } +} diff --git a/src/dummy/dashboard/dashboard.comparasion.kandang.dummy.json b/src/dummy/dashboard/dashboard.comparasion.kandang.dummy.json new file mode 100644 index 00000000..fc0bf82d --- /dev/null +++ b/src/dummy/dashboard/dashboard.comparasion.kandang.dummy.json @@ -0,0 +1,347 @@ +{ + "statistics_data": [ + { + "label": "HPP Global", + "value": 16200, + "percent_last_month": 15.5 + }, + { + "label": "Avg. Selling Price", + "value": 28300, + "percent_last_month": -50 + }, + { + "label": "FCR", + "value": 24.02, + "percent_last_month": 15.5 + }, + { + "label": "Mortality", + "value": 5, + "percent_last_month": -15.5 + } + ], + "charts": { + "kandang": { + "series": [ + { + "id": 1, + "label": "Kandang Dago", + "unit": "%" + }, + { + "id": 2, + "label": "Kandang Sulanjana", + "unit": "%" + }, + { + "id": 3, + "label": "Kandang Garut 2", + "unit": "%" + } + ], + "dataset": [ + { + "week": 1, + "1": 21.2, + "2": 19.5, + "3": 20.1 + }, + { + "week": 2, + "1": 22.5, + "2": 19.8, + "3": 20.4 + }, + { + "week": 3, + "1": 23.1, + "2": 20.2, + "3": 21.0 + }, + { + "week": 4, + "1": 24.5, + "2": 21.5, + "3": 22.1 + }, + { + "week": 5, + "1": 25.8, + "2": 22.4, + "3": 23.5 + }, + { + "week": 6, + "1": 26.2, + "2": 23.1, + "3": 24.8 + }, + { + "week": 7, + "1": 27.5, + "2": 24.5, + "3": 26.2 + }, + { + "week": 8, + "1": 28.1, + "2": 25.8, + "3": 27.5 + }, + { + "week": 9, + "1": 28.8, + "2": 26.2, + "3": 28.4 + }, + { + "week": 10, + "1": 29.1, + "2": 27.5, + "3": 28.1 + }, + { + "week": 11, + "1": 28.5, + "2": 28.1, + "3": 27.4 + }, + { + "week": 12, + "1": 27.2, + "2": 29.1, + "3": 26.5 + }, + { + "week": 13, + "1": 26.1, + "2": 28.5, + "3": 25.8 + }, + { + "week": 14, + "1": 25.8, + "2": 27.2, + "3": 24.2 + }, + { + "week": 15, + "1": 24.5, + "2": 26.1, + "3": 23.1 + }, + { + "week": 16, + "1": 23.2, + "2": 25.8, + "3": 22.5 + }, + { + "week": 17, + "1": 22.8, + "2": 24.5, + "3": 21.9 + }, + { + "week": 18, + "1": 21.9, + "2": 23.2, + "3": 21.0 + }, + { + "week": 19, + "1": 21.2, + "2": 22.8, + "3": 20.5 + }, + { + "week": 20, + "1": 20.5, + "2": 21.9, + "3": 19.8 + }, + { + "week": 21, + "1": 19.8, + "2": 21.2, + "3": 19.2 + }, + { + "week": 22, + "1": 20.4, + "2": 20.5, + "3": 18.5 + }, + { + "week": 23, + "1": 21.0, + "2": 19.8, + "3": 18.1 + }, + { + "week": 24, + "1": 22.1, + "2": 20.4, + "3": 17.8 + }, + { + "week": 25, + "1": 23.5, + "2": 21.0, + "3": 18.5 + }, + { + "week": 26, + "1": 24.8, + "2": 22.1, + "3": 19.2 + }, + { + "week": 27, + "1": 26.2, + "2": 23.5, + "3": 20.1 + }, + { + "week": 28, + "1": 27.5, + "2": 24.8, + "3": 21.5 + }, + { + "week": 29, + "1": 28.4, + "2": 26.2, + "3": 22.8 + }, + { + "week": 30, + "1": 28.1, + "2": 27.5, + "3": 24.2 + }, + { + "week": 31, + "1": 27.4, + "2": 28.4, + "3": 25.8 + }, + { + "week": 32, + "1": 26.5, + "2": 28.1, + "3": 26.5 + }, + { + "week": 33, + "1": 25.8, + "2": 27.4, + "3": 27.2 + }, + { + "week": 34, + "1": 24.2, + "2": 26.5, + "3": 28.1 + }, + { + "week": 35, + "1": 23.1, + "2": 25.8, + "3": 28.5 + }, + { + "week": 36, + "1": 22.5, + "2": 24.2, + "3": 29.1 + }, + { + "week": 37, + "1": 21.9, + "2": 23.1, + "3": 28.8 + }, + { + "week": 38, + "1": 21.0, + "2": 22.5, + "3": 28.1 + }, + { + "week": 39, + "1": 20.5, + "2": 21.9, + "3": 27.4 + }, + { + "week": 40, + "1": 19.8, + "2": 21.0, + "3": 26.5 + }, + { + "week": 41, + "1": 19.2, + "2": 20.5, + "3": 25.8 + }, + { + "week": 42, + "1": 18.5, + "2": 19.8, + "3": 24.2 + }, + { + "week": 43, + "1": 18.1, + "2": 19.2, + "3": 23.1 + }, + { + "week": 44, + "1": 17.8, + "2": 18.5, + "3": 22.5 + }, + { + "week": 45, + "1": 18.5, + "2": 18.1, + "3": 21.9 + }, + { + "week": 46, + "1": 19.2, + "2": 17.8, + "3": 21.0 + }, + { + "week": 47, + "1": 20.1, + "2": 18.5, + "3": 20.5 + }, + { + "week": 48, + "1": 21.5, + "2": 19.2, + "3": 19.8 + }, + { + "week": 49, + "1": 22.8, + "2": 20.1, + "3": 19.2 + }, + { + "week": 50, + "1": 24.2, + "2": 21.5, + "3": 18.5 + } + ] + } + } +} diff --git a/src/dummy/dashboard/dashboard.comparasion.location.dummy.json b/src/dummy/dashboard/dashboard.comparasion.location.dummy.json new file mode 100644 index 00000000..8404a931 --- /dev/null +++ b/src/dummy/dashboard/dashboard.comparasion.location.dummy.json @@ -0,0 +1,1796 @@ +{ + "statistics_data": [ + { + "label": "HPP Global", + "value": 16200, + "percent_last_month": 15.5 + }, + { + "label": "Avg. Selling Price", + "value": 28300, + "percent_last_month": -50 + }, + { + "label": "FCR", + "value": 24.02, + "percent_last_month": 15.5 + }, + { + "label": "Mortality", + "value": 5, + "percent_last_month": -15.5 + } + ], + "charts": { + "body_weight": { + "series": [ + { + "id": "body_weight", + "label": "Body Weight", + "unit": "g" + }, + { + "id": "std_body_weight", + "label": "STD. Body Weight", + "unit": "g" + } + ], + "dataset": [ + { + "week": 1, + "body_weight": 1400, + "std_body_weight": 1480 + }, + { + "week": 2, + "body_weight": 1490, + "std_body_weight": 1580 + }, + { + "week": 3, + "body_weight": 1560, + "std_body_weight": 1650 + }, + { + "week": 4, + "body_weight": 1600, + "std_body_weight": 1700 + }, + { + "week": 5, + "body_weight": 1720, + "std_body_weight": 1750 + }, + { + "week": 6, + "body_weight": 1760, + "std_body_weight": 1750 + }, + { + "week": 7, + "body_weight": 1800, + "std_body_weight": 1770 + }, + { + "week": 8, + "body_weight": 1765, + "std_body_weight": 1770 + }, + { + "week": 9, + "body_weight": 1750, + "std_body_weight": 1780 + }, + { + "week": 10, + "body_weight": 1820, + "std_body_weight": 1800 + }, + { + "week": 11, + "body_weight": 1800, + "std_body_weight": 1790 + }, + { + "week": 12, + "body_weight": 1790, + "std_body_weight": 1780 + }, + { + "week": 13, + "body_weight": 1810, + "std_body_weight": 1770 + }, + { + "week": 14, + "body_weight": 1750, + "std_body_weight": 1780 + }, + { + "week": 15, + "body_weight": 1740, + "std_body_weight": 1800 + }, + { + "week": 16, + "body_weight": 1740, + "std_body_weight": 1820 + }, + { + "week": 17, + "body_weight": 1800, + "std_body_weight": 1830 + }, + { + "week": 18, + "body_weight": 1830, + "std_body_weight": 1840 + }, + { + "week": 19, + "body_weight": 1830, + "std_body_weight": 1840 + }, + { + "week": 20, + "body_weight": 1810, + "std_body_weight": 1845 + }, + { + "week": 21, + "body_weight": 1800, + "std_body_weight": 1850 + }, + { + "week": 22, + "body_weight": 1830, + "std_body_weight": 1855 + }, + { + "week": 23, + "body_weight": 1810, + "std_body_weight": 1860 + }, + { + "week": 24, + "body_weight": 1840, + "std_body_weight": 1870 + }, + { + "week": 25, + "body_weight": 1800, + "std_body_weight": 1880 + }, + { + "week": 26, + "body_weight": 1880, + "std_body_weight": 1900 + }, + { + "week": 27, + "body_weight": 1910, + "std_body_weight": 1910 + }, + { + "week": 28, + "body_weight": 1900, + "std_body_weight": 1920 + }, + { + "week": 29, + "body_weight": 1840, + "std_body_weight": 1925 + }, + { + "week": 30, + "body_weight": 1810, + "std_body_weight": 1930 + }, + { + "week": 31, + "body_weight": 1780, + "std_body_weight": 1935 + }, + { + "week": 32, + "body_weight": 1820, + "std_body_weight": 1940 + }, + { + "week": 33, + "body_weight": 1800, + "std_body_weight": 1945 + }, + { + "week": 34, + "body_weight": 1770, + "std_body_weight": 1950 + }, + { + "week": 35, + "body_weight": 1840, + "std_body_weight": 1955 + }, + { + "week": 36, + "body_weight": 1810, + "std_body_weight": 1960 + }, + { + "week": 37, + "body_weight": 1780, + "std_body_weight": 1965 + }, + { + "week": 38, + "body_weight": 1820, + "std_body_weight": 1970 + }, + { + "week": 39, + "body_weight": 1770, + "std_body_weight": 1970 + }, + { + "week": 40, + "body_weight": 1840, + "std_body_weight": 1975 + }, + { + "week": 41, + "body_weight": 1820, + "std_body_weight": 1975 + }, + { + "week": 42, + "body_weight": 1790, + "std_body_weight": 1975 + }, + { + "week": 43, + "body_weight": 1860, + "std_body_weight": 1980 + }, + { + "week": 44, + "body_weight": 1820, + "std_body_weight": 1980 + }, + { + "week": 45, + "body_weight": 1800, + "std_body_weight": 1980 + }, + { + "week": 46, + "body_weight": 1840, + "std_body_weight": 1985 + }, + { + "week": 47, + "body_weight": 1790, + "std_body_weight": 1990 + }, + { + "week": 48, + "body_weight": 1910, + "std_body_weight": 1990 + }, + { + "week": 49, + "body_weight": 1950, + "std_body_weight": 1995 + }, + { + "week": 50, + "body_weight": 1910, + "std_body_weight": 2000 + } + ] + }, + "performance": { + "series": [ + { + "id": "act_laying", + "label": "Act. % Laying", + "unit": "%" + }, + { + "id": "std_laying", + "label": "STD. % Laying", + "unit": "%" + }, + { + "id": "act_egg_weight", + "label": "Act. Egg Weight", + "unit": "%" + }, + { + "id": "std_egg_weight", + "label": "STD. Egg Weight", + "unit": "%" + }, + { + "id": "act_feed_intake", + "label": "Act. Feed Intake", + "unit": "%" + }, + { + "id": "std_feed_intake", + "label": "STD. Feed Intake", + "unit": "%" + }, + { + "id": "act_uniformity", + "label": "Act. Uniformity", + "unit": "%" + }, + { + "id": "std_uniformity", + "label": "STD. Uniformity", + "unit": "%" + } + ], + "dataset": [ + { + "week": 1, + "act_laying": 60, + "std_laying": 63, + "act_egg_weight": 53, + "std_egg_weight": 54, + "act_feed_intake": 76, + "std_feed_intake": 75, + "act_uniformity": 85, + "std_uniformity": 85 + }, + { + "week": 2, + "act_laying": 64, + "std_laying": 68, + "act_egg_weight": 54, + "std_egg_weight": 55, + "act_feed_intake": 78, + "std_feed_intake": 76, + "act_uniformity": 85, + "std_uniformity": 85 + }, + { + "week": 3, + "act_laying": 68, + "std_laying": 72, + "act_egg_weight": 54, + "std_egg_weight": 57, + "act_feed_intake": 81, + "std_feed_intake": 77, + "act_uniformity": 86, + "std_uniformity": 85 + }, + { + "week": 4, + "act_laying": 70, + "std_laying": 76, + "act_egg_weight": 56, + "std_egg_weight": 60, + "act_feed_intake": 84, + "std_feed_intake": 78, + "act_uniformity": 86, + "std_uniformity": 85 + }, + { + "week": 5, + "act_laying": 76, + "std_laying": 78, + "act_egg_weight": 60, + "std_egg_weight": 64, + "act_feed_intake": 86, + "std_feed_intake": 78, + "act_uniformity": 87, + "std_uniformity": 85 + }, + { + "week": 6, + "act_laying": 78, + "std_laying": 78, + "act_egg_weight": 64, + "std_egg_weight": 67, + "act_feed_intake": 87, + "std_feed_intake": 78, + "act_uniformity": 87, + "std_uniformity": 85 + }, + { + "week": 7, + "act_laying": 80, + "std_laying": 78, + "act_egg_weight": 68, + "std_egg_weight": 67, + "act_feed_intake": 88, + "std_feed_intake": 78, + "act_uniformity": 88, + "std_uniformity": 85 + }, + { + "week": 8, + "act_laying": 78, + "std_laying": 79, + "act_egg_weight": 72, + "std_egg_weight": 67, + "act_feed_intake": 87, + "std_feed_intake": 78, + "act_uniformity": 88, + "std_uniformity": 85 + }, + { + "week": 9, + "act_laying": 81, + "std_laying": 78, + "act_egg_weight": 75, + "std_egg_weight": 67, + "act_feed_intake": 87, + "std_feed_intake": 78, + "act_uniformity": 88, + "std_uniformity": 85 + }, + { + "week": 10, + "act_laying": 80, + "std_laying": 78, + "act_egg_weight": 76, + "std_egg_weight": 67, + "act_feed_intake": 88, + "std_feed_intake": 78, + "act_uniformity": 89, + "std_uniformity": 85 + }, + { + "week": 11, + "act_laying": 79, + "std_laying": 79, + "act_egg_weight": 75, + "std_egg_weight": 67, + "act_feed_intake": 88, + "std_feed_intake": 78, + "act_uniformity": 89, + "std_uniformity": 85 + }, + { + "week": 12, + "act_laying": 80, + "std_laying": 78, + "act_egg_weight": 77, + "std_egg_weight": 68, + "act_feed_intake": 88, + "std_feed_intake": 79, + "act_uniformity": 88, + "std_uniformity": 85 + }, + { + "week": 13, + "act_laying": 81, + "std_laying": 78, + "act_egg_weight": 77, + "std_egg_weight": 68, + "act_feed_intake": 89, + "std_feed_intake": 79, + "act_uniformity": 88, + "std_uniformity": 85 + }, + { + "week": 14, + "act_laying": 78, + "std_laying": 79, + "act_egg_weight": 78, + "std_egg_weight": 69, + "act_feed_intake": 88, + "std_feed_intake": 79, + "act_uniformity": 88, + "std_uniformity": 85 + }, + { + "week": 15, + "act_laying": 77, + "std_laying": 79, + "act_egg_weight": 77, + "std_egg_weight": 70, + "act_feed_intake": 87, + "std_feed_intake": 80, + "act_uniformity": 87, + "std_uniformity": 85 + }, + { + "week": 16, + "act_laying": 77, + "std_laying": 80, + "act_egg_weight": 78, + "std_egg_weight": 70, + "act_feed_intake": 86, + "std_feed_intake": 80, + "act_uniformity": 87, + "std_uniformity": 85 + }, + { + "week": 17, + "act_laying": 80, + "std_laying": 80, + "act_egg_weight": 80, + "std_egg_weight": 72, + "act_feed_intake": 88, + "std_feed_intake": 81, + "act_uniformity": 87, + "std_uniformity": 85 + }, + { + "week": 18, + "act_laying": 82, + "std_laying": 81, + "act_egg_weight": 83, + "std_egg_weight": 73, + "act_feed_intake": 88, + "std_feed_intake": 81, + "act_uniformity": 88, + "std_uniformity": 85 + }, + { + "week": 19, + "act_laying": 82, + "std_laying": 82, + "act_egg_weight": 84, + "std_egg_weight": 73, + "act_feed_intake": 88, + "std_feed_intake": 82, + "act_uniformity": 88, + "std_uniformity": 85 + }, + { + "week": 20, + "act_laying": 81, + "std_laying": 82, + "act_egg_weight": 82, + "std_egg_weight": 74, + "act_feed_intake": 88, + "std_feed_intake": 82, + "act_uniformity": 88, + "std_uniformity": 85 + }, + { + "week": 21, + "act_laying": 80, + "std_laying": 83, + "act_egg_weight": 82, + "std_egg_weight": 74, + "act_feed_intake": 88, + "std_feed_intake": 83, + "act_uniformity": 88, + "std_uniformity": 85 + }, + { + "week": 22, + "act_laying": 82, + "std_laying": 83, + "act_egg_weight": 82, + "std_egg_weight": 75, + "act_feed_intake": 89, + "std_feed_intake": 83, + "act_uniformity": 88, + "std_uniformity": 85 + }, + { + "week": 23, + "act_laying": 80, + "std_laying": 84, + "act_egg_weight": 84, + "std_egg_weight": 75, + "act_feed_intake": 88, + "std_feed_intake": 84, + "act_uniformity": 89, + "std_uniformity": 85 + }, + { + "week": 24, + "act_laying": 82, + "std_laying": 84, + "act_egg_weight": 82, + "std_egg_weight": 76, + "act_feed_intake": 88, + "std_feed_intake": 84, + "act_uniformity": 89, + "std_uniformity": 85 + }, + { + "week": 25, + "act_laying": 84, + "std_laying": 85, + "act_egg_weight": 83, + "std_egg_weight": 76, + "act_feed_intake": 88, + "std_feed_intake": 85, + "act_uniformity": 89, + "std_uniformity": 85 + }, + { + "week": 26, + "act_laying": 86, + "std_laying": 86, + "act_egg_weight": 87, + "std_egg_weight": 77, + "act_feed_intake": 89, + "std_feed_intake": 85, + "act_uniformity": 88, + "std_uniformity": 85 + }, + { + "week": 27, + "act_laying": 87, + "std_laying": 86, + "act_egg_weight": 88, + "std_egg_weight": 77, + "act_feed_intake": 89, + "std_feed_intake": 85, + "act_uniformity": 88, + "std_uniformity": 85 + }, + { + "week": 28, + "act_laying": 83, + "std_laying": 86, + "act_egg_weight": 84, + "std_egg_weight": 77, + "act_feed_intake": 88, + "std_feed_intake": 85, + "act_uniformity": 88, + "std_uniformity": 85 + }, + { + "week": 29, + "act_laying": 81, + "std_laying": 86, + "act_egg_weight": 82, + "std_egg_weight": 77, + "act_feed_intake": 87, + "std_feed_intake": 85, + "act_uniformity": 88, + "std_uniformity": 85 + }, + { + "week": 30, + "act_laying": 79, + "std_laying": 86, + "act_egg_weight": 80, + "std_egg_weight": 78, + "act_feed_intake": 86, + "std_feed_intake": 86, + "act_uniformity": 87, + "std_uniformity": 85 + }, + { + "week": 31, + "act_laying": 81, + "std_laying": 85, + "act_egg_weight": 82, + "std_egg_weight": 78, + "act_feed_intake": 87, + "std_feed_intake": 86, + "act_uniformity": 87, + "std_uniformity": 85 + }, + { + "week": 32, + "act_laying": 79, + "std_laying": 85, + "act_egg_weight": 80, + "std_egg_weight": 78, + "act_feed_intake": 86, + "std_feed_intake": 86, + "act_uniformity": 87, + "std_uniformity": 85 + }, + { + "week": 33, + "act_laying": 82, + "std_laying": 85, + "act_egg_weight": 84, + "std_egg_weight": 78, + "act_feed_intake": 88, + "std_feed_intake": 86, + "act_uniformity": 88, + "std_uniformity": 85 + }, + { + "week": 34, + "act_laying": 80, + "std_laying": 85, + "act_egg_weight": 82, + "std_egg_weight": 78, + "act_feed_intake": 88, + "std_feed_intake": 86, + "act_uniformity": 88, + "std_uniformity": 85 + }, + { + "week": 35, + "act_laying": 83, + "std_laying": 85, + "act_egg_weight": 84, + "std_egg_weight": 79, + "act_feed_intake": 89, + "std_feed_intake": 86, + "act_uniformity": 88, + "std_uniformity": 85 + }, + { + "week": 36, + "act_laying": 81, + "std_laying": 85, + "act_egg_weight": 82, + "std_egg_weight": 79, + "act_feed_intake": 88, + "std_feed_intake": 87, + "act_uniformity": 89, + "std_uniformity": 85 + }, + { + "week": 37, + "act_laying": 83, + "std_laying": 85, + "act_egg_weight": 84, + "std_egg_weight": 79, + "act_feed_intake": 89, + "std_feed_intake": 87, + "act_uniformity": 89, + "std_uniformity": 85 + }, + { + "week": 38, + "act_laying": 80, + "std_laying": 85, + "act_egg_weight": 81, + "std_egg_weight": 79, + "act_feed_intake": 88, + "std_feed_intake": 87, + "act_uniformity": 89, + "std_uniformity": 85 + }, + { + "week": 39, + "act_laying": 83, + "std_laying": 86, + "act_egg_weight": 84, + "std_egg_weight": 79, + "act_feed_intake": 89, + "std_feed_intake": 87, + "act_uniformity": 88, + "std_uniformity": 85 + }, + { + "week": 40, + "act_laying": 81, + "std_laying": 86, + "act_egg_weight": 82, + "std_egg_weight": 79, + "act_feed_intake": 88, + "std_feed_intake": 87, + "act_uniformity": 88, + "std_uniformity": 85 + }, + { + "week": 41, + "act_laying": 83, + "std_laying": 86, + "act_egg_weight": 85, + "std_egg_weight": 79, + "act_feed_intake": 89, + "std_feed_intake": 87, + "act_uniformity": 88, + "std_uniformity": 85 + }, + { + "week": 42, + "act_laying": 81, + "std_laying": 86, + "act_egg_weight": 82, + "std_egg_weight": 79, + "act_feed_intake": 88, + "std_feed_intake": 87, + "act_uniformity": 88, + "std_uniformity": 85 + }, + { + "week": 43, + "act_laying": 83, + "std_laying": 86, + "act_egg_weight": 85, + "std_egg_weight": 80, + "act_feed_intake": 89, + "std_feed_intake": 87, + "act_uniformity": 88, + "std_uniformity": 85 + }, + { + "week": 44, + "act_laying": 80, + "std_laying": 86, + "act_egg_weight": 82, + "std_egg_weight": 80, + "act_feed_intake": 88, + "std_feed_intake": 88, + "act_uniformity": 89, + "std_uniformity": 85 + }, + { + "week": 45, + "act_laying": 84, + "std_laying": 86, + "act_egg_weight": 85, + "std_egg_weight": 80, + "act_feed_intake": 89, + "std_feed_intake": 88, + "act_uniformity": 89, + "std_uniformity": 85 + }, + { + "week": 46, + "act_laying": 82, + "std_laying": 87, + "act_egg_weight": 83, + "std_egg_weight": 80, + "act_feed_intake": 88, + "std_feed_intake": 88, + "act_uniformity": 89, + "std_uniformity": 85 + }, + { + "week": 47, + "act_laying": 84, + "std_laying": 87, + "act_egg_weight": 85, + "std_egg_weight": 80, + "act_feed_intake": 89, + "std_feed_intake": 88, + "act_uniformity": 89, + "std_uniformity": 85 + }, + { + "week": 48, + "act_laying": 82, + "std_laying": 87, + "act_egg_weight": 83, + "std_egg_weight": 80, + "act_feed_intake": 88, + "std_feed_intake": 88, + "act_uniformity": 89, + "std_uniformity": 85 + }, + { + "week": 49, + "act_laying": 88, + "std_laying": 88, + "act_egg_weight": 90, + "std_egg_weight": 80, + "act_feed_intake": 89, + "std_feed_intake": 88, + "act_uniformity": 90, + "std_uniformity": 85 + }, + { + "week": 50, + "act_laying": 85, + "std_laying": 88, + "act_egg_weight": 87, + "std_egg_weight": 80, + "act_feed_intake": 89, + "std_feed_intake": 88, + "act_uniformity": 89, + "std_uniformity": 85 + } + ] + }, + "fcr": { + "series": [ + { + "id": "act_fcr", + "label": "Act. FCR", + "unit": "" + }, + { + "id": "std_fcr", + "label": "STD. FCR", + "unit": "" + }, + { + "id": "act_fcr_cum", + "label": "Act. FCR Cumulative", + "unit": "" + }, + { + "id": "std_fcr_cum", + "label": "STD. FCR Cumulative", + "unit": "" + } + ], + "dataset": [ + { + "week": 1, + "act_fcr": 1.42, + "std_fcr": 1.45, + "act_fcr_cum": 1.42, + "std_fcr_cum": 1.45 + }, + { + "week": 2, + "act_fcr": 1.48, + "std_fcr": 1.5, + "act_fcr_cum": 1.45, + "std_fcr_cum": 1.48 + }, + { + "week": 3, + "act_fcr": 1.55, + "std_fcr": 1.55, + "act_fcr_cum": 1.48, + "std_fcr_cum": 1.51 + }, + { + "week": 4, + "act_fcr": 1.62, + "std_fcr": 1.6, + "act_fcr_cum": 1.52, + "std_fcr_cum": 1.54 + }, + { + "week": 5, + "act_fcr": 1.68, + "std_fcr": 1.65, + "act_fcr_cum": 1.56, + "std_fcr_cum": 1.57 + }, + { + "week": 6, + "act_fcr": 1.72, + "std_fcr": 1.7, + "act_fcr_cum": 1.6, + "std_fcr_cum": 1.6 + }, + { + "week": 7, + "act_fcr": 1.75, + "std_fcr": 1.75, + "act_fcr_cum": 1.63, + "std_fcr_cum": 1.64 + }, + { + "week": 8, + "act_fcr": 1.82, + "std_fcr": 1.8, + "act_fcr_cum": 1.67, + "std_fcr_cum": 1.68 + }, + { + "week": 9, + "act_fcr": 1.88, + "std_fcr": 1.85, + "act_fcr_cum": 1.7, + "std_fcr_cum": 1.72 + }, + { + "week": 10, + "act_fcr": 1.95, + "std_fcr": 1.9, + "act_fcr_cum": 1.75, + "std_fcr_cum": 1.75 + }, + { + "week": 11, + "act_fcr": 2.02, + "std_fcr": 2.0, + "act_fcr_cum": 1.78, + "std_fcr_cum": 1.79 + }, + { + "week": 12, + "act_fcr": 2.08, + "std_fcr": 2.1, + "act_fcr_cum": 1.82, + "std_fcr_cum": 1.83 + }, + { + "week": 13, + "act_fcr": 2.15, + "std_fcr": 2.15, + "act_fcr_cum": 1.86, + "std_fcr_cum": 1.87 + }, + { + "week": 14, + "act_fcr": 2.22, + "std_fcr": 2.2, + "act_fcr_cum": 1.9, + "std_fcr_cum": 1.91 + }, + { + "week": 15, + "act_fcr": 2.28, + "std_fcr": 2.25, + "act_fcr_cum": 1.94, + "std_fcr_cum": 1.95 + }, + { + "week": 16, + "act_fcr": 2.35, + "std_fcr": 2.3, + "act_fcr_cum": 1.98, + "std_fcr_cum": 1.99 + }, + { + "week": 17, + "act_fcr": 2.42, + "std_fcr": 2.4, + "act_fcr_cum": 2.02, + "std_fcr_cum": 2.03 + }, + { + "week": 18, + "act_fcr": 2.48, + "std_fcr": 2.5, + "act_fcr_cum": 2.06, + "std_fcr_cum": 2.07 + }, + { + "week": 19, + "act_fcr": 2.55, + "std_fcr": 2.55, + "act_fcr_cum": 2.1, + "std_fcr_cum": 2.11 + }, + { + "week": 20, + "act_fcr": 2.62, + "std_fcr": 2.6, + "act_fcr_cum": 2.15, + "std_fcr_cum": 2.15 + }, + { + "week": 21, + "act_fcr": 2.68, + "std_fcr": 2.7, + "act_fcr_cum": 2.19, + "std_fcr_cum": 2.19 + }, + { + "week": 22, + "act_fcr": 2.75, + "std_fcr": 2.75, + "act_fcr_cum": 2.23, + "std_fcr_cum": 2.23 + }, + { + "week": 23, + "act_fcr": 2.82, + "std_fcr": 2.8, + "act_fcr_cum": 2.27, + "std_fcr_cum": 2.27 + }, + { + "week": 24, + "act_fcr": 2.88, + "std_fcr": 2.9, + "act_fcr_cum": 2.31, + "std_fcr_cum": 2.31 + }, + { + "week": 25, + "act_fcr": 2.95, + "std_fcr": 2.95, + "act_fcr_cum": 2.35, + "std_fcr_cum": 2.35 + }, + { + "week": 26, + "act_fcr": 3.02, + "std_fcr": 3.0, + "act_fcr_cum": 2.39, + "std_fcr_cum": 2.39 + }, + { + "week": 27, + "act_fcr": 3.08, + "std_fcr": 3.1, + "act_fcr_cum": 2.43, + "std_fcr_cum": 2.43 + }, + { + "week": 28, + "act_fcr": 3.15, + "std_fcr": 3.15, + "act_fcr_cum": 2.47, + "std_fcr_cum": 2.47 + }, + { + "week": 29, + "act_fcr": 3.22, + "std_fcr": 3.2, + "act_fcr_cum": 2.51, + "std_fcr_cum": 2.51 + }, + { + "week": 30, + "act_fcr": 3.28, + "std_fcr": 3.3, + "act_fcr_cum": 2.55, + "std_fcr_cum": 2.55 + }, + { + "week": 31, + "act_fcr": 3.35, + "std_fcr": 3.35, + "act_fcr_cum": 2.59, + "std_fcr_cum": 2.59 + }, + { + "week": 32, + "act_fcr": 3.42, + "std_fcr": 3.4, + "act_fcr_cum": 2.63, + "std_fcr_cum": 2.63 + }, + { + "week": 33, + "act_fcr": 3.48, + "std_fcr": 3.5, + "act_fcr_cum": 2.67, + "std_fcr_cum": 2.67 + }, + { + "week": 34, + "act_fcr": 3.55, + "std_fcr": 3.55, + "act_fcr_cum": 2.71, + "std_fcr_cum": 2.71 + }, + { + "week": 35, + "act_fcr": 3.62, + "std_fcr": 3.6, + "act_fcr_cum": 2.75, + "std_fcr_cum": 2.75 + }, + { + "week": 36, + "act_fcr": 3.68, + "std_fcr": 3.7, + "act_fcr_cum": 2.79, + "std_fcr_cum": 2.79 + }, + { + "week": 37, + "act_fcr": 3.75, + "std_fcr": 3.75, + "act_fcr_cum": 2.83, + "std_fcr_cum": 2.83 + }, + { + "week": 38, + "act_fcr": 3.82, + "std_fcr": 3.8, + "act_fcr_cum": 2.87, + "std_fcr_cum": 2.87 + }, + { + "week": 39, + "act_fcr": 3.88, + "std_fcr": 3.9, + "act_fcr_cum": 2.91, + "std_fcr_cum": 2.91 + }, + { + "week": 40, + "act_fcr": 3.95, + "std_fcr": 3.95, + "act_fcr_cum": 2.95, + "std_fcr_cum": 2.95 + }, + { + "week": 41, + "act_fcr": 4.02, + "std_fcr": 4.0, + "act_fcr_cum": 2.99, + "std_fcr_cum": 2.99 + }, + { + "week": 42, + "act_fcr": 4.08, + "std_fcr": 4.1, + "act_fcr_cum": 3.03, + "std_fcr_cum": 3.03 + }, + { + "week": 43, + "act_fcr": 4.15, + "std_fcr": 4.15, + "act_fcr_cum": 3.07, + "std_fcr_cum": 3.07 + }, + { + "week": 44, + "act_fcr": 4.22, + "std_fcr": 4.2, + "act_fcr_cum": 3.11, + "std_fcr_cum": 3.11 + }, + { + "week": 45, + "act_fcr": 4.28, + "std_fcr": 4.3, + "act_fcr_cum": 3.15, + "std_fcr_cum": 3.15 + }, + { + "week": 46, + "act_fcr": 4.35, + "std_fcr": 4.35, + "act_fcr_cum": 3.19, + "std_fcr_cum": 3.19 + }, + { + "week": 47, + "act_fcr": 4.42, + "std_fcr": 4.4, + "act_fcr_cum": 3.23, + "std_fcr_cum": 3.23 + }, + { + "week": 48, + "act_fcr": 4.48, + "std_fcr": 4.5, + "act_fcr_cum": 3.27, + "std_fcr_cum": 3.27 + }, + { + "week": 49, + "act_fcr": 4.55, + "std_fcr": 4.55, + "act_fcr_cum": 3.31, + "std_fcr_cum": 3.31 + }, + { + "week": 50, + "act_fcr": 4.62, + "std_fcr": 4.6, + "act_fcr_cum": 3.35, + "std_fcr_cum": 3.35 + } + ] + }, + "quality_control": { + "series": [ + { + "id": "normal", + "label": "Normal", + "unit": "%" + }, + { + "id": "abnormal", + "label": "Abnormal", + "unit": "%" + } + ], + "dataset": [ + { + "week": 1, + "normal": 6.8, + "abnormal": 5.65 + }, + { + "week": 2, + "normal": 7.05, + "abnormal": 5.68 + }, + { + "week": 3, + "normal": 7.2, + "abnormal": 5.72 + }, + { + "week": 4, + "normal": 7.3, + "abnormal": 5.69 + }, + { + "week": 5, + "normal": 7.32, + "abnormal": 5.75 + }, + { + "week": 6, + "normal": 7.4, + "abnormal": 6.0 + }, + { + "week": 7, + "normal": 7.35, + "abnormal": 6.22 + }, + { + "week": 8, + "normal": 7.42, + "abnormal": 6.45 + }, + { + "week": 9, + "normal": 7.38, + "abnormal": 6.68 + }, + { + "week": 10, + "normal": 7.35, + "abnormal": 6.75 + }, + { + "week": 11, + "normal": 7.42, + "abnormal": 6.78 + }, + { + "week": 12, + "normal": 7.39, + "abnormal": 6.82 + }, + { + "week": 13, + "normal": 7.35, + "abnormal": 6.8 + }, + { + "week": 14, + "normal": 7.4, + "abnormal": 6.9 + }, + { + "week": 15, + "normal": 7.45, + "abnormal": 6.95 + }, + { + "week": 16, + "normal": 7.42, + "abnormal": 7.05 + }, + { + "week": 17, + "normal": 7.38, + "abnormal": 7.12 + }, + { + "week": 18, + "normal": 7.45, + "abnormal": 7.18 + }, + { + "week": 19, + "normal": 7.48, + "abnormal": 7.2 + }, + { + "week": 20, + "normal": 7.4, + "abnormal": 7.15 + }, + { + "week": 21, + "normal": 7.42, + "abnormal": 7.1 + }, + { + "week": 22, + "normal": 7.45, + "abnormal": 7.18 + }, + { + "week": 23, + "normal": 7.4, + "abnormal": 7.12 + }, + { + "week": 24, + "normal": 7.48, + "abnormal": 7.08 + }, + { + "week": 25, + "normal": 7.5, + "abnormal": 7.15 + }, + { + "week": 26, + "normal": 7.45, + "abnormal": 7.25 + }, + { + "week": 27, + "normal": 7.4, + "abnormal": 7.32 + }, + { + "week": 28, + "normal": 7.48, + "abnormal": 7.37 + }, + { + "week": 29, + "normal": 7.52, + "abnormal": 7.2 + }, + { + "week": 30, + "normal": 7.45, + "abnormal": 7.15 + }, + { + "week": 31, + "normal": 7.4, + "abnormal": 7.0 + }, + { + "week": 32, + "normal": 7.42, + "abnormal": 7.12 + }, + { + "week": 33, + "normal": 7.45, + "abnormal": 7.18 + }, + { + "week": 34, + "normal": 7.38, + "abnormal": 7.1 + }, + { + "week": 35, + "normal": 7.4, + "abnormal": 7.22 + }, + { + "week": 36, + "normal": 7.45, + "abnormal": 7.05 + }, + { + "week": 37, + "normal": 7.42, + "abnormal": 7.15 + }, + { + "week": 38, + "normal": 7.38, + "abnormal": 7.22 + }, + { + "week": 39, + "normal": 7.4, + "abnormal": 7.0 + }, + { + "week": 40, + "normal": 7.45, + "abnormal": 7.18 + }, + { + "week": 41, + "normal": 7.42, + "abnormal": 7.22 + }, + { + "week": 42, + "normal": 7.39, + "abnormal": 7.1 + }, + { + "week": 43, + "normal": 7.42, + "abnormal": 7.25 + }, + { + "week": 44, + "normal": 7.38, + "abnormal": 7.15 + }, + { + "week": 45, + "normal": 7.45, + "abnormal": 7.28 + }, + { + "week": 46, + "normal": 7.48, + "abnormal": 7.35 + }, + { + "week": 47, + "normal": 7.42, + "abnormal": 7.45 + }, + { + "week": 48, + "normal": 7.45, + "abnormal": 7.48 + }, + { + "week": 49, + "normal": 7.5, + "abnormal": 7.42 + }, + { + "week": 50, + "normal": 7.48, + "abnormal": 7.35 + } + ] + }, + "deplesi": { + "series": [ + { + "id": "act_deplesi", + "label": "Act. Deplesi", + "unit": "g" + }, + { + "id": "std_deplesi", + "label": "STD. Deplesi", + "unit": "g" + } + ], + "dataset": [ + { + "week": 1, + "act_deplesi": 1400, + "std_deplesi": 1480 + }, + { + "week": 2, + "act_deplesi": 1490, + "std_deplesi": 1580 + }, + { + "week": 3, + "act_deplesi": 1560, + "std_deplesi": 1650 + }, + { + "week": 4, + "act_deplesi": 1600, + "std_deplesi": 1700 + }, + { + "week": 5, + "act_deplesi": 1720, + "std_deplesi": 1750 + }, + { + "week": 6, + "act_deplesi": 1760, + "std_deplesi": 1750 + }, + { + "week": 7, + "act_deplesi": 1800, + "std_deplesi": 1770 + }, + { + "week": 8, + "act_deplesi": 1765, + "std_deplesi": 1770 + }, + { + "week": 9, + "act_deplesi": 1750, + "std_deplesi": 1780 + }, + { + "week": 10, + "act_deplesi": 1820, + "std_deplesi": 1800 + }, + { + "week": 11, + "act_deplesi": 1800, + "std_deplesi": 1790 + }, + { + "week": 12, + "act_deplesi": 1790, + "std_deplesi": 1780 + }, + { + "week": 13, + "act_deplesi": 1810, + "std_deplesi": 1770 + }, + { + "week": 14, + "act_deplesi": 1750, + "std_deplesi": 1780 + }, + { + "week": 15, + "act_deplesi": 1740, + "std_deplesi": 1800 + }, + { + "week": 16, + "act_deplesi": 1740, + "std_deplesi": 1820 + }, + { + "week": 17, + "act_deplesi": 1800, + "std_deplesi": 1830 + }, + { + "week": 18, + "act_deplesi": 1830, + "std_deplesi": 1840 + }, + { + "week": 19, + "act_deplesi": 1830, + "std_deplesi": 1840 + }, + { + "week": 20, + "act_deplesi": 1810, + "std_deplesi": 1845 + }, + { + "week": 21, + "act_deplesi": 1800, + "std_deplesi": 1850 + }, + { + "week": 22, + "act_deplesi": 1830, + "std_deplesi": 1855 + }, + { + "week": 23, + "act_deplesi": 1810, + "std_deplesi": 1860 + }, + { + "week": 24, + "act_deplesi": 1840, + "std_deplesi": 1870 + }, + { + "week": 25, + "act_deplesi": 1800, + "std_deplesi": 1880 + }, + { + "week": 26, + "act_deplesi": 1880, + "std_deplesi": 1900 + }, + { + "week": 27, + "act_deplesi": 1910, + "std_deplesi": 1910 + }, + { + "week": 28, + "act_deplesi": 1900, + "std_deplesi": 1920 + }, + { + "week": 29, + "act_deplesi": 1840, + "std_deplesi": 1925 + }, + { + "week": 30, + "act_deplesi": 1810, + "std_deplesi": 1930 + }, + { + "week": 31, + "act_deplesi": 1780, + "std_deplesi": 1935 + }, + { + "week": 32, + "act_deplesi": 1820, + "std_deplesi": 1940 + }, + { + "week": 33, + "act_deplesi": 1800, + "std_deplesi": 1945 + }, + { + "week": 34, + "act_deplesi": 1770, + "std_deplesi": 1950 + }, + { + "week": 35, + "act_deplesi": 1840, + "std_deplesi": 1955 + }, + { + "week": 36, + "act_deplesi": 1810, + "std_deplesi": 1960 + }, + { + "week": 37, + "act_deplesi": 1780, + "std_deplesi": 1965 + }, + { + "week": 38, + "act_deplesi": 1820, + "std_deplesi": 1970 + }, + { + "week": 39, + "act_deplesi": 1770, + "std_deplesi": 1970 + }, + { + "week": 40, + "act_deplesi": 1840, + "std_deplesi": 1975 + }, + { + "week": 41, + "act_deplesi": 1820, + "std_deplesi": 1975 + }, + { + "week": 42, + "act_deplesi": 1790, + "std_deplesi": 1975 + }, + { + "week": 43, + "act_deplesi": 1860, + "std_deplesi": 1980 + }, + { + "week": 44, + "act_deplesi": 1820, + "std_deplesi": 1980 + }, + { + "week": 45, + "act_deplesi": 1800, + "std_deplesi": 1980 + }, + { + "week": 46, + "act_deplesi": 1840, + "std_deplesi": 1985 + }, + { + "week": 47, + "act_deplesi": 1790, + "std_deplesi": 1990 + }, + { + "week": 48, + "act_deplesi": 1910, + "std_deplesi": 1990 + }, + { + "week": 49, + "act_deplesi": 1950, + "std_deplesi": 1995 + }, + { + "week": 50, + "act_deplesi": 1910, + "std_deplesi": 2000 + } + ] + } + } +} diff --git a/src/dummy/dashboard/dashboard.default.json b/src/dummy/dashboard/dashboard.default.json new file mode 100644 index 00000000..7e657aeb --- /dev/null +++ b/src/dummy/dashboard/dashboard.default.json @@ -0,0 +1,15 @@ +{ + "statistics_data": [ + { + "label": "HPP Global", + "value": 16200, + "percent_last_month": 15.5 + }, + { + "label": "Avg. Selling Price", + "value": 28300, + "percent_last_month": -50 + } + ], + "charts": {} +} diff --git a/src/dummy/dashboard/dashboard.overview.dummy.json b/src/dummy/dashboard/dashboard.overview.dummy.json new file mode 100644 index 00000000..8404a931 --- /dev/null +++ b/src/dummy/dashboard/dashboard.overview.dummy.json @@ -0,0 +1,1796 @@ +{ + "statistics_data": [ + { + "label": "HPP Global", + "value": 16200, + "percent_last_month": 15.5 + }, + { + "label": "Avg. Selling Price", + "value": 28300, + "percent_last_month": -50 + }, + { + "label": "FCR", + "value": 24.02, + "percent_last_month": 15.5 + }, + { + "label": "Mortality", + "value": 5, + "percent_last_month": -15.5 + } + ], + "charts": { + "body_weight": { + "series": [ + { + "id": "body_weight", + "label": "Body Weight", + "unit": "g" + }, + { + "id": "std_body_weight", + "label": "STD. Body Weight", + "unit": "g" + } + ], + "dataset": [ + { + "week": 1, + "body_weight": 1400, + "std_body_weight": 1480 + }, + { + "week": 2, + "body_weight": 1490, + "std_body_weight": 1580 + }, + { + "week": 3, + "body_weight": 1560, + "std_body_weight": 1650 + }, + { + "week": 4, + "body_weight": 1600, + "std_body_weight": 1700 + }, + { + "week": 5, + "body_weight": 1720, + "std_body_weight": 1750 + }, + { + "week": 6, + "body_weight": 1760, + "std_body_weight": 1750 + }, + { + "week": 7, + "body_weight": 1800, + "std_body_weight": 1770 + }, + { + "week": 8, + "body_weight": 1765, + "std_body_weight": 1770 + }, + { + "week": 9, + "body_weight": 1750, + "std_body_weight": 1780 + }, + { + "week": 10, + "body_weight": 1820, + "std_body_weight": 1800 + }, + { + "week": 11, + "body_weight": 1800, + "std_body_weight": 1790 + }, + { + "week": 12, + "body_weight": 1790, + "std_body_weight": 1780 + }, + { + "week": 13, + "body_weight": 1810, + "std_body_weight": 1770 + }, + { + "week": 14, + "body_weight": 1750, + "std_body_weight": 1780 + }, + { + "week": 15, + "body_weight": 1740, + "std_body_weight": 1800 + }, + { + "week": 16, + "body_weight": 1740, + "std_body_weight": 1820 + }, + { + "week": 17, + "body_weight": 1800, + "std_body_weight": 1830 + }, + { + "week": 18, + "body_weight": 1830, + "std_body_weight": 1840 + }, + { + "week": 19, + "body_weight": 1830, + "std_body_weight": 1840 + }, + { + "week": 20, + "body_weight": 1810, + "std_body_weight": 1845 + }, + { + "week": 21, + "body_weight": 1800, + "std_body_weight": 1850 + }, + { + "week": 22, + "body_weight": 1830, + "std_body_weight": 1855 + }, + { + "week": 23, + "body_weight": 1810, + "std_body_weight": 1860 + }, + { + "week": 24, + "body_weight": 1840, + "std_body_weight": 1870 + }, + { + "week": 25, + "body_weight": 1800, + "std_body_weight": 1880 + }, + { + "week": 26, + "body_weight": 1880, + "std_body_weight": 1900 + }, + { + "week": 27, + "body_weight": 1910, + "std_body_weight": 1910 + }, + { + "week": 28, + "body_weight": 1900, + "std_body_weight": 1920 + }, + { + "week": 29, + "body_weight": 1840, + "std_body_weight": 1925 + }, + { + "week": 30, + "body_weight": 1810, + "std_body_weight": 1930 + }, + { + "week": 31, + "body_weight": 1780, + "std_body_weight": 1935 + }, + { + "week": 32, + "body_weight": 1820, + "std_body_weight": 1940 + }, + { + "week": 33, + "body_weight": 1800, + "std_body_weight": 1945 + }, + { + "week": 34, + "body_weight": 1770, + "std_body_weight": 1950 + }, + { + "week": 35, + "body_weight": 1840, + "std_body_weight": 1955 + }, + { + "week": 36, + "body_weight": 1810, + "std_body_weight": 1960 + }, + { + "week": 37, + "body_weight": 1780, + "std_body_weight": 1965 + }, + { + "week": 38, + "body_weight": 1820, + "std_body_weight": 1970 + }, + { + "week": 39, + "body_weight": 1770, + "std_body_weight": 1970 + }, + { + "week": 40, + "body_weight": 1840, + "std_body_weight": 1975 + }, + { + "week": 41, + "body_weight": 1820, + "std_body_weight": 1975 + }, + { + "week": 42, + "body_weight": 1790, + "std_body_weight": 1975 + }, + { + "week": 43, + "body_weight": 1860, + "std_body_weight": 1980 + }, + { + "week": 44, + "body_weight": 1820, + "std_body_weight": 1980 + }, + { + "week": 45, + "body_weight": 1800, + "std_body_weight": 1980 + }, + { + "week": 46, + "body_weight": 1840, + "std_body_weight": 1985 + }, + { + "week": 47, + "body_weight": 1790, + "std_body_weight": 1990 + }, + { + "week": 48, + "body_weight": 1910, + "std_body_weight": 1990 + }, + { + "week": 49, + "body_weight": 1950, + "std_body_weight": 1995 + }, + { + "week": 50, + "body_weight": 1910, + "std_body_weight": 2000 + } + ] + }, + "performance": { + "series": [ + { + "id": "act_laying", + "label": "Act. % Laying", + "unit": "%" + }, + { + "id": "std_laying", + "label": "STD. % Laying", + "unit": "%" + }, + { + "id": "act_egg_weight", + "label": "Act. Egg Weight", + "unit": "%" + }, + { + "id": "std_egg_weight", + "label": "STD. Egg Weight", + "unit": "%" + }, + { + "id": "act_feed_intake", + "label": "Act. Feed Intake", + "unit": "%" + }, + { + "id": "std_feed_intake", + "label": "STD. Feed Intake", + "unit": "%" + }, + { + "id": "act_uniformity", + "label": "Act. Uniformity", + "unit": "%" + }, + { + "id": "std_uniformity", + "label": "STD. Uniformity", + "unit": "%" + } + ], + "dataset": [ + { + "week": 1, + "act_laying": 60, + "std_laying": 63, + "act_egg_weight": 53, + "std_egg_weight": 54, + "act_feed_intake": 76, + "std_feed_intake": 75, + "act_uniformity": 85, + "std_uniformity": 85 + }, + { + "week": 2, + "act_laying": 64, + "std_laying": 68, + "act_egg_weight": 54, + "std_egg_weight": 55, + "act_feed_intake": 78, + "std_feed_intake": 76, + "act_uniformity": 85, + "std_uniformity": 85 + }, + { + "week": 3, + "act_laying": 68, + "std_laying": 72, + "act_egg_weight": 54, + "std_egg_weight": 57, + "act_feed_intake": 81, + "std_feed_intake": 77, + "act_uniformity": 86, + "std_uniformity": 85 + }, + { + "week": 4, + "act_laying": 70, + "std_laying": 76, + "act_egg_weight": 56, + "std_egg_weight": 60, + "act_feed_intake": 84, + "std_feed_intake": 78, + "act_uniformity": 86, + "std_uniformity": 85 + }, + { + "week": 5, + "act_laying": 76, + "std_laying": 78, + "act_egg_weight": 60, + "std_egg_weight": 64, + "act_feed_intake": 86, + "std_feed_intake": 78, + "act_uniformity": 87, + "std_uniformity": 85 + }, + { + "week": 6, + "act_laying": 78, + "std_laying": 78, + "act_egg_weight": 64, + "std_egg_weight": 67, + "act_feed_intake": 87, + "std_feed_intake": 78, + "act_uniformity": 87, + "std_uniformity": 85 + }, + { + "week": 7, + "act_laying": 80, + "std_laying": 78, + "act_egg_weight": 68, + "std_egg_weight": 67, + "act_feed_intake": 88, + "std_feed_intake": 78, + "act_uniformity": 88, + "std_uniformity": 85 + }, + { + "week": 8, + "act_laying": 78, + "std_laying": 79, + "act_egg_weight": 72, + "std_egg_weight": 67, + "act_feed_intake": 87, + "std_feed_intake": 78, + "act_uniformity": 88, + "std_uniformity": 85 + }, + { + "week": 9, + "act_laying": 81, + "std_laying": 78, + "act_egg_weight": 75, + "std_egg_weight": 67, + "act_feed_intake": 87, + "std_feed_intake": 78, + "act_uniformity": 88, + "std_uniformity": 85 + }, + { + "week": 10, + "act_laying": 80, + "std_laying": 78, + "act_egg_weight": 76, + "std_egg_weight": 67, + "act_feed_intake": 88, + "std_feed_intake": 78, + "act_uniformity": 89, + "std_uniformity": 85 + }, + { + "week": 11, + "act_laying": 79, + "std_laying": 79, + "act_egg_weight": 75, + "std_egg_weight": 67, + "act_feed_intake": 88, + "std_feed_intake": 78, + "act_uniformity": 89, + "std_uniformity": 85 + }, + { + "week": 12, + "act_laying": 80, + "std_laying": 78, + "act_egg_weight": 77, + "std_egg_weight": 68, + "act_feed_intake": 88, + "std_feed_intake": 79, + "act_uniformity": 88, + "std_uniformity": 85 + }, + { + "week": 13, + "act_laying": 81, + "std_laying": 78, + "act_egg_weight": 77, + "std_egg_weight": 68, + "act_feed_intake": 89, + "std_feed_intake": 79, + "act_uniformity": 88, + "std_uniformity": 85 + }, + { + "week": 14, + "act_laying": 78, + "std_laying": 79, + "act_egg_weight": 78, + "std_egg_weight": 69, + "act_feed_intake": 88, + "std_feed_intake": 79, + "act_uniformity": 88, + "std_uniformity": 85 + }, + { + "week": 15, + "act_laying": 77, + "std_laying": 79, + "act_egg_weight": 77, + "std_egg_weight": 70, + "act_feed_intake": 87, + "std_feed_intake": 80, + "act_uniformity": 87, + "std_uniformity": 85 + }, + { + "week": 16, + "act_laying": 77, + "std_laying": 80, + "act_egg_weight": 78, + "std_egg_weight": 70, + "act_feed_intake": 86, + "std_feed_intake": 80, + "act_uniformity": 87, + "std_uniformity": 85 + }, + { + "week": 17, + "act_laying": 80, + "std_laying": 80, + "act_egg_weight": 80, + "std_egg_weight": 72, + "act_feed_intake": 88, + "std_feed_intake": 81, + "act_uniformity": 87, + "std_uniformity": 85 + }, + { + "week": 18, + "act_laying": 82, + "std_laying": 81, + "act_egg_weight": 83, + "std_egg_weight": 73, + "act_feed_intake": 88, + "std_feed_intake": 81, + "act_uniformity": 88, + "std_uniformity": 85 + }, + { + "week": 19, + "act_laying": 82, + "std_laying": 82, + "act_egg_weight": 84, + "std_egg_weight": 73, + "act_feed_intake": 88, + "std_feed_intake": 82, + "act_uniformity": 88, + "std_uniformity": 85 + }, + { + "week": 20, + "act_laying": 81, + "std_laying": 82, + "act_egg_weight": 82, + "std_egg_weight": 74, + "act_feed_intake": 88, + "std_feed_intake": 82, + "act_uniformity": 88, + "std_uniformity": 85 + }, + { + "week": 21, + "act_laying": 80, + "std_laying": 83, + "act_egg_weight": 82, + "std_egg_weight": 74, + "act_feed_intake": 88, + "std_feed_intake": 83, + "act_uniformity": 88, + "std_uniformity": 85 + }, + { + "week": 22, + "act_laying": 82, + "std_laying": 83, + "act_egg_weight": 82, + "std_egg_weight": 75, + "act_feed_intake": 89, + "std_feed_intake": 83, + "act_uniformity": 88, + "std_uniformity": 85 + }, + { + "week": 23, + "act_laying": 80, + "std_laying": 84, + "act_egg_weight": 84, + "std_egg_weight": 75, + "act_feed_intake": 88, + "std_feed_intake": 84, + "act_uniformity": 89, + "std_uniformity": 85 + }, + { + "week": 24, + "act_laying": 82, + "std_laying": 84, + "act_egg_weight": 82, + "std_egg_weight": 76, + "act_feed_intake": 88, + "std_feed_intake": 84, + "act_uniformity": 89, + "std_uniformity": 85 + }, + { + "week": 25, + "act_laying": 84, + "std_laying": 85, + "act_egg_weight": 83, + "std_egg_weight": 76, + "act_feed_intake": 88, + "std_feed_intake": 85, + "act_uniformity": 89, + "std_uniformity": 85 + }, + { + "week": 26, + "act_laying": 86, + "std_laying": 86, + "act_egg_weight": 87, + "std_egg_weight": 77, + "act_feed_intake": 89, + "std_feed_intake": 85, + "act_uniformity": 88, + "std_uniformity": 85 + }, + { + "week": 27, + "act_laying": 87, + "std_laying": 86, + "act_egg_weight": 88, + "std_egg_weight": 77, + "act_feed_intake": 89, + "std_feed_intake": 85, + "act_uniformity": 88, + "std_uniformity": 85 + }, + { + "week": 28, + "act_laying": 83, + "std_laying": 86, + "act_egg_weight": 84, + "std_egg_weight": 77, + "act_feed_intake": 88, + "std_feed_intake": 85, + "act_uniformity": 88, + "std_uniformity": 85 + }, + { + "week": 29, + "act_laying": 81, + "std_laying": 86, + "act_egg_weight": 82, + "std_egg_weight": 77, + "act_feed_intake": 87, + "std_feed_intake": 85, + "act_uniformity": 88, + "std_uniformity": 85 + }, + { + "week": 30, + "act_laying": 79, + "std_laying": 86, + "act_egg_weight": 80, + "std_egg_weight": 78, + "act_feed_intake": 86, + "std_feed_intake": 86, + "act_uniformity": 87, + "std_uniformity": 85 + }, + { + "week": 31, + "act_laying": 81, + "std_laying": 85, + "act_egg_weight": 82, + "std_egg_weight": 78, + "act_feed_intake": 87, + "std_feed_intake": 86, + "act_uniformity": 87, + "std_uniformity": 85 + }, + { + "week": 32, + "act_laying": 79, + "std_laying": 85, + "act_egg_weight": 80, + "std_egg_weight": 78, + "act_feed_intake": 86, + "std_feed_intake": 86, + "act_uniformity": 87, + "std_uniformity": 85 + }, + { + "week": 33, + "act_laying": 82, + "std_laying": 85, + "act_egg_weight": 84, + "std_egg_weight": 78, + "act_feed_intake": 88, + "std_feed_intake": 86, + "act_uniformity": 88, + "std_uniformity": 85 + }, + { + "week": 34, + "act_laying": 80, + "std_laying": 85, + "act_egg_weight": 82, + "std_egg_weight": 78, + "act_feed_intake": 88, + "std_feed_intake": 86, + "act_uniformity": 88, + "std_uniformity": 85 + }, + { + "week": 35, + "act_laying": 83, + "std_laying": 85, + "act_egg_weight": 84, + "std_egg_weight": 79, + "act_feed_intake": 89, + "std_feed_intake": 86, + "act_uniformity": 88, + "std_uniformity": 85 + }, + { + "week": 36, + "act_laying": 81, + "std_laying": 85, + "act_egg_weight": 82, + "std_egg_weight": 79, + "act_feed_intake": 88, + "std_feed_intake": 87, + "act_uniformity": 89, + "std_uniformity": 85 + }, + { + "week": 37, + "act_laying": 83, + "std_laying": 85, + "act_egg_weight": 84, + "std_egg_weight": 79, + "act_feed_intake": 89, + "std_feed_intake": 87, + "act_uniformity": 89, + "std_uniformity": 85 + }, + { + "week": 38, + "act_laying": 80, + "std_laying": 85, + "act_egg_weight": 81, + "std_egg_weight": 79, + "act_feed_intake": 88, + "std_feed_intake": 87, + "act_uniformity": 89, + "std_uniformity": 85 + }, + { + "week": 39, + "act_laying": 83, + "std_laying": 86, + "act_egg_weight": 84, + "std_egg_weight": 79, + "act_feed_intake": 89, + "std_feed_intake": 87, + "act_uniformity": 88, + "std_uniformity": 85 + }, + { + "week": 40, + "act_laying": 81, + "std_laying": 86, + "act_egg_weight": 82, + "std_egg_weight": 79, + "act_feed_intake": 88, + "std_feed_intake": 87, + "act_uniformity": 88, + "std_uniformity": 85 + }, + { + "week": 41, + "act_laying": 83, + "std_laying": 86, + "act_egg_weight": 85, + "std_egg_weight": 79, + "act_feed_intake": 89, + "std_feed_intake": 87, + "act_uniformity": 88, + "std_uniformity": 85 + }, + { + "week": 42, + "act_laying": 81, + "std_laying": 86, + "act_egg_weight": 82, + "std_egg_weight": 79, + "act_feed_intake": 88, + "std_feed_intake": 87, + "act_uniformity": 88, + "std_uniformity": 85 + }, + { + "week": 43, + "act_laying": 83, + "std_laying": 86, + "act_egg_weight": 85, + "std_egg_weight": 80, + "act_feed_intake": 89, + "std_feed_intake": 87, + "act_uniformity": 88, + "std_uniformity": 85 + }, + { + "week": 44, + "act_laying": 80, + "std_laying": 86, + "act_egg_weight": 82, + "std_egg_weight": 80, + "act_feed_intake": 88, + "std_feed_intake": 88, + "act_uniformity": 89, + "std_uniformity": 85 + }, + { + "week": 45, + "act_laying": 84, + "std_laying": 86, + "act_egg_weight": 85, + "std_egg_weight": 80, + "act_feed_intake": 89, + "std_feed_intake": 88, + "act_uniformity": 89, + "std_uniformity": 85 + }, + { + "week": 46, + "act_laying": 82, + "std_laying": 87, + "act_egg_weight": 83, + "std_egg_weight": 80, + "act_feed_intake": 88, + "std_feed_intake": 88, + "act_uniformity": 89, + "std_uniformity": 85 + }, + { + "week": 47, + "act_laying": 84, + "std_laying": 87, + "act_egg_weight": 85, + "std_egg_weight": 80, + "act_feed_intake": 89, + "std_feed_intake": 88, + "act_uniformity": 89, + "std_uniformity": 85 + }, + { + "week": 48, + "act_laying": 82, + "std_laying": 87, + "act_egg_weight": 83, + "std_egg_weight": 80, + "act_feed_intake": 88, + "std_feed_intake": 88, + "act_uniformity": 89, + "std_uniformity": 85 + }, + { + "week": 49, + "act_laying": 88, + "std_laying": 88, + "act_egg_weight": 90, + "std_egg_weight": 80, + "act_feed_intake": 89, + "std_feed_intake": 88, + "act_uniformity": 90, + "std_uniformity": 85 + }, + { + "week": 50, + "act_laying": 85, + "std_laying": 88, + "act_egg_weight": 87, + "std_egg_weight": 80, + "act_feed_intake": 89, + "std_feed_intake": 88, + "act_uniformity": 89, + "std_uniformity": 85 + } + ] + }, + "fcr": { + "series": [ + { + "id": "act_fcr", + "label": "Act. FCR", + "unit": "" + }, + { + "id": "std_fcr", + "label": "STD. FCR", + "unit": "" + }, + { + "id": "act_fcr_cum", + "label": "Act. FCR Cumulative", + "unit": "" + }, + { + "id": "std_fcr_cum", + "label": "STD. FCR Cumulative", + "unit": "" + } + ], + "dataset": [ + { + "week": 1, + "act_fcr": 1.42, + "std_fcr": 1.45, + "act_fcr_cum": 1.42, + "std_fcr_cum": 1.45 + }, + { + "week": 2, + "act_fcr": 1.48, + "std_fcr": 1.5, + "act_fcr_cum": 1.45, + "std_fcr_cum": 1.48 + }, + { + "week": 3, + "act_fcr": 1.55, + "std_fcr": 1.55, + "act_fcr_cum": 1.48, + "std_fcr_cum": 1.51 + }, + { + "week": 4, + "act_fcr": 1.62, + "std_fcr": 1.6, + "act_fcr_cum": 1.52, + "std_fcr_cum": 1.54 + }, + { + "week": 5, + "act_fcr": 1.68, + "std_fcr": 1.65, + "act_fcr_cum": 1.56, + "std_fcr_cum": 1.57 + }, + { + "week": 6, + "act_fcr": 1.72, + "std_fcr": 1.7, + "act_fcr_cum": 1.6, + "std_fcr_cum": 1.6 + }, + { + "week": 7, + "act_fcr": 1.75, + "std_fcr": 1.75, + "act_fcr_cum": 1.63, + "std_fcr_cum": 1.64 + }, + { + "week": 8, + "act_fcr": 1.82, + "std_fcr": 1.8, + "act_fcr_cum": 1.67, + "std_fcr_cum": 1.68 + }, + { + "week": 9, + "act_fcr": 1.88, + "std_fcr": 1.85, + "act_fcr_cum": 1.7, + "std_fcr_cum": 1.72 + }, + { + "week": 10, + "act_fcr": 1.95, + "std_fcr": 1.9, + "act_fcr_cum": 1.75, + "std_fcr_cum": 1.75 + }, + { + "week": 11, + "act_fcr": 2.02, + "std_fcr": 2.0, + "act_fcr_cum": 1.78, + "std_fcr_cum": 1.79 + }, + { + "week": 12, + "act_fcr": 2.08, + "std_fcr": 2.1, + "act_fcr_cum": 1.82, + "std_fcr_cum": 1.83 + }, + { + "week": 13, + "act_fcr": 2.15, + "std_fcr": 2.15, + "act_fcr_cum": 1.86, + "std_fcr_cum": 1.87 + }, + { + "week": 14, + "act_fcr": 2.22, + "std_fcr": 2.2, + "act_fcr_cum": 1.9, + "std_fcr_cum": 1.91 + }, + { + "week": 15, + "act_fcr": 2.28, + "std_fcr": 2.25, + "act_fcr_cum": 1.94, + "std_fcr_cum": 1.95 + }, + { + "week": 16, + "act_fcr": 2.35, + "std_fcr": 2.3, + "act_fcr_cum": 1.98, + "std_fcr_cum": 1.99 + }, + { + "week": 17, + "act_fcr": 2.42, + "std_fcr": 2.4, + "act_fcr_cum": 2.02, + "std_fcr_cum": 2.03 + }, + { + "week": 18, + "act_fcr": 2.48, + "std_fcr": 2.5, + "act_fcr_cum": 2.06, + "std_fcr_cum": 2.07 + }, + { + "week": 19, + "act_fcr": 2.55, + "std_fcr": 2.55, + "act_fcr_cum": 2.1, + "std_fcr_cum": 2.11 + }, + { + "week": 20, + "act_fcr": 2.62, + "std_fcr": 2.6, + "act_fcr_cum": 2.15, + "std_fcr_cum": 2.15 + }, + { + "week": 21, + "act_fcr": 2.68, + "std_fcr": 2.7, + "act_fcr_cum": 2.19, + "std_fcr_cum": 2.19 + }, + { + "week": 22, + "act_fcr": 2.75, + "std_fcr": 2.75, + "act_fcr_cum": 2.23, + "std_fcr_cum": 2.23 + }, + { + "week": 23, + "act_fcr": 2.82, + "std_fcr": 2.8, + "act_fcr_cum": 2.27, + "std_fcr_cum": 2.27 + }, + { + "week": 24, + "act_fcr": 2.88, + "std_fcr": 2.9, + "act_fcr_cum": 2.31, + "std_fcr_cum": 2.31 + }, + { + "week": 25, + "act_fcr": 2.95, + "std_fcr": 2.95, + "act_fcr_cum": 2.35, + "std_fcr_cum": 2.35 + }, + { + "week": 26, + "act_fcr": 3.02, + "std_fcr": 3.0, + "act_fcr_cum": 2.39, + "std_fcr_cum": 2.39 + }, + { + "week": 27, + "act_fcr": 3.08, + "std_fcr": 3.1, + "act_fcr_cum": 2.43, + "std_fcr_cum": 2.43 + }, + { + "week": 28, + "act_fcr": 3.15, + "std_fcr": 3.15, + "act_fcr_cum": 2.47, + "std_fcr_cum": 2.47 + }, + { + "week": 29, + "act_fcr": 3.22, + "std_fcr": 3.2, + "act_fcr_cum": 2.51, + "std_fcr_cum": 2.51 + }, + { + "week": 30, + "act_fcr": 3.28, + "std_fcr": 3.3, + "act_fcr_cum": 2.55, + "std_fcr_cum": 2.55 + }, + { + "week": 31, + "act_fcr": 3.35, + "std_fcr": 3.35, + "act_fcr_cum": 2.59, + "std_fcr_cum": 2.59 + }, + { + "week": 32, + "act_fcr": 3.42, + "std_fcr": 3.4, + "act_fcr_cum": 2.63, + "std_fcr_cum": 2.63 + }, + { + "week": 33, + "act_fcr": 3.48, + "std_fcr": 3.5, + "act_fcr_cum": 2.67, + "std_fcr_cum": 2.67 + }, + { + "week": 34, + "act_fcr": 3.55, + "std_fcr": 3.55, + "act_fcr_cum": 2.71, + "std_fcr_cum": 2.71 + }, + { + "week": 35, + "act_fcr": 3.62, + "std_fcr": 3.6, + "act_fcr_cum": 2.75, + "std_fcr_cum": 2.75 + }, + { + "week": 36, + "act_fcr": 3.68, + "std_fcr": 3.7, + "act_fcr_cum": 2.79, + "std_fcr_cum": 2.79 + }, + { + "week": 37, + "act_fcr": 3.75, + "std_fcr": 3.75, + "act_fcr_cum": 2.83, + "std_fcr_cum": 2.83 + }, + { + "week": 38, + "act_fcr": 3.82, + "std_fcr": 3.8, + "act_fcr_cum": 2.87, + "std_fcr_cum": 2.87 + }, + { + "week": 39, + "act_fcr": 3.88, + "std_fcr": 3.9, + "act_fcr_cum": 2.91, + "std_fcr_cum": 2.91 + }, + { + "week": 40, + "act_fcr": 3.95, + "std_fcr": 3.95, + "act_fcr_cum": 2.95, + "std_fcr_cum": 2.95 + }, + { + "week": 41, + "act_fcr": 4.02, + "std_fcr": 4.0, + "act_fcr_cum": 2.99, + "std_fcr_cum": 2.99 + }, + { + "week": 42, + "act_fcr": 4.08, + "std_fcr": 4.1, + "act_fcr_cum": 3.03, + "std_fcr_cum": 3.03 + }, + { + "week": 43, + "act_fcr": 4.15, + "std_fcr": 4.15, + "act_fcr_cum": 3.07, + "std_fcr_cum": 3.07 + }, + { + "week": 44, + "act_fcr": 4.22, + "std_fcr": 4.2, + "act_fcr_cum": 3.11, + "std_fcr_cum": 3.11 + }, + { + "week": 45, + "act_fcr": 4.28, + "std_fcr": 4.3, + "act_fcr_cum": 3.15, + "std_fcr_cum": 3.15 + }, + { + "week": 46, + "act_fcr": 4.35, + "std_fcr": 4.35, + "act_fcr_cum": 3.19, + "std_fcr_cum": 3.19 + }, + { + "week": 47, + "act_fcr": 4.42, + "std_fcr": 4.4, + "act_fcr_cum": 3.23, + "std_fcr_cum": 3.23 + }, + { + "week": 48, + "act_fcr": 4.48, + "std_fcr": 4.5, + "act_fcr_cum": 3.27, + "std_fcr_cum": 3.27 + }, + { + "week": 49, + "act_fcr": 4.55, + "std_fcr": 4.55, + "act_fcr_cum": 3.31, + "std_fcr_cum": 3.31 + }, + { + "week": 50, + "act_fcr": 4.62, + "std_fcr": 4.6, + "act_fcr_cum": 3.35, + "std_fcr_cum": 3.35 + } + ] + }, + "quality_control": { + "series": [ + { + "id": "normal", + "label": "Normal", + "unit": "%" + }, + { + "id": "abnormal", + "label": "Abnormal", + "unit": "%" + } + ], + "dataset": [ + { + "week": 1, + "normal": 6.8, + "abnormal": 5.65 + }, + { + "week": 2, + "normal": 7.05, + "abnormal": 5.68 + }, + { + "week": 3, + "normal": 7.2, + "abnormal": 5.72 + }, + { + "week": 4, + "normal": 7.3, + "abnormal": 5.69 + }, + { + "week": 5, + "normal": 7.32, + "abnormal": 5.75 + }, + { + "week": 6, + "normal": 7.4, + "abnormal": 6.0 + }, + { + "week": 7, + "normal": 7.35, + "abnormal": 6.22 + }, + { + "week": 8, + "normal": 7.42, + "abnormal": 6.45 + }, + { + "week": 9, + "normal": 7.38, + "abnormal": 6.68 + }, + { + "week": 10, + "normal": 7.35, + "abnormal": 6.75 + }, + { + "week": 11, + "normal": 7.42, + "abnormal": 6.78 + }, + { + "week": 12, + "normal": 7.39, + "abnormal": 6.82 + }, + { + "week": 13, + "normal": 7.35, + "abnormal": 6.8 + }, + { + "week": 14, + "normal": 7.4, + "abnormal": 6.9 + }, + { + "week": 15, + "normal": 7.45, + "abnormal": 6.95 + }, + { + "week": 16, + "normal": 7.42, + "abnormal": 7.05 + }, + { + "week": 17, + "normal": 7.38, + "abnormal": 7.12 + }, + { + "week": 18, + "normal": 7.45, + "abnormal": 7.18 + }, + { + "week": 19, + "normal": 7.48, + "abnormal": 7.2 + }, + { + "week": 20, + "normal": 7.4, + "abnormal": 7.15 + }, + { + "week": 21, + "normal": 7.42, + "abnormal": 7.1 + }, + { + "week": 22, + "normal": 7.45, + "abnormal": 7.18 + }, + { + "week": 23, + "normal": 7.4, + "abnormal": 7.12 + }, + { + "week": 24, + "normal": 7.48, + "abnormal": 7.08 + }, + { + "week": 25, + "normal": 7.5, + "abnormal": 7.15 + }, + { + "week": 26, + "normal": 7.45, + "abnormal": 7.25 + }, + { + "week": 27, + "normal": 7.4, + "abnormal": 7.32 + }, + { + "week": 28, + "normal": 7.48, + "abnormal": 7.37 + }, + { + "week": 29, + "normal": 7.52, + "abnormal": 7.2 + }, + { + "week": 30, + "normal": 7.45, + "abnormal": 7.15 + }, + { + "week": 31, + "normal": 7.4, + "abnormal": 7.0 + }, + { + "week": 32, + "normal": 7.42, + "abnormal": 7.12 + }, + { + "week": 33, + "normal": 7.45, + "abnormal": 7.18 + }, + { + "week": 34, + "normal": 7.38, + "abnormal": 7.1 + }, + { + "week": 35, + "normal": 7.4, + "abnormal": 7.22 + }, + { + "week": 36, + "normal": 7.45, + "abnormal": 7.05 + }, + { + "week": 37, + "normal": 7.42, + "abnormal": 7.15 + }, + { + "week": 38, + "normal": 7.38, + "abnormal": 7.22 + }, + { + "week": 39, + "normal": 7.4, + "abnormal": 7.0 + }, + { + "week": 40, + "normal": 7.45, + "abnormal": 7.18 + }, + { + "week": 41, + "normal": 7.42, + "abnormal": 7.22 + }, + { + "week": 42, + "normal": 7.39, + "abnormal": 7.1 + }, + { + "week": 43, + "normal": 7.42, + "abnormal": 7.25 + }, + { + "week": 44, + "normal": 7.38, + "abnormal": 7.15 + }, + { + "week": 45, + "normal": 7.45, + "abnormal": 7.28 + }, + { + "week": 46, + "normal": 7.48, + "abnormal": 7.35 + }, + { + "week": 47, + "normal": 7.42, + "abnormal": 7.45 + }, + { + "week": 48, + "normal": 7.45, + "abnormal": 7.48 + }, + { + "week": 49, + "normal": 7.5, + "abnormal": 7.42 + }, + { + "week": 50, + "normal": 7.48, + "abnormal": 7.35 + } + ] + }, + "deplesi": { + "series": [ + { + "id": "act_deplesi", + "label": "Act. Deplesi", + "unit": "g" + }, + { + "id": "std_deplesi", + "label": "STD. Deplesi", + "unit": "g" + } + ], + "dataset": [ + { + "week": 1, + "act_deplesi": 1400, + "std_deplesi": 1480 + }, + { + "week": 2, + "act_deplesi": 1490, + "std_deplesi": 1580 + }, + { + "week": 3, + "act_deplesi": 1560, + "std_deplesi": 1650 + }, + { + "week": 4, + "act_deplesi": 1600, + "std_deplesi": 1700 + }, + { + "week": 5, + "act_deplesi": 1720, + "std_deplesi": 1750 + }, + { + "week": 6, + "act_deplesi": 1760, + "std_deplesi": 1750 + }, + { + "week": 7, + "act_deplesi": 1800, + "std_deplesi": 1770 + }, + { + "week": 8, + "act_deplesi": 1765, + "std_deplesi": 1770 + }, + { + "week": 9, + "act_deplesi": 1750, + "std_deplesi": 1780 + }, + { + "week": 10, + "act_deplesi": 1820, + "std_deplesi": 1800 + }, + { + "week": 11, + "act_deplesi": 1800, + "std_deplesi": 1790 + }, + { + "week": 12, + "act_deplesi": 1790, + "std_deplesi": 1780 + }, + { + "week": 13, + "act_deplesi": 1810, + "std_deplesi": 1770 + }, + { + "week": 14, + "act_deplesi": 1750, + "std_deplesi": 1780 + }, + { + "week": 15, + "act_deplesi": 1740, + "std_deplesi": 1800 + }, + { + "week": 16, + "act_deplesi": 1740, + "std_deplesi": 1820 + }, + { + "week": 17, + "act_deplesi": 1800, + "std_deplesi": 1830 + }, + { + "week": 18, + "act_deplesi": 1830, + "std_deplesi": 1840 + }, + { + "week": 19, + "act_deplesi": 1830, + "std_deplesi": 1840 + }, + { + "week": 20, + "act_deplesi": 1810, + "std_deplesi": 1845 + }, + { + "week": 21, + "act_deplesi": 1800, + "std_deplesi": 1850 + }, + { + "week": 22, + "act_deplesi": 1830, + "std_deplesi": 1855 + }, + { + "week": 23, + "act_deplesi": 1810, + "std_deplesi": 1860 + }, + { + "week": 24, + "act_deplesi": 1840, + "std_deplesi": 1870 + }, + { + "week": 25, + "act_deplesi": 1800, + "std_deplesi": 1880 + }, + { + "week": 26, + "act_deplesi": 1880, + "std_deplesi": 1900 + }, + { + "week": 27, + "act_deplesi": 1910, + "std_deplesi": 1910 + }, + { + "week": 28, + "act_deplesi": 1900, + "std_deplesi": 1920 + }, + { + "week": 29, + "act_deplesi": 1840, + "std_deplesi": 1925 + }, + { + "week": 30, + "act_deplesi": 1810, + "std_deplesi": 1930 + }, + { + "week": 31, + "act_deplesi": 1780, + "std_deplesi": 1935 + }, + { + "week": 32, + "act_deplesi": 1820, + "std_deplesi": 1940 + }, + { + "week": 33, + "act_deplesi": 1800, + "std_deplesi": 1945 + }, + { + "week": 34, + "act_deplesi": 1770, + "std_deplesi": 1950 + }, + { + "week": 35, + "act_deplesi": 1840, + "std_deplesi": 1955 + }, + { + "week": 36, + "act_deplesi": 1810, + "std_deplesi": 1960 + }, + { + "week": 37, + "act_deplesi": 1780, + "std_deplesi": 1965 + }, + { + "week": 38, + "act_deplesi": 1820, + "std_deplesi": 1970 + }, + { + "week": 39, + "act_deplesi": 1770, + "std_deplesi": 1970 + }, + { + "week": 40, + "act_deplesi": 1840, + "std_deplesi": 1975 + }, + { + "week": 41, + "act_deplesi": 1820, + "std_deplesi": 1975 + }, + { + "week": 42, + "act_deplesi": 1790, + "std_deplesi": 1975 + }, + { + "week": 43, + "act_deplesi": 1860, + "std_deplesi": 1980 + }, + { + "week": 44, + "act_deplesi": 1820, + "std_deplesi": 1980 + }, + { + "week": 45, + "act_deplesi": 1800, + "std_deplesi": 1980 + }, + { + "week": 46, + "act_deplesi": 1840, + "std_deplesi": 1985 + }, + { + "week": 47, + "act_deplesi": 1790, + "std_deplesi": 1990 + }, + { + "week": 48, + "act_deplesi": 1910, + "std_deplesi": 1990 + }, + { + "week": 49, + "act_deplesi": 1950, + "std_deplesi": 1995 + }, + { + "week": 50, + "act_deplesi": 1910, + "std_deplesi": 2000 + } + ] + } + } +} diff --git a/src/dummy/dashboard/dashboard.production.dummy.json b/src/dummy/dashboard/dashboard.production.dummy.json deleted file mode 100644 index bb6e6af6..00000000 --- a/src/dummy/dashboard/dashboard.production.dummy.json +++ /dev/null @@ -1,1801 +0,0 @@ -{ - "statistics_data": [ - { - "title": "Total Keuangan", - "value": 2850000000, - "change": 12.5, - "period": "monthly", - "changeType": "increase" - }, - { - "title": "Penjualan", - "value": 3200000, - "change": 8.3, - "period": "monthly", - "changeType": "increase" - }, - { - "title": "Pembelian", - "value": 1850000000, - "change": -3.2, - "period": "monthly", - "changeType": "decrease" - }, - { - "title": "Biaya Overhead", - "value": 160000000, - "change": -1.5, - "period": "monthly", - "changeType": "decrease" - } - ], - "production_charts": [ - { - "date": "2025-12-01T00:00:00Z", - "flocks": [ - { - "id": 1, - "name": "Flock A-002", - "data": 88 - }, - { - "id": 2, - "name": "Flock A-001", - "data": 92 - }, - { - "id": 3, - "name": "Flock B-001", - "data": 90 - }, - { - "id": 4, - "name": "Flock B-002", - "data": 85 - } - ] - }, - { - "date": "2025-12-03T00:00:00Z", - "flocks": [ - { - "id": 1, - "name": "Flock A-002", - "data": 85 - }, - { - "id": 2, - "name": "Flock A-001", - "data": 95 - }, - { - "id": 3, - "name": "Flock B-001", - "data": 93 - }, - { - "id": 4, - "name": "Flock B-002", - "data": 87 - } - ] - }, - { - "date": "2025-12-05T00:00:00Z", - "flocks": [ - { - "id": 1, - "name": "Flock A-002", - "data": 82 - }, - { - "id": 2, - "name": "Flock A-001", - "data": 98 - }, - { - "id": 3, - "name": "Flock B-001", - "data": 91 - }, - { - "id": 4, - "name": "Flock B-002", - "data": 84 - } - ] - }, - { - "date": "2025-12-07T00:00:00Z", - "flocks": [ - { - "id": 1, - "name": "Flock A-002", - "data": 80 - }, - { - "id": 2, - "name": "Flock A-001", - "data": 89 - }, - { - "id": 3, - "name": "Flock B-001", - "data": 88 - }, - { - "id": 4, - "name": "Flock B-002", - "data": 82 - } - ] - }, - { - "date": "2025-12-08T00:00:00Z", - "flocks": [ - { - "id": 1, - "name": "Flock A-002", - "data": 83 - }, - { - "id": 2, - "name": "Flock A-001", - "data": 92 - }, - { - "id": 3, - "name": "Flock B-001", - "data": 95 - }, - { - "id": 4, - "name": "Flock B-002", - "data": 85 - } - ] - }, - { - "date": "2025-12-11T00:00:00Z", - "flocks": [ - { - "id": 1, - "name": "Flock A-002", - "data": 81 - }, - { - "id": 2, - "name": "Flock A-001", - "data": 88 - }, - { - "id": 3, - "name": "Flock B-001", - "data": 92 - }, - { - "id": 4, - "name": "Flock B-002", - "data": 83 - } - ] - }, - { - "date": "2025-12-13T00:00:00Z", - "flocks": [ - { - "id": 1, - "name": "Flock A-002", - "data": 84 - }, - { - "id": 2, - "name": "Flock A-001", - "data": 90 - }, - { - "id": 3, - "name": "Flock B-001", - "data": 89 - }, - { - "id": 4, - "name": "Flock B-002", - "data": 86 - } - ] - }, - { - "date": "2025-12-15T00:00:00Z", - "flocks": [ - { - "id": 1, - "name": "Flock A-002", - "data": 82 - }, - { - "id": 2, - "name": "Flock A-001", - "data": 94 - }, - { - "id": 3, - "name": "Flock B-001", - "data": 96 - }, - { - "id": 4, - "name": "Flock B-002", - "data": 84 - } - ] - }, - { - "date": "2025-12-17T00:00:00Z", - "flocks": [ - { - "id": 1, - "name": "Flock A-002", - "data": 80 - }, - { - "id": 2, - "name": "Flock A-001", - "data": 91 - }, - { - "id": 3, - "name": "Flock B-001", - "data": 93 - }, - { - "id": 4, - "name": "Flock B-002", - "data": 82 - } - ] - }, - { - "date": "2025-12-19T00:00:00Z", - "flocks": [ - { - "id": 1, - "name": "Flock A-002", - "data": 79 - }, - { - "id": 2, - "name": "Flock A-001", - "data": 88 - }, - { - "id": 3, - "name": "Flock B-001", - "data": 90 - }, - { - "id": 4, - "name": "Flock B-002", - "data": 81 - } - ] - }, - { - "date": "2025-12-21T00:00:00Z", - "flocks": [ - { - "id": 1, - "name": "Flock A-002", - "data": 81 - }, - { - "id": 2, - "name": "Flock A-001", - "data": 97 - }, - { - "id": 3, - "name": "Flock B-001", - "data": 92 - }, - { - "id": 4, - "name": "Flock B-002", - "data": 83 - } - ] - }, - { - "date": "2025-12-23T00:00:00Z", - "flocks": [ - { - "id": 1, - "name": "Flock A-002", - "data": 83 - }, - { - "id": 2, - "name": "Flock A-001", - "data": 95 - }, - { - "id": 3, - "name": "Flock B-001", - "data": 98 - }, - { - "id": 4, - "name": "Flock B-002", - "data": 85 - } - ] - }, - { - "date": "2025-12-25T00:00:00Z", - "flocks": [ - { - "id": 1, - "name": "Flock A-002", - "data": 80 - }, - { - "id": 2, - "name": "Flock A-001", - "data": 89 - }, - { - "id": 3, - "name": "Flock B-001", - "data": 94 - }, - { - "id": 4, - "name": "Flock B-002", - "data": 82 - } - ] - }, - { - "date": "2025-12-27T00:00:00Z", - "flocks": [ - { - "id": 1, - "name": "Flock A-002", - "data": 82 - }, - { - "id": 2, - "name": "Flock A-001", - "data": 93 - }, - { - "id": 3, - "name": "Flock B-001", - "data": 96 - }, - { - "id": 4, - "name": "Flock B-002", - "data": 84 - } - ] - }, - { - "date": "2025-12-28T00:00:00Z", - "flocks": [ - { - "id": 1, - "name": "Flock A-002", - "data": 85 - }, - { - "id": 2, - "name": "Flock A-001", - "data": 96 - }, - { - "id": 3, - "name": "Flock B-001", - "data": 95 - }, - { - "id": 4, - "name": "Flock B-002", - "data": 87 - } - ] - } - ], - "standard_productions": [ - { - "week": 18, - "standards": [ - { - "name": "hen_day", - "value": 40 - }, - { - "name": "hen_house", - "value": 38 - }, - { - "name": "uniformity", - "value": 85 - }, - { - "name": "egg_weight", - "value": 52 - }, - { - "name": "egg_mass", - "value": 20 - } - ], - "flocks": [ - { - "id": 1, - "name": "Flock A-001", - "data": 38 - }, - { - "id": 2, - "name": "Flock A-002", - "data": 37 - }, - { - "id": 3, - "name": "Flock B-001", - "data": 39 - }, - { - "id": 4, - "name": "Flock B-002", - "data": 36 - } - ] - }, - { - "week": 20, - "standards": [ - { - "name": "hen_day", - "value": 45 - }, - { - "name": "hen_house", - "value": 43 - }, - { - "name": "uniformity", - "value": 86 - }, - { - "name": "egg_weight", - "value": 54 - }, - { - "name": "egg_mass", - "value": 24 - } - ], - "flocks": [ - { - "id": 1, - "name": "Flock A-001", - "data": 43 - }, - { - "id": 2, - "name": "Flock A-002", - "data": 42 - }, - { - "id": 3, - "name": "Flock B-001", - "data": 44 - }, - { - "id": 4, - "name": "Flock B-002", - "data": 41 - } - ] - }, - { - "week": 22, - "standards": [ - { - "name": "hen_day", - "value": 48 - }, - { - "name": "hen_house", - "value": 46 - }, - { - "name": "uniformity", - "value": 87 - }, - { - "name": "egg_weight", - "value": 55 - }, - { - "name": "egg_mass", - "value": 26 - } - ], - "flocks": [ - { - "id": 1, - "name": "Flock A-001", - "data": 47 - }, - { - "id": 2, - "name": "Flock A-002", - "data": 46 - }, - { - "id": 3, - "name": "Flock B-001", - "data": 48 - }, - { - "id": 4, - "name": "Flock B-002", - "data": 45 - } - ] - }, - { - "week": 24, - "standards": [ - { - "name": "hen_day", - "value": 50 - }, - { - "name": "hen_house", - "value": 48 - }, - { - "name": "uniformity", - "value": 88 - }, - { - "name": "egg_weight", - "value": 56 - }, - { - "name": "egg_mass", - "value": 28 - } - ], - "flocks": [ - { - "id": 1, - "name": "Flock A-001", - "data": 49 - }, - { - "id": 2, - "name": "Flock A-002", - "data": 48 - }, - { - "id": 3, - "name": "Flock B-001", - "data": 50 - }, - { - "id": 4, - "name": "Flock B-002", - "data": 47 - } - ] - }, - { - "week": 26, - "standards": [ - { - "name": "hen_day", - "value": 52 - }, - { - "name": "hen_house", - "value": 50 - }, - { - "name": "uniformity", - "value": 89 - }, - { - "name": "egg_weight", - "value": 57 - }, - { - "name": "egg_mass", - "value": 30 - } - ], - "flocks": [ - { - "id": 1, - "name": "Flock A-001", - "data": 50 - }, - { - "id": 2, - "name": "Flock A-002", - "data": 49 - }, - { - "id": 3, - "name": "Flock B-001", - "data": 51 - }, - { - "id": 4, - "name": "Flock B-002", - "data": 48 - } - ] - }, - { - "week": 28, - "standards": [ - { - "name": "hen_day", - "value": 55 - }, - { - "name": "hen_house", - "value": 53 - }, - { - "name": "uniformity", - "value": 90 - }, - { - "name": "egg_weight", - "value": 58 - }, - { - "name": "egg_mass", - "value": 32 - } - ], - "flocks": [ - { - "id": 1, - "name": "Flock A-001", - "data": 53 - }, - { - "id": 2, - "name": "Flock A-002", - "data": 52 - }, - { - "id": 3, - "name": "Flock B-001", - "data": 54 - }, - { - "id": 4, - "name": "Flock B-002", - "data": 51 - } - ] - }, - { - "week": 30, - "standards": [ - { - "name": "hen_day", - "value": 58 - }, - { - "name": "hen_house", - "value": 56 - }, - { - "name": "uniformity", - "value": 91 - }, - { - "name": "egg_weight", - "value": 59 - }, - { - "name": "egg_mass", - "value": 34 - } - ], - "flocks": [ - { - "id": 1, - "name": "Flock A-001", - "data": 55 - }, - { - "id": 2, - "name": "Flock A-002", - "data": 54 - }, - { - "id": 3, - "name": "Flock B-001", - "data": 56 - }, - { - "id": 4, - "name": "Flock B-002", - "data": 53 - } - ] - }, - { - "week": 32, - "standards": [ - { - "name": "hen_day", - "value": 60 - }, - { - "name": "hen_house", - "value": 58 - }, - { - "name": "uniformity", - "value": 92 - }, - { - "name": "egg_weight", - "value": 60 - }, - { - "name": "egg_mass", - "value": 36 - } - ], - "flocks": [ - { - "id": 1, - "name": "Flock A-001", - "data": 58 - }, - { - "id": 2, - "name": "Flock A-002", - "data": 57 - }, - { - "id": 3, - "name": "Flock B-001", - "data": 59 - }, - { - "id": 4, - "name": "Flock B-002", - "data": 56 - } - ] - }, - { - "week": 34, - "standards": [ - { - "name": "hen_day", - "value": 62 - }, - { - "name": "hen_house", - "value": 60 - }, - { - "name": "uniformity", - "value": 92 - }, - { - "name": "egg_weight", - "value": 61 - }, - { - "name": "egg_mass", - "value": 38 - } - ], - "flocks": [ - { - "id": 1, - "name": "Flock A-001", - "data": 60 - }, - { - "id": 2, - "name": "Flock A-002", - "data": 59 - }, - { - "id": 3, - "name": "Flock B-001", - "data": 61 - }, - { - "id": 4, - "name": "Flock B-002", - "data": 58 - } - ] - }, - { - "week": 36, - "standards": [ - { - "name": "hen_day", - "value": 64 - }, - { - "name": "hen_house", - "value": 62 - }, - { - "name": "uniformity", - "value": 93 - }, - { - "name": "egg_weight", - "value": 62 - }, - { - "name": "egg_mass", - "value": 40 - } - ], - "flocks": [ - { - "id": 1, - "name": "Flock A-001", - "data": 62 - }, - { - "id": 2, - "name": "Flock A-002", - "data": 61 - }, - { - "id": 3, - "name": "Flock B-001", - "data": 63 - }, - { - "id": 4, - "name": "Flock B-002", - "data": 60 - } - ] - }, - { - "week": 38, - "standards": [ - { - "name": "hen_day", - "value": 66 - }, - { - "name": "hen_house", - "value": 64 - }, - { - "name": "uniformity", - "value": 93 - }, - { - "name": "egg_weight", - "value": 63 - }, - { - "name": "egg_mass", - "value": 42 - } - ], - "flocks": [ - { - "id": 1, - "name": "Flock A-001", - "data": 64 - }, - { - "id": 2, - "name": "Flock A-002", - "data": 63 - }, - { - "id": 3, - "name": "Flock B-001", - "data": 65 - }, - { - "id": 4, - "name": "Flock B-002", - "data": 62 - } - ] - }, - { - "week": 40, - "standards": [ - { - "name": "hen_day", - "value": 68 - }, - { - "name": "hen_house", - "value": 66 - }, - { - "name": "uniformity", - "value": 94 - }, - { - "name": "egg_weight", - "value": 64 - }, - { - "name": "egg_mass", - "value": 44 - } - ], - "flocks": [ - { - "id": 1, - "name": "Flock A-001", - "data": 66 - }, - { - "id": 2, - "name": "Flock A-002", - "data": 65 - }, - { - "id": 3, - "name": "Flock B-001", - "data": 67 - }, - { - "id": 4, - "name": "Flock B-002", - "data": 64 - } - ] - }, - { - "week": 42, - "standards": [ - { - "name": "hen_day", - "value": 70 - }, - { - "name": "hen_house", - "value": 68 - }, - { - "name": "uniformity", - "value": 94 - }, - { - "name": "egg_weight", - "value": 65 - }, - { - "name": "egg_mass", - "value": 46 - } - ], - "flocks": [ - { - "id": 1, - "name": "Flock A-001", - "data": 68 - }, - { - "id": 2, - "name": "Flock A-002", - "data": 67 - }, - { - "id": 3, - "name": "Flock B-001", - "data": 69 - }, - { - "id": 4, - "name": "Flock B-002", - "data": 66 - } - ] - }, - { - "week": 44, - "standards": [ - { - "name": "hen_day", - "value": 72 - }, - { - "name": "hen_house", - "value": 70 - }, - { - "name": "uniformity", - "value": 95 - }, - { - "name": "egg_weight", - "value": 66 - }, - { - "name": "egg_mass", - "value": 48 - } - ], - "flocks": [ - { - "id": 1, - "name": "Flock A-001", - "data": 70 - }, - { - "id": 2, - "name": "Flock A-002", - "data": 69 - }, - { - "id": 3, - "name": "Flock B-001", - "data": 71 - }, - { - "id": 4, - "name": "Flock B-002", - "data": 68 - } - ] - }, - { - "week": 46, - "standards": [ - { - "name": "hen_day", - "value": 74 - }, - { - "name": "hen_house", - "value": 72 - }, - { - "name": "uniformity", - "value": 95 - }, - { - "name": "egg_weight", - "value": 67 - }, - { - "name": "egg_mass", - "value": 50 - } - ], - "flocks": [ - { - "id": 1, - "name": "Flock A-001", - "data": 72 - }, - { - "id": 2, - "name": "Flock A-002", - "data": 71 - }, - { - "id": 3, - "name": "Flock B-001", - "data": 73 - }, - { - "id": 4, - "name": "Flock B-002", - "data": 70 - } - ] - }, - { - "week": 48, - "standards": [ - { - "name": "hen_day", - "value": 76 - }, - { - "name": "hen_house", - "value": 74 - }, - { - "name": "uniformity", - "value": 95 - }, - { - "name": "egg_weight", - "value": 68 - }, - { - "name": "egg_mass", - "value": 52 - } - ], - "flocks": [ - { - "id": 1, - "name": "Flock A-001", - "data": 74 - }, - { - "id": 2, - "name": "Flock A-002", - "data": 73 - }, - { - "id": 3, - "name": "Flock B-001", - "data": 75 - }, - { - "id": 4, - "name": "Flock B-002", - "data": 72 - } - ] - }, - { - "week": 50, - "standards": [ - { - "name": "hen_day", - "value": 78 - }, - { - "name": "hen_house", - "value": 76 - }, - { - "name": "uniformity", - "value": 96 - }, - { - "name": "egg_weight", - "value": 69 - }, - { - "name": "egg_mass", - "value": 54 - } - ], - "flocks": [ - { - "id": 1, - "name": "Flock A-001", - "data": 76 - }, - { - "id": 2, - "name": "Flock A-002", - "data": 75 - }, - { - "id": 3, - "name": "Flock B-001", - "data": 77 - }, - { - "id": 4, - "name": "Flock B-002", - "data": 74 - } - ] - }, - { - "week": 52, - "standards": [ - { - "name": "hen_day", - "value": 80 - }, - { - "name": "hen_house", - "value": 78 - }, - { - "name": "uniformity", - "value": 96 - }, - { - "name": "egg_weight", - "value": 70 - }, - { - "name": "egg_mass", - "value": 56 - } - ], - "flocks": [ - { - "id": 1, - "name": "Flock A-001", - "data": 78 - }, - { - "id": 2, - "name": "Flock A-002", - "data": 77 - }, - { - "id": 3, - "name": "Flock B-001", - "data": 79 - }, - { - "id": 4, - "name": "Flock B-002", - "data": 76 - } - ] - }, - { - "week": 54, - "standards": [ - { - "name": "hen_day", - "value": 82 - }, - { - "name": "hen_house", - "value": 80 - }, - { - "name": "uniformity", - "value": 96 - }, - { - "name": "egg_weight", - "value": 71 - }, - { - "name": "egg_mass", - "value": 58 - } - ], - "flocks": [ - { - "id": 1, - "name": "Flock A-001", - "data": 80 - }, - { - "id": 2, - "name": "Flock A-002", - "data": 79 - }, - { - "id": 3, - "name": "Flock B-001", - "data": 81 - }, - { - "id": 4, - "name": "Flock B-002", - "data": 78 - } - ] - }, - { - "week": 56, - "standards": [ - { - "name": "hen_day", - "value": 84 - }, - { - "name": "hen_house", - "value": 82 - }, - { - "name": "uniformity", - "value": 97 - }, - { - "name": "egg_weight", - "value": 72 - }, - { - "name": "egg_mass", - "value": 60 - } - ], - "flocks": [ - { - "id": 1, - "name": "Flock A-001", - "data": 82 - }, - { - "id": 2, - "name": "Flock A-002", - "data": 81 - }, - { - "id": 3, - "name": "Flock B-001", - "data": 83 - }, - { - "id": 4, - "name": "Flock B-002", - "data": 80 - } - ] - }, - { - "week": 58, - "standards": [ - { - "name": "hen_day", - "value": 86 - }, - { - "name": "hen_house", - "value": 84 - }, - { - "name": "uniformity", - "value": 97 - }, - { - "name": "egg_weight", - "value": 73 - }, - { - "name": "egg_mass", - "value": 62 - } - ], - "flocks": [ - { - "id": 1, - "name": "Flock A-001", - "data": 84 - }, - { - "id": 2, - "name": "Flock A-002", - "data": 83 - }, - { - "id": 3, - "name": "Flock B-001", - "data": 85 - }, - { - "id": 4, - "name": "Flock B-002", - "data": 82 - } - ] - }, - { - "week": 60, - "standards": [ - { - "name": "hen_day", - "value": 88 - }, - { - "name": "hen_house", - "value": 86 - }, - { - "name": "uniformity", - "value": 97 - }, - { - "name": "egg_weight", - "value": 74 - }, - { - "name": "egg_mass", - "value": 64 - } - ], - "flocks": [ - { - "id": 1, - "name": "Flock A-001", - "data": 86 - }, - { - "id": 2, - "name": "Flock A-002", - "data": 85 - }, - { - "id": 3, - "name": "Flock B-001", - "data": 87 - }, - { - "id": 4, - "name": "Flock B-002", - "data": 84 - } - ] - }, - { - "week": 62, - "standards": [ - { - "name": "hen_day", - "value": 90 - }, - { - "name": "hen_house", - "value": 88 - }, - { - "name": "uniformity", - "value": 98 - }, - { - "name": "egg_weight", - "value": 75 - }, - { - "name": "egg_mass", - "value": 66 - } - ], - "flocks": [ - { - "id": 1, - "name": "Flock A-001", - "data": 88 - }, - { - "id": 2, - "name": "Flock A-002", - "data": 87 - }, - { - "id": 3, - "name": "Flock B-001", - "data": 89 - }, - { - "id": 4, - "name": "Flock B-002", - "data": 86 - } - ] - }, - { - "week": 64, - "standards": [ - { - "name": "hen_day", - "value": 92 - }, - { - "name": "hen_house", - "value": 90 - }, - { - "name": "uniformity", - "value": 98 - }, - { - "name": "egg_weight", - "value": 76 - }, - { - "name": "egg_mass", - "value": 68 - } - ], - "flocks": [ - { - "id": 1, - "name": "Flock A-001", - "data": 90 - }, - { - "id": 2, - "name": "Flock A-002", - "data": 89 - }, - { - "id": 3, - "name": "Flock B-001", - "data": 91 - }, - { - "id": 4, - "name": "Flock B-002", - "data": 88 - } - ] - }, - { - "week": 66, - "standards": [ - { - "name": "hen_day", - "value": 94 - }, - { - "name": "hen_house", - "value": 92 - }, - { - "name": "uniformity", - "value": 98 - }, - { - "name": "egg_weight", - "value": 77 - }, - { - "name": "egg_mass", - "value": 70 - } - ], - "flocks": [ - { - "id": 1, - "name": "Flock A-001", - "data": 92 - }, - { - "id": 2, - "name": "Flock A-002", - "data": 91 - }, - { - "id": 3, - "name": "Flock B-001", - "data": 93 - }, - { - "id": 4, - "name": "Flock B-002", - "data": 90 - } - ] - }, - { - "week": 68, - "standards": [ - { - "name": "hen_day", - "value": 95 - }, - { - "name": "hen_house", - "value": 93 - }, - { - "name": "uniformity", - "value": 98 - }, - { - "name": "egg_weight", - "value": 78 - }, - { - "name": "egg_mass", - "value": 72 - } - ], - "flocks": [ - { - "id": 1, - "name": "Flock A-001", - "data": 93 - }, - { - "id": 2, - "name": "Flock A-002", - "data": 92 - }, - { - "id": 3, - "name": "Flock B-001", - "data": 94 - }, - { - "id": 4, - "name": "Flock B-002", - "data": 91 - } - ] - }, - { - "week": 70, - "standards": [ - { - "name": "hen_day", - "value": 96 - }, - { - "name": "hen_house", - "value": 94 - }, - { - "name": "uniformity", - "value": 99 - }, - { - "name": "egg_weight", - "value": 79 - }, - { - "name": "egg_mass", - "value": 74 - } - ], - "flocks": [ - { - "id": 1, - "name": "Flock A-001", - "data": 94 - }, - { - "id": 2, - "name": "Flock A-002", - "data": 93 - }, - { - "id": 3, - "name": "Flock B-001", - "data": 95 - }, - { - "id": 4, - "name": "Flock B-002", - "data": 92 - } - ] - }, - { - "week": 72, - "standards": [ - { - "name": "hen_day", - "value": 97 - }, - { - "name": "hen_house", - "value": 95 - }, - { - "name": "uniformity", - "value": 99 - }, - { - "name": "egg_weight", - "value": 80 - }, - { - "name": "egg_mass", - "value": 76 - } - ], - "flocks": [ - { - "id": 1, - "name": "Flock A-001", - "data": 95 - }, - { - "id": 2, - "name": "Flock A-002", - "data": 94 - }, - { - "id": 3, - "name": "Flock B-001", - "data": 96 - }, - { - "id": 4, - "name": "Flock B-002", - "data": 93 - } - ] - } - ], - "egg_weights": [ - { - "flock": { - "id": 1, - "name": "Flock A-001" - }, - "weight": 62 - }, - { - "flock": { - "id": 2, - "name": "Flock A-002" - }, - "weight": 61 - }, - { - "flock": { - "id": 3, - "name": "Flock B-001" - }, - "weight": 63 - }, - { - "flock": { - "id": 4, - "name": "Flock B-002" - }, - "weight": 60 - }, - { - "flock": { - "id": 5, - "name": "Flock C-001" - }, - "weight": 62 - } - ], - "fcr_data": [ - { - "flock": { - "id": 1, - "name": "Flock A-001" - }, - "fcr": 2.1 - }, - { - "flock": { - "id": 2, - "name": "Flock A-002" - }, - "fcr": 2.3 - }, - { - "flock": { - "id": 3, - "name": "Flock B-001" - }, - "fcr": 2 - }, - { - "flock": { - "id": 4, - "name": "Flock B-002" - }, - "fcr": 2.4 - }, - { - "flock": { - "id": 5, - "name": "Flock C-001" - }, - "fcr": 2.2 - } - ] -} diff --git a/src/dummy/dashboard/dashboard.production.dummy.ts b/src/dummy/dashboard/dashboard.production.dummy.ts index b663f28c..285505c0 100644 --- a/src/dummy/dashboard/dashboard.production.dummy.ts +++ b/src/dummy/dashboard/dashboard.production.dummy.ts @@ -5,35 +5,38 @@ * This file is auto-generated. Do not edit manually. */ -import { - DashboardProductionStatisticsData, - DashboardProductionProductionChartsFlocks, - DashboardProductionProductionCharts, - DashboardProductionStandardProductionsStandards, - DashboardProductionStandardProductions, - DashboardProductionFcrDataFlock, - DashboardProductionEggWeights, - DashboardProductionFcrData, - DashboardProduction, -} from '../../types/api/dashboard/dashboard-production'; +import { Dashboard, DashboardMeta } from '../../types/api/dashboard/dashboard'; import { BaseApiResponse } from '@/types/api/api-general'; -import dummyData from './dashboard.production.dummy.json'; - +import dummyData from './dashboard.overview.dummy.json'; +import dummyData2 from './dashboard.comparasion.location.dummy.json'; +import dummyData3 from './dashboard.comparasion.flock.dummy.json'; +import dummyData4 from './dashboard.comparasion.kandang.dummy.json'; +import dummyData5 from './dashboard.default.json'; /** * Get dummy DashboardProduction data * @returns Promise with BaseApiResponse containing DashboardProduction */ -export async function getDummySingle(): Promise< - BaseApiResponse -> { +export async function getDummySingle(): Promise> { return new Promise((resolve) => { setTimeout(() => { resolve({ code: 200, status: 'success', message: 'Data retrieved successfully', - data: dummyData as unknown as DashboardProduction, + meta: { + page: 1, + limit: 1, + total_pages: 1, + total_results: 1, + filters: { + analysis_mode: 'OVERVIEW', + location_ids: [1], + flock_ids: [1], + kandang_ids: [1], + }, + } as DashboardMeta, + data: dummyData as unknown as Dashboard, }); - }, 500); + }); }); } diff --git a/src/services/api/dashboard.ts b/src/services/api/dashboard.ts index d45ebbde..942a5a67 100644 --- a/src/services/api/dashboard.ts +++ b/src/services/api/dashboard.ts @@ -1,13 +1,9 @@ import { BaseApiService } from '@/services/api/base'; import { BaseApiResponse } from '@/types/api/api-general'; -import { DashboardProduction } from '@/types/api/dashboard/dashboard-production'; +import { Dashboard } from '@/types/api/dashboard/dashboard'; import { getDummySingle } from '@/dummy/dashboard/dashboard.production.dummy'; -class DashboardService extends BaseApiService< - DashboardProduction, - unknown, - unknown -> { +class DashboardService extends BaseApiService { constructor(basePath: string) { super(basePath); } @@ -19,11 +15,11 @@ class DashboardService extends BaseApiService< * * Note: Currently using dummy data. When real API is ready, * uncomment the line below and remove getDummySingle() call: - * return await this.customRequest>(endpoint); + * return await this.customRequest>(endpoint); */ async getDashboardProductionFetcher( endpoint: string - ): Promise> { + ): Promise> { // For now, we're using dummy data regardless of the endpoint // The endpoint parameter is kept for future API integration console.log('Fetching dashboard data with endpoint:', endpoint); diff --git a/src/types/api/dashboard/dashboard-production.d.ts b/src/types/api/dashboard/dashboard-production.d.ts deleted file mode 100644 index 5d873806..00000000 --- a/src/types/api/dashboard/dashboard-production.d.ts +++ /dev/null @@ -1,52 +0,0 @@ -export interface DashboardProduction { - statistics_data: DashboardProductionStatisticsData[]; - production_charts: DashboardProductionProductionCharts[]; - standard_productions: DashboardProductionStandardProductions[]; - egg_weights: DashboardProductionEggWeights[]; - fcr_data: DashboardProductionFcrData[]; -} - -export interface DashboardProductionFcrData { - flock: DashboardProductionFcrDataFlock; - fcr: number; -} - -export interface DashboardProductionEggWeights { - flock: DashboardProductionFcrDataFlock; - weight: number; -} - -export interface DashboardProductionStandardProductions { - week: number; - standards: DashboardProductionStandardProductionsStandards[]; - flocks: DashboardProductionProductionChartsFlocks[]; -} - -export interface DashboardProductionProductionCharts { - date: string; - flocks: DashboardProductionProductionChartsFlocks[]; -} - -export interface DashboardProductionStatisticsData { - title: string; - value: number; - change: number; - period: string; - changeType: string; -} - -export interface DashboardProductionFcrDataFlock { - id: number; - name: string; -} - -export interface DashboardProductionStandardProductionsStandards { - name: string; - value: number; -} - -export interface DashboardProductionProductionChartsFlocks { - id: number; - name: string; - data: number; -} diff --git a/src/types/api/dashboard/dashboard.d.ts b/src/types/api/dashboard/dashboard.d.ts new file mode 100644 index 00000000..9be93528 --- /dev/null +++ b/src/types/api/dashboard/dashboard.d.ts @@ -0,0 +1,60 @@ +import { SuccessApiResponse } from '@/types/api/api-general'; + +export interface Dashboard { + statistics_data: DashboardStatisticsData[]; + charts: DashboardComparisonCharts | DashboardOverviewCharts; +} + +export interface DashboardComparisonCharts { + location: DashboardCharts; + flock: DashboardCharts; + kandang: DashboardCharts; +} + +export interface DashboardOverviewCharts { + body_weight: DashboardCharts; + performance: DashboardCharts; + fcr: DashboardCharts; + quality_control: DashboardCharts; + deplesi: DashboardCharts; +} + +export interface DashboardCharts { + series: DashboardChartsSeries[]; + dataset: DashboardChartsDataset[]; +} + +export interface DashboardStatisticsData { + label: string; + value: number; + percent_last_month: number; +} + +export interface DashboardChartsDataset { + week: number; + // Index signature to support dynamic keys (series IDs) in comparison mode + [key: string | number]: number | undefined; +} + +export interface DashboardChartsSeries { + id: string | number; + label: string; + unit: string; +} + +export interface DashboardFilter { + start_date: string; + end_date: string; + analysis_mode: 'OVERVIEW' | 'COMPARISON'; + location_ids: number[]; + flock_ids: number[]; + kandang_ids: number[]; +} + +export interface DashboardMeta { + page: number; + limit: number; + total_pages: number; + total_results: number; + filters: DashboardFilter; +}