diff --git a/CHANGELOG.md b/CHANGELOG.md
index 2e08435..302cf41 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -6,6 +6,7 @@ All notable changes to this project are documented here. The project follows
## [Unreleased]
+- The NOC charts have tooltips, on the dashboard and on the wallboard in the NOC window: hover (or touch) a chart to see every series on that day, with a total. Click an entry in the legend to hide or show that series, and the scale follows what is left. The "how it arrives" bars on the Traffic tab show the same kind of tooltip, and its legend picks which ways in (caches, PNIs, IX peering, transit) the table counts.
## [2.9.1] — 2026-11-04
- Jokes in the game now poke fun at networks, cables and routers, never at people, countries or beliefs. A few networks have new names (Atlas Hold-the-Line Telecom, Star-Blink, Telekom Malay-tency, Oh Yas Sénégal, Afghan Tele-Pass, Island-Hop Micronesia, Tel-One-derful, Tango Two-Step), so do three of the names for your own cables, and about forty descriptions of networks, cities, cables and events were rewritten.
diff --git a/scripts/lib/mcp-game.js b/scripts/lib/mcp-game.js
index 0de39b8..cf61800 100644
--- a/scripts/lib/mcp-game.js
+++ b/scripts/lib/mcp-game.js
@@ -11,7 +11,7 @@ const path = require('node:path');
const { load } = require('../../tests/harness');
const HEADLESS_JS = fs.readFileSync(path.join(__dirname, 'mcp-headless.js'), 'utf8');
-const ACT_DIR = path.join(__dirname, '..', '..', 'src', 'game', '90-actions');
+const ACT_DIRS = ['90-actions', '94-dashboard', '96-map'].map((d) => path.join(__dirname, '..', '..', 'src', 'game', d));
// The arguments of the actions the command tables do not type (the drafts), read from their source
// (`dfSrc:({v})=>`): in the page the actions are wrapped for puzzle mode, so their own parameter lists are not visible.
@@ -20,8 +20,8 @@ function actArgs() {
if (ACT_ARGS) return ACT_ARGS;
ACT_ARGS = {};
const re = /(?:^|[\s,{])([A-Za-z]\w*):\s*(?:async\s*)?\(\s*\{([^}]*)\}\s*(?:=\s*\{\s*\}\s*)?\)\s*=>/g;
- for (const f of fs.readdirSync(ACT_DIR).filter((f) => f.endsWith('.js')).sort()) {
- const src = fs.readFileSync(path.join(ACT_DIR, f), 'utf8');
+ for (const [dir, f] of ACT_DIRS.flatMap((d) => fs.readdirSync(d).filter((f) => f.endsWith('.js')).sort().map((f) => [d, f]))) {
+ const src = fs.readFileSync(path.join(dir, f), 'utf8');
for (const m of src.matchAll(re)) if (!ACT_ARGS[m[1]]) ACT_ARGS[m[1]] = m[2].split(',').map((a) => a.split('=')[0].trim()).filter(Boolean);
}
return ACT_ARGS;
diff --git a/site/i18n/de.js b/site/i18n/de.js
index 7d8e371..a9c0de4 100644
--- a/site/i18n/de.js
+++ b/site/i18n/de.js
@@ -1757,6 +1757,7 @@
"dashboard.all_n":"Alle ({n})",
"dashboard.amp_huts_and_spares":"Verstärkerhütten und Ersatzteile",
"dashboard.caches_pnis_and_ix":"Caches, PNIs und IX",
+"dashboard.chart_total":"Gesamt",
"dashboard.customers_are_upset":"Kunden sind verärgert",
"dashboard.delivered_30_days":"Geliefert, 30 Tage",
"dashboard.five_nines_ish":"fünf Neunen, so ungefähr",
diff --git a/site/i18n/es.js b/site/i18n/es.js
index 1acb3a7..b554085 100644
--- a/site/i18n/es.js
+++ b/site/i18n/es.js
@@ -1755,6 +1755,7 @@
"dashboard.all_n":"Todo ({n})",
"dashboard.amp_huts_and_spares":"Casetas de amplificación y repuestos",
"dashboard.caches_pnis_and_ix":"cachés, PNIs e IX",
+"dashboard.chart_total":"Total",
"dashboard.customers_are_upset":"los clientes están molestos",
"dashboard.delivered_30_days":"Entregado, 30 días",
"dashboard.five_nines_ish":"casi cinco nueves",
diff --git a/site/i18n/fr.js b/site/i18n/fr.js
index b773527..a82034f 100644
--- a/site/i18n/fr.js
+++ b/site/i18n/fr.js
@@ -1755,6 +1755,7 @@
"dashboard.all_n":"Toutes ({n})",
"dashboard.amp_huts_and_spares":"Abris d’amplis et rechanges",
"dashboard.caches_pnis_and_ix":"caches, PNI et IX",
+"dashboard.chart_total":"Total",
"dashboard.customers_are_upset":"les clients râlent",
"dashboard.delivered_30_days":"Livré, 30 jours",
"dashboard.five_nines_ish":"cinq neuf, ou presque",
diff --git a/site/i18n/it.js b/site/i18n/it.js
index b050b08..8ea4136 100644
--- a/site/i18n/it.js
+++ b/site/i18n/it.js
@@ -1755,6 +1755,7 @@
"dashboard.all_n":"Tutte ({n})",
"dashboard.amp_huts_and_spares":"Shelter amplificatori e ricambi",
"dashboard.caches_pnis_and_ix":"cache, PNI e IX",
+"dashboard.chart_total":"Totale",
"dashboard.customers_are_upset":"clienti furiosi",
"dashboard.delivered_30_days":"Consegnato, 30 giorni",
"dashboard.five_nines_ish":"cinque nove, più o meno",
diff --git a/site/i18n/pt.js b/site/i18n/pt.js
index cf2987c..1117eac 100644
--- a/site/i18n/pt.js
+++ b/site/i18n/pt.js
@@ -1755,6 +1755,7 @@
"dashboard.all_n":"Todos ({n})",
"dashboard.amp_huts_and_spares":"Abrigos de amplificador e reservas",
"dashboard.caches_pnis_and_ix":"caches, PNIs e IX",
+"dashboard.chart_total":"Total",
"dashboard.customers_are_upset":"clientes furiosos",
"dashboard.delivered_30_days":"Entregue, 30 dias",
"dashboard.five_nines_ish":"cinco noves, quase",
diff --git a/src/agent/20-commands.js b/src/agent/20-commands.js
index 275791e..d7e74ed 100644
--- a/src/agent/20-commands.js
+++ b/src/agent/20-commands.js
@@ -415,6 +415,7 @@ const API_CMD={
const API_VIEW={
traceMode:{args:[['m','string']],doc:'Redo the open traceroute in a routing mode: normal, fast or scenic.'},
+ chartToggle:{args:[['c','string'],['k','string']],doc:'Hide or show one series of a dashboard chart (a legend click); hiding every series shows them all again.'},
help:{args:[],doc:'Open the how-to-play modal.'},
dash:{args:[],doc:'Open the NOC dashboard.'},
dashClose:{args:[],doc:'Close the NOC dashboard.'},
diff --git a/src/game/93-ui/70-link-panels.js b/src/game/93-ui/70-link-panels.js
index f588fbb..8fcd742 100644
--- a/src/game/93-ui/70-link-panels.js
+++ b/src/game/93-ui/70-link-panels.js
@@ -161,8 +161,9 @@ function linkPanel(id){
return h;
}
const EGC={c:[tr('common.caches'),'#16A866'],p:[tr('common.pnis'),'#7B61FF'],ix:[tr('common.ix_peering_0631'),'#FFD23F'],t:[tr('common.transit'),'#FF8A3D'],l2:[tr('common.l2_circuits'),'#2F8CFF']};
-function svgChart(rows,stackKeys,lines,fmtY){
- const W=600,H=180,L=50,B=20,T=8,Rr=8;if(rows.length<2)return `
`;
let ymax=1;for(const r of rows){let s=0;for(const k of stackKeys)s+=r[k]||0;ymax=Math.max(ymax,s);for(const ln of lines)ymax=Math.max(ymax,r[ln.k]||0);}ymax*=1.1;
const x=i=>L+(W-L-Rr)*i/(rows.length-1),y=v=>T+(H-T-B)*(1-v/ymax);let g='';
for(let j=0;j<=3;j++){const v=ymax*j/3,yy=y(v);g+=`${fmtY(v)}`;}
@@ -170,7 +171,7 @@ function svgChart(rows,stackKeys,lines,fmtY){
for(const k of stackKeys){const top=rows.map((r,i)=>base[i]+(r[k]||0));let d=`M${x(0)},${y(top[0])}`;for(let i=1;i=0;i--)d+=`L${x(i)},${y(base[i])}`;g+=``;top.forEach((v,i)=>base[i]=v);}
for(const ln of lines){let d='';rows.forEach((r,i)=>{d+=(i?'L':'M')+x(i)+','+y(r[ln.k]||0);});g+=``;const last=rows[rows.length-1][ln.k]||0;g+=``;}
g+=`${dateStr(rows[0].d)}${dateStr(rows[rows.length-1].d)}`;
- return ``;}
+ return ``;}
// For a network you currently reach over transit: the cheapest way to move it to peering.
// Exchange members as sets, rebuilt once per routing pass: hints are asked for many networks at a time.
let IXMR=null,IXMC={};const ixHas=(x,id)=>{if(IXMR!==R){IXMR=R;IXMC={};}return (IXMC[x]||(IXMC[x]=new Set(ixMembers(x)))).has(id);};
diff --git a/src/game/94-dashboard/60-dashboard.js b/src/game/94-dashboard/60-dashboard.js
index 269f689..4ea4fae 100644
--- a/src/game/94-dashboard/60-dashboard.js
+++ b/src/game/94-dashboard/60-dashboard.js
@@ -7,20 +7,22 @@ function renderDash(){checkLayer();
const tile=(l,v,sub)=>`
`;
const tT=(R.egT.t||0)||1;
- const row=(n,e,want)=>{const t=e.c+e.p+e.ix+e.t;return {n,e,t,want,cost:(R.cost.transit||0)*e.t/tT,lost:want>0.01?Math.max(0,1-t/want):0};};
+ const offMix=(UI.chartOff&&UI.chartOff.mix)||{},filt=Object.keys(offMix).length>0;
+ // The legend above the table picks which ways in count; "lost" still looks at everything the network gets.
+ const row=(n,e0,want)=>{const e={};for(const k of ['c','p','ix','t'])e[k]=offMix[k]?0:e0[k];const t=e.c+e.p+e.ix+e.t,all=e0.c+e0.p+e0.ix+e0.t;return {n,e,t,want,cost:(R.cost.transit||0)*e.t/tT,lost:want>0.01?Math.max(0,1-all/want):0};};
const nets=NETS.filter(n=>!n.tail).map(n=>row(n,R.netEg[n.id]||{c:0,p:0,ix:0,t:0},R.demTo[n.id]||0));
{const e={c:0,p:0,ix:0,t:0};let w=0;for(const n of NETS)if(n.tail){const x=R.netEg[n.id];if(x)for(const k in e)e[k]+=x[k]||0;w+=R.demTo[n.id]||0;}nets.push(row({id:'_tail',name:tr('dashboard.the_long_tail_n_small_networks',{n:NETS.filter(n=>n.tail).length}),asn:'many',type:'eye',col:'#8A93B8'},e,w));}
- for(let i=nets.length-1;i>=0;i--)if(!(nets[i].t>0.01||nets[i].want>0.01))nets.splice(i,1);
+ for(let i=nets.length-1;i>=0;i--)if(!(nets[i].t>0.01||(!filt&&nets[i].want>0.01)))nets.splice(i,1);
{const k=UI.dashSort||'traffic',dir=UI.dashDir||-1,val=x=>k==='name'?x.n.name.toLowerCase():k==='asn'?x.n.asn:k==='type'?x.n.type:k==='cost'?x.cost:k==='lost'?x.lost:x.t;nets.sort((a,b)=>{const A=val(a),B=val(b);return (AB?1:0)*dir||b.t-a.t;});}
if(DT==='cust')h+=custSection();
if(DT==='conn')h+=connSection();
if(DT==='traffic')h+=`
`;}
const ls=S.links.filter(l=>capOf(l)>0).map(l=>({l,u:(R.load[l.id]||0)/capOf(l)})).sort((a,b)=>b.u-a.u).slice(0,8);
const rs=Object.keys(S.pops).map(c=>({c,u:(R.nodeLoad[c]||0)/(R.nodeCap[c]||1)})).sort((a,b)=>b.u-a.u).slice(0,6);
diff --git a/src/game/94-dashboard/65-chart-legend.js b/src/game/94-dashboard/65-chart-legend.js
new file mode 100644
index 0000000..63cfdfa
--- /dev/null
+++ b/src/game/94-dashboard/65-chart-legend.js
@@ -0,0 +1,44 @@
+/* The NOC charts: legend entries switch a series on and off (the scale follows what is left), and hovering or
+ touching a chart shows every visible series on that day. View state only: UI.chartOff is never saved. */
+const CHARTS={
+ traffic:{stack:['c','p','ix','t','l2'],lines:['dem'],fmt:v=>fmtG(v),name:k=>k==='dem'?tr('common.demand'):EGC[k][0],col:k=>k==='dem'?'#1E2640':EGC[k][1]},
+ mix:{stack:['c','p','ix','t'],lines:[],fmt:v=>fmtG(v),name:k=>EGC[k][0],col:k=>EGC[k][1]}, // the Traffic tab's table
+ money:{stack:[],lines:['rev','cost'],fmt:v=>fmt$(v),name:k=>k==='rev'?tr('common.revenue'):tr('common.costs'),col:k=>k==='rev'?'#16A866':'#FF4D5E'}
+};
+const chartKeys=C=>[...C.stack,...C.lines];
+function chartLegend(id,label){const C=CHARTS[id],off=(UI.chartOff&&UI.chartOff[id])||{};
+ return `
${chartKeys(C).map(k=>``).join('')}
`;}
+Object.assign(ACT,{
+ chartToggle:({c,k})=>{const C=CHARTS[c];if(!C||!chartKeys(C).includes(k))return;
+ const off=((UI.chartOff=UI.chartOff||{})[c]=UI.chartOff[c]||{});if(off[k])delete off[k];else off[k]=1;
+ if(chartKeys(C).every(x=>off[x]))UI.chartOff[c]={}; // nothing left to draw: show everything again
+ renderDash();},
+});
+// The tooltip and its cursor line sit on , outside the dashboard, so the per-tick redraw never removes them.
+// Pointer moves are frequent: the tip is only rebuilt (and measured) when what it shows changes, not on every pixel.
+let chartTip=null,chartCur=null,chartKey='',chartTw=0,chartTh=0;
+function chartHide(){if(chartTip&&!chartTip.hidden){chartTip.hidden=chartCur.hidden=true;chartKey='';}}
+function chartEnsure(){if(!chartTip){chartTip=document.createElement('div');chartTip.className='chtip';chartCur=document.createElement('div');chartCur.className='chcur';document.body.append(chartCur,chartTip);}}
+// Fill the tip when its content key changes; measure it once, so moving inside the same content reads no layout.
+function chartFill(key,html,showCur){if(key===chartKey&&!chartTip.hidden)return false;chartKey=key;chartTip.innerHTML=html;chartTip.hidden=false;chartCur.hidden=!showCur;chartTw=chartTip.offsetWidth;chartTh=chartTip.offsetHeight;return true;}
+// Keep the tip inside the window, beside x and above y (below it when there is no room).
+function chartPlace(x,cy){const tw=chartTw,th=chartTh;
+ chartTip.style.left=Math.max(4,Math.min(innerWidth-tw-4,x+12>innerWidth-tw-4?x-tw-12:x+12))+'px';
+ chartTip.style.top=Math.max(4,Math.min(innerHeight-th-4,cy-th-8<4?cy+14:cy-th-8))+'px';}
+function chartShow(svg,cx,cy){const id=svg.dataset.ch,C=CHARTS[id],H=S&&S.hist||[],n=Math.min(90,H.length),r=svg.getBoundingClientRect(),[bW,bH,bL,bT,bB,bR]=svg.dataset.box?svg.dataset.box.split(',').map(Number):[CHBOX.W,CHBOX.H,CHBOX.L,CHBOX.T,CHBOX.B,CHBOX.R];
+ if(!C||n<2||!r.width)return chartHide();
+ chartEnsure();
+ const sx=r.width/bW,i=Math.max(0,Math.min(n-1,Math.round(((cx-r.left)/sx-bL)/(bW-bL-bR)*(n-1)))),row=H[H.length-n+i],off=(UI.chartOff&&UI.chartOff[id])||{};
+ const x=r.left+(bL+(bW-bL-bR)*i/(n-1))*sx;
+ const key=id+'|'+row.d+'|'+Object.keys(off).join();
+ if(chartFill(key,chartHtml(C,row,off),true)||chartCur.dataset.x!==String(x)){chartCur.dataset.x=x;chartCur.style.cssText=`left:${x}px;top:${r.top+bT*sx}px;height:${(bH-bT-bB)*sx}px`;}
+ chartPlace(x,cy);}
+function chartHtml(C,row,off){const ks=chartKeys(C).filter(k=>!off[k]),st=C.stack.filter(k=>!off[k]);
+ return `${dateStr(row.d)}`+ks.map(k=>`
`:'');}
+// The "how it arrives" bars of the Traffic tab: the same tip, with each way in and its share.
+function mixShow(el,cx,cy){const raw=el.dataset.mix;chartEnsure();
+ if(chartKey!=='mix|'+raw||chartTip.hidden){let m;try{m=JSON.parse(raw);}catch(e){return chartHide();}
+ const ks=['c','p','ix','t'].filter(k=>m[k]>0),tot=ks.reduce((a,k)=>a+m[k],0);
+ chartFill('mix|'+raw,ks.length?ks.map(k=>`
${EGC[k][0]}${fmtG(m[k])} · ${pct(m[k]/tot)}
`).join(''):tr('common.nothing_yet'),false);}
+ chartPlace(cx,cy);}
+for(const t of ['pointermove','pointerdown'])document.addEventListener(t,e=>{const c=e.target.closest&&e.target.closest('svg[data-ch],.mix[data-mix]');if(!c)chartHide();else if(c.dataset.mix!==undefined)mixShow(c,e.clientX,e.clientY);else chartShow(c,e.clientX,e.clientY);});
diff --git a/src/game/94-dashboard/90-noc-window.js b/src/game/94-dashboard/90-noc-window.js
index 82b45fc..83d8189 100644
--- a/src/game/94-dashboard/90-noc-window.js
+++ b/src/game/94-dashboard/90-noc-window.js
@@ -5,7 +5,7 @@
per network, opened once a window says hello, so other games' tabs never unpack them. With no window nothing is sent. */
const NOC_HB=3000,NOC_LOST=10000,NOC_GAP=1000;
// What a click in the window does: changes only its own view, or runs in the game. Every button the dashboard draws is in one list.
-const NOC_LOCAL=['connCity','connF','connNet','connSort','custCity','custF','custSort','dashClose','dashSort','dashTab','listMore'];
+const NOC_LOCAL=['chartToggle','connCity','connF','connNet','connSort','custCity','custF','custSort','dashClose','dashSort','dashTab','listMore'];
const NOC_GO=['buyIx','buyNni','buyTransit','cache','connCancel','custGo','dashLink','goConn','lagIx','lagP','lagT','leaseSwap','netFocus','opsOpen','pni','pniAllOpen'];
const NOC={win:false,id:null,ctl:null,st:null,stId:null,peer:false,until:0,dirty:false,sent:0,speed:1,hid:false,yoAt:0,gone:false};
{const id=RW_IN?null:new URLSearchParams(location.search).get('noc');if(slotOkId(id)){NOC.win=true;NOC.id=id;}}
diff --git a/src/game/94-dashboard/91-noc-wall.js b/src/game/94-dashboard/91-noc-wall.js
index c990415..5025513 100644
--- a/src/game/94-dashboard/91-noc-wall.js
+++ b/src/game/94-dashboard/91-noc-wall.js
@@ -12,7 +12,7 @@ const nwG=v=>v>=1000?(+(v/1000).toFixed(1))+'T':(v>=10||v===0?Math.round(v):+v.t
const nwMapBox=()=>{let y0=Infinity,y1=-Infinity;for(const p of COAST){const b=polyBox(p);if(ringArea(p)>=600){y0=Math.min(y0,b[1]);y1=Math.max(y1,b[3]);}}return [0,Math.floor(y0),W,Math.ceil(y1-y0)];};
function nwLand(){let d='';for(const p of COAST){if(ringArea(p)<600&&!CITIES.some(c=>inPoly(c.x,c.y,p)))continue;d+='M'+p.map(q=>Math.round(q[0])+' '+Math.round(q[1])).join('L')+'Z';}return d;}
// ---------- charts ----------
-function nwChart(rows,stack,lines,fmtY,CW=900,CH=260,L=62){if(rows.length<2)return `