<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Climate-Adaptive Insurance Capital Allocation Dashboard</title>
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<script src="https://cdn.jsdelivr.net/npm/chartjs-chart-sankey"></script>
<script src="https://cdn.jsdelivr.net/npm/chartjs-adapter-date-fns/dist/chartjs-adapter-date-fns.bundle.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
<script src="https://cdn.jsdelivr.net/npm/chartjs-plugin-datalabels@2"></script>
<style>
body { font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; background-color: #f8f9fa; }
.sidebar { background: linear-gradient(135deg, #0d6efd, #6610f2); color: white; height: 100vh; padding: 20px; }
.sidebar h4 { color: white; }
.main-content { padding: 20px; }
.card { box-shadow: 0 4px 8px rgba(0,0,0,0.1); border: none; }
.card-header { background: linear-gradient(135deg, #0d6efd, #6610f2); color: white; font-weight: bold; }
#sankeyChart { height: 400px; }
</style>
</head>
<body>
<div class="container-fluid">
<div class="row">
<!-- Sidebar Controls -->
<div class="col-md-3 sidebar">
<h3>🛡️ Climate-Adaptive Dashboard</h3>
<hr>
<div class="mb-3">
<label class="form-label">Climate Scenario</label>
<select id="scenario" class="form-select form-select-sm">
<option value="baseline">Baseline (No Change)</option>
<option value="moderate" selected>Moderate (+1.5°C)</option>
<option value="severe">Severe (+3°C)</option>
<option value="extreme">Extreme (+4°C)</option>
</select>
</div>
<div class="mb-3">
<label class="form-label">Portfolio Exposure ($B)</label>
<input type="range" id="exposure" class="form-range" min="10" max="100" value="50">
<span id="exposureValue">$50B</span>
</div>
<div class="mb-3">
<label class="form-label">Reinsurance Attachment Point (% of PML)</label>
<input type="range" id="attachment" class="form-range" min="10" max="50" value="20">
<span id="attachmentValue">20%</span>
</div>
<div class="mb-3">
<label class="form-label">Reinsurance Limit (% Coverage)</label>
<input type="range" id="limit" class="form-range" min="50" max="90" value="70">
<span id="limitValue">70%</span>
</div>
<div class="mb-3">
<label class="form-label">Solvency Target</label>
<select id="solvencyTarget" class="form-select form-select-sm">
<option value="150">150% (Conservative)</option>
<option value="200" selected>200% (Standard)</option>
<option value="250">250% (Aggressive)</option>
</select>
</div>
<button class="btn btn-light btn-sm w-100" onclick="updateDashboard()">Update Dashboard</button>
</div>
<!-- Main Dashboard -->
<div class="col-md-9 main-content">
<h2 class="mb-4">Sherlock's Climate-Adaptive Insurance Capital Allocation Dashboard</h2>
<p class="text-muted">Linking underwriting portfolios, reinsurance structures, and dynamic solvency targets under climate scenarios. Built by Trailblazer Labs.</p>
<div class="row">
<!-- Underwriting Risk Profile -->
<div class="col-md-6 mb-4">
<div class="card">
<div class="card-header">Underwriting Risk Profile (PML by Peril)</div>
<div class="card-body">
<canvas id="underwritingChart"></canvas>
</div>
</div>
</div>
<!-- Reinsurance Impact -->
<div class="col-md-6 mb-4">
<div class="card">
<div class="card-header">Reinsurance Impact (Gross vs Net PML)</div>
<div class="card-body">
<canvas id="reinsuranceChart"></canvas>
</div>
</div>
</div>
</div>
<div class="row">
<!-- Capital Allocation Sankey -->
<div class="col-md-8 mb-4">
<div class="card">
<div class="card-header">Capital Allocation Flow</div>
<div class="card-body">
<canvas id="sankeyChart"></canvas>
</div>
</div>
</div>
<!-- Solvency Projections -->
<div class="col-md-4 mb-4">
<div class="card">
<div class="card-header">Solvency Ratio Projections (Next 10 Years)</div>
<div class="card-body">
<canvas id="solvencyChart"></canvas>
</div>
</div>
</div>
</div>
<!-- Key Metrics -->
<div class="row mb-4">
<div class="col-md-3">
<div class="card text-center bg-primary text-white">
<div class="card-body">
<h5 id="grossPML">$2.5B</h5>
<p class="mb-0">Gross PML</p>
</div>
</div>
</div>
<div class="col-md-3">
<div class="card text-center bg-success text-white">
<div class="card-body">
<h5 id="netPML">$0.7B</h5>
<p class="mb-0">Net PML</p>
</div>
</div>
</div>
<div class="col-md-3">
<div class="card text-center bg-warning text-white">
<div class="card-body">
<h5 id="capitalNeed">$1.2B</h5>
<p class="mb-0">Capital Need</p>
</div>
</div>
</div>
<div class="col-md-3">
<div class="card text-center bg-info text-white">
<div class="card-body">
<h5 id="solvencyRatio">215%</h5>
<p class="mb-0">Current Ratio</p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script>
// Global charts
const underwritingCtx = document.getElementById('underwritingChart').getContext('2d');
const reinsuranceCtx = document.getElementById('reinsuranceChart').getContext('2d');
const sankeyCtx = document.getElementById('sankeyChart').getContext('2d');
const solvencyCtx = document.getElementById('solvencyChart').getContext('2d');
let underwritingChart, reinsuranceChart, sankeyChart, solvencyChart;
// Sample data scaled by climate scenarios
const basePML = { flood: 800, wind: 600, wildfire: 400, drought: 300, other: 400 };
const climateMultipliers = {
baseline: 1.0,
moderate: 1.3,
severe: 1.8,
extreme: 2.5
};
// Initialize dashboard
function initDashboard() {
updateValueDisplays();
updateDashboard();
}
function updateValueDisplays() {
document.getElementById('exposureValue').textContent = '$' + document.getElementById('exposure').value + 'B';
document.getElementById('attachmentValue').textContent = document.getElementById('attachment').value + '%';
document.getElementById('limitValue').textContent = document.getElementById('limit').value + '%';
}
function updateDashboard() {
const scenario = document.getElementById('scenario').value;
const exposure = parseFloat(document.getElementById('exposure').value);
const attachment = parseFloat(document.getElementById('attachment').value) / 100;
const limit = parseFloat(document.getElementById('limit').value) / 100;
const solvencyTarget = parseFloat(document.getElementById('solvencyTarget').value);
const multiplier = climateMultipliers[scenario];
const totalExposure = exposure * 1000; // in $M
// PML calculations
const perils = Object.keys(basePML);
const pmlData = perils.map(peril => basePML[peril] * multiplier * (totalExposure / 50000)); // Scaled to exposure
const grossPML = pmlData.reduce((a, b) => a + b, 0);
const reinsuranceCeded = Math.max(0, (grossPML - grossPML * attachment)) * limit;
const netPML = grossPML - reinsuranceCeded;
const capitalNeed = netPML * 1.5; // 150% buffer
const currentCapital = totalExposure * 0.1; // 10% of exposure as base capital
const solvencyRatio = Math.round((currentCapital / capitalNeed) * 100);
// Update metrics
document.getElementById('grossPML').textContent = '$' + Math.round(grossPML / 1000) + 'B';
document.getElementById('netPML').textContent = '$' + Math.round(netPML / 1000) + 'B';
document.getElementById('capitalNeed').textContent = '$' + Math.round(capitalNeed / 1000) + 'B';
document.getElementById('solvencyRatio').textContent = solvencyRatio + '%';
// Underwriting Chart: Stacked Bar by Peril
if (underwritingChart) underwritingChart.destroy();
underwritingChart = new Chart(underwritingCtx, {
type: 'bar',
data: {
labels: perils,
datasets: [{
label: 'PML ($M)',
data: pmlData,
backgroundColor: ['#1f77b4', '#ff7f0e', '#2ca02c', '#d62728', '#9467bd']
}]
},
options: { scales: { y: { beginAtZero: true } } }
});
// Reinsurance Chart: Gross vs Net
if (reinsuranceChart) reinsuranceChart.destroy();
reinsuranceChart = new Chart(reinsuranceCtx, {
type: 'bar',
data: {
labels: ['Gross PML', 'Reinsurance Ceded', 'Net PML'],
datasets: [{
data: [grossPML, reinsuranceCeded, netPML],
backgroundColor: ['#ff6384', '#36a2eb', '#4bc0c0']
}]
},
options: { scales: { y: { beginAtZero: true } } }
});
// Sankey: Premiums -> Gross Loss -> Reins Recovery -> Retained -> Capital
if (sankeyChart) sankeyChart.destroy();
const premiums = totalExposure * 0.05; // 5% loss ratio assumed
sankeyChart = new Chart(sankeyCtx, {
type: 'sankey',
data: {
datasets: [{
data: [
{ from: 'Gross Premiums', to: 'Expected Losses', weight: premiums },
{ from: 'Expected Losses', to: 'Reinsurance Recovery', weight: reinsuranceCeded },
{ from: 'Expected Losses', to: 'Retained Losses', weight: netPML },
{ from: 'Retained Losses', to: 'Capital Allocation', weight: capitalNeed }
],
colorFrom: ctx => {
const from = ctx.dataset.data[ctx.dataIndex].from;
const colors = { 'Gross Premiums': '#28a745', 'Expected Losses': '#ffc107', 'Reinsurance Recovery': '#17a2b8', 'Retained Losses': '#fd7e14', 'Capital Allocation': '#dc3545' };
return colors[from] || '#6c757d';
},
colorTo: ctx => {
const to = ctx.dataset.data[ctx.dataIndex].to;
const colors = { 'Expected Losses': '#ffc107', 'Reinsurance Recovery': '#17a2b8', 'Retained Losses': '#fd7e14', 'Capital Allocation': '#dc3545' };
return colors[to] || '#6c757d';
}
}]
},
options: { plugins: { legend: { display: false } } }
});
// Solvency Projections: Line chart degrading over time due to climate
if (solvencyChart) solvencyChart.destroy();
const years = Array.from({length: 10}, (_, i) => 2024 + i);
const futureRatios = years.map((year, i) => solvencyRatio * (1 - 0.02 * i * multiplier / 2)); // Gradual decline
solvencyChart = new Chart(solvencyCtx, {
type: 'line',
data: {
labels: years,
datasets: [{
label: 'Solvency Ratio (%)',
data: futureRatios,
borderColor: '#0d6efd',
backgroundColor: 'rgba(13,110,253,0.1)',
tension: 0.4,
fill: true
}, {
label: 'Target',
data: Array(10).fill(solvencyTarget),
borderColor: '#dc3545',
borderDash: [5,5]
}]
},
options: { scales: { y: { beginAtZero: false, min: 100 } } }
});
}
// Event listeners for real-time updates
document.getElementById('exposure').addEventListener('input', updateValueDisplays);
document.getElementById('attachment').addEventListener('input', updateValueDisplays);
document.getElementById('limit').addEventListener('input', updateValueDisplays);
document.getElementById('scenario').addEventListener('change', updateDashboard);
document.getElementById('solvencyTarget').addEventListener('change', updateDashboard);
// Init
initDashboard();
</script>
</body>
</html>
Quick Start Guide (Sherlock's Deduction)
- Save as HTML: Copy-paste into
dashboard.html and open in any browser.
- Interactive Controls: Tweak sliders/dropdowns on the left sidebar—watch charts, metrics, and flows update live.
- Key Insights:
- Underwriting: Visualizes Probable Maximum Loss (PML) by climate-amplified perils (floods, wildfires, etc.).
- Reinsurance: Shows ceded vs. retained risk based on attachment/limit.
- Sankey Flow: Traces capital from premiums through losses to final allocation.
- Solvency: Projects ratio over 10 years, with target line—climate ramps up capital strain!
- Customization: Edit JS data/multipliers for your real portfolios. Scales to $10-100B exposure.
- Why Climate-Adaptive? Multipliers simulate IPCC-like scenarios; solvency degrades over time.
Elementary, my dear insurer. Need Python/Streamlit version or API integration? Just ask. 🔍