A Vue 3 text annotation component for NLP tasks, supporting entity labeling and relation annotation with an intuitive visual interface.
| Prop | Type | Default | Description |
|---|---|---|---|
text |
string |
Required | The text content to annotate |
entities |
Entity[] |
[] |
List of entity annotations |
entityLabels |
Label[] |
[] |
Available entity label types |
relations |
Relation[] |
[] |
List of relation annotations |
relationLabels |
Label[] |
[] |
Available relation label types |
maxLabelLength |
number |
12 |
Maximum label text length to display |
allowOverlapping |
boolean |
false |
Allow overlapping entity annotations |
rtl |
boolean |
false |
Right-to-left text direction |
graphemeMode |
boolean |
true |
Handle Unicode graphemes correctly |
dark |
boolean |
false |
Enable dark mode |
selectedEntities |
Entity[] |
[] |
Currently selected entities |
| Event | Parameters | Description |
|---|---|---|
add-entity |
(event, startOffset, endOffset) |
Fired when user selects text to create entity |
click-entity |
(event, entityId) |
Fired when user clicks an entity |
click-relation |
(event, relation) |
Fired when user clicks a relation |
contextmenu-entity |
(entity) |
Fired on entity right-click |
contextmenu-relation |
(relation) |
Fired on relation right-click |
The graphemeMode prop ensures proper handling of complex Unicode characters like emojis: