Spaces:
Runtime error
Runtime error
update
Browse files1180 unmodified lines11811182118311841185118637 unmodified lines12241225122612271228122912301231123212331180 unmodified linesreturn `M${sourceX},${sourceY}A${dr},${dr} 0 0,1 ${targetX},${targetY}`;}sim.on('tick', () => {link.attr('d', linkPath);node.attr('transform', d => `translate(${d.x},${d.y})`);37 unmodified lines<html lang='en'><head><meta charset='UTF-8'><title>Transformers Chronological Timeline</title><style>__TIMELINE_CSS__</style></head><body><div id='controls'><div style='font-weight:600; margin-bottom:8px;'>Chronological Timeline</div>🟡 base<br>🔵 modular<br>🔴 candidate<br><label><input type="checkbox" id="toggleRed" checked> Show candidates</label><div style='margin-top:10px; font-size:13px; color:var(--muted);'>Models positioned by creation date<br>Scroll & zoom to explore timeline1180 unmodified lines118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122337 unmodified lines12611262126312641265126612671268126912701271127212731180 unmodified linesreturn `M${sourceX},${sourceY}A${dr},${dr} 0 0,1 ${targetX},${targetY}`;}function idOf(x){ return typeof x === 'object' ? x.id : x; }function neighborsOf(id){const out = new Set([id]);Object.keys(linkedByIndex).forEach(k=>{const [a,b] = k.split(',');if(a===id) out.add(b);if(b===id) out.add(a);});return out;}// Highlight matches + neighbors; empty query resetsfunction applySearch(q){q = (q || '').trim().toLowerCase();if(!q){node.select("circle").style("opacity", 1);g.selectAll(".node-label").style("opacity", 1);link.style("opacity", 1);return;}const matches = new Set(timeline.nodes.filter(n => n.id.toLowerCase().includes(q)).map(n=>n.id));const keep = new Set();matches.forEach(m => neighborsOf(m).forEach(x => keep.add(x)));node.select("circle").style("opacity", d => keep.has(d.id) ? 1 : 0.08);g.selectAll(".node-label").style("opacity", d => keep.has(d.id) ? 1 : 0.08);link.style("opacity", d => {const s = idOf(d.source), t = idOf(d.target);return (keep.has(s) && keep.has(t)) ? 1 : 0.08;});}// wire it updocument.getElementById('searchBox').addEventListener('input', e => applySearch(e.target.value));sim.on('tick', () => {link.attr('d', linkPath);node.attr('transform', d => `translate(${d.x},${d.y})`);37 unmodified lines<html lang='en'><head><meta charset='UTF-8'><title>Transformers Chronological Timeline</title><style>__TIMELINE_CSS__</style></head><body><div id='controls'><div style='font-weight:600; margin-bottom:8px;'>Chronological Timeline</div>🟡 base<br>🔵 modular<br>🔴 candidate<br><label><input type="checkbox" id="toggleRed" checked> Show candidates</label><label><input type="checkbox" id="toggleRed" checked> Show candidates</label><input id="searchBox" type="text" placeholder="Search model…" style="margin-top:10px;width:100%;padding:6px 8px;border-radius:8px;border:1px solid #ccc;background:transparent;color:inherit;"><div style='margin-top:10px; font-size:13px; color:var(--muted);'>Models positioned by creation date<br>Scroll & zoom to explore timeline
modular_graph_and_candidates.py+40