-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmockData.ts
More file actions
364 lines (343 loc) · 11.6 KB
/
Copy pathmockData.ts
File metadata and controls
364 lines (343 loc) · 11.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
import { DailySensorData, FarmField, CropType, FieldSummary, SensorAlert, FarmReport, HealthStatus } from '../types';
const FIELDS: FarmField[] = ['North Farm', 'East Farm', 'West Farm', 'South Farm', 'Central Farm'];
const CROPS: Record<FarmField, CropType> = {
'North Farm': 'Corn',
'East Farm': 'Wheat',
'West Farm': 'Soybeans',
'South Farm': 'Tomatoes',
'Central Farm': 'Rice',
};
// Calculate status based on health score
export const calculateStatus = (score: number): HealthStatus => {
if (score >= 85) return 'Excellent';
if (score >= 70) return 'Good';
if (score >= 55) return 'Moderate';
if (score >= 40) return 'Poor';
return 'Critical';
};
// Status color helper mapping
export const getStatusColor = (status: HealthStatus) => {
switch (status) {
case 'Excellent':
return {
bg: 'bg-emerald-50',
text: 'text-[#15803D]',
border: 'border-emerald-200',
fill: '#15803D',
badge: 'bg-[#15803D] text-white',
};
case 'Good':
return {
bg: 'bg-green-50',
text: 'text-green-600',
border: 'border-green-200',
fill: '#22C55E',
badge: 'bg-green-500 text-white',
};
case 'Moderate':
return {
bg: 'bg-amber-50',
text: 'text-amber-700',
border: 'border-amber-200',
fill: '#EAB308',
badge: 'bg-amber-500 text-white',
};
case 'Poor':
return {
bg: 'bg-orange-50',
text: 'text-orange-700',
border: 'border-orange-200',
fill: '#F97316',
badge: 'bg-orange-500 text-white',
};
case 'Critical':
return {
bg: 'bg-rose-50',
text: 'text-rose-700',
border: 'border-rose-200',
fill: '#EF4444',
badge: 'bg-rose-500 text-white',
};
}
};
// Generate 365 Days of realistic data
export const generate365DaysData = (): DailySensorData[] => {
const data: DailySensorData[] = [];
const today = new Date('2026-07-24');
for (let i = 365; i >= 0; i--) {
const d = new Date(today);
d.setDate(d.getDate() - i);
const dateStr = d.toISOString().split('T')[0];
// Seasonal variance using sine waves
const dayOfYear = Math.floor((d.getTime() - new Date(d.getFullYear(), 0, 0).getTime()) / (1000 * 60 * 60 * 24));
const seasonalTempFactor = Math.sin(((dayOfYear - 80) / 365) * 2 * Math.PI); // Summer peak
const seasonalRainFactor = Math.cos(((dayOfYear - 20) / 365) * 2 * Math.PI);
FIELDS.forEach((field, fIndex) => {
const baseTemp = 20 + seasonalTempFactor * 12 + fIndex * 0.8;
const noiseTemp = (Math.sin(i * 0.5 + fIndex) * 2.5);
const temperature = Math.round((baseTemp + noiseTemp) * 10) / 10;
const rainfall = Math.max(0, Math.round((seasonalRainFactor * 10 + Math.sin(i * 1.3) * 15 - 5) * 10) / 10);
const baseMoisture = 40 + rainfall * 1.2 - (temperature * 0.4) + fIndex * 3;
const soilMoisture = Math.min(95, Math.max(15, Math.round((baseMoisture + Math.sin(i * 0.2) * 8) * 10) / 10));
const humidity = Math.min(98, Math.max(25, Math.round((55 + seasonalRainFactor * 15 + Math.cos(i * 0.4) * 10) * 10) / 10));
// NPK values (mg/kg)
const nitrogen = Math.min(180, Math.max(40, Math.round((120 + Math.sin(i * 0.05 + fIndex) * 30 + (Math.random() * 6 - 3)) * 10) / 10));
const phosphorus = Math.min(90, Math.max(15, Math.round((50 + Math.cos(i * 0.04 + fIndex) * 15 + (Math.random() * 4 - 2)) * 10) / 10));
const potassium = Math.min(300, Math.max(80, Math.round((200 + Math.sin(i * 0.06 + fIndex * 2) * 40 + (Math.random() * 8 - 4)) * 10) / 10));
// Calculate soil health score (0 - 100)
const moistureScore = 100 - Math.abs(soilMoisture - 50) * 1.5;
const tempScore = 100 - Math.abs(temperature - 22) * 2.5;
const npkScore = (nitrogen / 150 + phosphorus / 60 + potassium / 220) / 3 * 100;
const soilHealthScore = Math.min(99, Math.max(30, Math.round((moistureScore * 0.4 + tempScore * 0.3 + npkScore * 0.3))));
data.push({
date: dateStr,
field,
crop: CROPS[field],
temperature,
humidity,
soilMoisture,
nitrogen,
phosphorus,
potassium,
rainfall,
soilHealthScore,
status: calculateStatus(soilHealthScore),
});
});
}
return data;
};
export const MOCK_DATASET = generate365DaysData();
// Field Summaries for the Field Selector & Matrix
export const FIELD_SUMMARIES: FieldSummary[] = [
{
field: 'North Farm',
areaHectares: 145,
crop: 'Corn',
currentMoisture: 48.5,
currentTemp: 24.2,
avgNPKScore: 88,
healthScore: 92,
status: 'Excellent',
activeSensors: 24,
lastUpdated: '10 mins ago',
sensorGrid: Array.from({ length: 16 }, (_, idx) => ({
zone: `N-Z${idx + 1}`,
moisture: Math.round(42 + Math.sin(idx * 1.2) * 18),
status: calculateStatus(Math.round(80 + Math.sin(idx * 1.2) * 18)),
})),
},
{
field: 'East Farm',
areaHectares: 210,
crop: 'Wheat',
currentMoisture: 38.2,
currentTemp: 26.8,
avgNPKScore: 76,
healthScore: 78,
status: 'Good',
activeSensors: 32,
lastUpdated: '5 mins ago',
sensorGrid: Array.from({ length: 16 }, (_, idx) => ({
zone: `E-Z${idx + 1}`,
moisture: Math.round(35 + Math.cos(idx * 0.9) * 15),
status: calculateStatus(Math.round(72 + Math.cos(idx * 0.9) * 15)),
})),
},
{
field: 'West Farm',
areaHectares: 98,
crop: 'Soybeans',
currentMoisture: 52.0,
currentTemp: 23.1,
avgNPKScore: 84,
healthScore: 86,
status: 'Excellent',
activeSensors: 16,
lastUpdated: 'Just now',
sensorGrid: Array.from({ length: 16 }, (_, idx) => ({
zone: `W-Z${idx + 1}`,
moisture: Math.round(50 + Math.sin(idx * 0.7) * 12),
status: calculateStatus(Math.round(84 + Math.sin(idx * 0.7) * 12)),
})),
},
{
field: 'South Farm',
areaHectares: 175,
crop: 'Tomatoes',
currentMoisture: 28.4,
currentTemp: 29.5,
avgNPKScore: 62,
healthScore: 58,
status: 'Moderate',
activeSensors: 28,
lastUpdated: '12 mins ago',
sensorGrid: Array.from({ length: 16 }, (_, idx) => ({
zone: `S-Z${idx + 1}`,
moisture: Math.round(25 + Math.sin(idx * 1.5) * 10),
status: calculateStatus(Math.round(55 + Math.sin(idx * 1.5) * 10)),
})),
},
{
field: 'Central Farm',
areaHectares: 320,
crop: 'Rice',
currentMoisture: 72.8,
currentTemp: 25.0,
avgNPKScore: 91,
healthScore: 94,
status: 'Excellent',
activeSensors: 40,
lastUpdated: '2 mins ago',
sensorGrid: Array.from({ length: 16 }, (_, idx) => ({
zone: `C-Z${idx + 1}`,
moisture: Math.round(70 + Math.cos(idx * 0.5) * 10),
status: calculateStatus(Math.round(92 + Math.cos(idx * 0.5) * 8)),
})),
},
];
// Active Sensor Alerts
export const INITIAL_ALERTS: SensorAlert[] = [
{
id: 'alt-1',
field: 'South Farm',
title: 'Low Moisture Level Warning',
message: 'Soil moisture dropped to 28.4% in Zone S-4 (Tomato Crop). Immediate irrigation advised.',
timestamp: '15 minutes ago',
severity: 'high',
read: false,
metric: 'moisture',
},
{
id: 'alt-2',
field: 'East Farm',
title: 'Nitrogen Deficiency Detected',
message: 'Nitrogen level measured at 62 mg/kg in Zone E-8. Consider liquid fertilizing schedule.',
timestamp: '1 hour ago',
severity: 'medium',
read: false,
metric: 'npk',
},
{
id: 'alt-3',
field: 'South Farm',
title: 'High Canopy Temperature',
message: 'Ambient heat index reached 29.5°C. Risk of moisture evaporation heat stress.',
timestamp: '2 hours ago',
severity: 'medium',
read: true,
metric: 'temperature',
},
{
id: 'alt-4',
field: 'Central Farm',
title: 'Optimal Moisture Achieved',
message: 'Paddy irrigation in Central Farm reached ideal saturation point (72.8%).',
timestamp: '4 hours ago',
severity: 'low',
read: true,
metric: 'moisture',
},
];
// Mock Farm Reports
export const INITIAL_REPORTS: FarmReport[] = [
{
id: 'rep-001',
title: 'Q3 Comprehensive Soil Health Audit',
field: 'North Farm',
dateGenerated: '2026-07-20',
type: 'Soil Audit',
status: 'Completed',
summary: 'Detailed physical and chemical breakdown of North Farm Corn fields. High organic matter detected.',
fileSize: '4.2 MB',
},
{
id: 'rep-002',
title: 'Precision Irrigation Strategy & Water Savings',
field: 'South Farm',
dateGenerated: '2026-07-18',
type: 'Irrigation Plan',
status: 'Completed',
summary: 'Customized drip irrigation schedule for tomato crops to combat high summer temperatures.',
fileSize: '2.8 MB',
},
{
id: 'rep-003',
title: 'NPK Nutrient Balance & Fertilization Forecast',
field: 'East Farm',
dateGenerated: '2026-07-15',
type: 'NPK Yield',
status: 'Completed',
summary: 'Nutrient map showing nitrogen absorption curves and recommended potassium supplements.',
fileSize: '5.1 MB',
},
{
id: 'rep-004',
title: 'Mid-Season Crop Yield & Moisture Correlation',
field: 'Central Farm',
dateGenerated: '2026-07-10',
type: 'Comprehensive',
status: 'Completed',
summary: '365-day statistical analysis comparing paddy flooding depth against grain filling weight.',
fileSize: '6.7 MB',
},
];
// Landing Page Features & Testimonials
export const LANDING_FEATURES = [
{
icon: 'Droplets',
title: 'Real-time Moisture Tracking',
description: 'Sub-surface IoT sensor streaming delivers 99.4% accurate moisture depth profiles every 30 seconds.',
},
{
icon: 'Thermostat',
title: 'Thermal & Canopy Stress',
description: 'Detect microclimate heat spikes and evapotranspiration rates before root wilting occurs.',
},
{
icon: 'FlaskConical',
title: 'Spectrometric NPK Radar',
description: 'Continuous optical chemical sensing measures Nitrogen, Phosphorus, and Potassium balance live.',
},
{
icon: 'BrainCircuit',
title: 'Predictive Yield Analytics',
description: 'Proprietary soil health scoring models predict harvest yield with multi-year seasonal benchmarks.',
},
{
icon: 'BellRing',
title: 'Automated Anomaly Alerts',
description: 'Smart triggers send instant SMS & push alerts when soil conditions exceed biological safety boundaries.',
},
{
icon: 'FileSpreadsheet',
title: 'One-Click Compliance PDF Export',
description: 'Generate audit-ready environmental and agricultural reports instantly for certifications.',
},
];
export const TESTIMONIALS = [
{
quote: "AgroVision Analytics helped us reduce our irrigation water usage by 34% while increasing our corn crop yield by 18% in our first season.",
author: "Marcus Vance",
role: "Chief Operations Officer",
farm: "Vance Precision Ag, Midwest",
avatar: "https://images.unsplash.com/photo-1560250097-0b93528c311a?auto=format&fit=crop&q=80&w=150",
metric: "+18% Yield",
},
{
quote: "The NPK radar and moisture heatmaps give our agronomy team total clarity across 2,000+ acres without wasting manual soil sampling hours.",
author: "Dr. Elena Rostova",
role: "Lead Agronomist",
farm: "Valley Green Farms, California",
avatar: "https://images.unsplash.com/photo-1573496359142-b8d87734a5a2?auto=format&fit=crop&q=80&w=150",
metric: "34% Water Saved",
},
{
quote: "The intuitive dashboard layout and instant alert system saved our tomato yield during a sudden 4-day heat wave in South Farm.",
author: "Jacob Miller",
role: "Farm Director",
farm: "Miller Heritage Organics",
avatar: "https://images.unsplash.com/photo-1534528741775-53994a69daeb?auto=format&fit=crop&q=80&w=150",
metric: "99.8% Uptime",
},
];