Upload index.html
Browse files- index.html +169 -2
index.html
CHANGED
|
@@ -505,6 +505,83 @@
|
|
| 505 |
#reportSheet.region-sheet { break-inside:avoid!important; page-break-inside:avoid!important; }
|
| 506 |
.region-sheet .region-manager-note { break-inside:avoid!important; page-break-inside:avoid!important; }
|
| 507 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 508 |
</style></head>
|
| 509 |
<body>
|
| 510 |
<div class="app">
|
|
@@ -586,7 +663,7 @@
|
|
| 586 |
</main>
|
| 587 |
</div>
|
| 588 |
<div id="reportOverlay" role="dialog" aria-modal="true" aria-label="Reakt Monitor rapport" aria-hidden="true">
|
| 589 |
-
<div class="report-actions"><span><strong>REAKT ·
|
| 590 |
<section id="reportSheet" aria-label="Witte Inloop Monitor"></section>
|
| 591 |
</div>
|
| 592 |
<script src="https://cdn.jsdelivr.net/npm/html2canvas@1.4.1/dist/html2canvas.min.js"></script>
|
|
@@ -1312,7 +1389,7 @@ function getReportData(){
|
|
| 1312 |
earliest:period.begin,latest:period.peildatum,issues:result.passConflicts+result.identityConflicts+result.unmatchedPasses,hasShadow:false,
|
| 1313 |
historyLoaded:result.historyLoaded,correctedExisting:result.correctedExisting,correctedJanuary:result.correctedJanuary};
|
| 1314 |
}
|
| 1315 |
-
function
|
| 1316 |
const d=getReportData();if(!d)return;
|
| 1317 |
const range=d.earliest===d.latest?d.earliest:`${d.earliest} t/m ${d.latest}`;
|
| 1318 |
const avgDay=d.averageClientsPerDay.toLocaleString('nl-NL',{minimumFractionDigits:1,maximumFractionDigits:1});
|
|
@@ -1355,7 +1432,94 @@ function buildWhiteReport(){
|
|
| 1355 |
</div>
|
| 1356 |
<div class="report-foot"><span>Bron: scanregistratie 2026${d.historyLoaded?' en historisch referentiebestand 2025':''}. Rapportageperiode en peildatum staan bovenaan vermeld.</span></div>`;
|
| 1357 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1358 |
function openWhiteReport(){
|
|
|
|
| 1359 |
if(!importedData?.last){alert('Upload eerst een Excelbestand en rond de analyse af. Deze witte rapportage gebruikt geen verzonnen demo-KPI’s.');return;}
|
| 1360 |
if(importedData.last.site==='*'){alert('Kies eerst één locatie en voer daarna de analyse opnieuw uit. De witte monitor is in v0.8 een rapport per locatie.');return;}
|
| 1361 |
buildWhiteReport();$('reportOverlay').classList.add('open');$('reportOverlay').setAttribute('aria-hidden','false');document.body.classList.add('report-open');$('reportOverlay').scrollTop=0;
|
|
@@ -1396,6 +1560,7 @@ async function downloadReportImage(type='png'){
|
|
| 1396 |
}
|
| 1397 |
$('reportClose').addEventListener('click',closeWhiteReport);
|
| 1398 |
$('reportPrint').addEventListener('click',()=>window.print());
|
|
|
|
| 1399 |
$('reportPng').addEventListener('click',()=>downloadReportImage('png'));
|
| 1400 |
$('reportJpg').addEventListener('click',()=>downloadReportImage('jpg'));
|
| 1401 |
document.addEventListener('keydown',e=>{if(e.key==='Escape'&&$('reportOverlay').classList.contains('open'))closeWhiteReport()});
|
|
@@ -1812,6 +1977,7 @@ function buildRegionReport(d){
|
|
| 1812 |
const cards=kpis.map(([label,noteValue,detail],i)=>`<div class="report-kpi ${cols[i]}"><div class="k-icon">${['♟','+','♙','▦'][i]}</div><div><div class="k-label">${label}</div><div class="k-num">${nf(noteValue)}</div><div class="k-sub">${escapeHTML(detail)}</div></div><div class="k-underline"></div></div>`).join('');
|
| 1813 |
const tableRows=d.locations.map(x=>`<tr><td>${escapeHTML(x.name)}${x.present?'':' *'}</td><td>${nf(x.unique)}</td><td>${nf(x.newIntake)}</td><td>${nf(x.active)}</td><td>${nf(x.visits)}</td></tr>`).join('');
|
| 1814 |
const avail=d.available;
|
|
|
|
| 1815 |
$('reportSheet').classList.add('region-sheet');
|
| 1816 |
$('reportSheet').innerHTML=`
|
| 1817 |
<div class="region-wordmark"><span class="region-reakt">Reakt</span><small>Werken aan je toekomst</small></div>
|
|
@@ -1839,6 +2005,7 @@ function buildRegionReport(d){
|
|
| 1839 |
`;
|
| 1840 |
}
|
| 1841 |
function openRegionReport(){
|
|
|
|
| 1842 |
try{
|
| 1843 |
const d=regionReportData($('regionSelect').value);
|
| 1844 |
buildRegionReport(d);
|
|
|
|
| 505 |
#reportSheet.region-sheet { break-inside:avoid!important; page-break-inside:avoid!important; }
|
| 506 |
.region-sheet .region-manager-note { break-inside:avoid!important; page-break-inside:avoid!important; }
|
| 507 |
}
|
| 508 |
+
|
| 509 |
+
/* ORCHESTRA INFOGRAPHIC v1 — aparte uitvoerlaag; rekencode van V9 blijft intact */
|
| 510 |
+
#reportSheet.infographic-sheet{
|
| 511 |
+
--ig-ink:#1b2646;--ig-muted:#6a7287;--ig-purple:#7438c5;--ig-green:#27964b;--ig-orange:#f37011;
|
| 512 |
+
background:#f7f7f9;color:var(--ig-ink);width:min(100%,1210px);max-width:1210px;
|
| 513 |
+
padding:32px 38px 31px;font-family:Inter,'Segoe UI',Arial,sans-serif;
|
| 514 |
+
line-height:1.32;min-height:748px;box-shadow:0 22px 65px #0006;
|
| 515 |
+
}
|
| 516 |
+
.infographic-sheet .ig-head{display:flex;align-items:flex-start;justify-content:space-between;border-bottom:1px solid #e3e4e9;padding-bottom:15px;margin-bottom:14px;gap:20px}
|
| 517 |
+
.infographic-sheet .ig-wordmark{color:#f25d0b;font-weight:850;font-size:37px;letter-spacing:-2.4px;line-height:1}
|
| 518 |
+
.infographic-sheet .ig-wordmark sup{font-size:11px;color:#8642c4;letter-spacing:-.5px;vertical-align:super}
|
| 519 |
+
.infographic-sheet .ig-head-right{text-align:right;max-width:37%;padding-top:6px;font-size:11px;color:#828397;line-height:1.65}
|
| 520 |
+
.infographic-sheet .ig-head-right strong{display:block;font-size:10px;letter-spacing:1.4px;color:#7943ba}
|
| 521 |
+
.infographic-sheet .ig-title{font-size:27px;line-height:1.12;color:#202a45;font-weight:850;letter-spacing:-.5px;margin:12px 0 4px}
|
| 522 |
+
.infographic-sheet .ig-subtitle{font-size:12px;color:#788093;margin-bottom:20px}
|
| 523 |
+
.infographic-sheet .ig-layout{display:grid;grid-template-columns:minmax(0,.95fr) minmax(0,1.03fr) minmax(0,1.07fr);column-gap:25px;row-gap:23px;align-items:stretch}
|
| 524 |
+
.infographic-sheet .ig-col{min-width:0}
|
| 525 |
+
.infographic-sheet .ig-kpi-card{height:100%;border:1px solid #e7e8ed;background:#fff;border-radius:12px;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:15px 12px}
|
| 526 |
+
.infographic-sheet .ig-kpi-number{font-size:48px;font-weight:850;line-height:1.12;letter-spacing:-1px}
|
| 527 |
+
.infographic-sheet .ig-kpi-label{font-size:17px;font-weight:800;color:#20294a;margin-top:3px}
|
| 528 |
+
.infographic-sheet .ig-kpi-help{font-size:10.5px;color:#7c8191;max-width:95%;margin-top:11px;line-height:1.46}
|
| 529 |
+
.infographic-sheet .ig-purple{color:#733ac1}.infographic-sheet .ig-green{color:#279b52}.infographic-sheet .ig-orange{color:#f07112}
|
| 530 |
+
.infographic-sheet .ig-small-kpis{display:grid;grid-template-columns:1fr 1fr;gap:11px;height:100%}
|
| 531 |
+
.infographic-sheet .ig-small-kpis .ig-kpi-number{font-size:42px}
|
| 532 |
+
.infographic-sheet .ig-small-kpis .ig-kpi-label{font-size:14px}
|
| 533 |
+
.infographic-sheet .ig-small-kpis .ig-kpi-help{font-size:10px;margin-top:9px}
|
| 534 |
+
.infographic-sheet .ig-block{min-width:0;padding:2px 0}
|
| 535 |
+
.infographic-sheet .ig-block-title{font-size:16px;color:#202943;font-weight:820;margin:0 0 3px}
|
| 536 |
+
.infographic-sheet .ig-block-help{font-size:10.8px;line-height:1.3;color:#777f90;margin-bottom:12px}
|
| 537 |
+
.infographic-sheet .ig-month-bars{height:120px;display:grid;grid-template-columns:repeat(12,minmax(0,1fr));gap:4px;padding:1px 0 0;border-bottom:1px solid #dfe2e8;background:repeating-linear-gradient(to top,transparent 0,transparent 38px,#e4e5e9 39px,#e4e5e9 40px);}
|
| 538 |
+
.infographic-sheet .ig-month{display:flex;flex-direction:column;min-width:0;align-items:center;justify-content:end;position:relative}
|
| 539 |
+
.infographic-sheet .ig-month .ig-val{font-size:10.8px;font-weight:750;color:#34405e;height:16px;text-align:center;white-space:nowrap}
|
| 540 |
+
.infographic-sheet .ig-month .ig-bar{display:block;width:75%;max-width:30px;min-height:0;border-radius:2px 2px 0 0;background:#5cb9aa}
|
| 541 |
+
.infographic-sheet .ig-month .ig-label{display:block;position:absolute;bottom:-20px;font-size:10.4px;color:#747e8b;white-space:nowrap}
|
| 542 |
+
.infographic-sheet .ig-month-bars.ig-new-bars .ig-bar{background:#319b59}
|
| 543 |
+
.infographic-sheet .ig-chart-block{padding-bottom:24px}
|
| 544 |
+
.infographic-sheet .ig-frequency{display:flex;height:36px;overflow:hidden;margin:18px 0 9px}
|
| 545 |
+
.infographic-sheet .ig-frequency-seg{display:flex;align-items:center;justify-content:center;font-size:13px;font-weight:820;color:#fff;min-width:0;border-right:2px solid #fff}
|
| 546 |
+
.infographic-sheet .ig-frequency-seg:first-child{color:#2e2457}
|
| 547 |
+
.infographic-sheet .ig-freq-legend{display:grid;grid-template-columns:1fr 1fr;gap:8px 8px;margin-top:12px}
|
| 548 |
+
.infographic-sheet .ig-legend-entry{font-size:10.4px;color:#4e5670;white-space:nowrap}
|
| 549 |
+
.infographic-sheet .ig-legend-dot{display:inline-block;width:7px;height:7px;border-radius:50%;vertical-align:1px;margin-right:5px}
|
| 550 |
+
.infographic-sheet .ig-donut-row{display:flex;align-items:center;gap:14px;min-height:125px}
|
| 551 |
+
.infographic-sheet .ig-donut-wrap{position:relative;flex:none;width:140px;height:140px}
|
| 552 |
+
.infographic-sheet .ig-donut-wrap svg{display:block;width:100%;height:100%}
|
| 553 |
+
.infographic-sheet .ig-donut-center{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;pointer-events:none}
|
| 554 |
+
.infographic-sheet .ig-donut-center strong{font-size:23px;font-weight:850;line-height:1}
|
| 555 |
+
.infographic-sheet .ig-donut-center small{font-size:10px;color:#85899b}
|
| 556 |
+
.infographic-sheet .ig-donut-legend{display:flex;flex-direction:column;gap:10px;min-width:0;flex:1}
|
| 557 |
+
.infographic-sheet .ig-donut-legend-item{display:flex;justify-content:space-between;align-items:flex-start;gap:6px;font-size:11px;color:#343b5e}
|
| 558 |
+
.infographic-sheet .ig-donut-legend-item b{font-weight:800;white-space:nowrap}
|
| 559 |
+
.infographic-sheet .ig-donut-note{font-size:10.5px;color:#7b8392;line-height:1.38;margin:0}
|
| 560 |
+
.infographic-sheet .ig-explain{font-size:11px;color:#616a7a;line-height:1.34}
|
| 561 |
+
.infographic-sheet .ig-explain b{display:block;color:#343d60;margin:7px 0 2px;font-size:11px}
|
| 562 |
+
.infographic-sheet .ig-bottom-note{font-size:9.5px;color:#777e8e;margin-top:16px;border-top:1px solid #e5e6ea;padding-top:9px;display:flex;justify-content:space-between;gap:10px}
|
| 563 |
+
.infographic-sheet .ig-data-warning{background:#fff7e6;color:#8d5b10;border:1px solid #f3dcb2;border-radius:6px;margin:8px 0 12px;padding:8px 12px;font-size:11px}
|
| 564 |
+
/* Alle oude printfuncties blijven in het bestand. Alleen deze rapportvorm krijgt een eigen printindeling. */
|
| 565 |
+
@media print{
|
| 566 |
+
@page{size:A4 landscape;margin:4mm}
|
| 567 |
+
#reportSheet.infographic-sheet{width:100%!important;max-width:none!important;height:auto!important;min-height:0!important;padding:4mm 5mm 2mm!important;margin:0!important;zoom:1!important;box-shadow:none!important;background:#f7f7f9!important;break-inside:avoid!important;page-break-inside:avoid!important;-webkit-print-color-adjust:exact!important;print-color-adjust:exact!important}
|
| 568 |
+
#reportSheet.infographic-sheet .ig-head{padding-bottom:10px!important;margin-bottom:10px!important}
|
| 569 |
+
#reportSheet.infographic-sheet .ig-title{font-size:25px!important;margin:8px 0 3px!important}
|
| 570 |
+
#reportSheet.infographic-sheet .ig-subtitle{margin-bottom:13px!important}
|
| 571 |
+
#reportSheet.infographic-sheet .ig-layout{column-gap:17px!important;row-gap:15px!important;grid-template-columns:minmax(0,.95fr) minmax(0,1.03fr) minmax(0,1.07fr)!important}
|
| 572 |
+
#reportSheet.infographic-sheet .ig-kpi-card{padding:10px 8px!important}
|
| 573 |
+
#reportSheet.infographic-sheet .ig-kpi-number{font-size:43px!important}
|
| 574 |
+
#reportSheet.infographic-sheet .ig-small-kpis .ig-kpi-number{font-size:36px!important}
|
| 575 |
+
#reportSheet.infographic-sheet .ig-small-kpis .ig-kpi-label{font-size:12px!important}
|
| 576 |
+
#reportSheet.infographic-sheet .ig-small-kpis .ig-kpi-help{font-size:9px!important}
|
| 577 |
+
#reportSheet.infographic-sheet .ig-donut-wrap{width:119px!important;height:119px!important}
|
| 578 |
+
#reportSheet.infographic-sheet .ig-donut-row{min-height:119px!important;gap:9px!important}
|
| 579 |
+
#reportSheet.infographic-sheet .ig-month-bars{height:112px!important}
|
| 580 |
+
#reportSheet.infographic-sheet .ig-chart-block{padding-bottom:20px!important}
|
| 581 |
+
#reportSheet.infographic-sheet .ig-block-title{font-size:14px!important}
|
| 582 |
+
#reportSheet.infographic-sheet .ig-bottom-note{display:none!important}
|
| 583 |
+
#reportSheet.infographic-sheet .ig-block,#reportSheet.infographic-sheet .ig-kpi-card{break-inside:avoid!important}
|
| 584 |
+
}
|
| 585 |
</style></head>
|
| 586 |
<body>
|
| 587 |
<div class="app">
|
|
|
|
| 663 |
</main>
|
| 664 |
</div>
|
| 665 |
<div id="reportOverlay" role="dialog" aria-modal="true" aria-label="Reakt Monitor rapport" aria-hidden="true">
|
| 666 |
+
<div class="report-actions"><span><strong>REAKT · ORCHESTRA INFOGRAPHIC</strong> — voorlopige managementrapportage, controle vereist</span><div><button id="reportDesignToggle" type="button" title="Vergelijk oude en nieuwe rapportagevormgeving">◧ Toon vorig ontwerp</button> <button id="reportClose" type="button">✕ Sluiten</button> <button id="reportPng" class="report-png" type="button">⬇ Download PNG</button> <button id="reportJpg" class="report-jpg" type="button">⬇ Download JPG</button> <button id="reportPrint" class="report-print" type="button">↓ Opslaan als PDF / Afdrukken</button></div></div>
|
| 667 |
<section id="reportSheet" aria-label="Witte Inloop Monitor"></section>
|
| 668 |
</div>
|
| 669 |
<script src="https://cdn.jsdelivr.net/npm/html2canvas@1.4.1/dist/html2canvas.min.js"></script>
|
|
|
|
| 1389 |
earliest:period.begin,latest:period.peildatum,issues:result.passConflicts+result.identityConflicts+result.unmatchedPasses,hasShadow:false,
|
| 1390 |
historyLoaded:result.historyLoaded,correctedExisting:result.correctedExisting,correctedJanuary:result.correctedJanuary};
|
| 1391 |
}
|
| 1392 |
+
function buildClassicWhiteReport(){
|
| 1393 |
const d=getReportData();if(!d)return;
|
| 1394 |
const range=d.earliest===d.latest?d.earliest:`${d.earliest} t/m ${d.latest}`;
|
| 1395 |
const avgDay=d.averageClientsPerDay.toLocaleString('nl-NL',{minimumFractionDigits:1,maximumFractionDigits:1});
|
|
|
|
| 1432 |
</div>
|
| 1433 |
<div class="report-foot"><span>Bron: scanregistratie 2026${d.historyLoaded?' en historisch referentiebestand 2025':''}. Rapportageperiode en peildatum staan bovenaan vermeld.</span></div>`;
|
| 1434 |
}
|
| 1435 |
+
|
| 1436 |
+
// INFOGRAPHIC v1: alle KPIs blijven afkomstig uit getReportData/calculateImported (V9).
|
| 1437 |
+
// Alleen extra groepsverdelingen worden uit dezelfde, lokaal gelezen scangegevens opgebouwd.
|
| 1438 |
+
let infographicUseClassic=false;
|
| 1439 |
+
function infographicExtra(d){
|
| 1440 |
+
const base=importedData.last,site=base.site,period=base.period;
|
| 1441 |
+
if(!site||site==='*')throw Error('Infographic is uitsluitend voor één gekozen locatie.');
|
| 1442 |
+
const periodRows=importedData.all.filter(r=>r.site===site&&r.date>=period.begin&&r.date<=period.peildatum);
|
| 1443 |
+
const datesByClient=new Map(),recentClientSet=new Set(),latestDates=new Set();
|
| 1444 |
+
for(const r of periodRows){
|
| 1445 |
+
if(!datesByClient.has(r.id))datesByClient.set(r.id,new Set());
|
| 1446 |
+
datesByClient.get(r.id).add(r.date);latestDates.add(r.date);
|
| 1447 |
+
if(r.date>=period.activeFrom)recentClientSet.add(r.id);
|
| 1448 |
+
}
|
| 1449 |
+
const frequency=[0,0,0,0];
|
| 1450 |
+
for(const days of datesByClient.values()){
|
| 1451 |
+
const n=days.size;frequency[n<=5?0:n<=20?1:n<=50?2:3]++;
|
| 1452 |
+
}
|
| 1453 |
+
const unique=datesByClient.size;
|
| 1454 |
+
const recent=[...recentClientSet].filter(id=>datesByClient.has(id)).length;
|
| 1455 |
+
// Deze aantallen mogen nooit afwijken van de bestaande kern-KPI's.
|
| 1456 |
+
if(unique!==d.unique||frequency.reduce((a,b)=>a+b,0)!==d.unique)throw Error('De aanvullende telling komt niet overeen met het unieke cliëntenaantal; infographic is niet gegenereerd.');
|
| 1457 |
+
const known=Math.max(0,d.unique-d.newIntake);
|
| 1458 |
+
return {frequency,recent,notRecent:unique-recent,known,activeDifference:recent!==d.active,daysWithScans:latestDates.size};
|
| 1459 |
+
}
|
| 1460 |
+
function igNL(n){return Number(n).toLocaleString('nl-NL')}
|
| 1461 |
+
function igMonthChart(months,prop,isNew){
|
| 1462 |
+
const monthNames=['jan','feb','mrt','apr','mei','jun','jul','aug','sep','okt','nov','dec'];
|
| 1463 |
+
const lookup=new Map(months.map(x=>[Number(x.key.slice(5))-1,Number(x[prop])||0]));
|
| 1464 |
+
const maximum=Math.max(1,...lookup.values());
|
| 1465 |
+
return `<div class="ig-month-bars${isNew?' ig-new-bars':''}" role="img" aria-label="${isNew?'Nieuwe cliënten':'Cliënten'} per maand">${monthNames.map((m,i)=>{
|
| 1466 |
+
const v=lookup.get(i),height=v===undefined||v===0?0:Math.max(4,Math.round(v/maximum*84));
|
| 1467 |
+
return `<div class="ig-month"><span class="ig-val">${v===undefined?'':igNL(v)}</span><span class="ig-bar" style="height:${height}px"></span><span class="ig-label">${m}</span></div>`;
|
| 1468 |
+
}).join('')}</div>`;
|
| 1469 |
+
}
|
| 1470 |
+
function igDonut(values,colors,label,inside){
|
| 1471 |
+
const sum=values.reduce((a,b)=>a+b,0);
|
| 1472 |
+
if(sum<=0)return '<div class="ig-donut-wrap"><div class="ig-donut-center"><strong>0</strong><small>cliënten</small></div></div>';
|
| 1473 |
+
const rad=54,circ=2*Math.PI*rad;let shift=0;
|
| 1474 |
+
const arcs=values.map((v,i)=>{
|
| 1475 |
+
const len=v/sum*circ,offset=shift;shift+=len;
|
| 1476 |
+
return `<circle cx="75" cy="75" r="${rad}" fill="none" stroke="${colors[i]}" stroke-width="20" stroke-dasharray="${Math.max(0,len-1)} ${circ}" stroke-dashoffset="${-offset}" transform="rotate(-90 75 75)"/>`;
|
| 1477 |
+
}).join('');
|
| 1478 |
+
return `<div class="ig-donut-wrap"><svg viewBox="0 0 150 150" role="img" aria-label="${escapeHTML(label)}"><circle cx="75" cy="75" r="${rad}" fill="none" stroke="#e9e6ef" stroke-width="20"/>${arcs}</svg><div class="ig-donut-center"><strong>${igNL(inside)}</strong><small>cliënten</small></div></div>`;
|
| 1479 |
+
}
|
| 1480 |
+
function buildInfographicReport(){
|
| 1481 |
+
const d=getReportData();if(!d)return;
|
| 1482 |
+
const extra=infographicExtra(d),avg=d.averageClientsPerDay.toLocaleString('nl-NL',{minimumFractionDigits:1,maximumFractionDigits:1});
|
| 1483 |
+
const freqColors=['#c7b2e6','#9778d2','#6c3ec0','#f17316'],freqNames=['1–5 dagen','6–20 dagen','21–50 dagen','Meer dan 50 dagen'];
|
| 1484 |
+
const freq=extra.frequency;
|
| 1485 |
+
const frequencyBar=`<div class="ig-frequency" role="img" aria-label="Frequentie van cliëntbezoeken: ${freq.map((n,i)=>`${freqNames[i]} ${n}`).join(', ')}">${freq.map((n,i)=>n?`<div class="ig-frequency-seg" style="background:${freqColors[i]};width:${n/d.unique*100}%">${n/d.unique>.085?igNL(n):''}</div>`:'').join('')}</div>`;
|
| 1486 |
+
const freqLegend=`<div class="ig-freq-legend">${freqNames.map((name,i)=>`<span class="ig-legend-entry"><i class="ig-legend-dot" style="background:${freqColors[i]}"></i>${name}: <b>${igNL(freq[i])}</b></span>`).join('')}</div>`;
|
| 1487 |
+
const activeWindow=`${readableDate(d.period.activeFrom)} t/m ${readableDate(d.period.peildatum)}`;
|
| 1488 |
+
const activeCaption=`Minimaal één scan tussen ${activeWindow}`;
|
| 1489 |
+
const knownLabel=d.historyLoaded?'al eerder bekend':'eerder geregistreerd';
|
| 1490 |
+
const historyMessage=d.historyLoaded?'Nieuw volgens de beschikbare historie.':'Zonder historie 2025 zijn de instroomcijfers voorlopig.';
|
| 1491 |
+
const recentNote=extra.activeDifference?'De peildatum-KPI telt ook cliënten buiten deze rapportageperiode; de cirkel toont uitsluitend cliënten uit deze periode.':'Geen recente scan betekent niet automatisch uitstroom.';
|
| 1492 |
+
const warnings=!d.historyLoaded?'<div class="ig-data-warning">Historie 2025 ontbreekt. De aantallen nieuwe cliënten zijn voorlopig.</div>':'';
|
| 1493 |
+
const badge=d.historyLoaded?'Bron: scanregistratie 2026 + historie 2025':'Bron: scanregistratie 2026 · historie 2025 ontbreekt';
|
| 1494 |
+
$('reportSheet').classList.remove('region-sheet');$('reportSheet').classList.add('infographic-sheet');
|
| 1495 |
+
$('reportSheet').innerHTML=`
|
| 1496 |
+
<div class="ig-head"><div class="ig-wordmark">Reakt<sup>PG</sup></div><div class="ig-head-right"><strong>REAKT / INLOOP ${escapeHTML(d.site.toUpperCase())}</strong>${escapeHTML(d.period.label)}<br>Peildatum ${readableDate(d.period.peildatum)}</div></div>
|
| 1497 |
+
<h1 class="ig-title">Inloop ${escapeHTML(d.site)} in beeld</h1>
|
| 1498 |
+
<div class="ig-subtitle">Bereik, nieuwe instroom en betrokkenheid</div>
|
| 1499 |
+
${warnings}
|
| 1500 |
+
<div class="ig-layout">
|
| 1501 |
+
<div class="ig-col"><div class="ig-kpi-card"><div class="ig-kpi-number ig-purple">${igNL(d.unique)}</div><div class="ig-kpi-label">unieke cliënten</div><div class="ig-kpi-help">minimaal één keer gescand in deze periode</div></div></div>
|
| 1502 |
+
<div class="ig-col ig-block ig-chart-block"><h2 class="ig-block-title">Aantal cliënten per maand</h2><div class="ig-block-help">Iedere cliënt telt één keer per maand, ook bij vaker komen.</div>${igMonthChart(d.months,'clients',false)}</div>
|
| 1503 |
+
<div class="ig-col ig-block"><h2 class="ig-block-title">Hoe vaak komen cliënten?</h2><div class="ig-block-help">De kleuren tonen op hoeveel dagen cliënten hebben gescand.</div>${frequencyBar}${freqLegend}</div>
|
| 1504 |
+
|
| 1505 |
+
<div class="ig-col"><div class="ig-small-kpis"><div class="ig-kpi-card"><div class="ig-kpi-number ig-green">${igNL(d.newIntake)}</div><div class="ig-kpi-label">nieuwe cliënten</div><div class="ig-kpi-help">eerste scan in deze periode</div></div><div class="ig-kpi-card"><div class="ig-kpi-number ig-purple">${igNL(d.active)}</div><div class="ig-kpi-label">actieve cliënten</div><div class="ig-kpi-help">${escapeHTML(activeCaption)}</div></div></div></div>
|
| 1506 |
+
<div class="ig-col ig-block"><h2 class="ig-block-title">Nieuwe en bekende cliënten</h2><div class="ig-block-help">Van de ${igNL(d.unique)} unieke cliënten</div><div class="ig-donut-row">${igDonut([d.newIntake,extra.known],['#29964a','#7134c6'],'Nieuwe en bekende cliënten',d.unique)}<div class="ig-donut-legend"><div class="ig-donut-legend-item"><span><i class="ig-legend-dot" style="background:#29964a"></i>nieuw</span><b>${igNL(d.newIntake)}</b></div><div class="ig-donut-legend-item"><span><i class="ig-legend-dot" style="background:#7134c6"></i>${escapeHTML(knownLabel)}</span><b>${igNL(extra.known)}</b></div></div></div><p class="ig-donut-note">${historyMessage}</p></div>
|
| 1507 |
+
<div class="ig-col ig-block"><h2 class="ig-block-title">Recent nog geweest</h2><div class="ig-block-help">Scan in de laatste drie maanden t/m ${readableDate(d.period.peildatum)}</div><div class="ig-donut-row">${igDonut([extra.recent,extra.notRecent],['#f17316','#c6b4e5'],'Recent en niet recent bezocht',d.unique)}<div class="ig-donut-legend"><div class="ig-donut-legend-item"><span><i class="ig-legend-dot" style="background:#f17316"></i>Wel een scan</span><b>${igNL(extra.recent)}</b></div><div class="ig-donut-legend-item"><span><i class="ig-legend-dot" style="background:#c6b4e5"></i>Geen recente scan</span><b>${igNL(extra.notRecent)}</b></div></div></div><p class="ig-donut-note">${escapeHTML(recentNote)}</p></div>
|
| 1508 |
+
|
| 1509 |
+
<div class="ig-col"><div class="ig-kpi-card"><div class="ig-kpi-number ig-orange">${avg}</div><div class="ig-kpi-label">gemiddeld aantal cliënten per dag</div><div class="ig-kpi-help">gemiddelde over ${igNL(d.daysWithScans)} dagen waarop is gescand</div></div></div>
|
| 1510 |
+
<div class="ig-col ig-block ig-chart-block"><h2 class="ig-block-title">Nieuwe cliënten per maand</h2><div class="ig-block-help">De maand van de eerste scan op deze locatie.</div>${igMonthChart(d.months,'newIntake',true)}</div>
|
| 1511 |
+
<div class="ig-col ig-block"><h2 class="ig-block-title">Zo leest u de cijfers</h2><div class="ig-explain"><b>Unieke cliënten</b>Iedere cliënt met minimaal één scan in deze periode telt één keer mee.<b>Nieuwe cliënten</b>De eerste scan op deze locatie valt in deze periode.<b>Nieuwe scanpas</b>Een nieuwe pas telt niet als nieuwe cliënt.</div></div>
|
| 1512 |
+
</div>
|
| 1513 |
+
<div class="ig-bottom-note"><span>${escapeHTML(badge)}</span><span>ORCHESTRA · lokaal berekend · cijfers controleren vóór externe verspreiding</span></div>`;
|
| 1514 |
+
}
|
| 1515 |
+
function buildWhiteReport(){
|
| 1516 |
+
const sheet=$('reportSheet');
|
| 1517 |
+
if(infographicUseClassic){sheet.classList.remove('infographic-sheet');buildClassicWhiteReport();}
|
| 1518 |
+
else buildInfographicReport();
|
| 1519 |
+
}
|
| 1520 |
+
|
| 1521 |
function openWhiteReport(){
|
| 1522 |
+
infographicUseClassic=false; $('reportDesignToggle').hidden=false; $('reportDesignToggle').textContent='◧ Toon vorig ontwerp';
|
| 1523 |
if(!importedData?.last){alert('Upload eerst een Excelbestand en rond de analyse af. Deze witte rapportage gebruikt geen verzonnen demo-KPI’s.');return;}
|
| 1524 |
if(importedData.last.site==='*'){alert('Kies eerst één locatie en voer daarna de analyse opnieuw uit. De witte monitor is in v0.8 een rapport per locatie.');return;}
|
| 1525 |
buildWhiteReport();$('reportOverlay').classList.add('open');$('reportOverlay').setAttribute('aria-hidden','false');document.body.classList.add('report-open');$('reportOverlay').scrollTop=0;
|
|
|
|
| 1560 |
}
|
| 1561 |
$('reportClose').addEventListener('click',closeWhiteReport);
|
| 1562 |
$('reportPrint').addEventListener('click',()=>window.print());
|
| 1563 |
+
$('reportDesignToggle').addEventListener('click',()=>{infographicUseClassic=!infographicUseClassic;buildWhiteReport();$('reportDesignToggle').textContent=infographicUseClassic?'◧ Toon infographic':'◧ Toon vorig ontwerp';});
|
| 1564 |
$('reportPng').addEventListener('click',()=>downloadReportImage('png'));
|
| 1565 |
$('reportJpg').addEventListener('click',()=>downloadReportImage('jpg'));
|
| 1566 |
document.addEventListener('keydown',e=>{if(e.key==='Escape'&&$('reportOverlay').classList.contains('open'))closeWhiteReport()});
|
|
|
|
| 1977 |
const cards=kpis.map(([label,noteValue,detail],i)=>`<div class="report-kpi ${cols[i]}"><div class="k-icon">${['♟','+','♙','▦'][i]}</div><div><div class="k-label">${label}</div><div class="k-num">${nf(noteValue)}</div><div class="k-sub">${escapeHTML(detail)}</div></div><div class="k-underline"></div></div>`).join('');
|
| 1978 |
const tableRows=d.locations.map(x=>`<tr><td>${escapeHTML(x.name)}${x.present?'':' *'}</td><td>${nf(x.unique)}</td><td>${nf(x.newIntake)}</td><td>${nf(x.active)}</td><td>${nf(x.visits)}</td></tr>`).join('');
|
| 1979 |
const avail=d.available;
|
| 1980 |
+
$('reportSheet').classList.remove('infographic-sheet');
|
| 1981 |
$('reportSheet').classList.add('region-sheet');
|
| 1982 |
$('reportSheet').innerHTML=`
|
| 1983 |
<div class="region-wordmark"><span class="region-reakt">Reakt</span><small>Werken aan je toekomst</small></div>
|
|
|
|
| 2005 |
`;
|
| 2006 |
}
|
| 2007 |
function openRegionReport(){
|
| 2008 |
+
$('reportDesignToggle').hidden=true;
|
| 2009 |
try{
|
| 2010 |
const d=regionReportData($('regionSelect').value);
|
| 2011 |
buildRegionReport(d);
|