Upload index.html
Browse files- index.html +117 -3
index.html
CHANGED
|
@@ -45,6 +45,31 @@
|
|
| 45 |
@media(max-width:1250px){.agent-step{font-size:9px}.pace-label{font-size:10px}}
|
| 46 |
@media(max-width:680px){.pace-label{flex-direction:column;align-items:start}.agent-steps{min-height:110px}}
|
| 47 |
@media(prefers-reduced-motion:reduce){.agent-step.current .step-mark{animation:none}}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 48 |
</style></head>
|
| 49 |
<body>
|
| 50 |
<div class="app">
|
|
@@ -77,11 +102,16 @@
|
|
| 77 |
<section class="panel logpanel"><div class="panel-heading"><div><span class="section-kicker">REAL-TIME PROCESS</span><h3>Agent activity log</h3></div><span class="subtle" id="logStatus">Stand-by</span></div><div class="logs" id="logs"><div class="logitem muted">◌ Klik op ‘Start demo-analyse’ om de workflow te bekijken.</div></div></section>
|
| 78 |
</div>
|
| 79 |
<aside class="right-content"><section class="panel chatpanel"><div class="panel-heading"><div><span class="section-kicker">MANAGEMENT ASSISTENT</span><h3><span class="chat-icon">✧</span> Vraag het aan Inloop AI</h3></div><span class="demo-badge">DEMO</span></div><div class="chat-messages" id="messages"><div class="message assistant"><small>INLOOP AI · DEMONSTRATIE</small><p>Welkom! Start de demo-analyse en stel daarna een vraag over de fictieve locatiecijfers.</p></div></div><div class="quick-questions"><button data-q="Welke locatie groeit het sterkst?">Grootste groei?</button><button data-q="Zijn de cijfers gevalideerd?">Validatiestatus?</button><button data-q="Maak een managementsamenvatting">Samenvatting?</button></div><form id="chatForm" class="chat-form"><input id="chatInput" autocomplete="off" placeholder="Stel een vraag over de demo..." aria-label="Vraag aan Inloop AI"><button aria-label="Verstuur vraag">➤</button></form><div class="chat-disclaimer">Vooraf ingestelde demo-antwoorden · geen echte AI</div></section>
|
| 80 |
-
<section class="panel preview"><div class="panel-heading"><div><span class="section-kicker">OUTPUT</span><h3>Infographic preview</h3></div><span class="warn-label">CONCEPT</span></div><div class="paper"><div class="paper-top"><strong>REAKT<span>.</span></strong><small>INLOOPMONITOR / Q3 2026</small></div><h4>Inloop in beeld</h4><p>Illustratieve managementrapportage</p><div class="paper-kpis"><div><strong>12.480</strong><small>Bezoeken</small></div><div><strong>1.286</strong><small>Uniek</small></div><div><strong>164</strong><small>Instroom</small></div></div><div class="paper-bars"><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i></div><div class="paper-watermark">FICTIEVE DATA · NIET GEVALIDEERD</div></div><button class="export" id="exportBtn">
|
| 81 |
</div>
|
| 82 |
<footer>REAKT INLOOP INTELLIGENCE <span>ORCHESTRA PROTOTYPE · ALLEEN FICTIEVE TESTGEGEVENS · GEEN PRODUCTIEOMGEVING</span></footer>
|
| 83 |
</main>
|
| 84 |
-
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 85 |
<script>
|
| 86 |
window.addEventListener('error', function(event){
|
| 87 |
var status=document.getElementById('flowState');
|
|
@@ -383,7 +413,91 @@ reply=function(q){
|
|
| 383 |
return 'De AI-API is nog niet gekoppeld. Ik kan voorlopig alleen de gecontroleerde basisgetallen van het fictieve Excel-testbestand toelichten.';
|
| 384 |
};
|
| 385 |
|
| 386 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 387 |
Promise.resolve({ok:true,json:async()=>JSON.parse(document.getElementById('orchestra-demo-data').textContent)}).then(r=>r.json()).then(d=>{demoData=d;renderKPIs(d);renderChecks(d);drawChart(d)}).catch(()=>log('Demo-gegevens konden niet worden geladen'));
|
| 388 |
|
| 389 |
</script></body></html>
|
|
|
|
| 45 |
@media(max-width:1250px){.agent-step{font-size:9px}.pace-label{font-size:10px}}
|
| 46 |
@media(max-width:680px){.pace-label{flex-direction:column;align-items:start}.agent-steps{min-height:110px}}
|
| 47 |
@media(prefers-reduced-motion:reduce){.agent-step.current .step-mark{animation:none}}
|
| 48 |
+
|
| 49 |
+
/* V0.8: Witte vaste rapportlay-out, gescheiden van de ORCHESTRA-werkruimte. */
|
| 50 |
+
#reportOverlay{position:fixed;inset:0;background:#050b19eF;z-index:5000;overflow:auto;padding:22px;display:none}
|
| 51 |
+
#reportOverlay.open{display:block}body.report-open{overflow:hidden}
|
| 52 |
+
.report-actions{max-width:1510px;margin:0 auto 14px;display:flex;justify-content:space-between;gap:12px;align-items:center;color:#eaf2ff;font-size:14px}
|
| 53 |
+
.report-actions button{background:#1e497f;border:1px solid #4c7bad;padding:11px 18px}.report-actions .report-print{background:#146bd8}
|
| 54 |
+
#reportSheet{width:min(100%,1510px);margin:auto;background:white;color:#0a164a;font-family:'Segoe UI',Arial,sans-serif;padding:25px 28px 17px;box-shadow:0 22px 65px #0009;line-height:1.24}
|
| 55 |
+
#reportSheet *{box-sizing:border-box}#reportSheet .report-brand{color:#fa5a0a;font-size:33px;font-weight:850;letter-spacing:-1.5px;line-height:1;margin-bottom:11px}#reportSheet .report-brand sup{font-size:11px;color:#1596c8;letter-spacing:0;margin-left:2px}
|
| 56 |
+
.report-heading{display:flex;justify-content:space-between;align-items:center;gap:18px;margin-bottom:14px}.report-heading h1{font-size:32px;margin:0;color:#0b164d;letter-spacing:-1.1px}.report-heading p{font-size:16px;margin:3px 0 0;color:#29335f}
|
| 57 |
+
.report-meta{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;min-width:48%}.report-meta>div{border:1px solid #dce2ef;border-radius:7px;padding:10px 13px;display:flex;align-items:center;gap:11px;min-width:0}.report-meta .meta-icon{font-size:23px;color:#20116c}.report-meta strong{font-size:11px;display:block}.report-meta span{font-size:12px}
|
| 58 |
+
.report-kpi-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin:12px 0}.report-kpi{border:1px solid #e0e5ef;border-radius:8px;min-height:136px;padding:13px 12px;display:grid;grid-template-columns:54px 1fr;column-gap:12px;position:relative;overflow:hidden}.report-kpi .k-icon{width:52px;height:52px;border-radius:50%;display:grid;place-items:center;color:white;font-size:26px;font-weight:700}.report-kpi .k-label{font-size:14px;font-weight:750;margin-top:1px}.report-kpi .k-num{font-size:32px;font-weight:850;margin:7px 0 2px;color:#0b164d;white-space:nowrap}.report-kpi .k-sub{font-size:11px;color:#333f65;line-height:1.33}.report-kpi.purple .k-icon{background:linear-gradient(140deg,#863eec,#4c24bc)}.report-kpi.green .k-icon{background:linear-gradient(140deg,#50c52d,#168c24)}.report-kpi.orange .k-icon{background:linear-gradient(140deg,#fe8c20,#ff4d00)}.report-kpi.purple .k-label{color:#5b20d6}.report-kpi.green .k-label{color:#219824}.report-kpi.orange .k-label{color:#f45c0b}.report-kpi .k-underline{position:absolute;bottom:0;left:0;right:0;height:5px;background:linear-gradient(90deg,transparent,#ded6ff,transparent)}
|
| 59 |
+
.report-chart-grid{display:grid;grid-template-columns:1fr 1fr 1.13fr;gap:10px}.report-panel{border:1px solid #e1e5ef;border-radius:8px;padding:12px 14px;min-width:0;background:white}.report-panel h2{font-size:15px;margin:0 0 9px;color:#11176b}.report-panel h2 small{font-weight:400;font-size:11px}.report-panel .chart-box{height:172px;display:flex;align-items:stretch;min-width:0}
|
| 60 |
+
.report-chart-grid .report-panel{min-height:224px}.report-bottom-grid{display:grid;grid-template-columns:1fr 1.1fr 1.08fr;gap:10px;margin-top:10px}.report-bottom-grid .report-panel{min-height:216px}
|
| 61 |
+
.report-mini-table{width:100%;border-collapse:collapse;font-size:11px;text-align:center}.report-mini-table th{background:#f6f7fd;padding:10px 4px;color:#10166b;border:1px solid #e7eafa;font-weight:700}.report-mini-table td{padding:11px 3px;border-bottom:1px solid #f0f1f7}.report-mini-table .total td{font-weight:750;background:#f5f2ff;color:#5c20da}.report-mini-table td:first-child{text-align:left}
|
| 62 |
+
.report-intensity-row{display:flex;align-items:center;gap:9px;font-size:11px;margin:9px 0}.report-intensity-row .int-label{width:99px;flex:none}.report-intensity-row .int-bar-track{flex:1;height:19px;background:#f7f4ff}.report-intensity-row .int-bar{height:100%;background:linear-gradient(90deg,#7037c7,#a46ce6)}.report-intensity-row strong{width:25px}.report-intensity-summary{margin-top:9px;padding:8px;background:#f8f9fe;font-size:12px;color:#0a165a;display:flex;gap:14px;justify-content:space-between}.report-intensity-summary strong{font-size:17px}
|
| 63 |
+
.report-analysis{font-size:12px;line-height:1.45;color:#263254}.report-analysis p{margin:0 0 9px}.report-foot{margin-top:12px;font-size:10px;color:#53638e;display:flex;justify-content:space-between;gap:12px;border-top:1px solid #e6eafa;padding-top:9px}.report-provisional{color:#8f3c12;font-weight:700}.report-no-data{display:flex;align-items:center;justify-content:center;text-align:center;color:#697497;font-size:12px;border:1px dashed #e4e7f2;width:100%;height:100%;padding:15px}
|
| 64 |
+
.report-preview-trigger{width:100%;margin-top:9px;border:1px solid #536de4;background:linear-gradient(110deg,#203f8c,#663dc2);padding:12px 8px;color:white}
|
| 65 |
+
@media(max-width:1100px){.report-heading{display:block}.report-meta{margin-top:12px}.report-chart-grid,.report-bottom-grid{grid-template-columns:1fr}.report-kpi-grid{grid-template-columns:repeat(2,1fr)}}
|
| 66 |
+
@media print{
|
| 67 |
+
@page{size:A3 landscape;margin:6mm}
|
| 68 |
+
html,body{background:white!important;margin:0!important;padding:0!important;height:auto!important;overflow:visible!important}
|
| 69 |
+
body>.app{display:none!important}#reportOverlay{display:block!important;position:static!important;background:white!important;padding:0!important;margin:0!important;overflow:visible!important}
|
| 70 |
+
.report-actions{display:none!important}#reportSheet{box-shadow:none!important;width:100%!important;max-width:none!important;margin:0!important;padding:0!important;zoom:.94;print-color-adjust:exact;-webkit-print-color-adjust:exact}
|
| 71 |
+
.report-panel,.report-kpi{break-inside:avoid}.report-chart-grid,.report-bottom-grid{break-inside:avoid}
|
| 72 |
+
}
|
| 73 |
</style></head>
|
| 74 |
<body>
|
| 75 |
<div class="app">
|
|
|
|
| 102 |
<section class="panel logpanel"><div class="panel-heading"><div><span class="section-kicker">REAL-TIME PROCESS</span><h3>Agent activity log</h3></div><span class="subtle" id="logStatus">Stand-by</span></div><div class="logs" id="logs"><div class="logitem muted">◌ Klik op ‘Start demo-analyse’ om de workflow te bekijken.</div></div></section>
|
| 103 |
</div>
|
| 104 |
<aside class="right-content"><section class="panel chatpanel"><div class="panel-heading"><div><span class="section-kicker">MANAGEMENT ASSISTENT</span><h3><span class="chat-icon">✧</span> Vraag het aan Inloop AI</h3></div><span class="demo-badge">DEMO</span></div><div class="chat-messages" id="messages"><div class="message assistant"><small>INLOOP AI · DEMONSTRATIE</small><p>Welkom! Start de demo-analyse en stel daarna een vraag over de fictieve locatiecijfers.</p></div></div><div class="quick-questions"><button data-q="Welke locatie groeit het sterkst?">Grootste groei?</button><button data-q="Zijn de cijfers gevalideerd?">Validatiestatus?</button><button data-q="Maak een managementsamenvatting">Samenvatting?</button></div><form id="chatForm" class="chat-form"><input id="chatInput" autocomplete="off" placeholder="Stel een vraag over de demo..." aria-label="Vraag aan Inloop AI"><button aria-label="Verstuur vraag">➤</button></form><div class="chat-disclaimer">Vooraf ingestelde demo-antwoorden · geen echte AI</div></section>
|
| 105 |
+
<section class="panel preview"><div class="panel-heading"><div><span class="section-kicker">OUTPUT</span><h3>Infographic preview</h3></div><span class="warn-label">CONCEPT</span></div><div class="paper"><div class="paper-top"><strong>REAKT<span>.</span></strong><small>INLOOPMONITOR / Q3 2026</small></div><h4>Inloop in beeld</h4><p>Illustratieve managementrapportage</p><div class="paper-kpis"><div><strong>12.480</strong><small>Bezoeken</small></div><div><strong>1.286</strong><small>Uniek</small></div><div><strong>164</strong><small>Instroom</small></div></div><div class="paper-bars"><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i></div><div class="paper-watermark">FICTIEVE DATA · NIET GEVALIDEERD</div></div><button class="export" id="exportBtn">▣ Open witte Reakt-monitor</button></section></aside>
|
| 106 |
</div>
|
| 107 |
<footer>REAKT INLOOP INTELLIGENCE <span>ORCHESTRA PROTOTYPE · ALLEEN FICTIEVE TESTGEGEVENS · GEEN PRODUCTIEOMGEVING</span></footer>
|
| 108 |
</main>
|
| 109 |
+
</div>
|
| 110 |
+
<div id="reportOverlay" role="dialog" aria-modal="true" aria-label="Reakt Monitor rapport" aria-hidden="true">
|
| 111 |
+
<div class="report-actions"><span><strong>REAKT · Rapportvoorvertoning v0.8</strong> — uitsluitend fictieve testgegevens</span><div><button id="reportClose" type="button">✕ Sluiten</button> <button id="reportPrint" class="report-print" type="button">↓ Opslaan als PDF / Afdrukken</button></div></div>
|
| 112 |
+
<section id="reportSheet" aria-label="Witte Inloop Monitor"></section>
|
| 113 |
+
</div>
|
| 114 |
+
<script type="application/json" id="orchestra-demo-data">{"mode": "DEMO", "period": "Q3 2026 · fictief", "kpis": [{"label": "Bezoeken", "value": "12.480", "change": "+8,4%"}, {"label": "Unieke bezoekers", "value": "1.286", "change": "+3,2%"}, {"label": "Nieuwe instroom", "value": "164", "change": "+5,1%"}, {"label": "Verificatie", "value": "4 / 5", "change": "1 afwijking"}], "locations": [{"name": "Soeda", "visits": [350, 395, 428], "unique": 121}, {"name": "Rietdijk", "visits": [285, 305, 334], "unique": 108}, {"name": "Vredehof", "visits": [245, 268, 294], "unique": 93}, {"name": "Gouda", "visits": [320, 343, 365], "unique": 115}], "checks": [{"label": "Bezoeken", "ours": 2845, "shadow": 2845}, {"label": "Unieke bezoekers", "ours": 386, "shadow": 381}, {"label": "Nieuwe instroom", "ours": 42, "shadow": 42}, {"label": "Bezoeken vorig jaar", "ours": 2610, "shadow": 2610}, {"label": "Actieve locaties", "ours": 4, "shadow": 4}], "steps": [{"agent": "data", "text": "Demo-gegevens ingelezen en structuur gecontroleerd"}, {"agent": "analysis", "text": "Maandtrends en locatievergelijkingen berekend"}, {"agent": "insight", "text": "Opvallende ontwikkelingen samengevat (demo)"}, {"agent": "verify", "text": "Schaduwberekeningen vergeleken: 1 afwijking"}, {"agent": "report", "text": "Conceptinfographic voorbereid · NIET GEVALIDEERD"}]}</script>
|
| 115 |
<script>
|
| 116 |
window.addEventListener('error', function(event){
|
| 117 |
var status=document.getElementById('flowState');
|
|
|
|
| 413 |
return 'De AI-API is nog niet gekoppeld. Ik kan voorlopig alleen de gecontroleerde basisgetallen van het fictieve Excel-testbestand toelichten.';
|
| 414 |
};
|
| 415 |
|
| 416 |
+
|
| 417 |
+
// v0.8 — rapport wordt opgebouwd uit lokaal berekende, geaggregeerde testgegevens.
|
| 418 |
+
// Er is geen LLM, er wordt niet geüpload en ontbrekende velden worden NIET ingevuld.
|
| 419 |
+
const reportNL=n=>Number(n).toLocaleString('nl-NL');
|
| 420 |
+
function reportChartBars(names,values,color='#7935cf',asWeek=false){
|
| 421 |
+
const W=440,H=195,left=38,right=12,top=17,bottom=31,max=Math.max(1,...values);
|
| 422 |
+
let out=`<svg viewBox="0 0 ${W} ${H}" width="100%" height="100%" role="img" aria-label="Staafgrafiek">`;
|
| 423 |
+
for(let i=0;i<=4;i++){let y=top+(H-top-bottom)*i/4;out+=`<line x1="${left}" y1="${y}" x2="${W-right}" y2="${y}" stroke="#e6e8f2" stroke-width="1"/>`}
|
| 424 |
+
const band=(W-left-right)/Math.max(1,names.length),bar=Math.min(38,band*.7);
|
| 425 |
+
values.forEach((v,i)=>{const bh=(H-top-bottom-10)*v/max,x=left+band*i+(band-bar)/2,y=H-bottom-bh;
|
| 426 |
+
out+=`<rect x="${x}" y="${y}" width="${bar}" height="${Math.max(bh,0)}" fill="${color}"/><text x="${x+bar/2}" y="${Math.max(10,y-5)}" text-anchor="middle" fill="#18116b" font-size="${asWeek?10:12}" font-weight="700">${v}</text><text x="${x+bar/2}" y="${H-11}" text-anchor="middle" fill="#1f2a56" font-size="${asWeek?8:11}">${escapeHTML(names[i])}</text>`});
|
| 427 |
+
return out+'</svg>';
|
| 428 |
+
}
|
| 429 |
+
function reportChartLine(names,values){
|
| 430 |
+
if(!values.length)return '<div class="report-no-data">Geen gegevens beschikbaar</div>';
|
| 431 |
+
const W=440,H=195,L=40,T=24,B=34,R=15,max=Math.max(1,...values)*1.16,span=W-L-R;
|
| 432 |
+
let out=`<svg viewBox="0 0 ${W} ${H}" width="100%" height="100%" role="img" aria-label="Lijngrafiek">`;
|
| 433 |
+
for(let i=0;i<=4;i++){const y=T+(H-T-B)*i/4;out+=`<line x1="${L}" y1="${y}" x2="${W-R}" y2="${y}" stroke="#e5e8f2"/><text x="7" y="${y+4}" font-size="10" fill="#3e4771">${Math.round(max*(4-i)/4)}</text>`}
|
| 434 |
+
const dots=values.map((v,i)=>[L+(values.length===1?span/2:span*i/(values.length-1)),H-B-v/max*(H-T-B-7)]);
|
| 435 |
+
out+=`<polyline fill="none" stroke="#6630dc" stroke-width="3" points="${dots.map(p=>p.join(',')).join(' ')}"/>`;
|
| 436 |
+
dots.forEach(([x,y],i)=>{out+=`<circle cx="${x}" cy="${y}" r="4" fill="#6630dc"/><text x="${x}" y="${Math.max(11,y-10)}" font-size="11" font-weight="700" text-anchor="middle" fill="#5a22cb">${values[i]}</text><text x="${x}" y="${H-9}" text-anchor="middle" font-size="10" fill="#1d255e">${escapeHTML(names[i])}</text>`});
|
| 437 |
+
return out+'</svg>';
|
| 438 |
+
}
|
| 439 |
+
function getReportData(){
|
| 440 |
+
if(!importedData?.last) return null;
|
| 441 |
+
const sel=importedData.last.site,rows=importedData.all.filter(r=>sel==='*'||r.site===sel),unique=new Map(),days=new Set(),byMonth=new Map(),byWeek=[0,0,0,0,0,0,0],byDate=new Map();
|
| 442 |
+
rows.forEach(r=>{const key=r.site+'|'+r.id+'|'+r.date;if(days.has(key))return;days.add(key);
|
| 443 |
+
const mk=r.date.slice(0,7);byMonth.set(mk,(byMonth.get(mk)||0)+1);
|
| 444 |
+
const wk=new Date(r.date+'T12:00:00Z').getUTCDay();byWeek[(wk+6)%7]++;
|
| 445 |
+
const ck=r.id;if(!unique.has(ck))unique.set(ck,new Set());unique.get(ck).add(r.date);
|
| 446 |
+
});
|
| 447 |
+
const months=[...byMonth.keys()].sort();const intensities=[0,0,0,0,0],counts=[...unique.values()].map(d=>d.size);
|
| 448 |
+
counts.forEach(c=>{intensities[c<=5?0:c<=20?1:c<=50?2:c<=100?3:4]++});
|
| 449 |
+
const sorted=[...counts].sort((a,b)=>a-b),median=sorted.length?(sorted.length%2?sorted[(sorted.length-1)/2]:(sorted[sorted.length/2-1]+sorted[sorted.length/2])/2):0;
|
| 450 |
+
return {site:sel==='*'?'Alle locaties':sel,monthKeys:months,months:months.map(m=>({key:m,label:['jan','feb','mrt','apr','mei','jun','jul','aug','sep','okt','nov','dec'][Number(m.slice(5))-1],visits:byMonth.get(m)})),byWeek,intensities,
|
| 451 |
+
visits:days.size,unique:unique.size,average:unique.size?days.size/unique.size:0,median,maxDays:Math.max(0,...counts),
|
| 452 |
+
earliest:rows.map(r=>r.date).sort()[0],latest:rows.map(r=>r.date).sort().at(-1),
|
| 453 |
+
issues:importedData.last.passConflicts+importedData.last.identityConflicts+importedData.last.unmatchedPasses,hasShadow:false};
|
| 454 |
+
}
|
| 455 |
+
function buildWhiteReport(){
|
| 456 |
+
const d=getReportData();if(!d)return;
|
| 457 |
+
const range=d.earliest===d.latest?d.earliest:`${d.earliest} t/m ${d.latest}`;
|
| 458 |
+
const avg=d.average.toLocaleString('nl-NL',{minimumFractionDigits:1,maximumFractionDigits:1});
|
| 459 |
+
const missing='Niet beschikbaar';
|
| 460 |
+
const mon=d.months.map(m=>m.label),values=d.months.map(m=>m.visits),week=['Ma','Di','Wo','Do','Vr','Za','Zo'];
|
| 461 |
+
const weekdayMax=Math.max(...d.byWeek),weekdayMin=Math.min(...d.byWeek),busiest=week[d.byWeek.indexOf(weekdayMax)],quietest=week[d.byWeek.indexOf(weekdayMin)];
|
| 462 |
+
const summary=[`In de geselecteerde periode registreerde de proefmonitor ${reportNL(d.unique)} unieke cliëntnummers en ${reportNL(d.visits)} unieke bezoekdagen voor ${escapeHTML(d.site)}.`,
|
| 463 |
+
`De gemiddelde bezoekintensiteit bedraagt ${avg} bezoekdagen per cliëntnummer; de mediaan is ${String(d.median).replace('.',',')}.`,
|
| 464 |
+
`De meeste bezoekdagen vallen op ${busiest} (${reportNL(weekdayMax)}) en de minste op ${quietest} (${reportNL(weekdayMin)}).`,
|
| 465 |
+
`Nieuwe instroom en actieve deelnemers zijn nog niet vast te stellen uit deze proefberekening. De cijfers zijn niet onafhankelijk gevalideerd.`];
|
| 466 |
+
const kpis=[{klass:'purple',icon:'♟',label:'Unieke bezoekers',value:reportNL(d.unique),sub:'Unieke cliëntnummers binnen de geselecteerde periode'},
|
| 467 |
+
{klass:'green',icon:'+',label:'Nieuwe instroom',value:'—',sub:'Startdatum nog niet verwerkt; niet beschikbaar'},
|
| 468 |
+
{klass:'purple',icon:'♙',label:'Actieve deelnemers',value:'—',sub:'Einddatum / actieve status niet vastgesteld'},
|
| 469 |
+
{klass:'orange',icon:'▦',label:'Unieke bezoekdagen',value:reportNL(d.visits),sub:'Eén cliëntnummer per locatie per kalenderdag'}];
|
| 470 |
+
const kpiHTML=kpis.map(k=>`<div class="report-kpi ${k.klass}"><div class="k-icon">${k.icon}</div><div><div class="k-label">${k.label}</div><div class="k-num">${k.value}</div><div class="k-sub">${k.sub}</div></div><div class="k-underline"></div></div>`).join('');
|
| 471 |
+
const maxI=Math.max(1,...d.intensities),ilabels=['1 – 5 dagen','6 – 20 dagen','21 – 50 dagen','51 – 100 dagen','101 dagen of meer'];
|
| 472 |
+
const itHTML=d.intensities.map((c,i)=>`<div class="report-intensity-row"><span class="int-label">${ilabels[i]}</span><div class="int-bar-track"><div class="int-bar" style="width:${c/maxI*100}%"></div></div><strong>${c}</strong></div>`).join('');
|
| 473 |
+
$('reportSheet').innerHTML=`
|
| 474 |
+
<div class="report-brand">Reakt<sup>PG</sup></div>
|
| 475 |
+
<div class="report-heading"><div><h1>Reakt Inloop Monitor ${escapeHTML(d.site)}</h1><p>Inzicht in bereik, betrokkenheid en bezoekpatronen</p></div>
|
| 476 |
+
<div class="report-meta"><div><b class="meta-icon">▦</b><span><strong>Periode</strong>${escapeHTML(range)}</span></div><div><b class="meta-icon">⌖</b><span><strong>Locatie</strong>${escapeHTML(d.site)}</span></div><div><b class="meta-icon">↻</b><span><strong>Peildatum</strong>${escapeHTML(d.latest)}</span></div></div></div>
|
| 477 |
+
<div class="report-kpi-grid">${kpiHTML}</div>
|
| 478 |
+
<div class="report-chart-grid">
|
| 479 |
+
<section class="report-panel"><h2>Instroom per maand <small>(nieuwe deelnemers)</small></h2><div class="chart-box"><div class="report-no-data">${missing}<br>Startdatums ontbreken in deze proef</div></div></section>
|
| 480 |
+
<section class="report-panel"><h2>Unieke bezoekdagen per maand</h2><div class="chart-box">${reportChartLine(mon,values)}</div></section>
|
| 481 |
+
<section class="report-panel"><h2>Bezoekdagen per weekdag</h2><div class="chart-box">${reportChartBars(week,d.byWeek,'#ff6410',true)}</div></section>
|
| 482 |
+
</div>
|
| 483 |
+
<div class="report-bottom-grid">
|
| 484 |
+
<section class="report-panel"><h2>Kerncijfers locatie</h2><table class="report-mini-table"><thead><tr><th>Locatie</th><th>Unieke bezoekers</th><th>Unieke bezoekdagen</th><th>Gem. dagen / bezoeker</th></tr></thead><tbody><tr><td>⌖ ${escapeHTML(d.site)}</td><td>${reportNL(d.unique)}</td><td>${reportNL(d.visits)}</td><td>${avg}</td></tr><tr class="total"><td>Totaal / gemiddelde</td><td>${reportNL(d.unique)}</td><td>${reportNL(d.visits)}</td><td>${avg}</td></tr></tbody></table></section>
|
| 485 |
+
<section class="report-panel"><h2>Bezoekintensiteit <small>(unieke bezoekdagen per cliëntnummer)</small></h2>${itHTML}<div class="report-intensity-summary"><span>Gemiddeld<br><strong>${avg}</strong></span><span>Mediaan<br><strong>${String(d.median).replace('.',',')}</strong></span><span>Hoogste aantal dagen<br><strong>${d.maxDays}</strong></span></div></section>
|
| 486 |
+
<section class="report-panel"><h2>Managementanalyse</h2><div class="report-analysis">${summary.map(t=>`<p>${t}</p>`).join('')}</div></section>
|
| 487 |
+
</div>
|
| 488 |
+
<div class="report-foot"><span>Bron: Fictieve Reakt-scanregistratie · Definities: één cliëntnummer per locatie per dag telt als één bezoekdag</span><span class="report-provisional">FICTIEVE TESTGEGEVENS · NIET GEVALIDEERD · NIET PUBLICEREN</span></div>`;
|
| 489 |
+
}
|
| 490 |
+
function openWhiteReport(){
|
| 491 |
+
if(!importedData?.last){alert('Upload eerst het fictieve Excel-testbestand en rond de analyse af. Deze witte rapportage gebruikt geen verzonnen demo-KPI’s.');return;}
|
| 492 |
+
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;}
|
| 493 |
+
buildWhiteReport();$('reportOverlay').classList.add('open');$('reportOverlay').setAttribute('aria-hidden','false');document.body.classList.add('report-open');$('reportOverlay').scrollTop=0;
|
| 494 |
+
}
|
| 495 |
+
function closeWhiteReport(){$('reportOverlay').classList.remove('open');$('reportOverlay').setAttribute('aria-hidden','true');document.body.classList.remove('report-open')}
|
| 496 |
+
$('reportClose').addEventListener('click',closeWhiteReport);
|
| 497 |
+
$('reportPrint').addEventListener('click',()=>window.print());
|
| 498 |
+
document.addEventListener('keydown',e=>{if(e.key==='Escape'&&$('reportOverlay').classList.contains('open'))closeWhiteReport()});
|
| 499 |
+
|
| 500 |
+
$('startBtn').addEventListener('click',start);$('resetBtn').addEventListener('click',reset);$('chatForm').addEventListener('submit',e=>{e.preventDefault();const q=$('chatInput').value;$('chatInput').value='';ask(q)});document.querySelectorAll('[data-q]').forEach(b=>b.addEventListener('click',()=>ask(b.dataset.q)));$('exportBtn').addEventListener('click',openWhiteReport);
|
| 501 |
Promise.resolve({ok:true,json:async()=>JSON.parse(document.getElementById('orchestra-demo-data').textContent)}).then(r=>r.json()).then(d=>{demoData=d;renderKPIs(d);renderChecks(d);drawChart(d)}).catch(()=>log('Demo-gegevens konden niet worden geladen'));
|
| 502 |
|
| 503 |
</script></body></html>
|