0.1.6 • Published 4 years ago

vue-annotation-highlight v0.1.6

Weekly downloads
3
License
ISC
Repository
github
Last release
4 years ago

vue-annotation-highlight

A Vue.js library to highlight annotations.

Install

In your project folder:

npm install vue-annotation-highlight --save

or

yarn add vue-annotation-highlight

Usage

In your component:

import { AnnotationHighlight } from 'vue-annotation-highlight'

Add the component to your template

<annotation-highlight 
  :text="textToRender" 
  :annotations="annotationsToHighlight"
/>

Specify required properties

data() {
  return {
    textToRender: 'An annotation is extra information associated with a particular point in a document or other piece of information.',
    annotationsToHighlight: [
      { begin: 3, length: 10, source:'PRED', confidence:'0.9' },
      { begin: 53, length: 16, source:'PRED', confidence:'0.7' }
    ]
  }
}

⚡️ Each annotation must have at least begin and length properties.

Properties

PropExpected typeRequired
textString☑️
annotationsObject, Array
highlightStyleString, Object
highlightComponentObject

⚡ AnnotationHighlight passes the rendered annotation as annotation prop to your highlightComponent where you can extract the specific object. Find an example here: /components/MyHighlightComponent.vue

0.1.6

4 years ago

0.1.5

4 years ago

0.1.4

4 years ago

0.1.3

4 years ago

0.1.2

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago