/
AtlasProgrammer
/
pp-heat-map
Обзор
Документация
Войти
/
AtlasProgrammer
/
pp-heat-map
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
frontend/src/data/mockData.ts
604 строки
16 KB
AtlasProgrammer
upload files frontend
07 ноя 2025, 13:02
07 ноя 2025, 13:02
e56909e
Код
Авторство
О чём код?
export const mockAnalysisResult = { originalImage: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNkYPhfDwAChwGA60e6kgAAAABJRU5ErkJggg==', resultImage: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNkYPhfDwAChwGA60e6kgAAAABJRU5ErkJggg==', anomalies: [ { id: 1, x: 150, y: 200, width: 30, height: 25, confidence: 0.85, temperature: 45.2, area: 750, center: [165, 212.5] as [number, number], area_pixels: 750, bbox: [150, 200, 30, 25] as [number, number, number, number] }, { id: 2, x: 300, y: 150, width: 20, height: 35, confidence: 0.92, temperature: 52.1, area: 700, center: [310, 167.5] as [number, number], area_pixels: 700, bbox: [300, 150, 20, 35] as [number, number, number, number] }, { id: 3, x: 450, y: 300, width: 25, height: 20, confidence: 0.78, temperature: 38.7, area: 500, center: [462.5, 310] as [number, number], area_pixels: 500, bbox: [450, 300, 25, 20] as [number, number, number, number] } ], stats: { totalAnomalies: 3, averageTemperature: 45.3, maxTemperature: 52.1, minTemperature: 38.7, totalArea: 1950 } }; export const mockSatelliteImages = [ { id: 1, name: 'Sentinel-2_2024-01-15_B08', date: '2024-01-15T10:30:00Z', coordinates: { lat: 56.8431, lng: 60.6454 }, resolution: '10m', size: '2.5MB', url: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNkYPhfDwAChwGA60e6kgAAAABJRU5ErkJggg==', metadata: { satellite: 'Sentinel-2A', cloudCoverage: 15, processingLevel: 'L2A', bands: ['B02', 'B03', 'B04', 'B08'] } }, { id: 2, name: 'Sentinel-2_2024-01-15_B04', date: '2024-01-15T10:30:00Z', coordinates: { lat: 56.8431, lng: 60.6454 }, resolution: '10m', size: '2.1MB', url: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNkYPhfDwAChwGA60e6kgAAAABJRU5ErkJggg==', metadata: { satellite: 'Sentinel-2A', cloudCoverage: 15, processingLevel: 'L2A', bands: ['B02', 'B03', 'B04', 'B08'] } }, { id: 3, name: 'Sentinel-2_2024-01-15_B12', date: '2024-01-15T10:30:00Z', coordinates: { lat: 56.8431, lng: 60.6454 }, resolution: '20m', size: '1.8MB', url: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNkYPhfDwAChwGA60e6kgAAAABJRU5ErkJggg==', metadata: { satellite: 'Sentinel-2A', cloudCoverage: 12, processingLevel: 'L2A', bands: ['B02', 'B03', 'B04', 'B08', 'B12'] } }, { id: 4, name: 'Sentinel-2_2024-01-15_B11', date: '2024-01-15T10:30:00Z', coordinates: { lat: 56.8431, lng: 60.6454 }, resolution: '20m', size: '1.9MB', url: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNkYPhfDwAChwGA60e6kgAAAABJRU5ErkJggg==', metadata: { satellite: 'Sentinel-2A', cloudCoverage: 8, processingLevel: 'L2A', bands: ['B02', 'B03', 'B04', 'B08', 'B11'] } } ]; export const mockFirmsData = { points: [ { id: 1, lat: 56.8431, lng: 60.6454, confidence: 'high' as 'high' | 'medium' | 'low', brightness: 315.2, scan: 1.1, track: 1.0, acqDate: '2024-01-15', acqTime: '10:30', satellite: 'Terra', frp: 12.5, type: 0, lon: 60.6454, daynight: 'D' as 'D' | 'N', acq_date: '2024-01-15', bright_ti4: 315.2 }, { id: 2, lat: 56.8531, lng: 60.6554, confidence: 'medium' as 'high' | 'medium' | 'low', brightness: 298.7, scan: 1.2, track: 1.1, acqDate: '2024-01-15', acqTime: '10:35', satellite: 'Aqua', frp: 8.3, type: 0, lon: 60.6554, daynight: 'N' as 'D' | 'N', acq_date: '2024-01-15', bright_ti4: 298.7 }, { id: 3, lat: 56.8331, lng: 60.6354, confidence: 'high' as 'high' | 'medium' | 'low', brightness: 325.1, scan: 0.9, track: 0.8, acqDate: '2024-01-15', acqTime: '10:40', satellite: 'Terra', frp: 15.7, type: 0, lon: 60.6354, daynight: 'D' as 'D' | 'N', acq_date: '2024-01-15', bright_ti4: 325.1 }, // Нижний Тагил { id: 4, lat: 57.9200, lng: 59.9700, confidence: 'high' as 'high' | 'medium' | 'low', brightness: 310.8, scan: 1.0, track: 0.9, acqDate: '2024-01-15', acqTime: '10:50', satellite: 'Terra', frp: 11.9, type: 0, lon: 59.9700, daynight: 'D' as 'D' | 'N', acq_date: '2024-01-15', bright_ti4: 310.8 }, { id: 5, lat: 56.4000, lng: 61.9000, confidence: 'medium' as 'high' | 'medium' | 'low', brightness: 275.3, scan: 1.5, track: 1.3, acqDate: '2024-01-15', acqTime: '10:45', satellite: 'Aqua', frp: 5.2, type: 0, lon: 61.9000, daynight: 'N' as 'D' | 'N', acq_date: '2024-01-15', bright_ti4: 275.3 }, { id: 6, lat: 56.9000, lng: 59.9500, confidence: 'low' as 'high' | 'medium' | 'low', brightness: 285.1, scan: 1.3, track: 1.2, acqDate: '2024-01-15', acqTime: '11:00', satellite: 'SNPP', frp: 3.8, type: 0, lon: 59.9500, daynight: 'D' as 'D' | 'N', acq_date: '2024-01-15', bright_ti4: 285.1 }, { id: 7, lat: 59.6000, lng: 60.5500, confidence: 'high' as 'high' | 'medium' | 'low', brightness: 320.5, scan: 0.8, track: 0.7, acqDate: '2024-01-15', acqTime: '11:15', satellite: 'Terra', frp: 18.2, type: 0, lon: 60.5500, daynight: 'D' as 'D' | 'N', acq_date: '2024-01-15', bright_ti4: 320.5 }, { id: 8, lat: 59.7500, lng: 60.2000, confidence: 'medium' as 'high' | 'medium' | 'low', brightness: 295.8, scan: 1.4, track: 1.1, acqDate: '2024-01-15', acqTime: '11:30', satellite: 'Aqua', frp: 7.5, type: 0, lon: 60.2000, daynight: 'N' as 'D' | 'N', acq_date: '2024-01-15', bright_ti4: 295.8 }, { id: 9, lat: 57.8500, lng: 61.7000, confidence: 'high' as 'high' | 'medium' | 'low', brightness: 330.2, scan: 0.9, track: 0.8, acqDate: '2024-01-15', acqTime: '11:45', satellite: 'Terra', frp: 14.6, type: 0, lon: 61.7000, daynight: 'D' as 'D' | 'N', acq_date: '2024-01-15', bright_ti4: 330.2 }, { id: 10, lat: 57.3700, lng: 61.4000, confidence: 'low' as 'high' | 'medium' | 'low', brightness: 280.3, scan: 1.6, track: 1.4, acqDate: '2024-01-15', acqTime: '12:00', satellite: 'SNPP', frp: 4.1, type: 0, lon: 61.4000, daynight: 'N' as 'D' | 'N', acq_date: '2024-01-15', bright_ti4: 280.3 }, { id: 11, lat: 56.5000, lng: 60.2000, confidence: 'high' as 'high' | 'medium' | 'low', brightness: 340.8, scan: 0.7, track: 0.6, acqDate: '2024-01-15', acqTime: '12:15', satellite: 'Terra', frp: 22.3, type: 0, lon: 60.2000, daynight: 'D' as 'D' | 'N', acq_date: '2024-01-15', bright_ti4: 340.8 }, { id: 12, lat: 57.2000, lng: 59.8000, confidence: 'medium' as 'high' | 'medium' | 'low', brightness: 305.7, scan: 1.1, track: 1.0, acqDate: '2024-01-15', acqTime: '12:30', satellite: 'Aqua', frp: 9.8, type: 0, lon: 59.8000, daynight: 'N' as 'D' | 'N', acq_date: '2024-01-15', bright_ti4: 305.7 }, { id: 13, lat: 56.1000, lng: 61.3000, confidence: 'high' as 'high' | 'medium' | 'low', brightness: 325.9, scan: 0.8, track: 0.7, acqDate: '2024-01-15', acqTime: '12:45', satellite: 'Terra', frp: 16.4, type: 0, lon: 61.3000, daynight: 'D' as 'D' | 'N', acq_date: '2024-01-15', bright_ti4: 325.9 }, { id: 14, lat: 58.0000, lng: 60.8000, confidence: 'low' as 'high' | 'medium' | 'low', brightness: 275.6, scan: 1.5, track: 1.3, acqDate: '2024-01-15', acqTime: '13:00', satellite: 'SNPP', frp: 3.2, type: 0, lon: 60.8000, daynight: 'N' as 'D' | 'N', acq_date: '2024-01-15', bright_ti4: 275.6 }, { id: 15, lat: 56.7000, lng: 59.6000, confidence: 'medium' as 'high' | 'medium' | 'low', brightness: 290.4, scan: 1.2, track: 1.1, acqDate: '2024-01-15', acqTime: '13:15', satellite: 'Aqua', frp: 6.7, type: 0, lon: 59.6000, daynight: 'D' as 'D' | 'N', acq_date: '2024-01-15', bright_ti4: 290.4 } ], stats: { total: 15, highConfidence: 8, mediumConfidence: 5, lowConfidence: 2, averageBrightness: 304.8, averageFRP: 10.7, satellites: ['Terra', 'Aqua', 'SNPP'], day: 9, night: 6, avgConfidence: 75.5 } }; export const mockHistoryItems = [ { id: '1', timestamp: new Date('2024-01-15T10:30:00Z'), type: 'image_analysis' as 'image_analysis' | 'satellite_download' | 'firms_analysis', status: 'completed' as 'completed' | 'failed', fileName: 'thermal_image_001.jpg', fileSize: 2048576, result: { anomalies: 3, averageTemperature: 45.3, processingTime: 2.5 }, date: '2024-01-15T10:30:00Z', details: { anomalies: 3, averageTemperature: 45.3, processingTime: 2.5 } }, { id: '2', timestamp: new Date('2024-01-15T09:15:00Z'), type: 'satellite_download' as 'image_analysis' | 'satellite_download' | 'firms_analysis', status: 'completed' as 'completed' | 'failed', fileName: 'Sentinel-2_2024-01-15_B08.tif', fileSize: 5242880, result: { images: 2, totalSize: '7.2MB', coordinates: { lat: 55.7558, lng: 37.6176 } }, date: '2024-01-15T09:15:00Z', details: { images: 2, totalSize: '7.2MB', coordinates: { lat: 55.7558, lng: 37.6176 } } }, { id: '3', timestamp: new Date('2024-01-15T08:45:00Z'), type: 'firms_analysis' as 'image_analysis' | 'satellite_download' | 'firms_analysis', status: 'completed' as 'completed' | 'failed', fileName: 'FIRMS_data_2024-01-15.csv', fileSize: 153600, result: { firePoints: 5, highConfidence: 3, averageFRP: 10.7 }, date: '2024-01-15T08:45:00Z', details: { firePoints: 5, highConfidence: 3, averageFRP: 10.7 } }, { id: '4', timestamp: new Date('2024-01-14T16:20:00Z'), type: 'image_analysis' as 'image_analysis' | 'satellite_download' | 'firms_analysis', status: 'failed' as 'completed' | 'failed', fileName: 'corrupted_image.jpg', fileSize: 1024000, result: { error: 'Invalid image format' }, date: '2024-01-14T16:20:00Z', details: { error: 'Invalid image format' } }, { id: '5', timestamp: new Date('2024-01-14T14:10:00Z'), type: 'satellite_download' as 'image_analysis' | 'satellite_download' | 'firms_analysis', status: 'completed' as 'completed' | 'failed', fileName: 'Sentinel-2_2024-01-14_B04.tif', fileSize: 3145728, result: { images: 1, totalSize: '3.0MB', coordinates: { lat: 55.7558, lng: 37.6176 } }, date: '2024-01-14T14:10:00Z', details: { images: 1, totalSize: '3.0MB', coordinates: { lat: 55.7558, lng: 37.6176 } } } ]; export const mockBackendStatus = { isOnline: true, version: '1.0.0', uptime: '2d 14h 32m', lastCheck: new Date(), endpoints: { ping: true, analyze: true, satellite: true, firms: true } }; export const generateMockAnomaly = (id: number) => ({ id, x: Math.floor(Math.random() * 500) + 50, y: Math.floor(Math.random() * 400) + 50, width: Math.floor(Math.random() * 40) + 15, height: Math.floor(Math.random() * 40) + 15, confidence: Math.random() * 0.3 + 0.7, temperature: Math.random() * 20 + 35, area: Math.floor(Math.random() * 1000) + 200, center: [Math.floor(Math.random() * 500) + 50, Math.floor(Math.random() * 400) + 50] as [number, number], area_pixels: Math.floor(Math.random() * 1000) + 200, bbox: [Math.floor(Math.random() * 500) + 50, Math.floor(Math.random() * 400) + 50, Math.floor(Math.random() * 40) + 15, Math.floor(Math.random() * 40) + 15] as [number, number, number, number] }); export const generateMockFirePoint = (id: number) => ({ id, lat: 56.8431 + (Math.random() - 0.5) * 2.0, lng: 60.6454 + (Math.random() - 0.5) * 2.0, confidence: ['high', 'medium', 'low'][Math.floor(Math.random() * 3)] as 'high' | 'medium' | 'low', brightness: Math.random() * 100 + 250, scan: Math.random() * 2 + 0.5, track: Math.random() * 2 + 0.5, acqDate: '2024-01-15', acqTime: `${Math.floor(Math.random() * 24).toString().padStart(2, '0')}:${Math.floor(Math.random() * 60).toString().padStart(2, '0')}`, satellite: ['Terra', 'Aqua', 'SNPP'][Math.floor(Math.random() * 3)], frp: Math.random() * 20 + 5, type: 0, lon: 60.6454 + (Math.random() - 0.5) * 2.0, daynight: Math.random() > 0.5 ? 'D' : 'N' as 'D' | 'N', acq_date: '2024-01-15', bright_ti4: Math.random() * 100 + 250 }); export const generateMockHistoryItem = (id: string, type: 'image_analysis' | 'satellite_download' | 'firms_analysis') => { const timestamp = new Date(Date.now() - Math.random() * 7 * 24 * 60 * 60 * 1000); const baseItem = { id, timestamp, type, status: Math.random() > 0.1 ? 'completed' : 'failed' as 'completed' | 'failed', fileName: '', fileSize: Math.floor(Math.random() * 5000000) + 100000, result: {} }; switch (type) { case 'image_analysis': return { ...baseItem, fileName: `thermal_image_${id.padStart(3, '0')}.jpg`, result: { anomalies: Math.floor(Math.random() * 10) + 1, averageTemperature: Math.random() * 20 + 35, processingTime: Math.random() * 5 + 1 } }; case 'satellite_download': return { ...baseItem, fileName: `Sentinel-2_${timestamp.toISOString().split('T')[0]}_B08.tif`, result: { images: Math.floor(Math.random() * 5) + 1, totalSize: `${(baseItem.fileSize / 1024 / 1024).toFixed(1)}MB`, coordinates: { lat: 55.7558, lng: 37.6176 } } }; case 'firms_analysis': return { ...baseItem, fileName: `FIRMS_data_${timestamp.toISOString().split('T')[0]}.csv`, result: { firePoints: Math.floor(Math.random() * 20) + 1, highConfidence: Math.floor(Math.random() * 10) + 1, averageFRP: Math.random() * 15 + 5 } }; default: return baseItem; } };