// Published exact Python results, filtered locally; no market/API access. if(typeof document!=='undefined'){ const controls=[...document.querySelectorAll('#iqr-month,#iqr-method,#iqr-reset')],state=document.getElementById('iqr-state'); try{ const data=JSON.parse(document.getElementById('study-data').textContent),month=document.getElementById('iqr-month'),method=document.getElementById('iqr-method'),out=document.getElementById('iqr-output'),body=document.getElementById('iqr-rows'); function draw(){const r=data.groups.find(x=>x.month===month.value&&x.method===method.value);out.textContent=`보관 ${r.count}행 · ${r.method}\nQ1 ${r.q1.rounded_2dp} / Q3 ${r.q3.rounded_2dp} 만원\nIQR ${r.iqr.rounded_2dp} 만원\n검토 경계 ${r.lower_fence.rounded_2dp} ~ ${r.upper_fence.rounded_2dp} 만원\n엄격히 경계 밖: ${r.flag_count}행. 원본에서 삭제하지 않았습니다.\n표시는 소수 둘째 자리이며 경계 판정은 정확한 분수로 계산했습니다.`;body.replaceChildren();for(const row of r.flagged_rows){const tr=document.createElement('tr');for(const v of [row.snapshot_month,row.source_row_number,row.row.apartment,row.row.area,row.row.amount,row.saved_at_kst]){const td=document.createElement('td');td.textContent=v;tr.append(td);}body.append(tr);}if(!r.flagged_rows.length){const tr=document.createElement('tr'),td=document.createElement('td');td.colSpan=6;td.textContent='이 조건에서 경계 밖 행이 없습니다. 자료에 오류가 없다는 인증은 아닙니다.';tr.append(td);body.append(tr);}} month.addEventListener('change',draw);method.addEventListener('change',draw);document.getElementById('iqr-reset').addEventListener('click',()=>{month.value='all';method.value='inclusive';draw();month.focus();});draw(); controls.forEach(x=>{x.disabled=false;});if(state)state.hidden=true; }catch(error){ controls.forEach(x=>{x.disabled=true;});if(state)state.hidden=false; const output=document.getElementById('iqr-output'),rows=document.getElementById('iqr-rows'); if(output)output.textContent='';if(rows)rows.replaceChildren(); } }