Download index.html from idiouf/CAMEROON_CLIMATE_MALARIA_VECTRI_CMIP6_CSIDNET: direct link, hf CLI and curl.
- Browser
- Download file 134 kB
-
https://huggingface.co/spaces/idiouf/CAMEROON_CLIMATE_MALARIA_VECTRI_CMIP6_CSIDNET/resolve/main/index.html
- Command line
-
hf download hf://spaces/idiouf/CAMEROON_CLIMATE_MALARIA_VECTRI_CMIP6_CSIDNET/index.html
-
curl -L -o index.html https://huggingface.co/spaces/idiouf/CAMEROON_CLIMATE_MALARIA_VECTRI_CMIP6_CSIDNET/resolve/main/index.html
134 kB
| <html lang="en"> | |
| <head> | |
| <meta charset="utf-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1"> | |
| <title>Cameroon Malaria CMIP6 VECTRI</title> | |
| <meta name="description" content="Cameroon: climate suitability for malaria transmission (NEX-GDDP-CMIP6) and VECTRI simulations under SSP2-4.5 and SSP5-8.5, by region and department, with a level-1 validation against PNLP regional data."> | |
| <link rel="preconnect" href="https://fonts.googleapis.com"><link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> | |
| <link href="https://fonts.googleapis.com/css2?family=Manrope:wght@400;600;700;800&family=Roboto+Condensed:wght@400;700&display=swap" rel="stylesheet"> | |
| <style> | |
| :root{--bar:#5492CD;--bar2:#3f7bb8;--bg:#f4f6f9;--card:#ffffff;--ink:#1b2430;--mute:#5a6675;--line:#d9dee6;--acc:#bf5b20;--acc2:#173255;--chip:#eef3f9;--good:#1a7f4b;--warn:#fff6e5;--warnb:#e2b04a;--sea:#f4f6f9} | |
| @media (prefers-color-scheme: dark){:root:not([data-theme="light"]){--bar:#16314f;--bar2:#0f2338;--bg:#0f1620;--card:#18222e;--ink:#e6edf5;--mute:#9aa8b8;--line:#2b3846;--acc:#f08a4b;--acc2:#9cc3ec;--chip:#203042;--good:#5fd39a;--warn:#2b2516;--warnb:#a3802e;--sea:#0f1620}} | |
| :root[data-theme="dark"]{--bar:#16314f;--bar2:#0f2338;--bg:#0f1620;--card:#18222e;--ink:#e6edf5;--mute:#9aa8b8;--line:#2b3846;--acc:#f08a4b;--acc2:#9cc3ec;--chip:#203042;--good:#5fd39a;--warn:#2b2516;--warnb:#a3802e;--sea:#0f1620} | |
| *{box-sizing:border-box}html,body{margin:0;padding:0}html{background:var(--bar2)}body{margin:0 2cm;min-height:100vh;box-shadow:0 0 0 1px var(--bar2)}@media (max-width:640px){body{margin:0 6px}} | |
| body{background:var(--bg);color:var(--ink);font-family:Manrope,Arial,sans-serif;font-size:15px;line-height:1.5;overflow-x:hidden} | |
| a{color:var(--acc2)} | |
| header.top{background:var(--bar);color:#fff;position:sticky;top:0;z-index:20;box-shadow:0 2px 6px rgba(0,0,0,.18)} | |
| .topin{max-width:none;margin:0 auto;padding:8px 16px;display:flex;flex-wrap:wrap;gap:8px;align-items:center} | |
| .brand{font-weight:800;font-size:1.2rem;letter-spacing:.2px;margin-right:auto;display:flex;gap:8px;align-items:center} | |
| .brand small{font-family:"Roboto Condensed",sans-serif;font-weight:400;opacity:.85;font-size:.8rem} | |
| .nav{display:flex;flex-wrap:wrap;gap:6px} | |
| .nav button,.tog button{background:#fff;color:var(--bar2);border:2px solid #fff;border-radius:8px;padding:8px 16px;font:800 1.02rem Manrope,sans-serif;cursor:pointer;box-shadow:0 2px 5px rgba(0,0,0,.25);transition:transform .1s}.nav button:hover,.tog button:hover{transform:translateY(-1px);box-shadow:0 4px 9px rgba(0,0,0,.3)}.tog button{padding:8px 12px;font-size:.95rem;background:rgba(255,255,255,.18);color:#fff;border-color:rgba(255,255,255,.6);box-shadow:none} | |
| .nav button.on{background:var(--acc);color:#fff;border-color:#fff}.tog button.on{background:#fff;color:var(--bar2)} | |
| .tog{display:flex;gap:4px} | |
| .hero{background:linear-gradient(120deg,var(--bar2),var(--bar));color:#fff} | |
| .heroin{max-width:none;margin:0 auto;padding:22px 16px 18px} | |
| .hero h1{margin:0 0 6px;font-size:1.65rem;line-height:1.2;font-weight:800} | |
| .hero p{margin:0;max-width:900px;opacity:.95} | |
| .hero .by{margin-top:10px;font-size:.85rem;opacity:.9} | |
| main{max-width:none;margin:0 auto;padding:12px 16px 30px} | |
| .ctl{position:relative;top:0;z-index:15;background:var(--bg);padding:8px 0 6px;border-bottom:1px solid var(--line);margin-bottom:12px} | |
| .row{display:flex;flex-wrap:wrap;gap:10px 18px;align-items:flex-start} | |
| .grp{display:flex;flex-direction:column;gap:3px} | |
| .grp>span{font:700 .82rem "Roboto Condensed",sans-serif;text-transform:uppercase;letter-spacing:.6px;color:var(--mute)} | |
| .opts{display:flex;flex-wrap:wrap;gap:4px} | |
| .opts button{background:var(--card);color:var(--acc2);border:2px solid var(--acc2);border-radius:8px;padding:7px 14px;font:700 .95rem Manrope,sans-serif;cursor:pointer;box-shadow:0 1px 3px rgba(0,0,0,.15)}.opts button:hover{background:var(--chip)} | |
| .opts button.on{background:var(--acc2);color:var(--card);border-color:var(--acc2)} | |
| .opts.small button{font-size:.85rem;padding:5px 10px} | |
| section.page{display:none}section.page.on{display:block} | |
| h2{font-size:1.25rem;margin:14px 0 8px}h3{font-size:1.02rem;margin:4px 0 6px} | |
| .kpis{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin:8px 0 14px} | |
| .kpi{background:var(--card);border:1px solid var(--line);border-radius:10px;padding:10px 12px;border-top:4px solid var(--acc)} | |
| .kpi .l{font:700 .7rem "Roboto Condensed",sans-serif;text-transform:uppercase;color:var(--mute);letter-spacing:.4px} | |
| .kpi .v{font-size:1.45rem;font-weight:800;margin:2px 0} | |
| .kpi .s{font-size:.78rem;color:var(--mute)} | |
| .grid2{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px} | |
| .grid3{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px} | |
| .card{background:var(--card);border:1px solid var(--line);border-radius:10px;padding:10px 12px;min-width:0} | |
| .fig{width:100%;min-height:200px} | |
| .cap{font-size:.82rem;color:var(--mute);margin-top:4px} | |
| .find{background:var(--card);border-left:5px solid var(--acc);border-radius:8px;padding:10px 14px;margin:8px 0 12px} | |
| .find li{margin:3px 0} | |
| .note{background:var(--warn);border:1px solid var(--warnb);border-radius:8px;padding:8px 12px;font-size:.86rem;margin:8px 0} | |
| .tw{overflow-x:auto;-webkit-overflow-scrolling:touch}.codes{display:none}table.stack tr:first-child{display:none}table.stack,table.stack tbody{display:block;width:100%}table.stack tr{display:block;border-bottom:1px solid var(--line);padding:5px 0}table.stack td{display:flex;justify-content:space-between;align-items:baseline;gap:10px;border:0;padding:2px 4px;text-align:right!important;white-space:normal;font-size:.78rem}table.stack td::before{content:attr(data-label);font:700 .62rem "Roboto Condensed",sans-serif;text-transform:uppercase;color:var(--mute);text-align:left;flex:0 0 46%}table.stack td:first-child{font-weight:700;font-size:.84rem}table.stack td:first-child::before{content:none}@media (max-width:699px){.codes{display:block;font-size:.72rem;color:var(--mute);margin:-4px 0 10px;line-height:1.35}}@media (max-width:640px){th,td{white-space:normal;padding:3px 3px;font-size:.7rem;word-break:normal}th{font-size:.58rem;letter-spacing:0}} | |
| table{border-collapse:collapse;width:100%;font-size:.84rem;background:var(--card)} | |
| th,td{border-bottom:1px solid var(--line);padding:5px 8px;text-align:right;white-space:nowrap} | |
| th{font:700 .72rem "Roboto Condensed",sans-serif;text-transform:uppercase;color:var(--mute);position:sticky;top:0;background:var(--card)} | |
| td:first-child,th:first-child{text-align:left} | |
| tr.reg td{font-weight:700;background:var(--chip)} | |
| .pos{color:#b2182b}.neg{color:#2166ac} | |
| :root[data-theme="dark"] .pos{color:#f4a582}:root[data-theme="dark"] .neg{color:#92c5de} | |
| .units{display:flex;flex-direction:column;gap:6px} | |
| .units .opts button{font-size:.86rem;padding:5px 10px} | |
| footer{background:var(--bar2);color:#fff;margin-top:24px} | |
| footer .in{max-width:none;margin:0 auto;padding:16px;font-size:.85rem} | |
| footer a{color:#fff} | |
| .links{display:flex;flex-wrap:wrap;gap:8px 14px;margin-top:6px}.badges{display:flex;flex-wrap:wrap;gap:6px;margin:4px 0 12px}.badge{background:var(--chip);color:var(--acc2);border:1px solid var(--line);border-radius:14px;padding:3px 10px;font:600 .76rem Manrope,sans-serif}.matrix td,.matrix th{text-align:center}.matrix td:first-child{text-align:left;font-weight:600}.matrix th.sel{background:var(--acc2);color:var(--card)}.matrix th.pick{cursor:pointer;text-decoration:underline dotted}.cell{display:inline-block;min-width:64px;padding:3px 6px;border-radius:5px;font-weight:700}.grid4{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}.explore{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin-top:12px}.ex{background:var(--card);border:1px solid var(--line);border-left:5px solid var(--bar);border-radius:10px;padding:10px 14px;cursor:pointer}.ex:hover{border-left-color:var(--acc)}.ex b{display:block;margin-bottom:2px}.ex span{font-size:.84rem;color:var(--mute)}@media (max-width:1400px){.grid4{grid-template-columns:repeat(2,minmax(0,1fr))}}@media (max-width:1000px){.explore{grid-template-columns:1fr}}@media (max-width:700px){.grid4{grid-template-columns:1fr}} | |
| .dl a{display:inline-block;margin:3px 8px 3px 0} | |
| .muted{color:var(--mute)} | |
| @media (max-width:1000px){.kpis{grid-template-columns:repeat(2,minmax(0,1fr))}.grid2,.grid3{grid-template-columns:1fr}.hero h1{font-size:1.3rem}} | |
| @media (max-width:640px){header.top{position:relative}body{font-size:14px}.ctl{top:0;position:relative}.topin{padding:6px 12px}.brand small{display:none}.nav button{font-size:.88rem;padding:6px 10px}.tog button{font-size:.85rem;padding:5px 9px}.kpi .v{font-size:1.2rem}main{padding:8px 12px 24px}.opts button{font-size:.85rem;padding:6px 10px}} | |
| </style> | |
| </head> | |
| <body> | |
| <header class="top"><div class="topin"> | |
| <div class="brand"><span id="brand">Cameroon · Malaria & climate</span> <small>CMIP6 · VECTRI · CSIDNet</small></div> | |
| <div class="nav" id="nav"></div> | |
| <div class="tog" id="lang"><button data-l="en">EN</button><button data-l="fr">FR</button></div> | |
| <div class="tog" id="theme"><button data-t="light">☀</button><button data-t="dark">☾</button></div> | |
| </div></header> | |
| <div class="hero"><div class="heroin"> | |
| <h1 id="h1"></h1><p id="hsub"></p> | |
| <div class="by" id="hby"></div> | |
| </div></div> | |
| <main> | |
| <div class="ctl" id="ctl"><div class="row"> | |
| <div class="grp"><span id="l_view"></span><div class="opts small" id="o_view"></div></div> | |
| <div class="grp"><span id="l_scn"></span><div class="opts" id="o_scn"></div></div> | |
| <div class="grp"><span id="l_per"></span><div class="opts" id="o_per"></div></div> | |
| <div class="grp"><span id="l_lev"></span><div class="opts" id="o_lev"></div></div> | |
| </div></div> | |
| <div class="codes" id="codes"></div> | |
| <section class="page" id="p_over"></section> | |
| <section class="page" id="p_clim"></section> | |
| <section class="page" id="p_suit"></section> | |
| <section class="page" id="p_vec"></section> | |
| <section class="page" id="p_smc"></section> | |
| <section class="page" id="p_val"></section> | |
| <section class="page" id="p_dhis"></section> | |
| <section class="page" id="p_unit"></section> | |
| <section class="page" id="p_meth"></section> | |
| </main> | |
| <footer><div class="in"> | |
| <div id="fsig"></div> | |
| <div class="links"><a href="https://scientific-hub-lab.github.io/Dr-Ibrahima-Diouf/" target="_blank" rel="noopener">Personal page</a><a href="https://huggingface.co/idiouf" target="_blank" rel="noopener">Hugging Face dashboards</a><a href="https://www.linkedin.com/in/dr-ibrahima-diouf-610872108/" target="_blank" rel="noopener">LinkedIn</a></div> | |
| </div></footer> | |
| <script src="plotly.min.js"></script> | |
| <script src="data_core.js"></script> | |
| <script> | |
| ; | |
| const D = window.CMR, ONE = D.meta.nmodels < 2, U = D.units, NU = U.keys.length, MON_EN = ["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"], MON_FR = ["janv.","févr.","mars","avr.","mai","juin","juil.","août","sept.","oct.","nov.","déc."]; | |
| const S = {page: "over", lang: "en", view: "ENSEMBLE", scn: "ssp585", per: "2081-2100", lev: "region", unit: 0}; | |
| try { const q = JSON.parse(localStorage.getItem("cmr_state") || "{}"); ["lang", "page"].forEach(k => { if (q[k]) S[k] = q[k]; }); } catch (e) {} | |
| const tag = () => S.scn + "_" + S.per; | |
| const TX = { | |
| en: {h1: "Cameroon: malaria transmission under a changing climate", hsub: "Climate suitability for malaria transmission and VECTRI model simulations for Cameroon, its 10 regions and 58 departments, from NEX-GDDP-CMIP6 (bias-adjusted CMIP6 projections at 0.25°) under SSP2-4.5 and SSP5-8.5, for 2041-2060 and 2081-2100 against 1995-2014, with a level-1 validation against the confirmed malaria cases of the 10 regions published by the PNLP (2020-2024) and against the monthly routine data of 213 health districts (DHIS2, 2019-2023): test positivity, incidence and seasonality.", | |
| by: "Dr Ibrahima Diouf · Faculty of Sciences and Techniques (FST), University of Labé (Guinea) and LPAO-SF, ESP, UCAD (Senegal) · Prepared for the CSIDNet Working Group on Early Warning Systems", | |
| nav: {over: "Overview", clim: "Climate", suit: "Suitability", vec: "VECTRI", smc: "Seasonality & SMC", val: "Validation (regions)", dhis: "Routine data (DHIS2)", unit: "Territory sheet", meth: "Method & data"}, | |
| view: "Simulation", scn: "Scenario", per: "Period", lev: "Map level", ens: "CMIP6 ensemble median", region: "Regions", department: "Departments", grid: "Grid 0.25°", | |
| hist: "1995-2014", months: "months", mpy: "months per year"}, | |
| fr: {h1: "Cameroun : transmission du paludisme sous un climat qui change", hsub: "Aptitude climatique à la transmission du paludisme et simulations du modèle VECTRI pour le Cameroun, ses 10 régions et ses 58 départements, à partir de NEX-GDDP-CMIP6 (projections CMIP6 corrigées de biais à 0,25°) sous SSP2-4.5 et SSP5-8.5, pour 2041-2060 et 2081-2100 par rapport à 1995-2014, avec une validation au niveau 1 contre les cas confirmés de paludisme des 10 régions publiés par le PNLP (2020-2024) et contre les données mensuelles de routine de 213 districts de santé (DHIS2, 2019-2023) : positivité, incidence et saisonnalité.", | |
| by: "Dr Ibrahima Diouf · Faculté des Sciences et Techniques (FST), Université de Labé (Guinée) et LPAO-SF, ESP, UCAD (Sénégal) · Préparé pour le groupe de travail CSIDNet sur les systèmes d'alerte précoce", | |
| nav: {over: "Vue d'ensemble", clim: "Climat", suit: "Aptitude", vec: "VECTRI", smc: "Saisonnalité & CPS", val: "Validation (régions)", dhis: "Données de routine (DHIS2)", unit: "Fiche territoire", meth: "Méthode & données"}, | |
| view: "Simulation", scn: "Scénario", per: "Période", lev: "Niveau des cartes", ens: "Médiane d'ensemble CMIP6", region: "Régions", department: "Départements", grid: "Grille 0,25°", | |
| hist: "1995-2014", months: "mois", mpy: "mois par an"}}; | |
| const t = k => TX[S.lang][k] || TX.en[k] || k, L = (en, fr) => S.lang === "fr" ? fr : en; | |
| const MON = () => S.lang === "fr" ? MON_FR : MON_EN; | |
| const simLabel = v => v === "ENSEMBLE" ? (ONE ? "CMIP6" : t("ens")) : D.meta.sims[D.meta.simkeys.indexOf(v)]; | |
| const tagLabel = (tg) => tg === "hist" ? "1995-2014" : tg.replace("ssp245_", "SSP2-4.5 ").replace("ssp585_", "SSP5-8.5 "); | |
| const css = v => getComputedStyle(document.documentElement).getPropertyValue(v).trim(); | |
| const DARK = () => document.documentElement.getAttribute("data-theme") === "dark" || (!document.documentElement.getAttribute("data-theme") && matchMedia("(prefers-color-scheme: dark)").matches); | |
| const fmt = (x, d = 1, sg = false) => x == null || !isFinite(x) ? "-" : ((sg && x > 0 ? "+" : "") + Number(x).toFixed(d)).replace("-", "−").replace(".", S.lang === "fr" ? "," : "."); | |
| const cls = x => x == null ? "" : x > 0 ? "pos" : x < 0 ? "neg" : ""; | |
| const A = (v, tg) => D.agg[v][tg], AE = tg => D.agg.ENSEMBLE[tg]; | |
| const uname = i => U.name[i]; | |
| const regIdx = U.kind.map((k, i) => k === "region" ? i : -1).filter(i => i >= 0), depIdx = U.kind.map((k, i) => k === "department" ? i : -1).filter(i => i >= 0); | |
| const levIdx = () => S.lev === "region" ? regIdx : depIdx; | |
| // ------------------------------------------------------------------ map data (one file per simulation, loaded when needed) | |
| const MAPS = {}; | |
| function loadMaps(v){ if (MAPS[v]) return Promise.resolve(MAPS[v]); return new Promise((ok, ko) => { const s = document.createElement("script"); s.src = "maps_" + D.meta.views.indexOf(v) + ".js"; s.onload = () => { MAPS[v] = window.CMR_MAPS[v]; ok(MAPS[v]); }; s.onerror = ko; document.head.appendChild(s); }); } | |
| const G = D.grid, XS = Array.from({length: G.nx}, (_, i) => +(G.lon0 + i * G.dx).toFixed(3)), YS = Array.from({length: G.ny}, (_, j) => +(G.lat0 + j * G.dx).toFixed(3)); | |
| function toGrid(arr){ const z = []; for (let j = 0; j < G.ny; j++) z.push(new Array(G.nx).fill(null)); G.cells.forEach((c, k) => { const v = arr[k]; z[Math.floor(c / G.nx)][c % G.nx] = v == null ? null : v; }); return z; } | |
| // department of each cell (centre point in polygon; nearest department centroid otherwise), for the hover text | |
| const inRing = (p, r) => { let ins = false; for (let i = 0, j = r.length - 1; i < r.length; j = i++) { const a = r[i], b = r[j]; if ((a[1] > p[1]) !== (b[1] > p[1]) && p[0] < (b[0] - a[0]) * (p[1] - a[1]) / (b[1] - a[1]) + a[0]) ins = !ins; } return ins; }; | |
| const CENT = U.rings.map(rs => { let x = 0, y = 0, n = 0; rs.forEach(r => r.forEach(p => { x += p[0]; y += p[1]; n++; })); return [x / n, y / n]; }); | |
| const CELLDEP = G.celldep ? G.celldep : G.cells.map(c => { const p = [G.lon0 + (c % G.nx) * G.dx, G.lat0 + Math.floor(c / G.nx) * G.dx]; let f = depIdx.find(i => U.rings[i].some(r => inRing(p, r))); | |
| if (f == null) { let b = 1e9; depIdx.forEach(i => { const d = (CENT[i][0] - p[0]) ** 2 + (CENT[i][1] - p[1]) ** 2; if (d < b) { b = d; f = i; } }); } return f; }); | |
| const HOVTXT = () => toGrid(CELLDEP.map(i => U.name[i] + " (" + U.region[i] + ")")); | |
| // ------------------------------------------------------------------ colours | |
| const SEQ = [[0, "#ffffcc"], [.25, "#fed976"], [.5, "#fd8d3c"], [.75, "#e31a1c"], [1, "#800026"]], DIV = [[0, "#2166ac"], [.25, "#92c5de"], [.5, "#f7f7f7"], [.75, "#f4a582"], [1, "#b2182b"]], | |
| BLUE = [[0, "#f7fbff"], [.35, "#9ecae1"], [.7, "#3182bd"], [1, "#08306b"]], TEMP = [[0, "#313695"], [.25, "#abd9e9"], [.5, "#ffffbf"], [.75, "#f46d43"], [1, "#a50026"]], | |
| BRBG = [[0, "#8c510a"], [.25, "#dfc27d"], [.5, "#f5f5f5"], [.75, "#80cdc1"], [1, "#01665e"]], PURP = [[0, "#fcfbfd"], [.5, "#9e9ac8"], [1, "#3f007d"]], | |
| MONC = ["#313695", "#4575b4", "#74add1", "#abd9e9", "#a6d96a", "#66bd63", "#fee08b", "#fdae61", "#f46d43", "#d73027", "#a50026", "#762a83"], | |
| SIMC = ["#1b9e77", "#d95f02", "#7570b3", "#e7298a"], TAGC = {"ssp245_2041-2060": "#74add1", "ssp245_2081-2100": "#1f5fa8", "ssp585_2041-2060": "#f08a5d", "ssp585_2081-2100": "#b5172b"}; | |
| function colorAt(scale, f){ f = Math.max(0, Math.min(1, f)); for (let i = 1; i < scale.length; i++) if (f <= scale[i][0]) { const a = scale[i - 1], b = scale[i], u = (f - a[0]) / (b[0] - a[0] || 1), h = s => [1, 3, 5].map(k => parseInt(s.substr(k, 2), 16)), A_ = h(a[1]), B_ = h(b[1]); return "rgb(" + A_.map((v, k) => Math.round(v + (B_[k] - v) * u)).join(",") + ")"; } return scale[scale.length - 1][1]; } | |
| // ------------------------------------------------------------------ plotting helpers | |
| function base(){ const ink = css("--ink"), line = css("--line"); return {paper_bgcolor: "rgba(0,0,0,0)", plot_bgcolor: "rgba(0,0,0,0)", font: {family: "Manrope, Arial, sans-serif", color: ink, size: 12}, margin: {l: 50, r: 10, t: 34, b: 40}, | |
| xaxis: {gridcolor: line, zerolinecolor: line, linecolor: line}, yaxis: {gridcolor: line, zerolinecolor: line, linecolor: line}, hoverlabel: {font: {family: "Manrope"}}, title: {font: {size: 13}, x: 0, xanchor: "left"}}; } | |
| const merge = (a, b) => { const o = JSON.parse(JSON.stringify(a)); Object.keys(b || {}).forEach(k => { o[k] = (b[k] && typeof b[k] === "object" && !Array.isArray(b[k]) && o[k] && typeof o[k] === "object") ? merge(o[k], b[k]) : b[k]; }); return o; }; | |
| const NARROW = () => window.innerWidth < 700; | |
| const TOUCH = () => matchMedia("(hover: none)").matches || NARROW(); | |
| function wrapTxt(t, n){ if (!t || typeof t !== "string" || t.indexOf("<br>") >= 0 || t.replace(/<[^>]+>/g, "").length <= n) return t; const w = t.split(" "), out = []; let line = ""; | |
| w.forEach(x => { const L = (line + " " + x).replace(/<[^>]+>/g, "").trim().length; if (L > n && line) { out.push(line); line = x; } else line = line ? line + " " + x : x; }); if (line) out.push(line); return out.join("<br>"); } | |
| function plot(id, traces, lay, h){ const div = document.getElementById(id); if (!div) return; div.style.height = (h || 360) + "px"; const Lx = merge(base(), lay || {}); | |
| if (TOUCH()) Object.keys(Lx).forEach(k => { if (/^[xy]axis\d*$/.test(k)) Lx[k].fixedrange = true; }); | |
| if (NARROW()) { const n = Math.max(28, Math.floor((div.clientWidth || 340) / 7.2)); | |
| if (Lx.title && Lx.title.text) { const t0 = Lx.title.text; Lx.title.text = wrapTxt(t0, n); const extra = (Lx.title.text.match(/<br>/g) || []).length; if (extra) { Lx.margin = Lx.margin || {}; Lx.margin.t = (Lx.margin.t || 34) + 16 * extra; div.style.height = ((h || 360) + 16 * extra) + "px"; } } | |
| Object.keys(Lx).forEach(k => { if (/^[xy]axis\d*$/.test(k) && Lx[k].title && Lx[k].title.text) { if (k[0] === "y") { Lx[k].title.font = Object.assign({}, Lx[k].title.font || {}, {size: 10}); Lx[k].title.text = wrapTxt(Lx[k].title.text, 36); } else Lx[k].title.text = wrapTxt(Lx[k].title.text, n); } }); } | |
| Plotly.react(div, traces, Lx, {displaylogo: false, responsive: true, scrollZoom: false, displayModeBar: TOUCH() ? false : "hover", modeBarButtonsToRemove: ["lasso2d", "select2d", "autoScale2d"], toImageButtonOptions: {format: "png", scale: 3, filename: id}}); } | |
| // map frame: Cameroon only, coordinates on the axes, outside of Cameroon covered | |
| const NRINGS = U.rings[0], VX = [8.35, 16.3], VY = [1.55, 13.2]; | |
| let MASK = null; | |
| function mask(){ if (!MASK) { let p = "M-5,-5L25,-5L25,30L-5,30Z"; NRINGS.forEach(r => { p += "M" + r.map(q => q[0] + "," + q[1]).join("L") + "Z"; }); MASK = p; } return {type: "path", path: MASK, xref: "x", yref: "y", fillrule: "evenodd", fillcolor: css("--card"), line: {width: 0}, layer: "above"}; } | |
| function outlines(){ const tr = []; const add = (idx, w, c) => { const x = [], y = []; idx.forEach(i => U.rings[i].forEach(r => { r.forEach(p => { x.push(p[0]); y.push(p[1]); }); x.push(null); y.push(null); })); tr.push({type: "scatter", mode: "lines", x: x, y: y, line: {color: c, width: w}, hoverinfo: "skip", showlegend: false}); }; | |
| add(depIdx, 0.5, DARK() ? "rgba(230,237,245,.45)" : "rgba(40,40,40,.45)"); add(regIdx, 1.4, DARK() ? "#e6edf5" : "#222"); add([0], 1.8, DARK() ? "#e6edf5" : "#111"); return tr; } | |
| const RCODE = {"Adamaoua": "AD", "Centre": "CE", "Est": "ES", "Extrême-Nord": "EN", "Littoral": "LT", "Nord": "NO", "Nord-Ouest": "NW", "Ouest": "OU", "Sud": "SU", "Sud-Ouest": "SW"}; | |
| function labels(){ const x = [], y = [], s = []; const POS = {"Extrême-Nord": [14.35, 10.75], "Littoral": [9.85, 4.0], "Sud-Ouest": [9.35, 5.0]}; regIdx.forEach(i => { const p = POS[U.name[i]] || CENT[i]; x.push(p[0]); y.push(p[1]); s.push(NARROW() ? (RCODE[U.name[i]] || U.name[i]) : U.name[i]); }); | |
| return {type: "scatter", mode: "text", x: x, y: y, text: s, textfont: {size: 9, color: DARK() ? "#fff" : "#111", family: "Roboto Condensed"}, hoverinfo: "skip", showlegend: false}; } | |
| function geoLayout(title){ const tick = (a, b, s, suf) => { const v = []; for (let q = a; q <= b; q += s) v.push(q); return {tickvals: v, ticktext: v.map(q => q + suf)}; }; | |
| return {title: {text: title}, margin: {l: 46, r: 8, t: 34, b: 34}, shapes: [mask()], showlegend: false, | |
| xaxis: Object.assign({range: VX.slice(), showgrid: true, zeroline: false, constrain: "domain", ticks: "outside", ticklen: 3}, tick(9, 16, 1, "°E")), | |
| yaxis: Object.assign({range: VY.slice(), showgrid: true, zeroline: false, scaleanchor: "x", scaleratio: 1, constrain: "domain", ticks: "outside", ticklen: 3}, tick(2, 13, 1, "°N"))}; } | |
| // gridded map, or the same field averaged over regions or departments | |
| function gridMap(id, arr, o){ // o: {title, scale, zmin, zmax, unit, dec, stip (agreement array), unitVals (aggregates for unit maps)} | |
| const lev = S.lev, tr = []; | |
| if (o.auto) { const src = (lev === "grid" || !o.unitVals) ? arr : levIdx().map(i => o.unitVals[i]); | |
| const q = (p) => { const v = src.filter(x => x != null && isFinite(x)).sort((x, y) => x - y); return v.length ? v[Math.min(v.length - 1, Math.max(0, Math.round(p * (v.length - 1))))] : null; }; | |
| if (o.auto === "sym") { const m = sym([q(0.03), q(0.97)], o.minAbs); o.zmin = -m; o.zmax = m; } | |
| else { const r = [q(0.02), q(0.98)], st = o.step || 0.5; if (r[0] <= r[1]) { o.zmin = Math.floor(r[0] / st) * st; o.zmax = Math.ceil(r[1] / st) * st; if (o.zmax - o.zmin < st) o.zmax = o.zmin + st; } } } | |
| if (lev === "grid" || !o.unitVals) { | |
| tr.push({type: "heatmap", x: XS, y: YS, z: toGrid(arr), text: HOVTXT(), zmin: o.zmin, zmax: o.zmax, colorscale: o.scale, zsmooth: false, xgap: 0, ygap: 0, | |
| showscale: !o.noscale, hovertemplate: o.noscale ? "%{text}<br>%{x:.2f}°E %{y:.2f}°N<extra></extra>" : "%{text}<br>%{x:.2f}°E %{y:.2f}°N<br>%{z:." + (o.dec == null ? 1 : o.dec) + "f} " + (o.unit || "") + "<extra></extra>", colorbar: {thickness: 11, len: 0.9, x: 1.0, xpad: 4, title: {text: o.unit || "", side: "right"}, outlinewidth: 0}}); | |
| } else { | |
| const idx = levIdx(), vals = o.unitVals; | |
| idx.forEach(i => { const v = vals[i]; const f = v == null ? null : (v - o.zmin) / (o.zmax - o.zmin); | |
| U.rings[i].forEach((r, n) => tr.push({type: "scatter", mode: "lines", fill: "toself", x: r.map(p => p[0]), y: r.map(p => p[1]), line: {width: 0.4, color: DARK() ? "#9aa8b8" : "#555"}, | |
| fillcolor: v == null ? "#cccccc" : colorAt(o.scale, f), hoveron: "fills", hoverinfo: "text", text: U.name[i] + (U.kind[i] === "department" ? " (" + U.region[i] + ")" : "") + ": " + fmt(v, o.dec == null ? 1 : o.dec, o.sg) + " " + (o.unit || ""), showlegend: false})); }); | |
| tr.push({type: "scatter", mode: "markers", x: [null], y: [null], marker: {color: [o.zmin], colorscale: o.scale, cmin: o.zmin, cmax: o.zmax, showscale: true, colorbar: {thickness: 11, len: 0.9, x: 1.0, xpad: 4, title: {text: o.unit || "", side: "right"}, outlinewidth: 0}}, hoverinfo: "skip", showlegend: false}); | |
| } | |
| if (o.stip && (lev === "grid" || !o.unitVals)) { const x = [], y = []; G.cells.forEach((c, k) => { if (o.stip[k] != null && o.stip[k] >= (o.thr || 0.999) && G.frac[k] > 0.4) { x.push(G.lon0 + (c % G.nx) * G.dx); y.push(G.lat0 + Math.floor(c / G.nx) * G.dx); } }); | |
| tr.push({type: "scatter", mode: "markers", x: x, y: y, marker: {size: 2.4, color: DARK() ? "#fff" : "#111"}, hoverinfo: "skip", showlegend: false}); } | |
| outlines().forEach(q => tr.push(q)); tr.push(labels()); | |
| const el = document.getElementById(id), w = el ? el.clientWidth : 600, pw = Math.max(200, w - 46 - 8 - 78), h = Math.round(pw * (VY[1] - VY[0]) / (VX[1] - VX[0]) + 34 + 34); | |
| const lay = geoLayout(o.title); lay.margin = {l: 46, r: 6, t: 30, b: 30}; | |
| plot(id, tr, lay, Math.min(h, 640)); | |
| } | |
| const sym = (arr, minAbs) => { let m = 0; arr.forEach(v => { if (v != null && isFinite(v)) m = Math.max(m, Math.abs(v)); }); m = Math.max(m, minAbs || 0.1); const n = Math.pow(10, Math.floor(Math.log10(m))); return Math.ceil(m / n * 2) / 2 * n; }; | |
| const rng = (arr) => { let a = 1e9, b = -1e9; arr.forEach(v => { if (v != null && isFinite(v)) { a = Math.min(a, v); b = Math.max(b, v); } }); return [a, b]; }; | |
| const agv = (v, tg, f) => (D.agg[v][tg] || {})[f] || new Array(NU).fill(null); | |
| // ------------------------------------------------------------------ text helpers | |
| function rangeTxt(f, i, d){ const r = AE("rng_" + tag()); if (!r || !r[f]) return ""; return L(" (models: ", " (modèles : ") + fmt(r[f][0][i], d, true) + L(" to ", " à ") + fmt(r[f][1][i], d, true) + ")"; } | |
| function signTxt(f, i){ const r = AE("rng_" + tag()); if (!r || !r[f]) return ""; const n = AE("n_" + tag()), up = r[f][2][i], dn = r[f][3][i]; return L(";", " ;") + (up === n ? L(" all " + n + " models show an increase", " les " + n + " modèles montrent une hausse") : dn === n ? L(" all " + n + " models show a decrease", " les " + n + " modèles montrent une baisse") : L(" the models disagree on the sign (" + up + " up, " + dn + " down)", " les modèles divergent sur le signe (" + up + " en hausse, " + dn + " en baisse)")); } | |
| const vv = (f, i, tg) => (S.view === "ENSEMBLE" ? AE(tg || tag()) : A(S.view, tg || tag()))[f][i]; | |
| // ------------------------------------------------------------------ pages | |
| function controls(){ | |
| const mk = (id, items, key) => { const el = document.getElementById(id); el.innerHTML = ""; items.forEach(([v, lab]) => { const b = document.createElement("button"); b.textContent = lab; if (S[key] === v) b.className = "on"; b.onclick = () => { S[key] = v; render(); }; el.appendChild(b); }); }; | |
| mk("o_view", D.meta.views.map(v => [v, simLabel(v)]), "view"); | |
| mk("o_scn", [["ssp245", "SSP2-4.5"], ["ssp585", "SSP5-8.5"]], "scn"); document.getElementById("o_view").parentNode.style.display = D.meta.views.length > 1 ? "" : "none"; | |
| const PERS = [...new Set(D.meta.tags.map(x => x.split("_")[1]))].sort(); if (!PERS.includes(S.per)) S.per = PERS[PERS.length - 1]; mk("o_per", PERS.map(p => [p, p]), "per"); | |
| mk("o_lev", [["grid", t("grid")], ["region", t("region")], ["department", t("department")]], "lev"); | |
| ["view", "scn", "per", "lev"].forEach(k => document.getElementById("l_" + k).textContent = t(k)); | |
| const nav = document.getElementById("nav"); nav.innerHTML = ""; Object.keys(TX.en.nav).filter(p => (p !== "val" || D.val) && (p !== "dhis" || D.dhis)).forEach(p => { const b = document.createElement("button"); b.textContent = t("nav")[p]; if (S.page === p) b.className = "on"; b.onclick = () => { S.page = p; save(); render(); window.scrollTo(0, 0); }; nav.appendChild(b); }); | |
| document.querySelectorAll("#lang button").forEach(b => { b.className = b.dataset.l === S.lang ? "on" : ""; b.onclick = () => { S.lang = b.dataset.l; save(); render(); }; }); | |
| const th = document.documentElement.getAttribute("data-theme") || (DARK() ? "dark" : "light"); document.querySelectorAll("#theme button").forEach(b => { b.className = b.dataset.t === th ? "on" : ""; b.onclick = () => { document.documentElement.setAttribute("data-theme", b.dataset.t); MASK = null; render(); }; }); | |
| document.getElementById("ctl").style.display = (S.page === "meth" || S.page === "val" || S.page === "dhis") ? "none" : ""; | |
| document.getElementById("o_lev").parentNode.style.display = (["over", "clim", "suit", "vec", "smc"].includes(S.page)) ? "" : "none"; | |
| } | |
| function save(){ try { localStorage.setItem("cmr_state", JSON.stringify({lang: S.lang, page: S.page})); } catch (e) {} } | |
| function kpi(l, v, s){ return '<div class="kpi"><div class="l">' + l + '</div><div class="v">' + v + '</div><div class="s">' + s + "</div></div>"; } | |
| async function pOver(){ | |
| const el = document.getElementById("p_over"), tg = tag(), H = AE("hist"), F = AE(tg), Dd = AE("d_" + tg), i = 0, V = S.view, Hv = D.agg[V].hist, Dv = D.agg[V]["d_" + tg]; | |
| const lab = tagLabel(tg); | |
| el.innerHTML = '<h2>' + L("Cameroon at a glance", "Le Cameroun en bref") + ' <span class="muted" style="font-weight:600;font-size:.9rem">· ' + simLabel(V) + " · " + lab + L(" against ", " par rapport à ") + "1995-2014</span></h2>" + | |
| '<div class="badges">' + ["NEX-GDDP-CMIP6", (ONE ? "CMIP6" : D.meta.nmodels + L(" models", " modèles")), "0.25° · " + D.meta.ncell + L(" cells", " cellules"), "SSP2-4.5 · SSP5-8.5", "VECTRI", L("10 regions · 58 departments", "10 régions · 58 départements"), L("Rules: 16-34 °C, 60 mm", "Règles : 16-34 °C, 60 mm")].map(x => '<span class="badge">' + x + "</span>").join("") + "</div>" + | |
| '<div class="kpis">' + | |
| kpi(L("Mean temperature", "Température moyenne"), fmt(Hv.tmean[i], 1) + " °C", L("change ", "variation ") + '<b class="' + cls(Dv.tmean[i]) + '">' + fmt(Dv.tmean[i], 1, true) + " °C</b>") + | |
| kpi(L("Annual rainfall", "Pluie annuelle"), fmt(Hv.rain[i], 0) + " mm", L("change ", "variation ") + '<b class="' + cls(Dv.rain[i]) + '">' + fmt(Dv.rain[i], 0, true) + " %</b>") + | |
| kpi(L("Suitable season (rules)", "Saison favorable (règles)"), fmt(Hv.season[i], 1) + " " + t("months"), L("change ", "variation ") + '<b class="' + cls(Dv.season[i]) + '">' + fmt(Dv.season[i], 2, true) + " " + t("months") + "</b>") + | |
| kpi(L("Annual EIR (VECTRI)", "EIR annuel (VECTRI)"), fmt(Hv.eir[i], 0), L("infective bites per person · change ", "piqûres infectantes par personne · variation ") + '<b class="' + cls(Dv.eir[i]) + '">' + fmt(Dv.eir[i], 0, true) + " %</b>") + | |
| kpi(L("Transmission season (VECTRI)", "Saison de transmission (VECTRI)"), fmt(Hv.vseason[i], 1) + " " + t("months"), L("months with EIR ≥ 1 · change ", "mois avec EIR ≥ 1 · variation ") + '<b class="' + cls(Dv.vseason[i]) + '">' + fmt(Dv.vseason[i], 2, true) + "</b>") + | |
| kpi(L("Parasite rate (VECTRI)", "Prévalence parasitaire (VECTRI)"), fmt(Hv.pr[i], 0) + " %", L("change ", "variation ") + '<b class="' + cls(Dv.pr[i]) + '">' + fmt(Dv.pr[i], 1, true) + L(" points", " points") + "</b>") + | |
| kpi(L("EIR in July-October", "EIR de juillet à octobre"), fmt(Hv.eir_smc[i], 0) + " %", L("of annual EIR · change ", "de l'EIR annuel · variation ") + '<b class="' + cls(Dv.eir_smc[i]) + '">' + fmt(Dv.eir_smc[i], 1, true) + L(" points", " points") + "</b>") + | |
| kpi(L("People in stable suitability", "Population en aptitude stable"), fmt(Hv.stable_people[i], 1) + " M", L("season > 3 months · then ", "saison > 3 mois · ensuite ") + "<b>" + fmt(A(V, tg).stable_people[i], 1) + " M</b>") + | |
| "</div>" + | |
| '<div class="find"><h3>' + L("Key findings", "Principaux résultats") + " · " + lab + '</h3><ul id="findings"></ul></div>' + | |
| '<div class="card"><h3>' + L("Every scenario and period at a glance (Cameroon)", "Tous les scénarios et périodes en un coup d'œil (Cameroun)") + '</h3><div class="tw" id="t_mx"></div><div class="cap">' + L("Change against 1995-2014. Red: increase, blue: decrease; colour intensity grows with the size of the change. Click a column to show it on the whole page.", "Changement par rapport à 1995-2014. Rouge : hausse, bleu : baisse ; l'intensité de la couleur croît avec l'ampleur du changement. Cliquez sur une colonne pour l'afficher sur toute la page.") + '</div></div>' + | |
| '<div class="grid4" style="margin-top:12px"><div class="card"><div class="fig" id="f_o1"></div><div class="cap" id="c_o1"></div></div><div class="card"><div class="fig" id="f_o4"></div><div class="cap" id="c_o4"></div></div><div class="card"><div class="fig" id="f_o5"></div><div class="cap" id="c_o5"></div></div><div class="card"><div class="fig" id="f_o2"></div><div class="cap" id="c_o2"></div></div></div>' + | |
| '<div class="grid2" style="margin-top:12px"><div class="card"><div class="fig" id="f_o6"></div><div class="cap" id="c_o6"></div></div><div class="card"><div class="fig" id="f_o7"></div><div class="cap" id="c_o7"></div></div></div>' + | |
| '<div class="card" style="margin-top:12px"><div class="fig" id="f_o3"></div><div class="cap" id="c_o3"></div></div>' + | |
| '<h3 style="margin-top:16px">' + L("Explore", "Explorer") + '</h3><div class="explore" id="explore"></div>'; | |
| // findings, always from the ensemble with the spread of the four simulations | |
| const n = AE("n_" + tg), li = []; | |
| li.push(L("Mean temperature over Cameroon rises by ", "La température moyenne sur le Cameroun augmente de ") + "<b>" + fmt(Dd.tmean[0], 1, true) + " °C</b>" + rangeTxt("tmean", 0, 1) + "."); | |
| li.push(L("Annual rainfall changes by ", "La pluie annuelle varie de ") + "<b>" + fmt(Dd.rain[0], 0, true) + " %</b>" + rangeTxt("rain", 0, 0) + signTxt("rain", 0) + "."); | |
| li.push(L("The rule-based suitable season changes by ", "La saison favorable selon les règles varie de ") + "<b>" + fmt(Dd.season[0], 2, true) + L(" months", " mois") + "</b>" + rangeTxt("season", 0, 2) + signTxt("season", 0) + L(". More months become too hot for transmission: ", ". Davantage de mois deviennent trop chauds pour la transmission : ") + fmt(Dd.hot[0], 1, true) + L(" months above 34 °C.", " mois au-dessus de 34 °C.")); | |
| const pe = (D.tests[tg] || {}).eir ? D.tests[tg].eir[0] : null; | |
| li.push(L("VECTRI annual EIR (driven by one CMIP6 model) changes by ", "L'EIR annuel simulé par VECTRI (forcé par un modèle CMIP6) varie de ") + "<b>" + fmt(Dd.eir[0], 0, true) + " %</b>" + (pe == null ? "" : pe < 0.05 ? L(" (significant, Mann-Whitney p = ", " (significatif, Mann-Whitney p = ") + fmt(pe, 3) + ")" : L(" (not significant, p = ", " (non significatif, p = ") + fmt(pe, 2) + ")") + L(". The two approaches do not respond in the same way to warming (see the VECTRI page).", ". Les deux approches ne répondent pas de la même façon au réchauffement (voir la page VECTRI).")); | |
| const rs = regIdx.slice().sort((a, b) => (Dd.eir[b] || -1e9) - (Dd.eir[a] || -1e9)); | |
| li.push(L("Largest relative increase of EIR: ", "Plus forte hausse relative de l'EIR : ") + rs.slice(0, 3).map(r => U.name[r] + " (" + fmt(Dd.eir[r], 0, true) + " %)").join(", ") + L("; smallest: ", " ; plus faible : ") + rs.slice(-2).map(r => U.name[r] + " (" + fmt(Dd.eir[r], 0, true) + " %)").join(", ") + "."); | |
| li.push(L("Area in stable suitability (season longer than 3 months): ", "Surface en aptitude stable (saison de plus de 3 mois) : ") + fmt(H.stable_share[0], 0) + " % → <b>" + fmt(F.stable_share[0], 0) + " %</b>" + L("; ", " ; ") + L("people living where it is lost: ", "population vivant là où elle est perdue : ") + "<b>" + fmt(Dd.loss_people[0], 1) + " M</b>" + L(", where it is gained: ", ", là où elle est gagnée : ") + fmt(Dd.gain_people[0], 1) + (ONE ? L(" M (fixed population).", " M (population fixe).") : L(" M (ensemble-median map, fixed population).", " M (carte de la médiane d'ensemble, population fixe)."))); | |
| li.push(L("Share of annual EIR falling in July-October (the SMC window): ", "Part de l'EIR annuel comprise entre juillet et octobre (fenêtre de la CPS) : ") + fmt(H.eir_smc[0], 0) + " %" + L(" in 1995-2014, change ", " en 1995-2014, variation de ") + "<b>" + fmt(Dd.eir_smc[0], 1, true) + L(" points</b>", " points</b>") + rangeTxt("eir_smc", 0, 1) + L("; November: ", " ; novembre : ") + fmt(H.eir_nov[0], 1) + " %, " + fmt(Dd.eir_nov[0], 1, true) + L(" points.", " points.")); | |
| document.getElementById("findings").innerHTML = li.map(x => "<li>" + x + "</li>").join(""); | |
| const M = await loadMaps(V), ME = M; | |
| gridMap("f_o1", ME.hist.season, {title: L("Suitable season length, 1995-2014", "Durée de la saison favorable, 1995-2014"), scale: SEQ, auto: "seq", step: 0.5, unit: t("months"), unitVals: agv(V, "hist", "season")}); | |
| const dz = ME["d_" + tg].eir; gridMap("f_o2", dz, {title: L("Change of annual EIR (VECTRI), ", "Variation de l'EIR annuel (VECTRI), ") + lab, scale: DIV, auto: "sym", minAbs: 20, unit: "%", dec: 0, sg: true, stip: V === "ENSEMBLE" ? ME["d_" + tg].agree_eir : null, unitVals: agv(V, "d_" + tg, "eir")}); | |
| document.getElementById("c_o1").textContent = L("Longest run of consecutive months with temperature between 16 and 34 °C and rainfall of at least 60 mm (with one month of at least 80 mm in the year). " + simLabel(V) + ".", "Plus longue suite de mois consécutifs où la température est comprise entre 16 et 34 °C et la pluie atteint au moins 60 mm (avec au moins un mois de 80 mm dans l'année). " + simLabel(V) + "."); | |
| document.getElementById("c_o2").textContent = L("Relative change of the annual entomological inoculation rate simulated by VECTRI (colour scale capped at ±200 %). VECTRI driven by one CMIP6 model. Dots: change significant (Mann-Whitney test on the 20 annual values, p < 0.05). Cells with an annual EIR below 0.1 in 1995-2014 are left blank.", "Variation relative du taux d'inoculation entomologique annuel simulé par VECTRI (échelle limitée à ±200 %). VECTRI forcé par un modèle CMIP6. Points : changement significatif (test de Mann-Whitney sur les 20 valeurs annuelles, p < 0,05). Les cellules dont l'EIR annuel est inférieur à 0,1 en 1995-2014 sont laissées en blanc."); | |
| // all scenario-periods for Cameroon and regions: EIR change with simulation range | |
| const tr = [], names = regIdx.map(uname); D.meta.tags.forEach(tg2 => { const d2 = AE("d_" + tg2).eir, r2 = (AE("rng_" + tg2) || {}).eir; | |
| tr.push({type: "bar", name: tagLabel(tg2), x: [0].concat(regIdx).map(uname), y: [0].concat(regIdx).map(k => d2[k]), marker: {color: TAGC[tg2]}, | |
| error_y: r2 ? {type: "data", symmetric: false, array: [0].concat(regIdx).map(k => r2[1][k] - d2[k]), arrayminus: [0].concat(regIdx).map(k => d2[k] - r2[0][k]), thickness: 1, width: 2, color: css("--mute")} : {visible: false}, | |
| hovertemplate: "%{x}<br>" + tagLabel(tg2) + ": %{y:+.0f} %<extra></extra>"}); }); | |
| plot("f_o3", tr, {title: {text: L("Change of annual EIR by region, all scenarios and periods (VECTRI driven by one CMIP6 model)", "Variation de l'EIR annuel par région, tous scénarios et périodes (VECTRI forcé par un modèle CMIP6)")}, barmode: "group", xaxis: {tickangle: -60, tickfont: {size: 9}, automargin: true}, yaxis: {title: {text: "%"}, ticksuffix: " %"}, legend: {orientation: "h", y: -0.45}, margin: {b: 150}}, 470); | |
| document.getElementById("c_o3").textContent = L((ONE ? "VECTRI driven by CMIP6." : "VECTRI driven by the CMIP6 model closest to the ensemble median change over Cameroon.") + " The relative change is computed on the area-weighted annual EIR of each region.", (ONE ? "VECTRI forcé par CMIP6." : "VECTRI forcé par le modèle CMIP6 le plus proche du changement médian de l'ensemble sur le Cameroun.") + " La variation relative est calculée sur l'EIR annuel moyen pondéré par la surface de chaque région."); | |
| // scenario matrix | |
| const rowsM = [["tmean", L("Mean temperature (°C)", "Température moyenne (°C)"), 1, 6], ["rain", L("Annual rainfall (%)", "Pluie annuelle (%)"), 0, 60], ["season", L("Suitable season, rules (months)", "Saison favorable, règles (mois)"), 2, 1.5], | |
| ["hot", L("Months above 34 °C", "Mois au-dessus de 34 °C"), 1, 4], ["eir", L("Annual EIR, VECTRI (%)", "EIR annuel, VECTRI (%)"), 0, 120], ["vseason", L("Transmission season, VECTRI (months)", "Saison de transmission, VECTRI (mois)"), 2, 1.5], | |
| ["pr", L("Parasite rate, VECTRI (points)", "Prévalence, VECTRI (points)"), 1, 10], ["eir_smc", L("EIR share in July-October (points)", "Part de l'EIR en juillet-octobre (points)"), 1, 8]]; | |
| const bg = (v, sc) => { if (v == null) return "transparent"; const f = Math.max(-1, Math.min(1, v / sc)); const c = colorAt(DIV, (f + 1) / 2); return c.replace("rgb", "rgba").replace(")", "," + (0.25 + 0.6 * Math.abs(f)).toFixed(2) + ")"); }; | |
| let mx = '<table class="matrix"><tr><th>' + L("Indicator", "Indicateur") + "</th><th>1995-2014</th>" + D.meta.tags.map(tg2 => '<th class="pick' + (tg2 === tg ? " sel" : "") + '" data-t="' + tg2 + '">' + tagLabel(tg2) + "</th>").join("") + "</tr>"; | |
| rowsM.forEach(([f, lb, d, sc]) => { mx += "<tr><td>" + lb + "</td><td>" + fmt(Hv[f][0], d) + (f === "rain" ? " mm" : f === "eir" ? "" : "") + "</td>" + D.meta.tags.map(tg2 => { const v = D.agg[V]["d_" + tg2][f][0]; return '<td><span class="cell" style="background:' + bg(v, sc) + '">' + fmt(v, d, true) + "</span></td>"; }).join("") + "</tr>"; }); | |
| const sh = D.meta.tags.map(tg2 => A(V, tg2).stable_share[0]); mx += "<tr><td>" + L("Area in stable suitability (%)", "Surface en aptitude stable (%)") + "</td><td>" + fmt(Hv.stable_share[0], 0) + "</td>" + sh.map(v => "<td>" + fmt(v, 0) + "</td>").join("") + "</tr></table>"; | |
| document.getElementById("t_mx").innerHTML = mx; | |
| document.querySelectorAll("#t_mx th.pick").forEach(th => th.onclick = () => { const [sc, pe] = th.dataset.t.split("_"); S.scn = sc; S.per = pe; render(); }); | |
| // two more maps: temperature and rainfall change | |
| const dd = ME["d_" + tg]; | |
| gridMap("f_o4", dd.tmean, {title: L("Temperature change, ", "Variation de température, ") + lab, scale: [[0, "#fff5eb"], [.5, "#fd8d3c"], [1, "#7f2704"]], auto: "seq", step: 0.2, dec: 2, unit: "°C", sg: true, unitVals: agv(V, "d_" + tg, "tmean")}); | |
| gridMap("f_o5", dd.rain, {title: L("Rainfall change, ", "Variation de la pluie, ") + lab, scale: BRBG, auto: "sym", minAbs: 20, unit: "%", dec: 0, sg: true, unitVals: agv(V, "d_" + tg, "rain")}); | |
| document.getElementById("c_o4").textContent = L("Change of the mean annual temperature.", "Variation de la température moyenne annuelle."); | |
| document.getElementById("c_o5").textContent = L("Change of the annual rainfall, in percent of 1995-2014 (scale capped at ±100 %).", "Variation de la pluie annuelle, en pourcentage de 1995-2014 (échelle limitée à ±100 %)."); | |
| // seasonal cycle of Cameroon: monthly rainfall (bars) and monthly EIR (lines), 1995-2014 and the selected future | |
| const C0 = D.cal[V].hist, C1 = D.cal[V][tg], M_ = MON(); | |
| plot("f_o6", [{type: "bar", name: L("Rain 1995-2014", "Pluie 1995-2014"), x: M_, y: C0.rain[0], marker: {color: DARK() ? "rgba(156,195,236,.45)" : "rgba(84,146,205,.35)"}, yaxis: "y2", hovertemplate: "%{x}: %{y:.0f} mm<extra></extra>"}, | |
| {type: "bar", name: L("Rain ", "Pluie ") + lab, x: M_, y: C1.rain[0], marker: {color: DARK() ? "rgba(156,195,236,.85)" : "rgba(23,50,85,.55)"}, yaxis: "y2", hovertemplate: "%{x}: %{y:.0f} mm<extra></extra>"}, | |
| {type: "scatter", mode: "lines+markers", name: "EIR 1995-2014", x: M_, y: C0.eir[0], line: {color: DARK() ? "#fff" : "#111", width: 3}, hovertemplate: "%{x}: %{y:.1f}<extra>EIR 1995-2014</extra>"}, | |
| {type: "scatter", mode: "lines+markers", name: "EIR " + lab, x: M_, y: C1.eir[0], line: {color: TAGC[tg] || "#b5172b", width: 3}, hovertemplate: "%{x}: %{y:.1f}<extra>EIR " + lab + "</extra>"}], | |
| {title: {text: L("Seasonal cycle over Cameroon: rainfall and monthly EIR", "Cycle saisonnier sur le Cameroun : pluie et EIR mensuel")}, barmode: "group", yaxis: {title: {text: L("EIR (bites per person per month)", "EIR (piqûres par personne et par mois)")}}, yaxis2: {title: {text: "mm"}, overlaying: "y", side: "right", showgrid: false, rangemode: "tozero", tickformat: ".0f", tickmode: "auto", nticks: 6}, | |
| legend: {orientation: "h", y: -0.2}, margin: {b: 80, r: 50}, shapes: [{type: "rect", xref: "x", yref: "paper", x0: 5.5, x1: 9.5, y0: 0, y1: 1, fillcolor: DARK() ? "rgba(240,138,75,.10)" : "rgba(191,91,32,.08)", line: {width: 0}, layer: "below"}]}, 380); | |
| document.getElementById("c_o6").textContent = L("Area-weighted means over Cameroon. Shaded: July to October, the SMC window in Nord and Extrême-Nord. In the south, rainfall is bimodal: the national mean smooths the two seasons.", "Moyennes pondérées par la surface sur le Cameroun. Zone ombrée : juillet à octobre, la fenêtre de la CPS dans le Nord et l'Extrême-Nord. Au sud, le régime des pluies est bimodal : la moyenne nationale atténue les deux saisons."); | |
| // regions: annual EIR, 1995-2014 and the selected future | |
| const ro = regIdx.slice().sort((a, b) => (Hv.eir[a] || 0) - (Hv.eir[b] || 0)), F2 = A(V, tg); | |
| plot("f_o7", [{type: "bar", orientation: "h", name: "1995-2014", y: ro.map(uname), x: ro.map(k => Hv.eir[k]), marker: {color: DARK() ? "#9aa8b8" : "#9e9e9e"}, hovertemplate: "%{y}: %{x:.0f}<extra>1995-2014</extra>"}, | |
| {type: "bar", orientation: "h", name: lab, y: ro.map(uname), x: ro.map(k => F2.eir[k]), marker: {color: TAGC[tg] || "#b5172b"}, hovertemplate: "%{y}: %{x:.0f}<extra>" + lab + "</extra>"}], | |
| {title: {text: L("Annual EIR by region (infective bites per person per year)", "EIR annuel par région (piqûres infectantes par personne et par an)")}, barmode: "group", margin: {l: 150, b: 70}, legend: {orientation: "h", y: -0.08}, xaxis: {title: {text: "EIR"}}, yaxis: {tickfont: {size: 9}, dtick: 1, automargin: true}}, 720); | |
| document.getElementById("c_o7").textContent = L("VECTRI, area-weighted over each region; regions sorted by their 1995-2014 value.", "VECTRI, moyenne pondérée par la surface de chaque région ; régions classées selon leur valeur de 1995-2014."); | |
| // explore cards | |
| const ex = [["clim", L("Climate", "Climat"), L("Temperature and rainfall maps, changes by region, monthly climatology of every territory.", "Cartes de température et de pluie, changements par région, climatologie mensuelle de chaque territoire.")], | |
| ["suit", L("Suitability", "Aptitude"), L("Suitable season, months too hot or too dry, gained and lost suitability, calendar, sensitivity to thresholds.", "Saison favorable, mois trop chauds ou trop secs, aptitude gagnée et perdue, calendrier, sensibilité aux seuils.")], | |
| ["vec", "VECTRI", L("EIR, parasite rate, transmission season, and how VECTRI compares with the rules.", "EIR, prévalence, saison de transmission, et comparaison de VECTRI avec les règles.")], | |
| ["smc", L("Seasonality & SMC", "Saisonnalité & CPS"), L("Share of transmission in July-October and in November, peak month, by region and department.", "Part de la transmission en juillet-octobre et en novembre, mois du pic, par région et département.")], | |
| ["unit", L("Territory sheet", "Fiche territoire"), L("All indicators of one region or department, for every scenario and period.", "Tous les indicateurs d'une région ou d'un département, pour chaque scénario et période.")], | |
| ["val", L("Validation (regions)", "Validation (régions)"), L("VECTRI and climate against the confirmed malaria cases of the 10 regions published by the PNLP, 2020-2024 (GADM level 1).", "VECTRI et climat contre les cas confirmés de paludisme des 10 régions publiés par le PNLP, 2020-2024 (niveau 1 de GADM).")], | |
| ["dhis", L("Routine data (DHIS2)", "Données de routine (DHIS2)"), L("Monthly cases, testing, positivity and seasonality of 213 health districts aggregated to the regions, SMC and ITN coverage, and how the simulated seasonality compares.", "Cas mensuels, tests, positivité et saisonnalité de 213 districts de santé agrégés aux régions, couverture de la CPS et des MILDA, et comparaison avec la saisonnalité simulée.")], | |
| ["meth", L("Method & data", "Méthode & données"), L("Data, rules, VECTRI set-up, territories, limits, downloads and references.", "Données, règles, configuration de VECTRI, territoires, limites, téléchargements et références.")]]; | |
| document.getElementById("explore").innerHTML = ex.map(([p, tt, tx]) => '<div class="ex" data-p="' + p + '"><b>' + tt + " →</b><span>" + tx + "</span></div>").join(""); | |
| document.querySelectorAll("#explore .ex").forEach(e => e.onclick = () => { S.page = e.dataset.p; save(); render(); window.scrollTo(0, 0); }); | |
| } | |
| function regionBars(id, f, title, unit, dec){ const tr = []; D.meta.tags.forEach(tg2 => { const d2 = AE("d_" + tg2)[f], r2 = (AE("rng_" + tg2) || {})[f]; const idx = [0].concat(regIdx); | |
| tr.push({type: "bar", name: tagLabel(tg2), x: idx.map(uname), y: idx.map(k => d2[k]), marker: {color: TAGC[tg2]}, error_y: r2 ? {type: "data", symmetric: false, array: idx.map(k => r2[1][k] - d2[k]), arrayminus: idx.map(k => d2[k] - r2[0][k]), thickness: 1, width: 2, color: css("--mute")} : {visible: false}, | |
| hovertemplate: "%{x}<br>" + tagLabel(tg2) + ": %{y:+." + dec + "f} " + unit + "<extra></extra>"}); }); | |
| plot(id, tr, {title: {text: title}, barmode: "group", xaxis: {tickangle: -60, tickfont: {size: 9}, automargin: true}, yaxis: {title: {text: unit}}, legend: {orientation: "h", y: -0.45}, margin: {b: 150}}, 460); } | |
| function unitButtons(target, cb){ const el = document.getElementById(target); let h = '<div class="units"><div class="opts">'; | |
| const st = U.kind[S.unit] === "department" ? U.name.indexOf(U.region[S.unit]) : S.unit; | |
| [0].concat(regIdx).forEach(i => { h += '<button data-u="' + i + '"' + (S.unit === i || (i === st && i > 0) ? ' class="on"' : "") + ">" + (U.name[i] === "Federal Capital Territory" ? "FCT" : uname(i)) + "</button>"; }); h += "</div>"; | |
| if (st > 0) { const ds = depIdx.filter(i => U.region[i] === U.name[st]); h += '<div class="opts small"><span class="muted" style="font-size:.72rem;align-self:center;min-width:64px">' + L("Departments of ", "Départements de ") + U.name[st] + "</span>"; ds.forEach(i => { h += '<button data-u="' + i + '"' + (S.unit === i ? ' class="on"' : "") + ">" + uname(i) + "</button>"; }); h += "</div>"; } | |
| el.innerHTML = h + "</div>"; el.querySelectorAll("button").forEach(b => b.onclick = () => { S.unit = +b.dataset.u; cb(); }); } | |
| function cycles(id, q, title, unit, i, opts){ // monthly cycle of a unit: 1995-2014 and the four futures, ensemble or one simulation | |
| const V = S.view, tr = [], M_ = MON(); | |
| ["hist"].concat(D.meta.tags).forEach(tg2 => { const c = D.cal[V][tg2]; if (!c) return; tr.push({type: "scatter", mode: "lines+markers", name: tagLabel(tg2), x: M_, y: c[q][i].map(v => v == null ? null : v * (opts && opts.k || 1)), line: {color: tg2 === "hist" ? (DARK() ? "#fff" : "#111") : TAGC[tg2], width: tg2 === "hist" ? 3 : 2}, marker: {size: 4}, hovertemplate: tagLabel(tg2) + " %{x}: %{y:.1f} " + unit + "<extra></extra>"}); }); | |
| const lay = {title: {text: title}, yaxis: {title: {text: unit}}, legend: {orientation: "h", y: -0.2}, margin: {b: 70}}; | |
| if (opts && opts.smc) lay.shapes = [{type: "rect", xref: "x", yref: "paper", x0: 5.5, x1: 9.5, y0: 0, y1: 1, fillcolor: DARK() ? "rgba(240,138,75,.12)" : "rgba(191,91,32,.10)", line: {width: 0}, layer: "below"}]; | |
| if (opts && opts.log) lay.yaxis.type = "log"; | |
| plot(id, tr, lay, 340); } | |
| async function pClim(){ | |
| const el = document.getElementById("p_clim"), tg = tag(), V = S.view, lab = tagLabel(tg); | |
| el.innerHTML = "<h2>" + L("Temperature and rainfall", "Température et pluie") + ' <span class="muted" style="font-weight:600;font-size:.9rem">· ' + simLabel(V) + "</span></h2>" + | |
| '<div class="grid2"><div class="card"><div class="fig" id="f_c1"></div></div><div class="card"><div class="fig" id="f_c2"></div></div><div class="card"><div class="fig" id="f_c3"></div></div><div class="card"><div class="fig" id="f_c4"></div></div></div>' + | |
| '<div class="cap">' + L("Left: 1995-2014. Right: change for ", "À gauche : 1995-2014. À droite : changement pour ") + lab + (ONE ? L(". One CMIP6 model.", ". Un modèle CMIP6.") : L(". Change maps: median of the " + D.meta.nmodels + " CMIP6 models; dots: at least 80 % of the models agree on the sign.", ". Cartes de changement : médiane des " + D.meta.nmodels + " modèles CMIP6 ; points : au moins 80 % des modèles s'accordent sur le signe.")) + "</div>" + | |
| '<div class="grid2" style="margin-top:12px"><div class="card"><div class="fig" id="f_c5"></div></div><div class="card"><div class="fig" id="f_c6"></div></div></div>' + | |
| '<h3 style="margin-top:14px">' + L("Monthly climatology of a territory", "Climatologie mensuelle d'un territoire") + '</h3><div id="u_c"></div><div class="grid2" style="margin-top:8px"><div class="card"><div class="fig" id="f_c7"></div></div><div class="card"><div class="fig" id="f_c8"></div></div></div>'; | |
| const M = await loadMaps(V), ag = M["d_" + tg].agree_tmean, ar = M["d_" + tg].agree_rain; | |
| gridMap("f_c1", M.hist.tmean, {title: L("Mean annual temperature, 1995-2014", "Température moyenne annuelle, 1995-2014"), scale: TEMP, auto: "seq", step: 1, unit: "°C", unitVals: agv(V, "hist", "tmean")}); | |
| gridMap("f_c2", M["d_" + tg].tmean, {title: L("Temperature change, ", "Variation de température, ") + lab, scale: [[0, "#fff5eb"], [.5, "#fd8d3c"], [1, "#7f2704"]], auto: "seq", step: 0.2, dec: 2, unit: "°C", sg: true, stip: V === "ENSEMBLE" ? ag : null, thr: D.meta.agree_thr, unitVals: agv(V, "d_" + tg, "tmean")}); | |
| gridMap("f_c3", M.hist.rain, {title: L("Annual rainfall, 1995-2014", "Pluie annuelle, 1995-2014"), scale: BLUE, auto: "seq", step: 50, unit: "mm", dec: 0, unitVals: agv(V, "hist", "rain")}); | |
| gridMap("f_c4", M["d_" + tg].rain, {title: L("Rainfall change, ", "Variation de la pluie, ") + lab, scale: BRBG, auto: "sym", minAbs: 20, unit: "%", dec: 0, sg: true, stip: V === "ENSEMBLE" ? ar : null, thr: D.meta.agree_thr, unitVals: agv(V, "d_" + tg, "rain")}); | |
| regionBars("f_c5", "tmean", L("Temperature change by region (°C)", "Variation de température par région (°C)"), "°C", 1); | |
| regionBars("f_c6", "rain", L("Rainfall change by region (%)", "Variation de la pluie par région (%)"), "%", 0); | |
| const draw = () => { unitButtons("u_c", draw); cycles("f_c7", "tas", L("Monthly mean temperature, ", "Température moyenne mensuelle, ") + uname(S.unit), "°C", S.unit); cycles("f_c8", "rain", L("Monthly rainfall, ", "Pluie mensuelle, ") + uname(S.unit), "mm", S.unit); }; | |
| draw(); | |
| } | |
| async function pSuit(){ | |
| const el = document.getElementById("p_suit"), tg = tag(), V = S.view, lab = tagLabel(tg); | |
| el.innerHTML = "<h2>" + L("Climate suitability for malaria transmission (rule-based)", "Aptitude climatique à la transmission du paludisme (règles)") + ' <span class="muted" style="font-weight:600;font-size:.9rem">· ' + simLabel(V) + "</span></h2>" + | |
| '<div class="note">' + L("A month is suitable when its mean temperature lies between 16 and 34 °C and its rainfall reaches 60 mm, in a year with at least one month of 80 mm. The season is the longest run of consecutive suitable months; stable suitability means a mean season longer than 3 months (Mordecai et al. 2013; Tanser et al. 2003; Smith et al. 2020).", "Un mois est favorable si sa température moyenne est comprise entre 16 et 34 °C et sa pluie atteint 60 mm, dans une année ayant au moins un mois de 80 mm. La saison est la plus longue suite de mois favorables consécutifs ; l'aptitude est stable quand la saison moyenne dépasse 3 mois (Mordecai et al. 2013 ; Tanser et al. 2003 ; Smith et al. 2020).") + "</div>" + | |
| '<div class="grid2"><div class="card"><div class="fig" id="f_s1"></div></div><div class="card"><div class="fig" id="f_s2"></div></div><div class="card"><div class="fig" id="f_s3"></div><div class="cap" id="c_s3"></div></div><div class="card"><div class="fig" id="f_s4"></div><div class="cap" id="c_s4"></div></div></div>' + | |
| '<div class="grid2" style="margin-top:12px"><div class="card"><div class="fig" id="f_s5"></div><div class="cap" id="c_s5"></div></div><div class="card"><div class="fig" id="f_s6"></div><div class="cap" id="c_s6"></div></div></div>' + | |
| '<div class="card" style="margin-top:12px"><div class="fig" id="f_s7"></div><div class="cap" id="c_s7"></div></div>' + | |
| '<h3 style="margin-top:14px">' + L("Sensitivity to the thresholds (Cameroon and regions)", "Sensibilité aux seuils (Cameroun et régions)") + '</h3><div class="tw" id="t_s"></div>'; | |
| const M = await loadMaps(V), d = M["d_" + tg]; | |
| gridMap("f_s1", M.hist.season, {title: L("Suitable season, 1995-2014", "Saison favorable, 1995-2014"), scale: SEQ, auto: "seq", step: 0.5, unit: t("months"), unitVals: agv(V, "hist", "season")}); | |
| gridMap("f_s2", d.season, {title: L("Change of the suitable season, ", "Variation de la saison favorable, ") + lab, scale: DIV, auto: "sym", minAbs: 0.2, unit: t("months"), dec: 2, sg: true, stip: V === "ENSEMBLE" ? d.agree_season : null, thr: D.meta.agree_thr, unitVals: agv(V, "d_" + tg, "season")}); | |
| gridMap("f_s3", d.hot, {title: L("Change of too-hot months (> 34 °C), ", "Variation des mois trop chauds (> 34 °C), ") + lab, scale: [[0, "#f7f7f7"], [.5, "#fdb863"], [1, "#b35806"]], auto: "seq", step: 0.5, unit: t("months"), dec: 2, sg: true, unitVals: agv(V, "d_" + tg, "hot")}); | |
| document.getElementById("c_s3").textContent = L("Months per year whose mean temperature exceeds the upper limit of 34 °C: the main reason why the season shortens where it does.", "Mois par an dont la température moyenne dépasse la limite haute de 34 °C : principale raison du raccourcissement de la saison là où il a lieu."); | |
| // gained, lost | |
| const tr = d.trans, cols = [[0, "#e6e6e6"], [0.25, "#e6e6e6"], [0.25, "#2166ac"], [0.5, "#2166ac"], [0.5, "#fde8b8"], [0.75, "#fde8b8"], [0.75, "#b2182b"], [1, "#b2182b"]]; | |
| const saveLev = S.lev; S.lev = "grid"; | |
| gridMap("f_s4", tr.map(v => v == null ? null : v + 0.5), {title: L("Stable suitability (season > 3 months), ", "Aptitude stable (saison > 3 mois), ") + lab, scale: cols, zmin: 0, zmax: 4, unit: "", dec: 0, noscale: true}); | |
| S.lev = saveLev; | |
| document.getElementById("c_s4").innerHTML = '<span style="color:#9e9e9e">■</span> ' + L("never stable", "jamais stable") + ' · <span style="color:#2166ac">■</span> ' + L("lost", "perdue") + ' · <span style="color:#e0b964">■</span> ' + L("stable in both periods", "stable aux deux périodes") + ' · <span style="color:#b2182b">■</span> ' + L("gained", "gagnée") + ". " + | |
| L("People in areas that lose stable suitability: ", "Population des zones qui perdent l'aptitude stable : ") + fmt(agv(V, "d_" + tg, "loss_people")[0], 2) + " M; " + L("that gain it: ", "qui la gagnent : ") + fmt(agv(V, "d_" + tg, "gain_people")[0], 2) + L(" M (fixed population).", " M (population fixe)."); | |
| // limiting factors, Cameroon and regions, historical and future | |
| const idx = [0].concat(regIdx), H = agv(V, "hist", "cold"), Hh = agv(V, "hist", "hot"), Hd = agv(V, "hist", "dry"), Hs = agv(V, "hist", "suitable"), F_ = A(V, tg); | |
| const bar = (nm, y, c) => ({type: "bar", name: nm, x: idx.map(uname), y: y, marker: {color: c}, hovertemplate: "%{x}: %{y:.1f} " + t("months") + "<extra>" + nm + "</extra>"}); | |
| plot("f_s5", [bar(L("suitable", "favorables"), idx.map(k => Hs[k]), "#1a9850"), bar(L("too dry", "trop secs"), idx.map(k => Hd[k]), "#d8b365"), bar(L("too hot", "trop chauds"), idx.map(k => Hh[k]), "#d73027"), bar(L("too cold", "trop froids"), idx.map(k => H[k]), "#4575b4")], | |
| {title: {text: L("What limits transmission, 1995-2014 (months per year)", "Ce qui limite la transmission, 1995-2014 (mois par an)")}, barmode: "stack", xaxis: {tickangle: -60, tickfont: {size: 9}, automargin: true}, yaxis: {title: {text: t("months")}, range: [0, 12]}, legend: {orientation: "h", y: -0.5}, margin: {b: 150}}, 440); | |
| document.getElementById("c_s5").textContent = L("Each month of the year is counted once: within the thermal range and wet enough (suitable), within the thermal range but too dry, too hot, or too cold. Area-weighted means. A suitable month does not always belong to the season (the season is the longest run).", "Chaque mois de l'année est compté une fois : dans la plage thermique et assez humide (favorable), dans la plage thermique mais trop sec, trop chaud ou trop froid. Moyennes pondérées par la surface. Un mois favorable n'appartient pas toujours à la saison (la saison est la plus longue suite)."); | |
| const Dd = A(V, "d_" + tg); | |
| plot("f_s6", [bar(L("suitable", "favorables"), idx.map(k => Dd.suitable[k]), "#1a9850"), bar(L("too dry", "trop secs"), idx.map(k => Dd.dry[k]), "#d8b365"), bar(L("too hot", "trop chauds"), idx.map(k => Dd.hot[k]), "#d73027"), bar(L("too cold", "trop froids"), idx.map(k => Dd.cold[k]), "#4575b4")], | |
| {title: {text: L("Change of the limiting factors, ", "Variation des facteurs limitants, ") + lab}, barmode: "group", xaxis: {tickangle: -60, tickfont: {size: 9}, automargin: true}, yaxis: {title: {text: t("months")}}, legend: {orientation: "h", y: -0.5}, margin: {b: 150}}, 440); | |
| document.getElementById("c_s6").textContent = L("Change in months per year of each class; the four classes add up to zero.", "Variation en mois par an de chaque classe ; la somme des quatre classes est nulle."); | |
| // calendar heatmap by region, historical and future | |
| const C0 = D.cal[V].hist.freq, C1 = (D.cal[V][tg] || {}).freq, M_ = MON(), rows = [0].concat(regIdx); | |
| const z = [], txt = []; rows.forEach(k => { z.push(C0[k].map(v => 100 * v)); txt.push(uname(k) + " · 1995-2014"); if (C1) { z.push(C1[k].map(v => 100 * v)); txt.push(uname(k) + " · " + lab); } }); | |
| plot("f_s7", [{type: "heatmap", z: z, x: M_, y: txt, zmin: 0, zmax: 100, colorscale: SEQ, colorbar: {thickness: 11, title: {text: "%", side: "right"}}, hovertemplate: "%{y}<br>%{x}: %{z:.0f} %<extra></extra>", xgap: 1, ygap: 1}], | |
| {title: {text: L("Calendar of suitability: share of the area where a month is suitable in at least half of the years", "Calendrier de l'aptitude : part de la surface où un mois est favorable au moins une année sur deux")}, yaxis: {autorange: "reversed", automargin: true, tickfont: {size: 10}}, margin: {l: 170}}, 120 + 22 * z.length); | |
| document.getElementById("c_s7").textContent = L("Area-weighted mean over each territory of the share of years in which the month is suitable.", "Moyenne pondérée par la surface, sur chaque territoire, de la part des années où le mois est favorable."); | |
| // sensitivity table | |
| const sn = L(["reference", "limits −1 °C", "limits +1 °C", "rain × 0.75", "rain × 1.25"], ["référence", "limites −1 °C", "limites +1 °C", "pluie × 0,75", "pluie × 1,25"]), H0 = A(V, "hist"), Fx = A(V, tg); let h = "<table><tr><th>" + L("Territory", "Territoire") + "</th>" + sn.map(s => "<th>" + s + "</th>").join("") + "</tr>"; | |
| idx.forEach(k => { h += "<tr" + (k === 0 ? ' class="reg"' : "") + "><td>" + uname(k) + "</td>" + sn.map((s, n) => { const x = Fx["sens_" + n][k] - H0["sens_" + n][k]; return '<td class="' + cls(x) + '">' + fmt(x, 2, true) + "</td>"; }).join("") + "</tr>"; }); | |
| document.getElementById("t_s").innerHTML = h + "</table><div class='cap'>" + L("Change of the mean season (months) for ", "Variation de la saison moyenne (mois) pour ") + lab + L(" with the temperature limits shifted by ±1 °C or the rainfall thresholds multiplied by 0.75 or 1.25.", " avec des limites de température décalées de ±1 °C ou des seuils de pluie multipliés par 0,75 ou 1,25.") + "</div>"; | |
| } | |
| async function pVec(){ | |
| const el = document.getElementById("p_vec"), tg = tag(), V = S.view, lab = tagLabel(tg); | |
| el.innerHTML = "<h2>" + L("VECTRI dynamical malaria model", "Modèle dynamique de paludisme VECTRI") + ' <span class="muted" style="font-weight:600;font-size:.9rem">· ' + L("CMIP6, one model", "CMIP6, un modèle") + "</span></h2>" + | |
| '<div class="note">' + L("VECTRI (Tompkins and Ermert 2013) simulates the mosquito and parasite cycles from daily rainfall and temperature, with the fixed population of the input file, here driven by CMIP6 (NEX-GDDP-CMIP6, bias-adjusted). Default parameters, not calibrated on Cameroon, no interventions (no bed nets, no SMC): absolute EIR and parasite rates are those of an untreated population and are high; relative changes and seasonality are the useful information.", "VECTRI (Tompkins et Ermert 2013) simule les cycles du moustique et du parasite à partir de la pluie et de la température journalières, avec la population fixe du fichier d'entrée, ici forcé par CMIP6 (NEX-GDDP-CMIP6, corrigé de biais). Paramètres par défaut, non calibré sur le Cameroun, sans interventions (ni moustiquaires, ni CPS) : l'EIR et la prévalence absolus sont ceux d'une population non traitée et sont élevés ; les changements relatifs et la saisonnalité sont l'information utile.") + "</div>" + | |
| '<div class="grid2"><div class="card"><div class="fig" id="f_v1"></div></div><div class="card"><div class="fig" id="f_v2"></div></div><div class="card"><div class="fig" id="f_v3"></div></div><div class="card"><div class="fig" id="f_v4"></div></div><div class="card"><div class="fig" id="f_v5"></div></div><div class="card"><div class="fig" id="f_v6"></div></div></div>' + | |
| '<div class="cap">' + L("EIR: entomological inoculation rate, infective bites per person per year (logarithmic colour scale). Transmission season: longest run of months with a monthly EIR of at least 1. VECTRI is driven by one CMIP6 model. Dots: change significant (Mann-Whitney test on the 20 annual values, p < 0.05).", "EIR : taux d'inoculation entomologique, piqûres infectantes par personne et par an (échelle de couleur logarithmique). Saison de transmission : plus longue suite de mois avec un EIR mensuel d'au moins 1. VECTRI est forcé par un modèle CMIP6. Points : changement significatif (test de Mann-Whitney sur les 20 valeurs annuelles, p < 0,05).") + "</div>" + | |
| '<div class="grid2" style="margin-top:12px"><div class="card"><div class="fig" id="f_v7"></div><div class="cap" id="c_v7"></div></div><div class="card"><div class="fig" id="f_v8"></div><div class="cap" id="c_v8"></div></div></div>'; | |
| const M = await loadMaps(V), d = M["d_" + tg]; | |
| const lg = M.hist.eir.map(v => v == null ? null : Math.log10(v + 1)), tv = [0, 1, 2, 3], tt = ["0", "10", "100", "1000"]; | |
| gridMap("f_v1", lg, {title: L("Annual EIR, 1995-2014", "EIR annuel, 1995-2014"), scale: SEQ, auto: "seq", step: 0.5, unit: "log10(EIR+1)", dec: 2, unitVals: S.lev === "grid" ? null : agv(V, "hist", "eir").map(v => v == null ? null : Math.log10(v + 1))}); | |
| gridMap("f_v2", d.eir, {title: L("Change of annual EIR, ", "Variation de l'EIR annuel, ") + lab, scale: DIV, auto: "sym", minAbs: 20, unit: "%", dec: 0, sg: true, stip: V === "ENSEMBLE" ? d.agree_eir : null, unitVals: agv(V, "d_" + tg, "eir")}); | |
| gridMap("f_v3", M.hist.pr, {title: L("Parasite rate (PR), 1995-2014", "Prévalence parasitaire (PR), 1995-2014"), scale: PURP, auto: "seq", step: 5, unit: "%", dec: 0, unitVals: agv(V, "hist", "pr")}); | |
| gridMap("f_v4", d.pr, {title: L("Change of the parasite rate, ", "Variation de la prévalence, ") + lab, scale: DIV, auto: "sym", minAbs: 3, unit: L("points", "points"), dec: 1, sg: true, stip: V === "ENSEMBLE" ? d.agree_pr : null, unitVals: agv(V, "d_" + tg, "pr")}); | |
| gridMap("f_v5", M.hist.vseason, {title: L("Transmission season (EIR ≥ 1 per month), 1995-2014", "Saison de transmission (EIR ≥ 1 par mois), 1995-2014"), scale: SEQ, auto: "seq", step: 0.5, unit: t("months"), unitVals: agv(V, "hist", "vseason")}); | |
| gridMap("f_v6", d.vseason, {title: L("Change of the transmission season, ", "Variation de la saison de transmission, ") + lab, scale: DIV, auto: "sym", minAbs: 0.3, unit: t("months"), dec: 2, sg: true, stip: V === "ENSEMBLE" ? d.agree_vseason : null, unitVals: agv(V, "d_" + tg, "vseason")}); | |
| // rules against VECTRI, by department | |
| const Dd = A(V, "d_" + tg), x = depIdx.map(k => Dd.season[k]), y = depIdx.map(k => Dd.vseason[k]); | |
| plot("f_v7", [{type: "scatter", mode: "markers", x: x, y: y, text: depIdx.map(k => uname(k) + " (" + U.region[k] + ")"), marker: {size: 7, color: depIdx.map(k => regIdx.indexOf(U.name.indexOf(U.region[k]))), colorscale: [[0, "#1b9e77"], [.33, "#d95f02"], [.66, "#7570b3"], [1, "#e7298a"]], line: {width: 0.5, color: "#fff"}}, | |
| hovertemplate: "%{text}<br>" + L("rules", "règles") + " %{x:+.2f}<br>VECTRI %{y:+.2f}<extra></extra>"}], | |
| {title: {text: L("Change of the season: rules against VECTRI, by department", "Variation de la saison : règles contre VECTRI, par département")}, xaxis: {title: {text: L("rule-based season (months)", "saison selon les règles (mois)")}, zeroline: true}, yaxis: {title: {text: L("VECTRI season (months)", "saison VECTRI (mois)")}, zeroline: true}}, 380); | |
| document.getElementById("c_v7").textContent = L("Each dot is a department, " + lab + ". The rule-based season shortens where months exceed 34 °C, while VECTRI, whose mosquito and parasite cycles speed up with warmth, often simulates a longer or more intense season. The two approaches answer different questions; their disagreement is a measure of model uncertainty.", "Chaque point est un département, " + lab + ". La saison selon les règles se raccourcit là où des mois dépassent 34 °C, tandis que VECTRI, dont les cycles du moustique et du parasite s'accélèrent avec la chaleur, simule souvent une saison plus longue ou plus intense. Les deux approches répondent à des questions différentes ; leur désaccord mesure une part de l'incertitude des modèles."); | |
| regionBars("f_v8", "vseason", L("Change of the VECTRI transmission season by region (months)", "Variation de la saison de transmission VECTRI par région (mois)"), L("months", "mois"), 2); | |
| document.getElementById("c_v8").textContent = L("Change of the longest run of months with an EIR of at least 1, area-weighted over each region, for the four scenario-periods. VECTRI driven by one CMIP6 model, so no spread between models is shown.", "Variation de la plus longue suite de mois avec un EIR d'au moins 1, pondérée par la surface de chaque région, pour les quatre scénarios-périodes. VECTRI forcé par un modèle CMIP6 : aucune dispersion entre modèles n'est montrée."); | |
| } | |
| async function pSmc(){ | |
| const el = document.getElementById("p_smc"), tg = tag(), V = S.view, lab = tagLabel(tg); | |
| el.innerHTML = "<h2>" + L("Seasonality of transmission and the SMC window", "Saisonnalité de la transmission et fenêtre de la CPS") + ' <span class="muted" style="font-weight:600;font-size:.9rem">· ' + simLabel(V) + "</span></h2>" + | |
| '<div class="note">' + L("Seasonal malaria chemoprevention (SMC) is given in monthly cycles during the high-transmission season. This page shows, from VECTRI, how much of the annual inoculation falls in July-October (shaded), and whether the peak and the end of the season move under the scenarios. In Cameroon, SMC is delivered in the Nord and Extrême-Nord regions, in monthly cycles from July to October. It describes the climate signal only; it is not a recommendation on the number of cycles, which also depends on surveillance data.", "La chimioprévention du paludisme saisonnier (CPS) est donnée en passages mensuels pendant la saison de forte transmission. Cette page montre, à partir de VECTRI, quelle part de l'inoculation annuelle tombe entre juillet et octobre (zone ombrée), et si le pic et la fin de la saison se déplacent selon les scénarios. Au Cameroun, la CPS est mise en œuvre dans les régions du Nord et de l'Extrême-Nord, en passages mensuels de juillet à octobre. Elle décrit le seul signal climatique ; ce n'est pas une recommandation sur le nombre de passages, qui dépend aussi des données de surveillance.") + "</div>" + | |
| '<div id="u_s"></div><div class="grid2" style="margin-top:8px"><div class="card"><div class="fig" id="f_m1"></div><div class="cap" id="c_m1"></div></div><div class="card"><div class="fig" id="f_m2"></div><div class="cap" id="c_m2"></div></div></div>' + | |
| '<div class="grid2" style="margin-top:12px"><div class="card"><div class="fig" id="f_m3"></div></div><div class="card"><div class="fig" id="f_m4"></div></div></div>' + | |
| '<h3 style="margin-top:14px">' + L("Share of annual EIR by month window, by territory (departments shown for the selected region)", "Part de l'EIR annuel par fenêtre de mois, par territoire (départements affichés pour la région choisie)") + '</h3><div class="tw" id="t_m"></div>'; | |
| const draw = () => { unitButtons("u_s", draw); | |
| const i = S.unit, c = D.cal[V]; | |
| // monthly EIR normalised: share of the annual total in each month | |
| const tr = []; ["hist"].concat(D.meta.tags).forEach(tg2 => { const e = c[tg2].eir[i], s = e.reduce((a, b) => a + (b || 0), 0); tr.push({type: "scatter", mode: "lines+markers", name: tagLabel(tg2), x: MON(), y: e.map(v => s > 0 ? 100 * v / s : null), line: {color: tg2 === "hist" ? (DARK() ? "#fff" : "#111") : TAGC[tg2], width: tg2 === "hist" ? 3 : 2}, marker: {size: 4}, hovertemplate: tagLabel(tg2) + " %{x}: %{y:.1f} %<extra></extra>"}); }); | |
| plot("f_m1", tr, {title: {text: L("Monthly share of annual EIR, ", "Part mensuelle de l'EIR annuel, ") + uname(i)}, yaxis: {ticksuffix: " %"}, legend: {orientation: "h", y: -0.2}, margin: {b: 70}, shapes: [{type: "rect", xref: "x", yref: "paper", x0: 5.5, x1: 9.5, y0: 0, y1: 1, fillcolor: DARK() ? "rgba(240,138,75,.12)" : "rgba(191,91,32,.10)", line: {width: 0}, layer: "below"}]}, 340); | |
| document.getElementById("c_m1").textContent = L("Monthly EIR divided by the annual total, area-weighted over the territory. Shaded: July to October.", "EIR mensuel divisé par le total annuel, pondéré par la surface du territoire. Zone ombrée : juillet à octobre."); | |
| cycles("f_m2", "vfreq", L("Months with EIR ≥ 1: share of the area and years, ", "Mois avec EIR ≥ 1 : part de la surface et des années, ") + uname(i), "%", i, {k: 100, smc: true}); | |
| document.getElementById("c_m2").textContent = L("For each calendar month, area-weighted share of years in which the monthly EIR reaches 1 infective bite per person.", "Pour chaque mois, part des années (pondérée par la surface) où l'EIR mensuel atteint 1 piqûre infectante par personne."); | |
| }; | |
| draw(); | |
| const M = await loadMaps(V); | |
| gridMap("f_m3", M.hist.eir_smc, {title: L("Share of annual EIR in July-October, 1995-2014", "Part de l'EIR annuel en juillet-octobre, 1995-2014"), scale: SEQ, auto: "seq", step: 5, unit: "%", dec: 0, unitVals: agv(V, "hist", "eir_smc")}); | |
| gridMap("f_m4", M["d_" + tg].eir_smc, {title: L("Change of that share, ", "Variation de cette part, ") + lab, scale: DIV, auto: "sym", minAbs: 1.5, unit: L("points", "points"), dec: 1, sg: true, stip: V === "ENSEMBLE" ? M["d_" + tg].agree_eir_smc : null, unitVals: agv(V, "d_" + tg, "eir_smc")}); | |
| const H = A(V, "hist"), F = A(V, tg), idx = [0]; | |
| const stS = U.kind[S.unit] === "department" ? U.name.indexOf(U.region[S.unit]) : S.unit; regIdx.forEach(r => { idx.push(r); if (r === stS) depIdx.filter(k => U.region[k] === U.name[r]).forEach(k => idx.push(k)); }); | |
| const Dd = A(V, "d_" + tg); | |
| let h = "<table><tr><th>" + L("Territory", "Territoire") + "</th><th>" + L("Jul-Oct, 1995-2014", "juil.-oct., 1995-2014") + "</th><th>" + L("Change (points)", "Variation (points)") + "</th><th>" + L("Nov, 1995-2014", "nov., 1995-2014") + "</th><th>" + L("Change (points)", "Variation (points)") + "</th><th>" + L("Peak month", "Mois du pic") + "</th><th>" + L("Annual EIR, 1995-2014", "EIR annuel, 1995-2014") + "</th><th>" + L("Change (%)", "Variation (%)") + "</th></tr>"; | |
| idx.forEach(k => { const e = D.cal[V].hist.eir[k], pk = e.indexOf(Math.max.apply(null, e)), e2 = (D.cal[V][tg] || D.cal[V].hist).eir[k], pk2 = e2.indexOf(Math.max.apply(null, e2)); | |
| h += "<tr" + (U.kind[k] !== "department" ? ' class="reg"' : "") + "><td>" + (U.kind[k] === "department" ? " " : "") + uname(k) + "</td><td>" + fmt(H.eir_smc[k], 0) + ' %</td><td class="' + cls(Dd.eir_smc[k]) + '">' + fmt(Dd.eir_smc[k], 1, true) + "</td><td>" + fmt(H.eir_nov[k], 1) + ' %</td><td class="' + cls(Dd.eir_nov[k]) + '">' + fmt(Dd.eir_nov[k], 1, true) + "</td><td>" + MON()[pk] + " → " + MON()[pk2] + "</td><td>" + fmt(H.eir[k], 0) + '</td><td class="' + cls(Dd.eir[k]) + '">' + fmt(Dd.eir[k], 0, true) + "</td></tr>"; }); | |
| document.getElementById("t_m").innerHTML = h + "</table><div class='cap'>" + L("Share of the area-weighted annual EIR that falls in July-October and in November, and its change; peak month of the area-weighted monthly EIR (1995-2014 → " + lab + "); annual EIR and its relative change. VECTRI driven by one CMIP6 model. ", "Part de l'EIR annuel (pondéré par la surface) qui tombe entre juillet et octobre et en novembre, et sa variation ; mois du pic de l'EIR mensuel pondéré (1995-2014 → " + lab + ") ; EIR annuel et sa variation relative. VECTRI forcé par un modèle CMIP6. ") + simLabel(V) + ".</div>"; | |
| } | |
| let VS = "eir", VO = "CONF_PC"; | |
| function pVal(){ | |
| const P = D.val, el = document.getElementById("p_val"), m = P.meta, rg = P.reg, YY = m.year_list; | |
| const SIMN = {eir: L("Annual EIR (VECTRI)", "EIR annuel (VECTRI)"), pr: L("Parasite rate (VECTRI)", "Prévalence (VECTRI)"), vseason: L("Transmission season (VECTRI)", "Saison de transmission (VECTRI)"), cases: L("New infections (VECTRI)", "Nouvelles infections (VECTRI)"), | |
| season: L("Suitable season (rules)", "Saison favorable (règles)"), rain: L("Annual rainfall", "Pluie annuelle"), tmean: L("Mean temperature", "Température moyenne")}; | |
| const SIMU = {eir: L("bites/person/year", "piqûres/pers./an"), pr: "%", vseason: t("months"), cases: L("per person per year", "par personne et par an"), season: t("months"), rain: "mm", tmean: "°C"}; | |
| const OBN = {CONF_PC: m.pop_source === "WorldPop 2020" ? L("Confirmed cases per 1000", "Cas confirmés pour 1000") : L("Confirmed cases per 1000 (approx.)", "Cas confirmés pour 1000 (approx.)"), CONF: L("Confirmed cases per year", "Cas confirmés par an")}; | |
| const nf = x => x == null ? "-" : Math.round(x).toLocaleString(S.lang === "fr" ? "fr-FR" : "en-GB"); | |
| const sp = P.spearman.find(r => r.sim === VS && r.obs === VO) || {}; | |
| const yrs = P.years, tc = yrs.reduce((a, r) => a + r.conf, 0), pop = rg.reduce((a, r) => a + r.people, 0); | |
| const TAGR = r => (m.smc_regions.indexOf(r.NAME_1) >= 0 ? " ◆" : "") + (m.crisis_regions.indexOf(r.NAME_1) >= 0 ? " ▲" : ""); | |
| el.innerHTML = "<h2>" + L("Validation against the PNLP data of the 10 regions (GADM level 1)", "Validation contre les données du PNLP des 10 régions (niveau 1 de GADM)") + "</h2>" + | |
| '<div class="note"><b>' + L("Why level 1 and how to read this page. ", "Pourquoi le niveau 1 et comment lire cette page. ") + "</b>" + | |
| L("The observations are the annual numbers of confirmed malaria cases per region published by the PNLP (10 regions, " + m.years + "), so the model is aggregated to GADM level 1. The CMIP6 historical run (1995-2014) is a free-running climate simulation: its years are not calendar years and it does not cover " + m.years + ". The test is therefore spatial (does the model rank the regions as the PNLP data do?), not year by year. With 10 regions only strong correlations (|ρ| above about 0.65) can be significant: the intervals are wide and the result is indicative. The PNLP table gives no number of people tested, so no test positivity can be computed. ◆ Nord and Extrême-Nord receive seasonal malaria chemoprevention (SMC), absent from VECTRI; ▲ Nord-Ouest and Sud-Ouest are affected by the security crisis since 2017, which weighs on access to care and reporting: each pair is left out in a sensitivity test.", | |
| "Les observations sont les nombres annuels de cas confirmés de paludisme par région publiés par le PNLP (10 régions, " + m.years + ") : le modèle est donc agrégé au niveau 1 de GADM. La simulation historique CMIP6 (1995-2014) est une simulation climatique libre : ses années ne sont pas des années du calendrier et elle ne couvre pas " + m.years + ". Le test est donc spatial (le modèle classe-t-il les régions comme les données du PNLP ?), et non année par année. Avec 10 régions, seules les corrélations fortes (|ρ| au-delà d'environ 0,65) peuvent être significatives : les intervalles sont larges et le résultat est indicatif. Le tableau du PNLP ne donne pas le nombre de personnes testées : aucune positivité ne peut être calculée. ◆ Le Nord et l'Extrême-Nord reçoivent la chimioprévention du paludisme saisonnier (CPS), absente de VECTRI ; ▲ le Nord-Ouest et le Sud-Ouest sont touchés par la crise sécuritaire depuis 2017, qui pèse sur l'accès aux soins et la notification : chaque paire est retirée dans un test de sensibilité.") + "</div>" + | |
| '<div class="row" style="margin:6px 0 10px"><div class="grp"><span>' + L("Simulated", "Simulé") + '</span><div class="opts small" id="o_vs"></div></div><div class="grp"><span>' + L("Observed", "Observé") + '</span><div class="opts small" id="o_vo"></div></div></div>' + | |
| '<div class="kpis">' + kpi(L("Regions · years", "Régions · années"), "10 · " + YY.length, m.years) + kpi(L("Confirmed cases per year", "Cas confirmés par an"), nf(tc / yrs.length), L("Cameroon, PNLP", "Cameroun, PNLP")) + | |
| kpi(L("Confirmed per 1000 per year", "Confirmés pour 1000 par an"), fmt(1000 * tc / yrs.length / pop, 0), m.pop_source) + | |
| kpi('Spearman <span style="text-transform:none">ρ</span>', fmt(sp.rho, 2), SIMN[VS] + L(" vs ", " vs ") + OBN[VO] + " · p<sub>perm</sub> = " + fmt(sp.p_perm, 3) + " · p<sub>Holm</sub> = " + fmt(sp.p_holm, 2)) + "</div>" + | |
| '<div class="grid2"><div class="card"><div class="fig" id="f_x1"></div><div class="cap" id="c_x1"></div></div><div class="card"><div class="fig" id="f_x2"></div><div class="cap" id="c_x2"></div></div></div>' + | |
| '<div class="grid4" style="margin-top:12px"><div class="card"><div class="fig" id="f_x3"></div></div><div class="card"><div class="fig" id="f_x4"></div></div><div class="card"><div class="fig" id="f_x5"></div></div><div class="card"><div class="fig" id="f_x6"></div></div></div>' + | |
| '<div class="grid2" style="margin-top:12px"><div class="card"><div class="fig" id="f_x7"></div><div class="cap" id="c_x7"></div></div><div class="card"><div class="fig" id="f_x8"></div><div class="cap" id="c_x8"></div></div></div>' + | |
| '<div class="grid2" style="margin-top:12px"><div class="card"><h3>' + L("All Spearman tests", "Tous les tests de Spearman") + '</h3><div class="tw" id="t_x1"></div><div class="cap" id="c_t1"></div></div><div class="card"><h3>' + L("Sensitivity and stability", "Sensibilité et stabilité") + '</h3><div class="tw" id="t_x4"></div><h3 style="margin-top:12px">' + L("Data-quality notes", "Notes de qualité des données") + '</h3><div class="tw" id="t_x2" style="max-height:360px;overflow:auto"></div></div></div>' + | |
| '<div class="card" style="margin-top:12px"><h3>' + L("Region table: observed (mean " + m.years + ") and simulated (1995-2014)", "Tableau par région : observé (moyenne " + m.years + ") et simulé (1995-2014)") + '</h3><div class="tw" id="t_x3"></div></div>'; | |
| const mk = (id, items, cur, cb) => { const e = document.getElementById(id); items.forEach(([k, lb]) => { const b = document.createElement("button"); b.textContent = lb; if (k === cur) b.className = "on"; b.onclick = () => cb(k); e.appendChild(b); }); }; | |
| mk("o_vs", Object.keys(SIMN).map(k => [k, SIMN[k]]), VS, k => { VS = k; pVal(); }); | |
| mk("o_vo", Object.keys(OBN).map(k => [k, OBN[k]]), VO, k => { VO = k; pVal(); }); | |
| // scatter | |
| const col = r => m.smc_regions.indexOf(r.NAME_1) >= 0 ? "#2b8cbe" : m.crisis_regions.indexOf(r.NAME_1) >= 0 ? "#7a7a7a" : "#bf5b20"; | |
| const x = rg.map(r => r["sim_" + VS]), y = rg.map(r => r[VO]); | |
| plot("f_x1", [{type: "scatter", mode: "markers+text", x: x, y: y, text: rg.map(r => r.NAME_1 + TAGR(r)), textposition: "top center", textfont: {size: 9, color: css("--mute")}, cliponaxis: false, | |
| marker: {size: 12, color: rg.map(col), line: {width: 1.5, color: css("--card")}}, hovertemplate: "%{text}<br>" + L("simulated ", "simulé ") + "%{x:.1f}<br>" + L("observed ", "observé ") + "%{y:,.0f}<extra></extra>"}], | |
| {title: {text: SIMN[VS] + L(" against ", " contre ") + OBN[VO]}, xaxis: {title: {text: SIMN[VS] + " (" + SIMU[VS] + ")"}, type: VS === "eir" ? "log" : "linear"}, yaxis: {title: {text: OBN[VO]}, type: "log", dtick: "D2", tickformat: ",.0f"}, | |
| annotations: [{xref: "paper", yref: "paper", x: 0.99, y: 0.02, xanchor: "right", yanchor: "bottom", showarrow: false, align: "right", bgcolor: css("--card"), bordercolor: css("--line"), borderwidth: 1, | |
| text: "ρ = " + fmt(sp.rho, 2) + " [" + fmt(sp.ci_lo, 2) + " ; " + fmt(sp.ci_hi, 2) + "]<br>p<sub>perm</sub> = " + fmt(sp.p_perm, 3) + " · p<sub>Holm</sub> = " + fmt(sp.p_holm, 2) + " · n = 10"}]}, 420); | |
| document.getElementById("c_x1").innerHTML = L("Orange: other regions; blue ◆: SMC regions (Nord, Extrême-Nord); grey ▲: crisis-affected regions (Nord-Ouest, Sud-Ouest). ρ: Spearman rank correlation, 95% bootstrap interval over the regions (5 000 resamples); p<sub>perm</sub>: two-sided permutation test (" + m.nperm + " permutations); p<sub>Holm</sub>: Holm correction over all " + P.spearman.length + " tests. VECTRI driven by CMIP6; climate indicators: " + (m.nmodels > 1 ? "median of " + m.nmodels + " CMIP6 models" : "CMIP6") + ".", | |
| "Orange : autres régions ; bleu ◆ : régions sous CPS (Nord, Extrême-Nord) ; gris ▲ : régions touchées par la crise (Nord-Ouest, Sud-Ouest). ρ : corrélation de rang de Spearman, intervalle bootstrap à 95 % sur les régions (5 000 tirages) ; p<sub>perm</sub> : test de permutation bilatéral (" + m.nperm + " permutations) ; p<sub>Holm</sub> : correction de Holm sur les " + P.spearman.length + " tests. VECTRI forcé par CMIP6 ; indicateurs climatiques : " + (m.nmodels > 1 ? "médiane de " + m.nmodels + " modèles CMIP6" : "CMIP6") + "."); | |
| // rho of every simulated indicator | |
| const ks = Object.keys(SIMN), rr = ks.map(k => P.spearman.find(r => r.sim === k && r.obs === VO) || {}); | |
| plot("f_x2", [{type: "scatter", mode: "markers", y: ks.map(k => SIMN[k]), x: rr.map(r => r.rho), error_x: {type: "data", symmetric: false, array: rr.map(r => r.ci_hi - r.rho), arrayminus: rr.map(r => r.rho - r.ci_lo), thickness: 1.5, width: 4, color: css("--mute")}, | |
| marker: {size: 13, symbol: rr.map(r => r.p_perm < 0.05 ? "diamond" : "diamond-open"), color: rr.map((r, i) => i < 4 ? "#bf5b20" : "#3f7bb8"), line: {width: 2, color: rr.map((r, i) => i < 4 ? "#bf5b20" : "#3f7bb8")}}, | |
| customdata: rr.map(r => [r.p_perm, r.p_holm]), hovertemplate: "%{y}: ρ = %{x:.2f}<br>p = %{customdata[0]:.3f} · Holm %{customdata[1]:.2f}<extra></extra>"}], | |
| {title: {text: L("Spearman ρ against ", "ρ de Spearman contre ") + OBN[VO]}, xaxis: {range: [-1, 1], dtick: 0.25, zeroline: true, title: {text: "ρ"}}, yaxis: {autorange: "reversed", automargin: true}, margin: {l: 190}}, 420); | |
| document.getElementById("c_x2").textContent = L("Orange: VECTRI; blue: climate. Filled: permutation p < 0.05. Bars: 95% bootstrap interval. If rainfall and temperature correlate as well as EIR, the agreement reflects the shared north-south climate gradient of Cameroon rather than malaria dynamics specifically.", | |
| "Orange : VECTRI ; bleu : climat. Plein : p de permutation < 0,05. Barres : intervalle bootstrap à 95 %. Si la pluie et la température corrèlent autant que l'EIR, l'accord traduit le gradient climatique nord-sud commun du Cameroun plutôt qu'une dynamique propre au paludisme."); | |
| // maps of the 10 regions | |
| const di = rg.map(r => U.keys.indexOf(r.key)); | |
| const dmap = (id, vals, title, scale, dec, unit) => { const v = vals.filter(q => q != null && isFinite(q)), lo = Math.min(...v), hi = Math.max(...v), tr = []; | |
| di.forEach((i, k) => { const val = vals[k], f = val == null ? null : (val - lo) / ((hi - lo) || 1); U.rings[i].forEach(r => tr.push({type: "scatter", mode: "lines", fill: "toself", x: r.map(p => p[0]), y: r.map(p => p[1]), line: {width: 0.6, color: DARK() ? "#9aa8b8" : "#333"}, | |
| fillcolor: val == null ? "#cccccc" : colorAt(scale, f), hoveron: "fills", hoverinfo: "text", text: rg[k].NAME_1 + ": " + fmt(val, dec) + " " + unit, showlegend: false})); }); | |
| tr.push({type: "scatter", mode: "markers", x: [null], y: [null], marker: {color: [lo], colorscale: scale, cmin: lo, cmax: hi, showscale: true, colorbar: {thickness: 9, len: 0.8, orientation: "h", y: -0.08, x: 0.5, xanchor: "center", outlinewidth: 0, tickfont: {size: 9}, title: {text: unit, side: "top", font: {size: 10}}}}, hoverinfo: "skip", showlegend: false}); | |
| plot(id, tr, {title: {text: title}, margin: {l: 6, r: 6, t: 30, b: 50}, xaxis: {visible: false, scaleanchor: "y", scaleratio: 1}, yaxis: {visible: false}}, 420); }; | |
| dmap("f_x3", rg.map(r => r.CONF_PC), OBN.CONF_PC, PURP, 0, L("per 1000", "pour 1000")); | |
| dmap("f_x4", rg.map(r => r.CONF / 1000), L("Confirmed cases per year (thousands)", "Cas confirmés par an (milliers)"), SEQ, 0, L("thousands", "milliers")); | |
| dmap("f_x5", rg.map(r => r.sim_eir), L("Simulated annual EIR", "EIR annuel simulé"), SEQ, 0, L("bites/p/yr", "piq./pers./an")); | |
| dmap("f_x6", rg.map(r => r.sim_pr), L("Simulated parasite rate (%)", "Prévalence simulée (%)"), PURP, 1, "%"); | |
| // observed cases by region and year | |
| const pal = ["#1b9e77", "#d95f02", "#7570b3", "#e7298a", "#66a61e", "#e6ab02", "#a6761d", "#666666", "#1f78b4", "#b2182b"]; | |
| plot("f_x7", rg.map((r, k) => ({type: "scatter", mode: "lines+markers", name: r.NAME_1, x: YY.map(String), y: r.by_year.map(v => v / 1000), line: {color: pal[k % 10], width: 2}, marker: {size: 6}, | |
| hovertemplate: r.NAME_1 + " %{x}: %{y:,.0f} 000<extra></extra>"})), | |
| {title: {text: L("Confirmed cases by region and year (thousands)", "Cas confirmés par région et par année (milliers)")}, xaxis: {type: "category"}, yaxis: {title: {text: L("thousands per year", "milliers par an")}, rangemode: "tozero", dtick: 100}, legend: {orientation: "h", y: -0.18, font: {size: 10}}, margin: {b: 110}}, 460); | |
| document.getElementById("c_x7").innerHTML = L("PNLP: surveillance syntheses 2020 and 2021, annual reports 2022, 2023 and 2024. The regional values add up exactly to the national totals of each year. ", "PNLP : synthèses de surveillance 2020 et 2021, rapports annuels 2022, 2023 et 2024. Les valeurs régionales s'additionnent exactement aux totaux nationaux de chaque année. ") + '<a href="Cameroon_PNLP_confirmed_malaria_cases_by_region_2020-2024.xlsx" download>' + L("Download the data (Excel)", "Télécharger les données (Excel)") + "</a>"; | |
| const order = rg.slice().sort((a, b) => b.CONF_PC - a.CONF_PC); | |
| const Z = order.map(r => r.by_year.map(v => 1000 * v / r.people)); | |
| plot("f_x8", [{type: "heatmap", z: Z, x: YY.map(String), y: order.map(r => r.NAME_1 + TAGR(r)), colorscale: PURP, xgap: 2, ygap: 2, colorbar: {thickness: 11, title: {text: L("per 1000", "pour 1000"), side: "right"}}, hovertemplate: "%{y} %{x}: %{z:.0f}<extra></extra>", | |
| text: Z.map(row => row.map(v => fmt(v, 0))), texttemplate: "%{text}", textfont: {size: 10}}], | |
| {title: {text: L("Confirmed cases per 1000 by region and year", "Cas confirmés pour 1000 par région et par année")}, xaxis: {type: "category"}, yaxis: {autorange: "reversed", automargin: true, tickfont: {size: 10}, dtick: 1}, margin: {l: 110}}, 460); | |
| document.getElementById("c_x8").textContent = L("Regions sorted by their mean incidence; denominator: " + m.pop_source + " population of each region, kept fixed over the five years.", "Régions classées par incidence moyenne ; dénominateur : population " + m.pop_source + " de chaque région, gardée fixe sur les cinq années."); | |
| // tables | |
| let h = "<table><tr><th>" + L("Simulated", "Simulé") + "</th><th>" + L("Observed", "Observé") + "</th><th style=\"text-transform:none\">ρ</th><th>" + L("95% CI", "IC 95 %") + "</th><th style=\"text-transform:none\">p perm</th><th style=\"text-transform:none\">p Holm</th></tr>"; | |
| P.spearman.forEach(r => { h += "<tr" + (r.p_perm < 0.05 ? ' style="font-weight:700"' : "") + "><td>" + SIMN[r.sim] + "</td><td>" + OBN[r.obs] + "</td><td>" + fmt(r.rho, 2) + "</td><td>" + fmt(r.ci_lo, 2) + " ; " + fmt(r.ci_hi, 2) + "</td><td>" + fmt(r.p_perm, 3) + "</td><td>" + fmt(r.p_holm, 2) + "</td></tr>"; }); | |
| document.getElementById("t_x1").innerHTML = h + "</table>"; | |
| document.getElementById("c_t1").innerHTML = m.pop_source === "WorldPop 2020" ? L("Confirmed cases per 1000 use the WorldPop 2020 population of each region (1 km, UN-adjusted).", "Les confirmés pour 1000 utilisent la population WorldPop 2020 de chaque région (1 km, ajustée ONU).") : L("Confirmed cases per 1000 use the AfriPop population of VECTRI (interpolated to 0.25°): indicative only.", "Les confirmés pour 1000 utilisent la population AfriPop de VECTRI (interpolée à 0,25°) : indicatif seulement."); | |
| const CASE = {no_smc: L("without Nord, Extrême-Nord (SMC)", "sans Nord, Extrême-Nord (CPS)"), no_crisis: L("without Nord-Ouest, Sud-Ouest (crisis)", "sans Nord-Ouest, Sud-Ouest (crise)")}; | |
| let s4 = "<table><tr><th>" + L("Test", "Test") + "</th><th>" + L("Simulated", "Simulé") + '</th><th>n</th><th style="text-transform:none">ρ</th><th>' + L("95% CI", "IC 95 %") + '</th><th style="text-transform:none">p perm</th></tr>'; | |
| Object.values(P.sens).forEach(r => { s4 += "<tr" + (r.p_perm < 0.05 ? ' style="font-weight:700"' : "") + '><td style="text-align:left">' + CASE[r.case] + "</td><td>" + (r.sim === "eir" ? "EIR" : L("Parasite rate", "Prévalence")) + "</td><td>" + r.n + "</td><td>" + fmt(r.rho, 2) + "</td><td>" + fmt(r.ci_lo, 2) + " ; " + fmt(r.ci_hi, 2) + "</td><td>" + fmt(r.p_perm, 3) + "</td></tr>"; }); | |
| P.yearly.forEach(r => { s4 += "<tr" + (r.p_perm < 0.05 ? ' style="font-weight:700"' : "") + '><td style="text-align:left">' + L("year ", "année ") + r.year + L(" only", " seule") + "</td><td>" + (r.sim === "eir" ? "EIR" : L("Parasite rate", "Prévalence")) + "</td><td>" + r.n + "</td><td>" + fmt(r.rho, 2) + "</td><td>" + fmt(r.ci_lo, 2) + " ; " + fmt(r.ci_hi, 2) + "</td><td>" + fmt(r.p_perm, 3) + "</td></tr>"; }); | |
| document.getElementById("t_x4").innerHTML = s4 + "</table><div class='cap'>" + L("Observed indicator: confirmed cases per 1000. Year rows: the same test with the cases of one year only, to check that the ranking does not depend on a single year.", "Indicateur observé : confirmés pour 1000. Lignes par année : le même test avec les cas d'une seule année, pour vérifier que le classement ne dépend pas d'une année.") + "</div>"; | |
| const SEV = {warning: ["#9a5b00", L("check", "à vérifier")], note: ["#3f7bb8", L("context", "contexte")]}; | |
| const RULE = r => r.rule.indexOf("change from") === 0 ? L(r.rule, r.rule.replace("change from the previous year", "variation par rapport à l'année précédente")) : r.rule.indexOf("security") === 0 ? L(r.rule, "crise sécuritaire depuis 2017 : accès aux soins et complétude de la notification") : L(r.rule, "CPS à chaque saison des pluies (juillet-octobre) : cas réduits par une intervention absente de VECTRI"); | |
| let q = "<table><tr><th>" + L("Year", "Année") + "</th><th>" + L("Region", "Région") + "</th><th>" + L("Note", "Note") + "</th><th></th></tr>"; | |
| P.qc.slice().sort((a, b) => (a.sev === "warning" ? 0 : 1) - (b.sev === "warning" ? 0 : 1) || a.year - b.year).forEach(r => { q += "<tr><td>" + (r.sev === "note" ? "-" : r.year) + "</td><td>" + r.region + '</td><td style="text-align:left;white-space:normal">' + RULE(r) + '</td><td style="color:' + SEV[r.sev][0] + ';font-weight:700">' + SEV[r.sev][1] + "</td></tr>"; }); | |
| document.getElementById("t_x2").innerHTML = q + "</table>"; | |
| let u = "<table><tr><th>" + L("Region", "Région") + "</th><th>" + L("Confirmed/yr", "Confirmés/an") + "</th><th>CV %</th><th>" + (m.pop_source === "WorldPop 2020" ? L("People (WorldPop 2020)", "Pop. (WorldPop 2020)") : L("People (VECTRI)", "Pop. (VECTRI)")) + "</th><th>" + L("Conf./1000", "Conf./1000") + "</th><th>" + L("Cells", "Cellules") + "</th><th>EIR</th><th>PR %</th><th>" + L("Season", "Saison") + "</th><th>" + L("EIR Jul-Oct %", "EIR juil.-oct. %") + "</th><th>" + L("Rain mm", "Pluie mm") + "</th><th>°C</th></tr>"; | |
| rg.slice().sort((a, b) => a.NAME_1.localeCompare(b.NAME_1)).forEach(r => { | |
| u += "<tr><td>" + r.NAME_1 + TAGR(r) + "</td><td>" + nf(r.conf) + "</td><td>" + fmt(r.cv_pct, 0) + "</td><td>" + nf(r.people) + "</td><td>" + fmt(r.CONF_PC, 0) + "</td><td>" + r.n_cells + "</td><td>" + fmt(r.sim_eir, 0) + "</td><td>" + fmt(r.sim_pr, 1) + "</td><td>" + fmt(r.sim_vseason, 1) + "</td><td>" + fmt(r.sim_eir_smc, 0) + "</td><td>" + fmt(r.sim_rain, 0) + "</td><td>" + fmt(r.sim_tmean, 1) + "</td></tr>"; }); | |
| document.getElementById("t_x3").innerHTML = u + "</table><div class='cap'>" + L("CV: coefficient of variation of the five annual values. Cells: 0.25° cells touching the region. Simulated values: area-weighted means of the cells, 1995-2014.", "CV : coefficient de variation des cinq valeurs annuelles. Cellules : cellules de 0,25° touchant la région. Valeurs simulées : moyennes des cellules pondérées par la surface, 1995-2014.") + "</div>"; | |
| } | |
| let DR = "Extrême-Nord"; | |
| function pDhis(){ | |
| const P = D.dhis, el = document.getElementById("p_dhis"), m = P.meta; | |
| const RN = r => r === "CMR" ? "Cameroon" : r, nf = x => x == null ? "-" : Math.round(x).toLocaleString(S.lang === "fr" ? "fr-FR" : "en-GB"); | |
| const yrs = [...new Set(P.nat.map(r => r.year))], ny = {}; P.nat.forEach(r => { ny[r.year] = ny[r.year] || [0, 0]; ny[r.year][0] += r.confirmed; ny[r.year][1] += r.tested; }); | |
| const se = P.seasonal.find(r => r.obs === "SEAS_JASO"); | |
| el.innerHTML = "<h2>" + L("Routine district data (DHIS2): positivity, incidence and seasonality", "Données de routine des districts (DHIS2) : positivité, incidence et saisonnalité") + "</h2>" + | |
| '<div class="note"><b>' + L("Data and checks. ", "Données et contrôles. ") + "</b>" + | |
| L("Monthly confirmed cases, suspected cases tested (health facilities and community health workers), population and routine ITN coverage of " + m.districts + " health districts, 2019-2025, aggregated to the 10 regions; SMC coverage of the districts of the Far North by cycle, 2019-2025. Quality control: the 2024 and 2025 columns of the source workbook are not attached to the right districts (district populations 2023 against 2024: r = " + fmt(m.qc_pop_r, 2) + "), so they are used only for the national totals; the regional analyses use 2019-2023, whose 2022 and 2023 regional totals are identical to the PNLP annual reports. In " + fmt(m.qc_conf_gt_tested, 0) + " % of the district-months, confirmed cases exceed the cases tested. In the SMC workbook, the 2023 sheet repeats the 2022 values.", | |
| "Cas confirmés mensuels, cas suspects testés (formations sanitaires et agents de santé communautaires), population et couverture de routine en MILDA de " + m.districts + " districts de santé, 2019-2025, agrégés aux 10 régions ; couverture de la CPS des districts de l'Extrême-Nord par cycle, 2019-2025. Contrôle qualité : les colonnes 2024 et 2025 du classeur source ne sont pas rattachées aux bons districts (populations des districts 2023 contre 2024 : r = " + fmt(m.qc_pop_r, 2) + ") ; elles ne servent qu'aux totaux nationaux ; les analyses régionales portent sur 2019-2023, dont les totaux régionaux 2022 et 2023 sont identiques aux rapports annuels du PNLP. Dans " + fmt(m.qc_conf_gt_tested, 0) + " % des mois-districts, les cas confirmés dépassent les cas testés. Dans le classeur CPS, la feuille 2023 reprend les valeurs de 2022.") + "</div>" + | |
| '<div class="kpis">' + kpi(L("Health districts", "Districts de santé"), m.districts, L("monthly data 2019-2025", "données mensuelles 2019-2025")) + | |
| kpi(L("Confirmed cases 2023", "Cas confirmés 2023"), nf(ny[2023][0]), L("national (same as WHO 2024)", "national (identique OMS 2024)")) + | |
| kpi(L("Test positivity 2019-2023", "Positivité 2019-2023"), fmt(100 * m.tpr_nat, 1) + " %", L("2024-2025: ", "2024-2025 : ") + fmt(100 * ny[2024][0] / ny[2024][1], 0) + " / " + fmt(100 * ny[2025][0] / ny[2025][1], 0) + " %") + | |
| kpi(L("Seasonality, model vs data", "Saisonnalité, modèle vs données"), "ρ = " + fmt(se.rho, 2), L("July-October share, 10 regions, p = ", "part juillet-octobre, 10 régions, p = ") + fmt(se.p_perm, 3)) + "</div>" + | |
| '<div class="card"><div class="fig" id="f_d1"></div><div class="cap">' + L("National monthly confirmed cases (bars) and test positivity rate (line). Light bars: 2024-2025.", "Cas confirmés mensuels au niveau national (barres) et taux de positivité (ligne). Barres claires : 2024-2025.") + "</div></div>" + | |
| '<h3 style="margin-top:14px">' + L("Choose a region", "Choisir une région") + '</h3><div class="opts" id="o_dr"></div>' + | |
| '<div class="grid2" style="margin-top:8px"><div class="card"><div class="fig" id="f_d2"></div><div class="cap" id="c_d2"></div></div><div class="card"><div class="fig" id="f_d3"></div><div class="cap">' + L("Annual confirmed cases and test positivity rate of the region, 2019-2023.", "Cas confirmés annuels et taux de positivité de la région, 2019-2023.") + "</div></div></div>" + | |
| '<div class="grid2" style="margin-top:12px"><div class="card"><div class="fig" id="f_d4"></div><div class="cap">' + L("Each point is a region. Simulated: share of the annual VECTRI EIR (1995-2014) in July-October; observed: share of the confirmed cases (2019-2023) in July-October. Spearman ρ with permutation p (20 000) and bootstrap 95% interval.", "Chaque point est une région. Simulé : part de l'EIR annuel de VECTRI (1995-2014) en juillet-octobre ; observé : part des cas confirmés (2019-2023) en juillet-octobre. ρ de Spearman, p par permutation (20 000) et intervalle bootstrap à 95 %.") + '</div></div><div class="card"><div class="fig" id="f_d5"></div><div class="cap">' + L("Pearson correlation between the observed monthly cycle of cases and the simulated cycle of EIR, without lag and with cases lagging the EIR by one month.", "Corrélation de Pearson entre le cycle mensuel observé des cas et le cycle simulé de l'EIR, sans décalage et avec les cas décalés d'un mois après l'EIR.") + "</div></div></div>" + | |
| '<h3 style="margin-top:14px">' + L("Regions: observed indicators 2019-2023 and simulated seasonality", "Régions : indicateurs observés 2019-2023 et saisonnalité simulée") + '</h3><div class="tw" id="t_d1"></div>' + | |
| '<h3 style="margin-top:14px">' + L("Spatial tests: simulated (1995-2014) against observed (2019-2023), 10 regions", "Tests spatiaux : simulé (1995-2014) contre observé (2019-2023), 10 régions") + '</h3><div class="tw" id="t_d2"></div>' + | |
| '<div class="grid2" style="margin-top:12px"><div class="card"><div class="fig" id="f_d6"></div><div class="cap">' + L("SMC in the Far North: mean coverage of the cycles by health district and year (treated children divided by the target; values above 100 % occur when more children are treated than planned).", "CPS dans l'Extrême-Nord : couverture moyenne des cycles par district de santé et par année (enfants traités divisés par la cible ; des valeurs au-delà de 100 % apparaissent quand plus d'enfants sont traités que prévu).") + '</div></div><div class="card"><div class="fig" id="f_d7"></div><div class="cap">' + L("Routine ITN delivery: median monthly coverage of the districts of each region, pregnant women at antenatal care. 2019-2023.", "Distribution de routine des MILDA : couverture mensuelle médiane des districts de chaque région, femmes enceintes en CPN. 2019-2023.") + "</div></div></div>"; | |
| // national series | |
| const x = P.nat.map(r => r.year + "-" + String(r.month).padStart(2, "0")), late = P.nat.map(r => r.year >= 2024); | |
| plot("f_d1", [{type: "bar", x: x, y: P.nat.map(r => r.confirmed), marker: {color: late.map(v => v ? "#9ecae1" : "#2171b5")}, name: L("confirmed cases", "cas confirmés"), hovertemplate: "%{x}: %{y:,.0f}<extra></extra>"}, | |
| {type: "scatter", mode: "lines", x: x, y: P.nat.map(r => 100 * r.confirmed / r.tested), yaxis: "y2", line: {color: "#cb181d", width: 2}, name: L("TPR", "taux de positivité"), hovertemplate: "%{x}: %{y:.1f} %<extra></extra>"}], | |
| {title: {text: L("Cameroon, monthly confirmed cases and test positivity, 2019-2025", "Cameroun, cas confirmés mensuels et positivité, 2019-2025")}, xaxis: {type: "category", tickangle: -45, nticks: NARROW() ? 7 : 28}, yaxis: {title: {text: L("cases per month", "cas par mois")}}, yaxis2: {overlaying: "y", side: "right", range: [40, 90], ticksuffix: " %", showgrid: false}, legend: {orientation: "h", y: -0.3}, margin: {b: 90, r: 50}}, 360); | |
| const regs = P.reg.map(r => r.NAME_1), ob = document.getElementById("o_dr"); | |
| regs.forEach(r => { const b = document.createElement("button"); b.textContent = r; if (r === DR) b.className = "on"; b.onclick = () => { DR = r; pDhis(); }; ob.appendChild(b); }); | |
| const sh = P.share[DR].map(v => 100 * v), sim = P.sim_eir_month[DR], ss = sim.reduce((a, b) => a + b, 0), cyc = P.cycles.filter(c => c.region === DR); | |
| plot("f_d2", [{type: "bar", x: MON(), y: sh, name: L("observed cases 2019-2023", "cas observés 2019-2023"), marker: {color: "#9ecae1"}, hovertemplate: "%{x}: %{y:.1f} %<extra></extra>"}, | |
| {type: "scatter", mode: "lines+markers", x: MON(), y: sim.map(v => 100 * v / ss), name: L("simulated EIR 1995-2014", "EIR simulé 1995-2014"), line: {color: "#cb181d", width: 2.5}, hovertemplate: "%{x}: %{y:.1f} %<extra></extra>"}], | |
| {title: {text: L("Monthly share of the annual total, ", "Part mensuelle du total annuel, ") + DR}, yaxis: {ticksuffix: " %"}, legend: {orientation: "h", y: -0.2}, margin: {b: 70}}, 340); | |
| document.getElementById("c_d2").textContent = L("Pearson r of the two cycles: ", "r de Pearson des deux cycles : ") + fmt(cyc.find(c => c.lag === 0).r, 2) + L(" without lag, ", " sans décalage, ") + fmt(cyc.find(c => c.lag === 1).r, 2) + L(" with a one-month lag.", " avec un décalage d'un mois."); | |
| const ry = P.ry.filter(r => r.region === DR); | |
| plot("f_d3", [{type: "bar", x: ry.map(r => String(r.year)), y: ry.map(r => r.confirmed), name: L("confirmed cases", "cas confirmés"), marker: {color: "#2171b5"}, hovertemplate: "%{x}: %{y:,.0f}<extra></extra>"}, | |
| {type: "scatter", mode: "lines+markers", x: ry.map(r => String(r.year)), y: ry.map(r => 100 * r.confirmed / r.tested), yaxis: "y2", name: L("TPR", "positivité"), line: {color: "#cb181d", width: 2}, hovertemplate: "%{x}: %{y:.1f} %<extra></extra>"}], | |
| {title: {text: DR + L(", 2019-2023", ", 2019-2023")}, yaxis: {title: {text: L("cases per year", "cas par an")}}, yaxis2: {overlaying: "y", side: "right", range: [40, 100], ticksuffix: " %", showgrid: false}, legend: {orientation: "h", y: -0.2}, margin: {b: 70, r: 50}}, 340); | |
| plot("f_d4", [{type: "scatter", mode: "markers+text", x: P.reg.map(r => r.sim_eir_smc), y: P.reg.map(r => r.SEAS_JASO), text: P.reg.map(r => NARROW() ? (RCODE[r.NAME_1] || r.NAME_1) : r.NAME_1), textposition: "top center", textfont: {size: 10}, marker: {size: 10, color: "#2171b5"}, hovertemplate: "%{text}: %{x:.0f} % / %{y:.0f} %<extra></extra>"}], | |
| {title: {text: "ρ = " + fmt(se.rho, 2) + " [" + fmt(se.ci_lo, 2) + ", " + fmt(se.ci_hi, 2) + "], p = " + fmt(se.p_perm, 3)}, xaxis: {title: {text: L("simulated EIR in Jul-Oct (%)", "EIR simulé en juil.-oct. (%)")}}, yaxis: {title: {text: L("observed cases in Jul-Oct (%)", "cas observés en juil.-oct. (%)")}}}, 360); | |
| const cy0 = regs.map(r => P.cycles.find(c => c.region === r && c.lag === 0).r), cy1 = regs.map(r => P.cycles.find(c => c.region === r && c.lag === 1).r); | |
| const lab = regs.map(r => NARROW() ? (RCODE[r] || r) : r); | |
| plot("f_d5", [{type: "bar", orientation: "h", y: lab, x: cy0, name: L("no lag", "sans décalage"), marker: {color: "#fdae61"}}, {type: "bar", orientation: "h", y: lab, x: cy1, name: L("1-month lag", "décalage 1 mois"), marker: {color: "#d7301f"}}], | |
| {title: {text: L("Agreement of the monthly cycles", "Accord des cycles mensuels")}, barmode: "group", xaxis: {range: [-1, 1], title: {text: "r"}}, yaxis: {autorange: "reversed", automargin: true}, legend: {orientation: "h", y: -0.2}, margin: {b: 70}}, 360); | |
| let h = "<table><tr><th>" + L("Region", "Région") + "</th><th>" + L("Test positivity", "Positivité") + "</th><th>" + L("Cases per 1000/yr", "Cas pour 1000/an") + "</th><th>" + L("Jul-Oct share, observed", "Part juil.-oct., observée") + "</th><th>" + L("Jul-Oct share of EIR, simulated", "Part juil.-oct. de l'EIR, simulée") + "</th><th>" + L("Peak month, observed", "Mois du pic, observé") + "</th><th>" + L("Peak month of EIR, simulated", "Mois du pic de l'EIR, simulé") + "</th></tr>"; | |
| P.reg.forEach(r => { h += "<tr><td>" + r.NAME_1 + "</td><td>" + fmt(100 * r.TPR, 1) + " %</td><td>" + fmt(r.INC, 0) + "</td><td>" + fmt(r.SEAS_JASO, 0) + " %</td><td>" + fmt(r.sim_eir_smc, 0) + " %</td><td>" + MON()[r.PEAK - 1] + "</td><td>" + MON()[r.sim_peak_eir - 1] + "</td></tr>"; }); | |
| document.getElementById("t_d1").innerHTML = h + "</table><div class='cap'>" + L("Population: DHIS2 district populations summed by region. Observed seasonality: mean monthly confirmed cases 2019-2023 divided by the annual total.", "Population : populations des districts DHIS2 additionnées par région. Saisonnalité observée : cas confirmés mensuels moyens 2019-2023 divisés par le total annuel.") + "</div>"; | |
| const SN = {eir: L("Annual EIR (VECTRI)", "EIR annuel (VECTRI)"), pr: L("Parasite rate (VECTRI)", "Prévalence (VECTRI)"), vseason: L("Transmission season (VECTRI)", "Saison de transmission (VECTRI)"), cases: L("New infections (VECTRI)", "Nouvelles infections (VECTRI)"), season: L("Suitable season (rules)", "Saison favorable (règles)"), rain: L("Annual rainfall", "Pluie annuelle"), tmean: L("Mean temperature", "Température moyenne")}; | |
| let h2 = "<table><tr><th>" + L("Simulated", "Simulé") + "</th><th>" + L("Observed", "Observé") + "</th><th>" + L("Spearman rho", "rho de Spearman") + "</th><th>" + L("95 % interval", "Intervalle à 95 %") + "</th><th>p</th><th>" + L("Holm p", "p de Holm") + "</th></tr>"; | |
| P.spatial.forEach(r => { h2 += "<tr><td>" + SN[r.sim] + "</td><td>" + (r.obs === "TPR" ? L("Test positivity", "Positivité") : L("Cases per 1000", "Cas pour 1000")) + "</td><td>" + fmt(r.rho, 2) + "</td><td>" + fmt(r.ci_lo, 2) + L(" to ", " à ") + fmt(r.ci_hi, 2) + "</td><td>" + fmt(r.p_perm, 3) + "</td><td>" + fmt(r.p_holm, 2) + "</td></tr>"; }); | |
| document.getElementById("t_d2").innerHTML = h2 + "</table><div class='cap'>" + L("Spearman rank correlation across the 10 regions; permutation p (20 000); bootstrap interval (5000); Holm correction over the 14 tests.", "Corrélation de rang de Spearman sur les 10 régions ; p par permutation (20 000) ; intervalle bootstrap (5000) ; correction de Holm sur les 14 tests.") + "</div>"; | |
| const sm = P.smc; | |
| plot("f_d6", [{type: "heatmap", x: sm.years.map(String), y: sm.districts, z: sm.cov, zmin: 60, zmax: 110, colorscale: [[0, "#d73027"], [0.5, "#fee08b"], [1, "#1a9850"]], colorbar: {ticksuffix: " %", thickness: 10}, hovertemplate: "%{y} %{x}: %{z:.0f} %<extra></extra>"}], | |
| {title: {text: L("SMC coverage, Far North districts", "Couverture de la CPS, districts de l'Extrême-Nord")}, xaxis: {type: "category"}, yaxis: {automargin: true, tickfont: {size: 9}}, margin: {l: 90}}, 560); | |
| const it = P.itn, cols = ["#1f77b4", "#ff7f0e", "#2ca02c", "#d62728", "#9467bd", "#8c564b", "#e377c2", "#7f7f7f", "#bcbd22", "#17becf"]; | |
| plot("f_d7", Object.keys(it).map((r, k) => ({type: "scatter", mode: "lines+markers", name: NARROW() ? (RCODE[r] || r) : r, x: it[r].years.map(String), y: it[r].pregnant, line: {color: cols[k % 10], width: 2}, hovertemplate: r + " %{x}: %{y:.0f} %<extra></extra>"})), | |
| {title: {text: L("Routine ITN coverage, pregnant women", "Couverture de routine en MILDA, femmes enceintes")}, xaxis: {type: "category"}, yaxis: {ticksuffix: " %", range: [0, 105]}, legend: {orientation: "h", y: -0.25}, margin: {b: 100}}, 560); | |
| } | |
| function pUnit(){ | |
| const el = document.getElementById("p_unit"), V = S.view; | |
| el.innerHTML = "<h2>" + L("Territory sheet", "Fiche territoire") + ' <span class="muted" style="font-weight:600;font-size:.9rem">· ' + simLabel(V) + '</span></h2><div id="u_u"></div><div id="u_body" style="margin-top:10px"></div>'; | |
| const draw = () => { unitButtons("u_u", draw); const i = S.unit, H = A(V, "hist"); | |
| const rows = [["tmean", L("Mean temperature (°C)", "Température moyenne (°C)"), 1], ["rain", L("Annual rainfall (mm; change in %)", "Pluie annuelle (mm ; variation en %)"), 0], ["season", L("Suitable season, rules (months)", "Saison favorable, règles (mois)"), 2], ["thermal", L("Months within 16-34 °C", "Mois entre 16 et 34 °C"), 1], ["hot", L("Months above 34 °C", "Mois au-dessus de 34 °C"), 1], ["dry", L("Months too dry", "Mois trop secs"), 1], | |
| ["eir", L("Annual EIR, VECTRI (bites; change in %)", "EIR annuel, VECTRI (piqûres ; variation en %)"), 0], ["vseason", L("Transmission season, VECTRI (months)", "Saison de transmission, VECTRI (mois)"), 2], ["pr", L("Parasite rate, VECTRI (%)", "Prévalence, VECTRI (%)"), 1], ["eir_smc", L("EIR share in July-October (%)", "Part de l'EIR en juillet-octobre (%)"), 1], ["stable_share", L("Area in stable suitability (%)", "Surface en aptitude stable (%)"), 0]]; | |
| let h = '<div class="kpis">' + kpi(L("Type", "Type"), U.kind[i] === "country" ? L("Country", "Pays") : U.kind[i] === "region" ? L("Region", "Région") : L("Department", "Département"), U.region[i] ? L("Region: ", "Région : ") + U.region[i] : "") + | |
| kpi(L("Area", "Superficie"), Math.round(U.km2[i]).toLocaleString(S.lang === "fr" ? "fr-FR" : "en-GB") + " km²", L("GADM 4.1 outline", "contour GADM 4.1")) + kpi(L("Population", "Population"), fmt(U.people[i], 2) + " M", L("fixed population of the VECTRI input", "population fixe du fichier VECTRI")) + | |
| kpi(L("Grid cells", "Cellules de grille"), fmt(U.ncell[i], 1), L("equivalent 0.25° cells", "cellules de 0,25° équivalentes")) + "</div>"; | |
| if (U.ncell[i] < 2) h += '<div class="note">' + L("This territory covers less than two grid cells of 0.25° (about 28 km): its values come from one or two cells shared with its neighbours and should be read with care.", "Ce territoire couvre moins de deux cellules de grille de 0,25° (environ 28 km) : ses valeurs viennent d'une ou deux cellules partagées avec ses voisins et doivent être lues avec prudence.") + "</div>"; | |
| h += '<div class="tw"><table><tr><th>' + L("Indicator", "Indicateur") + "</th><th>1995-2014</th>" + D.meta.tags.map(tg2 => "<th>" + tagLabel(tg2) + "</th>").join("") + "</tr>"; | |
| rows.forEach(([f, lab, d]) => { h += "<tr><td>" + lab + "</td><td>" + fmt(H[f][i], d) + "</td>" + D.meta.tags.map(tg2 => { const dd = f === "stable_share" ? A(V, tg2)[f][i] - H[f][i] : A(V, "d_" + tg2)[f][i]; | |
| const r = V === "ENSEMBLE" && f !== "stable_share" ? (AE("rng_" + tg2) || {})[f] : null; return '<td class="' + cls(dd) + '">' + fmt(dd, d, true) + (r ? '<br><span class="muted" style="font-size:.72rem">' + fmt(r[0][i], d, true) + " / " + fmt(r[1][i], d, true) + "</span>" : "") + "</td>"; }).join("") + "</tr>"; }); | |
| h += "</table></div><div class='cap'>" + L("Futures: change against 1995-2014 (EIR and rainfall in percent, parasite rate and shares in points). Small figures: lowest / highest of the CMIP6 models (climate and rule-based indicators; VECTRI uses one model).", "Futurs : changement par rapport à 1995-2014 (EIR et pluie en pourcentage, prévalence et parts en points). Petits chiffres : le plus bas / le plus haut des modèles CMIP6 (climat et indicateurs selon les règles ; VECTRI utilise un modèle).") + "</div>" + | |
| '<div class="grid2" style="margin-top:12px"><div class="card"><div class="fig" id="f_u1"></div></div><div class="card"><div class="fig" id="f_u2"></div></div><div class="card"><div class="fig" id="f_u3"></div></div><div class="card"><div class="fig" id="f_u4"></div></div></div>'; | |
| document.getElementById("u_body").innerHTML = h; | |
| cycles("f_u1", "eir", L("Monthly EIR, ", "EIR mensuel, ") + uname(i), L("bites per person", "piqûres par personne"), i, {smc: true}); | |
| cycles("f_u2", "freq", L("Months suitable (rules): share of years, ", "Mois favorables (règles) : part des années, ") + uname(i), "%", i, {k: 100}); | |
| cycles("f_u3", "tas", L("Monthly mean temperature, ", "Température moyenne mensuelle, ") + uname(i), "°C", i); | |
| cycles("f_u4", "rain", L("Monthly rainfall, ", "Pluie mensuelle, ") + uname(i), "mm", i); }; | |
| draw(); | |
| } | |
| function pMeth(){ | |
| const el = document.getElementById("p_meth"), m = D.meta, yrs = m.years; | |
| const simRows = m.sims.map(s => "<tr><td>" + s + "</td>" + ["hist"].concat(m.tags).map(tg2 => "<td>" + ((yrs[s] || {})[tg2] || "-") + "</td>").join("") + "</tr>").join(""); | |
| el.innerHTML = "<h2>" + L("Method and data", "Méthode et données") + "</h2>" + | |
| '<div class="grid2"><div class="card"><h3>' + L("Climate projections", "Projections climatiques") + "</h3><p>" + L("NEX-GDDP-CMIP6 (NASA; Thrasher et al. 2022): daily rainfall and temperature of " + (ONE ? "one CMIP6 global model" : m.nmodels + " CMIP6 global models") + ", bias-adjusted against observations and downscaled to 0.25° (about 28 km). Reference 1995-2014 (CMIP6 historical experiment); SSP2-4.5 and SSP5-8.5, 2041-2060 and 2081-2100. " + (ONE ? "Climate, rule-based suitability and VECTRI all use the same model." : "Climate and rule-based suitability: computed for every model, then the median of the models, cell by cell and territory by territory; dots: at least 80 % of the models agree on the sign of the change; small figures: lowest and highest model.") + "", "NEX-GDDP-CMIP6 (NASA ; Thrasher et al. 2022) : pluie et température journalières " + (ONE ? "d'un modèle global CMIP6" : "de " + m.nmodels + " modèles globaux CMIP6") + ", corrigées de biais par rapport aux observations et régionalisées à 0,25° (environ 28 km). Référence 1995-2014 (expérience historique CMIP6) ; SSP2-4.5 et SSP5-8.5, 2041-2060 et 2081-2100. " + (ONE ? "Le climat, l'aptitude selon les règles et VECTRI utilisent le même modèle." : "Climat et aptitude selon les règles : calculés pour chaque modèle, puis médiane des modèles, cellule par cellule et territoire par territoire ; points : au moins 80 % des modèles s'accordent sur le signe du changement ; petits chiffres : modèle le plus bas et le plus haut.")) + "</p><p class='muted' style='font-size:.85rem'>" + (ONE ? "" : L("Models: ", "Modèles : ") + m.models.join(", ") + ".") + "</p></div>" + | |
| '<div class="card"><h3>' + L("Rule-based suitability", "Aptitude selon les règles") + "</h3><p>" + L("Monthly mean temperature between 16 and 34 °C (thermal limits of the transmission curve, Mordecai et al. 2013, as applied by Smith et al. 2020); monthly rainfall of at least 60 mm in a year with at least one month of 80 mm (Tanser et al. 2003; Smith et al. 2020). Season: longest run of consecutive suitable months, counted in a 12-month window that starts in the driest month of each cell, so that a season is never cut by the calendar year. Stable suitability: mean season longer than 3 months. Change tested with the Mann-Whitney test on the 20 annual values of each territory.", "Température moyenne mensuelle entre 16 et 34 °C (limites thermiques de la courbe de transmission, Mordecai et al. 2013, telles qu'appliquées par Smith et al. 2020) ; pluie mensuelle d'au moins 60 mm dans une année ayant au moins un mois de 80 mm (Tanser et al. 2003 ; Smith et al. 2020). Saison : plus longue suite de mois favorables consécutifs, comptée dans une fenêtre de 12 mois qui commence au mois le plus sec de chaque cellule, de sorte qu'une saison n'est jamais coupée par l'année civile. Aptitude stable : saison moyenne de plus de 3 mois. Changement testé par le test de Mann-Whitney sur les 20 valeurs annuelles de chaque territoire.") + "</p></div>" + | |
| '<div class="card"><h3>VECTRI</h3><p>' + L("VECTRI (Tompkins and Ermert 2013; Asare et al. 2016) run on every grid cell with the daily rainfall and temperature of CMIP6 (NEX-GDDP-CMIP6)" + (ONE ? ", as for Niger and Guinea-Bissau" : ": among the " + m.nmodels + " models, the one whose projected changes over Cameroon (annual and July-September rainfall, mean temperature, four scenario-periods) are closest to the ensemble median") + ". Each slice is preceded by a 5-year spin-up (removed); default parameters, no interventions, fixed population (AfriPop, interpolated to 0.25°). Outputs: monthly EIR (sum of daily values), parasite rate, human bite rate, vector density. Transmission season: longest run of months with an EIR of at least 1 infective bite per person per month. Significance: Mann-Whitney test on the 20 annual values.", "VECTRI (Tompkins et Ermert 2013 ; Asare et al. 2016) tourne sur chaque cellule avec la pluie et la température journalières de CMIP6 (NEX-GDDP-CMIP6)" + (ONE ? ", comme pour le Niger et la Guinée-Bissau" : " : parmi les " + m.nmodels + " modèles, celui dont les changements projetés sur le Cameroun (pluie annuelle et de juillet-septembre, température moyenne, quatre scénarios-périodes) sont les plus proches de la médiane de l'ensemble") + ". Chaque tranche est précédée de 5 ans de mise en route (retirés) ; paramètres par défaut, sans interventions, population fixe (AfriPop, interpolée à 0,25°). Sorties : EIR mensuel (somme des valeurs journalières), prévalence parasitaire, taux de piqûre, densité vectorielle. Saison de transmission : plus longue suite de mois avec un EIR d'au moins 1 piqûre infectante par personne et par mois. Significativité : test de Mann-Whitney sur les 20 valeurs annuelles.") + "</p></div>" + | |
| '<div class="card"><h3>' + L("Territories", "Territoires") + "</h3><p>" + L("Boundaries: GADM 4.1, Cameroon, level 2: " + m.ncommunes + " departments, dissolved into the 10 regions of level 1, so that both levels nest exactly. Level 2 is used rather than level 3 (360 arrondissements) because most arrondissements are smaller than one 0.25° grid cell (median 0.76 cell): their values would only repeat cells shared with their neighbours, whereas the median department covers about 6 cells. Each 0.25° grid cell is shared between the territories it overlaps in proportion to the overlapping area (areas computed in an equal-area projection); a territory value is the area-weighted mean of its cells. Twelve departments, mainly in the western highlands (Ouest, Nord-Ouest) and the cities of Douala (Wouri) and Yaoundé (Mfoundi), cover less than two grid cells and should be read with care. " + m.ncell + " grid cells touch Cameroon.", "Limites : GADM 4.1, Cameroun, niveau 2 : " + m.ncommunes + " départements, regroupés dans les 10 régions du niveau 1, de sorte que les deux niveaux s'emboîtent exactement. Le niveau 2 est retenu plutôt que le niveau 3 (360 arrondissements) car la plupart des arrondissements sont plus petits qu'une cellule de 0,25° (médiane 0,76 cellule) : leurs valeurs ne feraient que répéter des cellules partagées avec leurs voisins, alors que le département médian couvre environ 6 cellules. Chaque cellule de 0,25° est partagée entre les territoires qu'elle recouvre au prorata de la surface (surfaces calculées dans une projection équivalente) ; la valeur d'un territoire est la moyenne pondérée par la surface de ses cellules. Douze départements, surtout sur les hautes terres de l'Ouest et du Nord-Ouest et dans les villes de Douala (Wouri) et Yaoundé (Mfoundi), couvrent moins de deux cellules et doivent être lus avec prudence. " + m.ncell + " cellules touchent le Cameroun.") + "</p></div>" + | |
| '<div class="card"><h3>' + L("Validation level and data", "Niveau et données de validation") + "</h3><p>" + L("The validation level is set by the observations: the PNLP publishes the annual number of confirmed malaria cases per region (surveillance syntheses 2020 and 2021, annual reports 2022, 2023 and 2024; table compiled by Dr Ngangue Siewe Idriss Nasser), so the comparison uses GADM level 1 (10 regions, names matched one to one). Quality control: the regional values add up exactly to the national totals of each year; year-to-year changes above 25 % are flagged. Indicators: confirmed cases and confirmed cases per 1000 people (WorldPop 2020 regional population when available, otherwise the VECTRI population); no test positivity, as the number of people tested is not given. Statistics: Spearman rank correlation, permutation p-value, bootstrap interval, Holm correction; sensitivity tests without the SMC regions (Nord, Extrême-Nord), without the crisis-affected regions (Nord-Ouest, Sud-Ouest) and year by year.", "Le niveau de validation est fixé par les observations : le PNLP publie le nombre annuel de cas confirmés de paludisme par région (synthèses de surveillance 2020 et 2021, rapports annuels 2022, 2023 et 2024 ; tableau compilé par le Dr Ngangue Siewe Idriss Nasser) : la comparaison se fait donc au niveau 1 de GADM (10 régions, noms appariés un à un). Contrôle qualité : les valeurs régionales s'additionnent exactement aux totaux nationaux de chaque année ; les variations d'une année à l'autre de plus de 25 % sont signalées. Indicateurs : cas confirmés et cas confirmés pour 1000 habitants (population régionale WorldPop 2020 si disponible, sinon population de VECTRI) ; pas de positivité, faute du nombre de personnes testées. Statistiques : corrélation de rang de Spearman, p de permutation, intervalle bootstrap, correction de Holm ; tests de sensibilité sans les régions sous CPS (Nord, Extrême-Nord), sans les régions touchées par la crise (Nord-Ouest, Sud-Ouest) et année par année.") + "</p></div></div>" + | |
| '<div class="note" style="margin-top:12px">' + L((ONE ? "Limits: one CMIP6 model only, so the spread between models is not shown; " : "Limits: ") + "VECTRI is driven by one model and is not calibrated on Cameroonian data; it includes no interventions; simulated (1995-2014) and observed (2020-2024) periods differ; only 10 regions are available for the validation; bias adjustment corrects the mean climate of each model, not the spread of the projections; population is fixed; the climate signal says nothing about future control, drug resistance or health system changes.", (ONE ? "Limites : un seul modèle CMIP6, la dispersion entre modèles n'est donc pas montrée ; " : "Limites : ") + "VECTRI est forcé par un seul modèle et n'est pas calibré sur les données du Cameroun ; il n'inclut aucune intervention ; les périodes simulée (1995-2014) et observée (2020-2024) diffèrent ; seules 10 régions sont disponibles pour la validation ; la correction de biais corrige le climat moyen de chaque modèle, pas la dispersion des projections ; la population est fixe ; le signal climatique ne dit rien du contrôle futur, des résistances ou de l'évolution du système de santé.") + "</div>" + | |
| '<div class="card" style="margin-top:12px"><h3>' + L("Downloads", "Téléchargements") + '</h3><div class="dl">' + '<a href="cameroon_units_cmip6.csv" download>' + L("All territories and periods (CSV)", "Tous les territoires et périodes (CSV)") + "</a>" + (ONE ? "" : ' <a href="model_ranking_cameroon.csv" download>' + L("Model ranking (CSV)", "Classement des modèles (CSV)") + "</a>") + ' <a href="Cameroon_PNLP_confirmed_malaria_cases_by_region_2020-2024.xlsx" download>' + L("PNLP confirmed cases by region, 2020-2024 (Excel)", "Cas confirmés du PNLP par région, 2020-2024 (Excel)") + '</a> <a href="cameroon_region_obs_vs_sim.csv" download>' + L("Validation by region (CSV)", "Validation par région (CSV)") + '</a> <a href="cameroon_region_validation_spearman.csv" download>' + L("Spearman tests (CSV)", "Tests de Spearman (CSV)") + '</a></div><div class="cap">' + L("One row per territory and period: values and changes for all indicators.", "Une ligne par territoire et par période : valeurs et changements de tous les indicateurs.") + "</div></div>" + | |
| '<div class="card" style="margin-top:12px"><h3>' + L("References", "Références") + '</h3><ul style="font-size:.85rem">' + | |
| "<li>Diouf I, Rodriguez-Fonseca B, Deme A, Caminade C, Morse AP, Cisse M, Sy I, Dia I, Ermert V, Ndione JA, Gaye AT (2017) Comparison of malaria simulations driven by meteorological observations and reanalysis products in Senegal. International Journal of Environmental Research and Public Health 14: 1119.</li>" + | |
| "<li>Diouf I, Rodriguez Fonseca B, Caminade C, Thiaw WM, Deme A, Morse AP, Ndione JA, Gaye AT, Diaw A, Ndiaye MKN (2020) Climate variability and malaria over West Africa. American Journal of Tropical Medicine and Hygiene 102: 1037-1047.</li>" + | |
| "<li>WorldPop (2018) Global High Resolution Population Denominators Project (OPP1134076), University of Southampton. Global 2000-2020 1 km UN-adjusted population. https://www.worldpop.org</li>" + | |
| "<li>Holm S (1979) A simple sequentially rejective multiple test procedure. Scandinavian Journal of Statistics 6: 65-70.</li>" + | |
| "<li>Asare EO, Tompkins AM, Bomblies A (2016) A regional model for malaria vector developmental habitats evaluated using explicit, pond-resolving surface hydrology simulations. PLoS ONE 11: e0150626.</li>" + | |
| "<li>Mordecai EA, Paaijmans KP, Johnson LR, et al. (2013) Optimal temperature for malaria transmission is dramatically lower than previously predicted. Ecology Letters 16: 22-30.</li>" + | |
| "<li>Ryan SJ, Lippi CA, Zermoglio F (2020) Shifting transmission risk for malaria in Africa with climate change: a framework for planning and intervention. Malaria Journal 19: 170.</li>" + | |
| "<li>Smith MW, Willis T, Alfieri L, et al. (2020) Incorporating hydrology into climate suitability models changes projections of malaria transmission in Africa. Nature Communications 11: 4353.</li>" + | |
| "<li>Tanser FC, Sharp B, le Sueur D (2003) Potential effect of climate change on malaria transmission in Africa. The Lancet 362: 1792-1798.</li>" + | |
| "<li>Thrasher B, Wang W, Michaelis A, Melton F, Lee T, Nemani R (2022) NASA Global Daily Downscaled Projections, CMIP6. Scientific Data 9: 262.</li>" + | |
| "<li>Tompkins AM, Ermert V (2013) A regional-scale, high resolution dynamical malaria model that accounts for population density, climate and surface hydrology. Malaria Journal 12: 65.</li>" + | |
| "<li>GADM (2022) Database of Global Administrative Areas, version 4.1. https://gadm.org</li></ul></div>"; | |
| } | |
| const PAGES = {val: pVal, dhis: pDhis, over: pOver, clim: pClim, suit: pSuit, vec: pVec, smc: pSmc, unit: pUnit, meth: pMeth}; | |
| async function render(){ | |
| document.documentElement.lang = S.lang; | |
| document.getElementById("h1").textContent = t("h1"); document.getElementById("brand").textContent = L("Cameroon · Malaria & climate", "Cameroun · Paludisme & climat"); document.getElementById("hsub").textContent = t("hsub"); document.getElementById("hby").textContent = t("by"); | |
| document.getElementById("fsig").innerHTML = "<b>Dr Ibrahima Diouf</b> · " + L("Physicist, climate and health scientist", "Physicien, chercheur climat et santé") + " · " + L("Data: NEX-GDDP-CMIP6 (NASA), VECTRI, GADM 4.1, AfriPop, WorldPop, PNLP Cameroon confirmed malaria cases by region 2020-2024, DHIS2 district data 2019-2025, SMC coverage 2019-2025.", "Données : NEX-GDDP-CMIP6 (NASA), VECTRI, GADM 4.1, AfriPop, WorldPop, cas confirmés de paludisme par région du PNLP Cameroun 2020-2024, données DHIS2 des districts 2019-2025, couverture de la CPS 2019-2025."); | |
| controls(); | |
| document.getElementById("codes").textContent = L("Map labels: ", "Étiquettes des cartes : ") + Object.entries(RCODE).map(([k, v]) => v + " " + k).join(" · "); | |
| document.querySelectorAll("section.page").forEach(s => s.classList.toggle("on", s.id === "p_" + S.page)); | |
| try { await PAGES[S.page](); } catch (e) { console.error(e); } | |
| } | |
| function stackTables(){ if (!NARROW()) { document.querySelectorAll("table.stack").forEach(t => t.classList.remove("stack")); return; } | |
| document.querySelectorAll("section.page.on .tw table").forEach(t => { if (t.classList.contains("stack")) return; const tw = t.closest(".tw"); if (!tw || tw.scrollWidth <= tw.clientWidth + 2) return; | |
| const rows = t.querySelectorAll("tr"); if (!rows.length || !rows[0].querySelector("th")) return; const lab = [...rows[0].children].map(c => c.textContent.trim()); | |
| rows.forEach((r, i) => { if (i === 0) return; [...r.children].forEach((c, j) => c.setAttribute("data-label", lab[j] || "")); }); t.classList.add("stack"); }); } | |
| let stT; new MutationObserver(() => { clearTimeout(stT); stT = setTimeout(stackTables, 120); }).observe(document.querySelector("main"), {childList: true, subtree: true}); | |
| render(); | |
| let rz; window.addEventListener("resize", () => { clearTimeout(rz); rz = setTimeout(() => document.querySelectorAll(".js-plotly-plot").forEach(d => Plotly.Plots.resize(d)), 200); }); | |
| </script> | |
| </body> | |
| </html> | |