forma-arch 0.7.1 → 0.7.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -225,6 +225,21 @@ var LABEL_AUTO_MAX=14; // above this many arrows in the current level, fixed
225
225
  var LABELS=null; // null = auto (by arrow count); true/false = user override for this session
226
226
  var SKINS=[["holo","◆ holo"],["blueprint","▭ blueprint"]], SKIN_IDS=["holo","blueprint"];
227
227
  var STMAP={done:"done","in-progress":"prog",next:"next",planned:"plan",problem:"prob",unknown:"unk"};
228
+ // The per-level tally. The mean is over the nodes that CARRY a completion, and it reports how many
229
+ // those were: on a real Go repo, 25 containers at 100% next to 28 nobody has ruled on rendered as
230
+ // "progress 100%" — the invented green this tool exists to kill, in the one number a stakeholder
231
+ // reads first. Dividing by every child instead would be the mirror lie: a node with no verdict is
232
+ // not 0% done, which is exactly why `gen` refuses to write a completion nobody curated. So the
233
+ // percentage keeps its honest denominator and shows it.
234
+ function tallyOf(kids){
235
+ var cnt={},tot=0,sum=0,nc=0,st3,j;
236
+ for(j=0;j<kids.length;j++){
237
+ st3=STMAP[kids[j].status2]||(kids[j].status==="planned"?"plan":"unk");
238
+ cnt[st3]=(cnt[st3]||0)+1;tot++;
239
+ if(kids[j].completion!=null){sum+=(+kids[j].completion||0);nc++;}
240
+ }
241
+ return {cnt:cnt,tot:tot,ruled:nc,mean:nc?Math.round(sum/nc):null};
242
+ }
228
243
  var M=null, stack=[null], mode="now", POS={}, drag=null, justDragged=false, CATNODES={}, FETCHED=false
229
244
  var VBOX={}; // last fitted viewBox per level — frozen while dragging so the canvas does not rescale
230
245
  function $(i){return document.getElementById(i)}
@@ -414,19 +429,15 @@ function draw(animate){
414
429
  var lvlIdx=((M.levels||[]).indexOf(lvlKey));
415
430
  var cb=(lvlIdx>-1?STR.crumbLevel+"-L"+(lvlIdx+1):STR.crumbLevel)+" · "+lvl.toUpperCase()+" &nbsp;&nbsp; <a data-d='-1'>"+esc(STR.crumbRoot)+"</a>";
416
431
  for(var w=0;w<chain.length;w++)cb+=" &rsaquo; "+(w===chain.length-1?"<b>"+esc(chain[w].name)+"</b>":"<a data-d='"+w+"'>"+esc(chain[w].name)+"</a>");
417
- // Per-level programme tally — the status-board essence in one glance: the status mix of THIS
418
- // view plus mean completion. Counts use the real children (a collapsed catalogue still counts
419
- // its members), so the tally never changes when the catalogue threshold does.
420
- var cnt={},tot=0,sum=0,nc=0,st3;
421
- for(j=0;j<realKids.length;j++){
422
- st3=STMAP[realKids[j].status2]||(realKids[j].status==="planned"?"plan":"unk");
423
- cnt[st3]=(cnt[st3]||0)+1;tot++;
424
- if(realKids[j].completion!=null){sum+=(+realKids[j].completion||0);nc++;}
425
- }
426
- if(tot){
432
+ // Per-level programme tally — the status-board essence in one glance. Counts use the real
433
+ // children (a collapsed catalogue still counts its members), so the tally never changes when the
434
+ // catalogue threshold does.
435
+ var T=tallyOf(realKids);
436
+ if(T.tot){
427
437
  var DOT={done:"#2fe08a",prog:"#ffc74d",next:"#3ee7ff",plan:"#2d5a72",prob:"#ff5d5d",unk:"#7d8f99"},ord=["done","prog","next","plan","prob","unk"],agg="";
428
- for(j=0;j<ord.length;j++)if(cnt[ord[j]])agg+='<i style="background:'+DOT[ord[j]]+'"></i>'+cnt[ord[j]];
429
- if(nc)agg+=' &nbsp;'+esc(STR.aggProgress)+' <b>'+Math.round(sum/nc)+'%</b>';
438
+ for(j=0;j<ord.length;j++)if(T.cnt[ord[j]])agg+='<i style="background:'+DOT[ord[j]]+'"></i>'+T.cnt[ord[j]];
439
+ // The coverage rides WITH the percentage, never without it. See tallyOf.
440
+ if(T.ruled)agg+=' &nbsp;'+esc(STR.aggProgress)+' <b>'+T.mean+'%</b> '+T.ruled+'/'+T.tot;
430
441
  cb='<span class="agg">'+agg+'</span>'+cb;
431
442
  }
432
443
  $("crumb").innerHTML=cb;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "forma-arch",
3
- "version": "0.7.1",
3
+ "version": "0.7.2",
4
4
  "description": "Forma — present your architecture instead of slides. An interactive, stack-agnostic C4 explorer (context → container → component → leaf) generated from your code and kept true to it by a deterministic drift check.",
5
5
  "keywords": [
6
6
  "architecture",