Spaces:
Sleeping
Sleeping
Update app.py
Browse files718 unmodified lines71972072172272372472572672772857 unmodified lines7867877887897907917927937947957967977987998008018028033 unmodified lines807808809810811812813718 unmodified lineslet transfers = TRANSFERS.filter(x=>x[0]===nodeName || x[1]===nodeName).map(x=>x[0]===nodeName?x[1]:x[0]);let loops = LOOPS.filter(x=>x[0]===nodeName || x[2]===nodeName).map(x=>x[0]===nodeName?x[2]:x[0]);// <-- NEW: include FRESH edges so teal arcs behave like real connectionslet fresh = FRESH.filter(x=>x[0]===nodeName || x[1]===nodeName).map(x=>x[0]===nodeName?x[1]:x[0]);return new Set([].concat(buys, sells, transfers, loops, fresh));}57 unmodified linesconst loops = LOOPS.filter(x => x[0]===nodeName || x[2]===nodeName).map(x => x[0]===nodeName ? x[2] : x[0]);// NEW — detect Fresh Buysconst fresh = FRESH.filter(x => x[0] === nodeName || x[1] === nodeName).map(x => x[0] === nodeName ? x[1] : x[0]);// NEW — detect Complete Exitsconst exits = [];COMPLETE_EXIT = __COMPLETE_EXIT__; // inject the map (see below)if (COMPLETE_EXIT[nodeName]) {exits.push(...COMPLETE_EXIT[nodeName]);}const box = document.getElementById("info-box");box.innerHTML = `3 unmodified lines<b>Sells:</b> ${sells.length ? sells.join(", ") : "<span style='color:#777'>None</span>"}<br><b>Transfers:</b> ${transfers.length ? transfers.join(", ") : "<span style='color:#777'>None</span>"}<br><b>Loops:</b> ${loops.length ? loops.join(", ") : "<span style='color:#777'>None</span>"}<br><b>Fresh Buys:</b> ${fresh.length ? fresh.join(", ") : "<span style='color:#777'>None</span>"}<b>Complete Exits:</b> ${exits.length ? exits.join(", ") : "<span style='color:#777'>None</span>"}<br></div>`;718 unmodified lines71972072172272372472572672772872973073173273373473573673773873974057 unmodified lines7987998008018028038048058068078088098108118128138148158163 unmodified lines820821822823824825826718 unmodified lineslet transfers = TRANSFERS.filter(x=>x[0]===nodeName || x[1]===nodeName).map(x=>x[0]===nodeName?x[1]:x[0]);let loops = LOOPS.filter(x=>x[0]===nodeName || x[2]===nodeName).map(x=>x[0]===nodeName?x[2]:x[0]);// include FRESH edgeslet fresh = FRESH.filter(x=>x[0]===nodeName || x[1]===nodeName).map(x=>x[0]===nodeName?x[1]:x[0]);// include COMPLETE_EXIT connections:// - if nodeName is an AMC, include companies in COMPLETE_EXIT[nodeName]// - if nodeName is a company, include AMCs that list that company in their COMPLETE_EXITlet exits = [];if (COMPLETE_EXIT[nodeName]) {// nodeName is an AMCexits = exits.concat(COMPLETE_EXIT[nodeName]);} else {// nodeName may be a company; find AMCs that have itexits = exits.concat(Object.keys(COMPLETE_EXIT).filter(amc => (COMPLETE_EXIT[amc] || []).includes(nodeName)));}return new Set([].concat(buys, sells, transfers, loops, fresh, exits));}57 unmodified linesconst loops = LOOPS.filter(x => x[0]===nodeName || x[2]===nodeName).map(x => x[0]===nodeName ? x[2] : x[0]);// detect Fresh Buysconst fresh = FRESH.filter(x => x[0] === nodeName || x[1] === nodeName).map(x => x[0] === nodeName ? x[1] : x[0]);// detect Complete Exits:// if nodeName is AMC, list companies they completely exited// if nodeName is company, list AMCs who completely exited that companylet exits = [];if (COMPLETE_EXIT[nodeName]) {exits = exits.concat(COMPLETE_EXIT[nodeName]); // nodeName is AMC} else {exits = exits.concat(Object.keys(COMPLETE_EXIT).filter(amc => (COMPLETE_EXIT[amc] || []).includes(nodeName)));}const box = document.getElementById("info-box");box.innerHTML = `3 unmodified lines<b>Sells:</b> ${sells.length ? sells.join(", ") : "<span style='color:#777'>None</span>"}<br><b>Transfers:</b> ${transfers.length ? transfers.join(", ") : "<span style='color:#777'>None</span>"}<br><b>Loops:</b> ${loops.length ? loops.join(", ") : "<span style='color:#777'>None</span>"}<br><b>Fresh Buys:</b> ${fresh.length ? fresh.join(", ") : "<span style='color:#777'>None</span>"}<br><b>Complete Exits:</b> ${exits.length ? exits.join(", ") : "<span style='color:#777'>None</span>"}<br></div>`;
app.py+23-10