const $=s=>document.querySelector(s); const fams=[...new Set(TAX.map(t=>t[2]))]; const fsel=$('#fam'),csel=$('#coord'); fams.forEach(f=>fsel.add(new Option(f,f))); function fillCoords(){csel.length=1;TAX.filter(t=>!fsel.value||t[2]===fsel.value).forEach(t=>csel.add(new Option(t[1],t[0])))} fillCoords(); let shown=12,list=[]; function esc(s){return String(s).replace(/[&<>"]/g,c=>({'&':'&','<':'<','>':'>','"':'"'}[c]))} function render(){ const q=$('#q').value.toLowerCase(),f=fsel.value,c=csel.value,l=$('#lab').value; list=ROWS.filter(r=>{ if(l==='yes'&&!r.d.length)return false; if(l==='no'&&r.d.length)return false; if(c&&!r.d.some(d=>d[0]==c))return false; if(f&&!r.d.some(d=>TAX[d[0]-1][2]===f))return false; if(q&&!r.turns.some(t=>t[1].toLowerCase().includes(q)))return false; return true}); $('#count').textContent=list.length+' of '+ROWS.length+' sampled rows'; $('#rows').innerHTML=list.slice(0,shown).map(r=>{ const t=r.turns.map((x,i)=>`
No rows match.
'; $('#more').style.display=list.length>shown?'inline-block':'none'; } ['q','coord','lab'].forEach(i=>$('#'+i).addEventListener('input',()=>{shown=12;render()})); fsel.addEventListener('input',()=>{fillCoords();shown=12;render()}); $('#more').onclick=()=>{shown+=12;render()}; render(); const fam=$('#famgrid');fams.forEach(f=>{const n=TAX.filter(t=>t[2]===f);fam.insertAdjacentHTML('beforeend',`