Upload index.html
Browse files- index.html +21 -13
index.html
CHANGED
|
@@ -436,7 +436,7 @@
|
|
| 436 |
.inline-chart-card{border:1px solid #355374;border-radius:10px;background:linear-gradient(145deg,#132944,#102036);padding:12px;min-width:0}
|
| 437 |
.inline-chart-card h4{font-size:12px;line-height:1.35;color:#e7f4ff;margin:0 0 10px;font-weight:750}
|
| 438 |
.inline-chart-card h4 small{font-size:10px;font-weight:400;color:#a8bcd3}
|
| 439 |
-
.inline-chart-svg{height:188px;background:#
|
| 440 |
.inline-chart-svg svg{display:block;width:100%;height:100%}
|
| 441 |
.inline-chart-empty{border:1px dashed #385473;border-radius:9px;color:#9fb8d4;font-size:11px;line-height:1.5;padding:15px}
|
| 442 |
.inline-chart-foot{color:#8eaaca;font-size:10px;line-height:1.4;margin-top:10px}
|
|
@@ -1159,31 +1159,39 @@ reply=function(q){
|
|
| 1159 |
// v0.8 — rapport wordt opgebouwd uit lokaal berekende, geaggregeerde testgegevens.
|
| 1160 |
// Er is geen LLM, er wordt niet geüpload en ontbrekende velden worden NIET ingevuld.
|
| 1161 |
const reportNL=n=>Number(n).toLocaleString('nl-NL');
|
| 1162 |
-
function reportChartBars(names,values,color='#7935cf',asWeek=false){
|
| 1163 |
const W=440,H=195,left=38,right=12,top=17,bottom=31,max=Math.max(1,...values);
|
| 1164 |
-
|
| 1165 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1166 |
const band=(W-left-right)/Math.max(1,names.length),bar=Math.min(38,band*.7);
|
| 1167 |
values.forEach((v,i)=>{const bh=(H-top-bottom-10)*v/max,x=left+band*i+(band-bar)/2,y=H-bottom-bh;
|
| 1168 |
-
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="
|
| 1169 |
return out+'</svg>';
|
| 1170 |
}
|
| 1171 |
-
function reportChartClientMonth(names,values){
|
| 1172 |
// Alleen presentatie: dezelfde berekende maandwaarden; iedere cliënt eenmaal per maand.
|
| 1173 |
const W=480,H=220,left=24,right=9,top=19,bottom=34;
|
| 1174 |
const max=Math.max(1,...values),span=H-top-bottom;
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1175 |
const band=(W-left-right)/Math.max(1,names.length),bar=Math.min(46,band*.82);
|
| 1176 |
-
let out=`<svg viewBox="0 0 ${W} ${H}" width="100%" height="100%" role="img" aria-label="Aantal unieke cliënten per maand">`;
|
| 1177 |
for(let i=0;i<=4;i++){
|
| 1178 |
const y=top+span*i/4;
|
| 1179 |
-
out+=`<line x1="${left}" y1="${y}" x2="${W-right}" y2="${y}" stroke="
|
| 1180 |
}
|
| 1181 |
values.forEach((v,i)=>{
|
| 1182 |
const height=(span-15)*v/max;
|
| 1183 |
const x=left+band*i+(band-bar)/2,y=H-bottom-height;
|
| 1184 |
out+=`<rect x="${x}" y="${y}" width="${bar}" height="${Math.max(0,height)}" fill="#763fc7" rx="1.8"/>`;
|
| 1185 |
-
out+=`<text x="${x+bar/2}" y="${Math.max(13,y-6)}" text-anchor="middle" fill="
|
| 1186 |
-
out+=`<text x="${x+bar/2}" y="${H-11}" text-anchor="middle" fill="
|
| 1187 |
});
|
| 1188 |
return out+'</svg>';
|
| 1189 |
}
|
|
@@ -1205,9 +1213,9 @@ function renderInlineReportCharts(){
|
|
| 1205 |
if(!data){host.innerHTML='<div class="inline-chart-empty">Analyseer eerst een Excelbestand om de bestaande rapportagegrafieken te zien.</div>';return;}
|
| 1206 |
const labels=data.months.map(m=>m.label);
|
| 1207 |
const specs=[
|
| 1208 |
-
['Nieuwe instroom per maand','Eerste geregistreerde scan op locatie',reportChartBars(labels,data.months.map(m=>m.newIntake),'#
|
| 1209 |
-
['Bezoekdagen per weekdag','Unieke cliënt-/locatie-/bezoekdagen',reportChartBars(['Ma','Di','Wo','Do','Vr','Za','Zo'],data.byWeek,'#
|
| 1210 |
-
['Aantal cliënten per maand','Iedere cliënt maximaal één keer per maand',reportChartClientMonth(labels,data.months.map(m=>m.clients))]
|
| 1211 |
];
|
| 1212 |
host.innerHTML=specs.map(([title,description,svg])=>`<section class="inline-chart-card"><h4>${title} <small>· ${description}</small></h4><div class="inline-chart-svg">${svg}</div></section>`).join('')+
|
| 1213 |
'<div class="inline-chart-foot">Dezelfde gegevens en grafieken als in de witte Reakt-monitor. Alleen lokale Excelanalyse · niet extern gevalideerd.</div>';
|
|
|
|
| 436 |
.inline-chart-card{border:1px solid #355374;border-radius:10px;background:linear-gradient(145deg,#132944,#102036);padding:12px;min-width:0}
|
| 437 |
.inline-chart-card h4{font-size:12px;line-height:1.35;color:#e7f4ff;margin:0 0 10px;font-weight:750}
|
| 438 |
.inline-chart-card h4 small{font-size:10px;font-weight:400;color:#a8bcd3}
|
| 439 |
+
.inline-chart-svg{height:188px;background:linear-gradient(180deg,#0f1f35,#0b1728);border:1px solid #294766;border-radius:7px;padding:7px;overflow:hidden;box-shadow:inset 0 0 0 1px rgba(120,171,220,.06)}
|
| 440 |
.inline-chart-svg svg{display:block;width:100%;height:100%}
|
| 441 |
.inline-chart-empty{border:1px dashed #385473;border-radius:9px;color:#9fb8d4;font-size:11px;line-height:1.5;padding:15px}
|
| 442 |
.inline-chart-foot{color:#8eaaca;font-size:10px;line-height:1.4;margin-top:10px}
|
|
|
|
| 1159 |
// v0.8 — rapport wordt opgebouwd uit lokaal berekende, geaggregeerde testgegevens.
|
| 1160 |
// Er is geen LLM, er wordt niet geüpload en ontbrekende velden worden NIET ingevuld.
|
| 1161 |
const reportNL=n=>Number(n).toLocaleString('nl-NL');
|
| 1162 |
+
function reportChartBars(names,values,color='#7935cf',asWeek=false,dark=false){
|
| 1163 |
const W=440,H=195,left=38,right=12,top=17,bottom=31,max=Math.max(1,...values);
|
| 1164 |
+
const gridColor=dark?'#2d4b67':'#e6e8f2';
|
| 1165 |
+
const valueColor=dark?'#dff3ff':'#18116b';
|
| 1166 |
+
const labelColor=dark?'#a8c7e5':'#1f2a56';
|
| 1167 |
+
const bgRect=dark?`<rect x="0" y="0" width="${W}" height="${H}" rx="8" fill="#0c182a"/>`:'';
|
| 1168 |
+
let out=`<svg viewBox="0 0 ${W} ${H}" width="100%" height="100%" role="img" aria-label="Staafgrafiek">${bgRect}`;
|
| 1169 |
+
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="${gridColor}" stroke-width="1"/>`}
|
| 1170 |
const band=(W-left-right)/Math.max(1,names.length),bar=Math.min(38,band*.7);
|
| 1171 |
values.forEach((v,i)=>{const bh=(H-top-bottom-10)*v/max,x=left+band*i+(band-bar)/2,y=H-bottom-bh;
|
| 1172 |
+
out+=`<rect x="${x}" y="${y}" width="${bar}" height="${Math.max(bh,0)}" fill="${color}" rx="1.5"/><text x="${x+bar/2}" y="${Math.max(10,y-5)}" text-anchor="middle" fill="${valueColor}" font-size="${asWeek?10:12}" font-weight="700">${v}</text><text x="${x+bar/2}" y="${H-11}" text-anchor="middle" fill="${labelColor}" font-size="${asWeek?8:11}">${escapeHTML(names[i])}</text>`});
|
| 1173 |
return out+'</svg>';
|
| 1174 |
}
|
| 1175 |
+
function reportChartClientMonth(names,values,dark=false){
|
| 1176 |
// Alleen presentatie: dezelfde berekende maandwaarden; iedere cliënt eenmaal per maand.
|
| 1177 |
const W=480,H=220,left=24,right=9,top=19,bottom=34;
|
| 1178 |
const max=Math.max(1,...values),span=H-top-bottom;
|
| 1179 |
+
const gridColor=dark?'#2d4b67':'#e8e6f2';
|
| 1180 |
+
const valueColor=dark?'#eee6ff':'#2e196e';
|
| 1181 |
+
const labelColor=dark?'#c3b4ff':'#22285e';
|
| 1182 |
+
const bgRect=dark?`<rect x="0" y="0" width="${W}" height="${H}" rx="8" fill="#0c182a"/>`:'';
|
| 1183 |
const band=(W-left-right)/Math.max(1,names.length),bar=Math.min(46,band*.82);
|
| 1184 |
+
let out=`<svg viewBox="0 0 ${W} ${H}" width="100%" height="100%" role="img" aria-label="Aantal unieke cliënten per maand">${bgRect}`;
|
| 1185 |
for(let i=0;i<=4;i++){
|
| 1186 |
const y=top+span*i/4;
|
| 1187 |
+
out+=`<line x1="${left}" y1="${y}" x2="${W-right}" y2="${y}" stroke="${gridColor}" stroke-width="1"/>`;
|
| 1188 |
}
|
| 1189 |
values.forEach((v,i)=>{
|
| 1190 |
const height=(span-15)*v/max;
|
| 1191 |
const x=left+band*i+(band-bar)/2,y=H-bottom-height;
|
| 1192 |
out+=`<rect x="${x}" y="${y}" width="${bar}" height="${Math.max(0,height)}" fill="#763fc7" rx="1.8"/>`;
|
| 1193 |
+
out+=`<text x="${x+bar/2}" y="${Math.max(13,y-6)}" text-anchor="middle" fill="${valueColor}" font-size="14" font-weight="800">${v}</text>`;
|
| 1194 |
+
out+=`<text x="${x+bar/2}" y="${H-11}" text-anchor="middle" fill="${labelColor}" font-size="12" font-weight="600">${escapeHTML(names[i])}</text>`;
|
| 1195 |
});
|
| 1196 |
return out+'</svg>';
|
| 1197 |
}
|
|
|
|
| 1213 |
if(!data){host.innerHTML='<div class="inline-chart-empty">Analyseer eerst een Excelbestand om de bestaande rapportagegrafieken te zien.</div>';return;}
|
| 1214 |
const labels=data.months.map(m=>m.label);
|
| 1215 |
const specs=[
|
| 1216 |
+
['Nieuwe instroom per maand','Eerste geregistreerde scan op locatie',reportChartBars(labels,data.months.map(m=>m.newIntake),'#63d219',false,true)],
|
| 1217 |
+
['Bezoekdagen per weekdag','Unieke cliënt-/locatie-/bezoekdagen',reportChartBars(['Ma','Di','Wo','Do','Vr','Za','Zo'],data.byWeek,'#ff7a10',true,true)],
|
| 1218 |
+
['Aantal cliënten per maand','Iedere cliënt maximaal één keer per maand',reportChartClientMonth(labels,data.months.map(m=>m.clients),true)]
|
| 1219 |
];
|
| 1220 |
host.innerHTML=specs.map(([title,description,svg])=>`<section class="inline-chart-card"><h4>${title} <small>· ${description}</small></h4><div class="inline-chart-svg">${svg}</div></section>`).join('')+
|
| 1221 |
'<div class="inline-chart-foot">Dezelfde gegevens en grafieken als in de witte Reakt-monitor. Alleen lokale Excelanalyse · niet extern gevalideerd.</div>';
|