langextract
langextract copied to clipboard
Clickable Entity Selector in Visualizations
For your consideration, a couple of minor changes to the visualization compiler enabled clickable entity selection, which i found alot faster to review on a longer document:
<<<<<<< SEARCH
:start_line:78
-------
.lx-highlight { position: relative; border-radius:3px; padding:1px 2px;}
=======
.lx-highlight { position: relative; border-radius:3px; padding:1px 2px; cursor: pointer;}
>>>>>>> REPLACE
<<<<<<< SEARCH
:start_line:545
-------
window.jumpToExtraction = jumpToExtraction;
updateDisplay();
}})();
=======
window.jumpToExtraction = jumpToExtraction;
document.getElementById('textWindow').addEventListener('click', (event) => {{
const span = event.target.closest('.lx-highlight');
if (span && span.dataset.idx) {{
jumpToExtraction(span.dataset.idx);
}}
}});
updateDisplay();
}})();
>>>>>>> REPLACE