Skip to content

Commit bc7ae4e

Browse files
authored
Merge pull request #29 from philenius/feature/custom-visualization-component
Feature: extend API to allow users to provide a custom Angular component for annotation visualizuation/rendering
2 parents 8733449 + 4872122 commit bc7ae4e

24 files changed

+1252
-395
lines changed

.vscode/settings.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
{
22
"editor.defaultFormatter": "esbenp.prettier-vscode",
33
"editor.formatOnSave": true,
4-
"eslint.options": {
5-
"extensions": [".ts", ".html"]
6-
},
7-
"eslint.validate": ["javascript", "javascriptreact", "typescript", "typescriptreact", "html"]
4+
"eslint.options": { "extensions": [".ts", ".html"] },
5+
"eslint.validate": ["javascript", "javascriptreact", "typescript", "typescriptreact", "html"],
6+
"editor.rulers": [150]
87
}

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# CHANGELOG
22

3+
## 17.3.0
4+
5+
Pull request: https://github.com/philenius/ngx-annotate-text/pull/29
6+
7+
- Adds the optional input `annotationRendererComponent` that defines which Angular component shall be used for rendering the annotations. By default, it uses the provided `NgxAnnotationRendererComponent`. You can implement your own annotation rendering component to customize the visualization of annotations. The custom component must implement the interface `NgxAnnotationRendererComponentInterface`. This implements feature request https://github.com/philenius/ngx-annotate-text/issues/9.
8+
- Update dependencies
9+
310
## 17.2.0
411

512
Pull request: https://github.com/philenius/ngx-annotate-text/pull/22

README.md

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,16 @@
55

66
[![Edit ngx-annotate-text demo](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/ngx-annotate-text-demo-sgb4t1?fontsize=14&hidenavigation=1&module=%2Fsrc%2Fapp%2Fapp.component.html&theme=dark)
77

8-
An Angular component library for interactively highlighting / annotating parts of text.
8+
This Angular component library is perfect for tasks like visualizing named entity recognition, part of speech tagging, or annotating text datasets. It allows for interactively highlighting and annotating parts of text.
99

1010
![Screenshot](https://raw.githubusercontent.com/philenius/ngx-annotate-text/main/screenshot.png)
1111

1212
## Features
1313

14-
- :point_up_2: Interactively mark entities such as cities, numbers, dates, etc.
15-
- :wastebasket: Interactively remove annotations / marked entities.
16-
- :tada: Purely based on CSS. No magic, no canvas, and no SVGs.
14+
- 👆 Interactively mark text ranges such as sentences, words, or parts of words.
15+
- 🗑️ Easily remove existing annotations.
16+
- 🎉 Purely based on CSS, with no use of SVGs or canvas.
17+
- 🛠️ Customize annotation rendering with your own Angular components.
1718

1819
## Demo
1920

@@ -100,12 +101,13 @@ View and edit the live demo Angular app on <a href="https://codesandbox.io/s/ngx
100101

101102
### Inputs
102103

103-
| Input | Description | Type | Default value |
104-
| :-------------- | ------------------------------------------------------------ | ------------------ | :------------ |
105-
| annotations | Represents the parts of the given text which shall be annotated. | `Annotation[]` | `[]` |
106-
| annotationClass | An optional CSS class applied to all elements which wrap the annotated parts of the given text. | `string|undefined` | `undefined` |
107-
| removable | Determines whether annotations shall have a small button in the top right corner so that the user can remove an annotation. | `boolean` | `true` |
108-
| text | The text which shall be displayed and annotated. | `string` | empty string |
104+
| Input | Description | Type | Default value |
105+
| :-------------------------- | ------------------------------------------------------------ | ------------------ | :------------ |
106+
| annotations | Represents the parts of the given text which shall be annotated. | `Annotation[]` | `[]` |
107+
| annotationClass | An optional CSS class applied to all elements which wrap the annotated parts of the given text. | `string|undefined` | `undefined` |
108+
| annotationRendererComponent | An optional Angular component that shall be used for rendering the annotation. By default, it uses the provided `NgxAnnotationRendererComponent`. You can implement your own annotation rendering component to customize the visualization of annotations. The custom component must implement the interface `NgxAnnotationRendererComponentInterface`. | `NgxAnnotationRendererComponentInterface` | `NgxAnnotationRendererComponent` |
109+
| removable | Determines whether annotations shall have a small button in the top right corner so that the user can remove an annotation. | `boolean` | `true` |
110+
| text | The text which shall be displayed and annotated. | `string` | empty string |
109111

110112
### Outputs
111113

@@ -127,7 +129,7 @@ View and edit the live demo Angular app on <a href="https://codesandbox.io/s/ngx
127129
### Recreate project from scratch
128130

129131
```bash
130-
npm install -g @angular/cli@^16
132+
npm install -g @angular/cli@^17
131133
ng new ngx-annotate-text-workspace
132134
cd ngx-annotate-text-workspace/
133135
ng generate library ngx-annotate-text

0 commit comments

Comments
 (0)