Flood Insurance Analytics

Advanced Business Intelligence Dashboard

Secure Access Required

Enter your API key to access the analytics dashboard

Your API key is encrypted and never stored locally

Upload CSV File

Click to select or drag and drop your flood insurance data

Processing your data...

Processing Error

Something went wrong while processing your file.

Analytics Dashboard

Comprehensive insights into your flood insurance portfolio

Filters

to

Performance Trends

Detailed Analysis

+ safeNum.toLocaleString(); case 'number': return safeNum.toLocaleString(); case 'percentage': return safeNum.toFixed(1) + '%'; default: return value || 'โ€”'; } }; const headers = columns.map(col => `${col.label}`).join(''); const rows = data.map(row => { const cells = columns.map(col => { const rawValue = row[col.key]; const formattedValue = formatValue(rawValue, col.format); return `${formattedValue}`; }).join(''); return `${cells}`; }).join(''); return `

${title}

${headers}${rows}
`; } function createEmptyTable(title, message) { return `

${title}

${message}
`; } // ===== FILTER UI FUNCTIONS ===== function updateActiveFilters() { const activeFiltersDiv = document.getElementById('activeFilters'); const filterTagsDiv = document.getElementById('filterTags'); let activeTags = []; if (app.filters.dateRange !== 'all') { const labels = { 'last12months': 'Last 12 Months', 'last6months': 'Last 6 Months', 'last3months': 'Last 3 Months', 'ytd': 'Year to Date' }; activeTags.push({ type: 'dateRange', label: `Date: ${labels[app.filters.dateRange]}` }); } if (app.filters.state !== 'all') { activeTags.push({ type: 'state', label: `State: ${app.filters.state}` }); } if (app.filters.agentGroup !== 'all') { activeTags.push({ type: 'agentGroup', label: `Agent: ${app.filters.agentGroup}` }); } if (app.filters.carrier !== 'all') { activeTags.push({ type: 'carrier', label: `Carrier: ${app.filters.carrier}` }); } if (app.filters.policyType !== 'all') { const labels = { 'new': 'New Business', 'renewal': 'Renewals' }; activeTags.push({ type: 'policyType', label: `Type: ${labels[app.filters.policyType]}` }); } if (app.filters.premiumMin > 0 || app.filters.premiumMax < 999999999) { const min = app.filters.premiumMin > 0 ? `$${app.filters.premiumMin.toLocaleString()}` : '$0'; const max = app.filters.premiumMax < 999999999 ? `$${app.filters.premiumMax.toLocaleString()}` : 'โˆž'; activeTags.push({ type: 'premium', label: `Premium: ${min} - ${max}` }); } if (activeTags.length > 0) { filterTagsDiv.innerHTML = activeTags.map(tag => `
${tag.label}
ร—
`).join(''); activeFiltersDiv.style.display = 'block'; } else { activeFiltersDiv.style.display = 'none'; } } function removeFilter(filterType) { switch (filterType) { case 'dateRange': document.getElementById('dateRangeFilter').value = 'all'; break; case 'state': document.getElementById('stateFilter').value = 'all'; break; case 'agentGroup': document.getElementById('agentGroupFilter').value = 'all'; break; case 'carrier': document.getElementById('carrierFilter').value = 'all'; break; case 'policyType': document.getElementById('policyTypeFilter').value = 'all'; break; case 'premium': document.getElementById('premiumMin').value = ''; document.getElementById('premiumMax').value = ''; break; } applyFilters(); } // ===== DEBUG FUNCTIONS ===== function debugFilters() { if (!app.originalData) { alert('โŒ No data loaded. Please upload a CSV file first.'); return; } console.log('๐Ÿ” DEBUG: Full data structure'); console.log('Original data:', app.originalData); console.log('Current filters:', app.filters); console.log('Filtered data:', app.filteredData); const debugPanel = document.getElementById('debugPanel'); if (debugPanel.style.display === 'none') { const originalCounts = { monthly: app.originalData.monthlyAnalysis?.length || 0, states: app.originalData.stateAnalysis?.length || 0, agents: app.originalData.agentGroupAnalysis?.length || 0, carriers: app.originalData.carrierTrends?.length || 0 }; const filteredCounts = app.filteredData ? { monthly: app.filteredData.monthlyAnalysis?.length || 0, states: app.filteredData.stateAnalysis?.length || 0, agents: app.filteredData.agentGroupAnalysis?.length || 0, carriers: app.filteredData.carrierTrends?.length || 0 } : originalCounts; document.getElementById('debugContent').innerHTML = ` ๐Ÿ” Debug Information

Current Filters:
${JSON.stringify(app.filters, null, 2)}

Data Counts:
Data TypeOriginalFilteredChange
Monthly${originalCounts.monthly}${filteredCounts.monthly}${filteredCounts.monthly - originalCounts.monthly}
States${originalCounts.states}${filteredCounts.states}${filteredCounts.states - originalCounts.states}
Agents${originalCounts.agents}${filteredCounts.agents}${filteredCounts.agents - originalCounts.agents}
Carriers${originalCounts.carriers}${filteredCounts.carriers}${filteredCounts.carriers - originalCounts.carriers}

Sample Data:
${app.originalData.stateAnalysis ? JSON.stringify(app.originalData.stateAnalysis[0], null, 2).substring(0, 200) + '...' : 'No state data'} `; debugPanel.style.display = 'block'; } else { debugPanel.style.display = 'none'; } } // ===== INITIALIZATION ===== document.addEventListener('DOMContentLoaded', function() { elements.apiKeyInput.addEventListener('keypress', function(e) { if (e.key === 'Enter') authenticate(); }); elements.apiKeyInput.focus(); });