Class: W3CAnnotationAdapterImpl
@ghentcdh/annotated-text / W3CAnnotationAdapterImpl
Class: W3CAnnotationAdapterImpl
Defined in: libs/core/src/lib/adapter/annotation/w3c/W3CAnnotationAdapter.ts:19
Extends
Constructors
Constructor
new W3CAnnotationAdapterImpl(
sourceUri?,language?):W3CAnnotationAdapterImpl
Defined in: libs/core/src/lib/adapter/annotation/w3c/W3CAnnotationAdapter.ts:22
Parameters
sourceUri?
string
language?
string
Returns
W3CAnnotationAdapterImpl
Overrides
Properties
annotationAdapter
protectedannotationAdapter:AnnotationAdapter<any>
Defined in: libs/core/src/lib/di/BaseAnnotationDiFn.ts:51
Inherited from
AnnotationAdapter.annotationAdapter
annotationModule
protectedannotationModule:AnnotationModule
Defined in: libs/core/src/lib/di/BaseAnnotationDiFn.ts:27
Inherited from
AnnotationAdapter.annotationModule
annotations
annotations: () =>
object[] &object
Defined in: libs/core/src/lib/adapter/annotation/AnnotationAdapter.ts:258
Type Declaration
sortBy()
sortBy: (
sortBy?) =>object[]
Parameters
sortBy?
"weight"
Returns
object[]
Inherited from
config?
optionalconfig:object
Defined in: libs/core/src/lib/adapter/annotation/AnnotationAdapter.ts:62
Configuration for styling the annotations, can be used to override default styles.
text
text:
object
text.handleRadius
handleRadius:
number=6
Inherited from
create
create:
boolean=false
Defined in: libs/core/src/lib/adapter/annotation/AnnotationAdapter.ts:52
If true, creation of annotations is enabled.
Param
Inherited from
edit
edit:
boolean=false
Defined in: libs/core/src/lib/adapter/annotation/AnnotationAdapter.ts:57
If true, edit of annotations is enabled.
Param
Inherited from
name
name:
string='W3CAnnotationAdapter'
Defined in: libs/core/src/lib/adapter/annotation/w3c/W3CAnnotationAdapter.ts:20
Name of the adapter. Be unique 😃.
Overrides
offsetStart
protectedoffsetStart:number=0
Defined in: libs/core/src/lib/adapter/annotation/AnnotationAdapter.ts:68
Inherited from
renderInstance
protectedrenderInstance:RenderInstances<{@context:string;body?: {format:"text";language?:string;source?:string;type:"TextualBody";value:string; } | {purpose:"tagging";type:"TextualBody";value?:string; } | {id?:string;purpose:"describing";source?:string;type:"SpecificResource";value:any; } | {textType:string;type:"AnnotationType"; } | ({format:"text";language?:string;source?:string;type:"TextualBody";value:string; } | {purpose:"tagging";type:"TextualBody";value?:string; } | {id?:string;purpose:"describing";source?:string;type:"SpecificResource";value:any; } | {textType:string;type:"AnnotationType"; })[];id:string;motivation:"tagging"|"classifying";target?: {processingLanguage?:string;selector?: {end:number;start:number;type:"TextPositionSelector"; } |object[];source?:string;textDirection?:"ltr"|"rtl";type:"Text"; } |object[]; }>
Defined in: libs/core/src/lib/adapter/annotation/AnnotationAdapter.ts:88
Inherited from
AnnotationAdapter.renderInstance
renderParams
renderParams:
Partial<RenderParams<ANNOTATION>>
Defined in: libs/core/src/lib/adapter/annotation/AnnotationAdapter.ts:64
Inherited from
AnnotationAdapter.renderParams
snapper
snapper:
Snapper
Defined in: libs/core/src/lib/adapter/annotation/AnnotationAdapter.ts:74
Use a word snapper function to adjust the start and end indices of an annotation.
Param
Param
Inherited from
styleInstance
styleInstance:
StyleInstances<{@context:string;body?: {format:"text";language?:string;source?:string;type:"TextualBody";value:string; } | {purpose:"tagging";type:"TextualBody";value?:string; } | {id?:string;purpose:"describing";source?:string;type:"SpecificResource";value:any; } | {textType:string;type:"AnnotationType"; } | ({format:"text";language?:string;source?:string;type:"TextualBody";value:string; } | {purpose:"tagging";type:"TextualBody";value?:string; } | {id?:string;purpose:"describing";source?:string;type:"SpecificResource";value:any; } | {textType:string;type:"AnnotationType"; })[];id:string;motivation:"tagging"|"classifying";target?: {processingLanguage?:string;selector?: {end:number;start:number;type:"TextPositionSelector"; } |object[];source?:string;textDirection?:"ltr"|"rtl";type:"Text"; } |object[]; }>
Defined in: libs/core/src/lib/adapter/annotation/AnnotationAdapter.ts:65
Inherited from
AnnotationAdapter.styleInstance
svgModel
protectedsvgModel:SvgModel
Defined in: libs/core/src/lib/di/BaseAnnotationDiFn.ts:52
Inherited from
tagConfig
tagConfig:
TagConfig<{@context:string;body?: {format:"text";language?:string;source?:string;type:"TextualBody";value:string; } | {purpose:"tagging";type:"TextualBody";value?:string; } | {id?:string;purpose:"describing";source?:string;type:"SpecificResource";value:any; } | {textType:string;type:"AnnotationType"; } | ({format:"text";language?:string;source?:string;type:"TextualBody";value:string; } | {purpose:"tagging";type:"TextualBody";value?:string; } | {id?:string;purpose:"describing";source?:string;type:"SpecificResource";value:any; } | {textType:string;type:"AnnotationType"; })[];id:string;motivation:"tagging"|"classifying";target?: {processingLanguage?:string;selector?: {end:number;start:number;type:"TextPositionSelector"; } |object[];source?:string;textDirection?:"ltr"|"rtl";type:"Text"; } |object[]; }>
Defined in: libs/core/src/lib/adapter/annotation/AnnotationAdapter.ts:63
Inherited from
text
protectedtext:string=''
Defined in: libs/core/src/lib/adapter/annotation/AnnotationAdapter.ts:67
Inherited from
textAdapter
protectedtextAdapter:TextAdapter
Defined in: libs/core/src/lib/di/BaseAnnotationDiFn.ts:50
Inherited from
Accessors
gutter
Get Signature
get gutter():
object
Defined in: libs/core/src/lib/adapter/annotation/AnnotationAdapter.ts:264
Returns
object
maxWeight
maxWeight:
number=0
paddingLeft
paddingLeft:
number=0
Inherited from
position
Get Signature
get position():
object
Defined in: libs/core/src/lib/adapter/annotation/AnnotationAdapter.ts:268
Returns
object
maxStartPosition
maxStartPosition:
number=0
minStartPosition
minStartPosition:
number=0
Inherited from
Methods
_parse()
_parse(
annotation):object
Defined in: libs/core/src/lib/adapter/annotation/w3c/W3CAnnotationAdapter.ts:29
Parse an annotation object into a TextAnnotation.
Parameters
annotation
@context
string = ...
body?
{ format: "text"; language?: string; source?: string; type: "TextualBody"; value: string; } | { purpose: "tagging"; type: "TextualBody"; value?: string; } | { id?: string; purpose: "describing"; source?: string; type: "SpecificResource"; value: any; } | { textType: string; type: "AnnotationType"; } | ({ format: "text"; language?: string; source?: string; type: "TextualBody"; value: string; } | { purpose: "tagging"; type: "TextualBody"; value?: string; } | { id?: string; purpose: "describing"; source?: string; type: "SpecificResource"; value: any; } | { textType: string; type: "AnnotationType"; })[] = ...
id
string = ...
motivation
"tagging" | "classifying" = ...
target?
{ processingLanguage?: string; selector?: { end: number; start: number; type: "TextPositionSelector"; } | object[]; source?: string; textDirection?: "ltr" | "rtl"; type: "Text"; } | object[] = ...
Returns
object
end
end:
number
id?
optionalid:string|number=annotationIdSchema
label?
optionallabel:string
start
start:
number
textSelection?
optionaltextSelection:string
Overrides
addAnnotation()
protectedaddAnnotation(annotationId,originalAnnotation,parsedAnnotation):void
Defined in: libs/core/src/lib/adapter/annotation/AnnotationAdapter.ts:238
Parameters
annotationId
string | number
originalAnnotation
@context
string = ...
body?
{ format: "text"; language?: string; source?: string; type: "TextualBody"; value: string; } | { purpose: "tagging"; type: "TextualBody"; value?: string; } | { id?: string; purpose: "describing"; source?: string; type: "SpecificResource"; value: any; } | { textType: string; type: "AnnotationType"; } | ({ format: "text"; language?: string; source?: string; type: "TextualBody"; value: string; } | { purpose: "tagging"; type: "TextualBody"; value?: string; } | { id?: string; purpose: "describing"; source?: string; type: "SpecificResource"; value: any; } | { textType: string; type: "AnnotationType"; })[] = ...
id
string = ...
motivation
"tagging" | "classifying" = ...
target?
{ processingLanguage?: string; selector?: { end: number; start: number; type: "TextPositionSelector"; } | object[]; source?: string; textDirection?: "ltr" | "rtl"; type: "Text"; } | object[] = ...
parsedAnnotation
_drawMetadata
{ color?: { active: { border?: string; borderWidth: number; fill?: string; }; default: { border?: string; borderWidth: number; fill?: string; }; edit: { border?: string; borderWidth: number; fill?: string; }; hover: { border?: string; borderWidth: number; fill?: string; }; tag: { border?: string; borderWidth: number; fill?: string; text?: string; }; }; dimensions?: { x: number; y1: number; y2: number; }; draws: object[]; } = annotationDrawMetadataSchema
_drawMetadata.color?
{ active: { border?: string; borderWidth: number; fill?: string; }; default: { border?: string; borderWidth: number; fill?: string; }; edit: { border?: string; borderWidth: number; fill?: string; }; hover: { border?: string; borderWidth: number; fill?: string; }; tag: { border?: string; borderWidth: number; fill?: string; text?: string; }; } = ...
_drawMetadata.color.active
{ border?: string; borderWidth: number; fill?: string; } = annotationDrawColorSchema
_drawMetadata.color.active.border?
string = ...
_drawMetadata.color.active.borderWidth
number = ...
_drawMetadata.color.active.fill?
string = ...
_drawMetadata.color.default
{ border?: string; borderWidth: number; fill?: string; } = annotationDrawColorSchema
_drawMetadata.color.default.border?
string = ...
_drawMetadata.color.default.borderWidth
number = ...
_drawMetadata.color.default.fill?
string = ...
_drawMetadata.color.edit
{ border?: string; borderWidth: number; fill?: string; } = annotationDrawColorSchema
_drawMetadata.color.edit.border?
string = ...
_drawMetadata.color.edit.borderWidth
number = ...
_drawMetadata.color.edit.fill?
string = ...
_drawMetadata.color.hover
{ border?: string; borderWidth: number; fill?: string; } = annotationDrawColorSchema
_drawMetadata.color.hover.border?
string = ...
_drawMetadata.color.hover.borderWidth
number = ...
_drawMetadata.color.hover.fill?
string = ...
_drawMetadata.color.tag
{ border?: string; borderWidth: number; fill?: string; text?: string; } = tagColorSchema
_drawMetadata.color.tag.border?
string = ...
_drawMetadata.color.tag.borderWidth
number = ...
_drawMetadata.color.tag.fill?
string = ...
_drawMetadata.color.tag.text?
string = ...
_drawMetadata.dimensions?
{ x: number; y1: number; y2: number; } = ...
_drawMetadata.dimensions.x
number = ...
_drawMetadata.dimensions.y1
number = ...
_drawMetadata.dimensions.y2
number = ...
_drawMetadata.draws
object[] = ...
_render
{ isGutter: boolean; lines: object[]; render: string; style: { color: { background?: string; backgroundActive?: string; border?: string; borderActive?: string; color?: string; gutterColor?: string; tagBackground?: string; tagColor?: string; }; renderStyle: any; }; weight?: number; } = renderSchema
_render.isGutter
boolean = ...
_render.lines
object[] = ...
_render.render
string = ...
_render.style
{ color: { background?: string; backgroundActive?: string; border?: string; borderActive?: string; color?: string; gutterColor?: string; tagBackground?: string; tagColor?: string; }; renderStyle: any; } = renderStyleSchema
_render.style.color
{ background?: string; backgroundActive?: string; border?: string; borderActive?: string; color?: string; gutterColor?: string; tagBackground?: string; tagColor?: string; } = annotationColorSchema
_render.style.color.background?
string = ...
_render.style.color.backgroundActive?
string = ...
_render.style.color.border?
string = ...
_render.style.color.borderActive?
string = ...
_render.style.color.color?
string = ...
_render.style.color.gutterColor?
string = ...
_render.style.color.tagBackground?
string = ...
_render.style.color.tagColor?
string = ...
_render.style.renderStyle
any = ...
_render.weight?
number = ...
end
number = ...
id?
string | number = annotationIdSchema
label?
string = ...
start
number = ...
textSelection?
string = ...
Returns
void
Inherited from
AnnotationAdapter.addAnnotation
addDrawAnnotations()
addDrawAnnotations(
annotationUuid,annotations,dimensions,color):void
Defined in: libs/core/src/lib/adapter/annotation/AnnotationAdapter.ts:224
Parameters
annotationUuid
string | number
annotations
object[]
dimensions
x
number = ...
y1
number = ...
y2
number = ...
color
active
{ border?: string; borderWidth: number; fill?: string; } = annotationDrawColorSchema
active.border?
string = ...
active.borderWidth
number = ...
active.fill?
string = ...
default
{ border?: string; borderWidth: number; fill?: string; } = annotationDrawColorSchema
default.border?
string = ...
default.borderWidth
number = ...
default.fill?
string = ...
edit
{ border?: string; borderWidth: number; fill?: string; } = annotationDrawColorSchema
edit.border?
string = ...
edit.borderWidth
number = ...
edit.fill?
string = ...
hover
{ border?: string; borderWidth: number; fill?: string; } = annotationDrawColorSchema
hover.border?
string = ...
hover.borderWidth
number = ...
hover.fill?
string = ...
tag
{ border?: string; borderWidth: number; fill?: string; text?: string; } = tagColorSchema
tag.border?
string = ...
tag.borderWidth
number = ...
tag.fill?
string = ...
tag.text?
string = ...
Returns
void
Inherited from
AnnotationAdapter.addDrawAnnotations
calculateWeights()
calculateWeights(
lines):void
Defined in: libs/core/src/lib/adapter/annotation/AnnotationAdapter.ts:260
Parameters
lines
TextLine[]
Returns
void
Inherited from
AnnotationAdapter.calculateWeights
changeConfig()
changeConfig():
void
Defined in: libs/core/src/lib/adapter/BaseAdapter.ts:18
Returns
void
Inherited from
AnnotationAdapter.changeConfig
clear()
clear():
void
Defined in: libs/core/src/lib/adapter/annotation/AnnotationAdapter.ts:250
Returns
void
Inherited from
clearDraws()
clearDraws():
void
Defined in: libs/core/src/lib/adapter/annotation/AnnotationAdapter.ts:254
Returns
void
Inherited from
createAnnotation()
createAnnotation(
characterPos):object
Defined in: libs/core/src/lib/adapter/annotation/AnnotationAdapter.ts:159
Create a new annotation object with default values.
Parameters
characterPos
number
Returns
object
_drawMetadata
_drawMetadata:
object=annotationDrawMetadataSchema
_drawMetadata.color?
optionalcolor:object
_drawMetadata.color.active
active:
object=annotationDrawColorSchema
_drawMetadata.color.active.border?
optionalborder:string
_drawMetadata.color.active.borderWidth
borderWidth:
number
_drawMetadata.color.active.fill?
optionalfill:string
_drawMetadata.color.default
default:
object=annotationDrawColorSchema
_drawMetadata.color.default.border?
optionalborder:string
_drawMetadata.color.default.borderWidth
borderWidth:
number
_drawMetadata.color.default.fill?
optionalfill:string
_drawMetadata.color.edit
edit:
object=annotationDrawColorSchema
_drawMetadata.color.edit.border?
optionalborder:string
_drawMetadata.color.edit.borderWidth
borderWidth:
number
_drawMetadata.color.edit.fill?
optionalfill:string
_drawMetadata.color.hover
hover:
object=annotationDrawColorSchema
_drawMetadata.color.hover.border?
optionalborder:string
_drawMetadata.color.hover.borderWidth
borderWidth:
number
_drawMetadata.color.hover.fill?
optionalfill:string
_drawMetadata.color.tag
tag:
object=tagColorSchema
_drawMetadata.color.tag.border?
optionalborder:string
_drawMetadata.color.tag.borderWidth
borderWidth:
number
_drawMetadata.color.tag.fill?
optionalfill:string
_drawMetadata.color.tag.text?
optionaltext:string
_drawMetadata.dimensions?
optionaldimensions:object
_drawMetadata.dimensions.x
x:
number
_drawMetadata.dimensions.y1
y1:
number
_drawMetadata.dimensions.y2
y2:
number
_drawMetadata.draws
draws:
object[]
_render
_render:
object=renderSchema
_render.isGutter
isGutter:
boolean
_render.lines
lines:
object[]
_render.render
render:
string
_render.style
style:
object=renderStyleSchema
_render.style.color
color:
object=annotationColorSchema
_render.style.color.background?
optionalbackground:string
_render.style.color.backgroundActive?
optionalbackgroundActive:string
_render.style.color.border?
optionalborder:string
_render.style.color.borderActive?
optionalborderActive:string
_render.style.color.color?
optionalcolor:string
_render.style.color.gutterColor?
optionalgutterColor:string
_render.style.color.tagBackground?
optionaltagBackground:string
_render.style.color.tagColor?
optionaltagColor:string
_render.style.renderStyle
renderStyle:
any
_render.weight?
optionalweight:number
end
end:
number
id?
optionalid:string|number=annotationIdSchema
label?
optionallabel:string
start
start:
number
textSelection?
optionaltextSelection:string
Inherited from
AnnotationAdapter.createAnnotation
format()
format(
annotation,isNew,hasChanged):object
Defined in: libs/core/src/lib/adapter/annotation/w3c/W3CAnnotationAdapter.ts:43
Format a TextAnnotation into an annotation object.
Parameters
annotation
_drawMetadata
{ color?: { active: { border?: string; borderWidth: number; fill?: string; }; default: { border?: string; borderWidth: number; fill?: string; }; edit: { border?: string; borderWidth: number; fill?: string; }; hover: { border?: string; borderWidth: number; fill?: string; }; tag: { border?: string; borderWidth: number; fill?: string; text?: string; }; }; dimensions?: { x: number; y1: number; y2: number; }; draws: object[]; } = annotationDrawMetadataSchema
_drawMetadata.color?
{ active: { border?: string; borderWidth: number; fill?: string; }; default: { border?: string; borderWidth: number; fill?: string; }; edit: { border?: string; borderWidth: number; fill?: string; }; hover: { border?: string; borderWidth: number; fill?: string; }; tag: { border?: string; borderWidth: number; fill?: string; text?: string; }; } = ...
_drawMetadata.color.active
{ border?: string; borderWidth: number; fill?: string; } = annotationDrawColorSchema
_drawMetadata.color.active.border?
string = ...
_drawMetadata.color.active.borderWidth
number = ...
_drawMetadata.color.active.fill?
string = ...
_drawMetadata.color.default
{ border?: string; borderWidth: number; fill?: string; } = annotationDrawColorSchema
_drawMetadata.color.default.border?
string = ...
_drawMetadata.color.default.borderWidth
number = ...
_drawMetadata.color.default.fill?
string = ...
_drawMetadata.color.edit
{ border?: string; borderWidth: number; fill?: string; } = annotationDrawColorSchema
_drawMetadata.color.edit.border?
string = ...
_drawMetadata.color.edit.borderWidth
number = ...
_drawMetadata.color.edit.fill?
string = ...
_drawMetadata.color.hover
{ border?: string; borderWidth: number; fill?: string; } = annotationDrawColorSchema
_drawMetadata.color.hover.border?
string = ...
_drawMetadata.color.hover.borderWidth
number = ...
_drawMetadata.color.hover.fill?
string = ...
_drawMetadata.color.tag
{ border?: string; borderWidth: number; fill?: string; text?: string; } = tagColorSchema
_drawMetadata.color.tag.border?
string = ...
_drawMetadata.color.tag.borderWidth
number = ...
_drawMetadata.color.tag.fill?
string = ...
_drawMetadata.color.tag.text?
string = ...
_drawMetadata.dimensions?
{ x: number; y1: number; y2: number; } = ...
_drawMetadata.dimensions.x
number = ...
_drawMetadata.dimensions.y1
number = ...
_drawMetadata.dimensions.y2
number = ...
_drawMetadata.draws
object[] = ...
_render
{ isGutter: boolean; lines: object[]; render: string; style: { color: { background?: string; backgroundActive?: string; border?: string; borderActive?: string; color?: string; gutterColor?: string; tagBackground?: string; tagColor?: string; }; renderStyle: any; }; weight?: number; } = renderSchema
_render.isGutter
boolean = ...
_render.lines
object[] = ...
_render.render
string = ...
_render.style
{ color: { background?: string; backgroundActive?: string; border?: string; borderActive?: string; color?: string; gutterColor?: string; tagBackground?: string; tagColor?: string; }; renderStyle: any; } = renderStyleSchema
_render.style.color
{ background?: string; backgroundActive?: string; border?: string; borderActive?: string; color?: string; gutterColor?: string; tagBackground?: string; tagColor?: string; } = annotationColorSchema
_render.style.color.background?
string = ...
_render.style.color.backgroundActive?
string = ...
_render.style.color.border?
string = ...
_render.style.color.borderActive?
string = ...
_render.style.color.color?
string = ...
_render.style.color.gutterColor?
string = ...
_render.style.color.tagBackground?
string = ...
_render.style.color.tagColor?
string = ...
_render.style.renderStyle
any = ...
_render.weight?
number = ...
end
number = ...
id?
string | number = annotationIdSchema
label?
string = ...
start
number = ...
textSelection?
string = ...
isNew
boolean
hasChanged
boolean
if the annotation has changes then create the annotation again, otherwise return the original annotation that has been cached.
Returns
object
@context
@context:
string
body?
optionalbody: {format:"text";language?:string;source?:string;type:"TextualBody";value:string; } | {purpose:"tagging";type:"TextualBody";value?:string; } | {id?:string;purpose:"describing";source?:string;type:"SpecificResource";value:any; } | {textType:string;type:"AnnotationType"; } | ({format:"text";language?:string;source?:string;type:"TextualBody";value:string; } | {purpose:"tagging";type:"TextualBody";value?:string; } | {id?:string;purpose:"describing";source?:string;type:"SpecificResource";value:any; } | {textType:string;type:"AnnotationType"; })[]
id
id:
string
motivation
motivation:
"tagging"|"classifying"
target?
optionaltarget: {processingLanguage?:string;selector?: {end:number;start:number;type:"TextPositionSelector"; } |object[];source?:string;textDirection?:"ltr"|"rtl";type:"Text"; } |object[]
Overrides
getAnnotation()
getAnnotation(
annotationId):object
Defined in: libs/core/src/lib/adapter/annotation/AnnotationAdapter.ts:220
Parameters
annotationId
string | number
Returns
object
_drawMetadata
_drawMetadata:
object=annotationDrawMetadataSchema
_drawMetadata.color?
optionalcolor:object
_drawMetadata.color.active
active:
object=annotationDrawColorSchema
_drawMetadata.color.active.border?
optionalborder:string
_drawMetadata.color.active.borderWidth
borderWidth:
number
_drawMetadata.color.active.fill?
optionalfill:string
_drawMetadata.color.default
default:
object=annotationDrawColorSchema
_drawMetadata.color.default.border?
optionalborder:string
_drawMetadata.color.default.borderWidth
borderWidth:
number
_drawMetadata.color.default.fill?
optionalfill:string
_drawMetadata.color.edit
edit:
object=annotationDrawColorSchema
_drawMetadata.color.edit.border?
optionalborder:string
_drawMetadata.color.edit.borderWidth
borderWidth:
number
_drawMetadata.color.edit.fill?
optionalfill:string
_drawMetadata.color.hover
hover:
object=annotationDrawColorSchema
_drawMetadata.color.hover.border?
optionalborder:string
_drawMetadata.color.hover.borderWidth
borderWidth:
number
_drawMetadata.color.hover.fill?
optionalfill:string
_drawMetadata.color.tag
tag:
object=tagColorSchema
_drawMetadata.color.tag.border?
optionalborder:string
_drawMetadata.color.tag.borderWidth
borderWidth:
number
_drawMetadata.color.tag.fill?
optionalfill:string
_drawMetadata.color.tag.text?
optionaltext:string
_drawMetadata.dimensions?
optionaldimensions:object
_drawMetadata.dimensions.x
x:
number
_drawMetadata.dimensions.y1
y1:
number
_drawMetadata.dimensions.y2
y2:
number
_drawMetadata.draws
draws:
object[]
_render
_render:
object=renderSchema
_render.isGutter
isGutter:
boolean
_render.lines
lines:
object[]
_render.render
render:
string
_render.style
style:
object=renderStyleSchema
_render.style.color
color:
object=annotationColorSchema
_render.style.color.background?
optionalbackground:string
_render.style.color.backgroundActive?
optionalbackgroundActive:string
_render.style.color.border?
optionalborder:string
_render.style.color.borderActive?
optionalborderActive:string
_render.style.color.color?
optionalcolor:string
_render.style.color.gutterColor?
optionalgutterColor:string
_render.style.color.tagBackground?
optionaltagBackground:string
_render.style.color.tagColor?
optionaltagColor:string
_render.style.renderStyle
renderStyle:
any
_render.weight?
optionalweight:number
end
end:
number
id?
optionalid:string|number=annotationIdSchema
label?
optionallabel:string
start
start:
number
textSelection?
optionaltextSelection:string
Inherited from
AnnotationAdapter.getAnnotation
getOriginalAnnotation()
protectedgetOriginalAnnotation(annotationId):object
Defined in: libs/core/src/lib/adapter/annotation/AnnotationAdapter.ts:216
Parameters
annotationId
string | number
Returns
object
@context
@context:
string
body?
optionalbody: {format:"text";language?:string;source?:string;type:"TextualBody";value:string; } | {purpose:"tagging";type:"TextualBody";value?:string; } | {id?:string;purpose:"describing";source?:string;type:"SpecificResource";value:any; } | {textType:string;type:"AnnotationType"; } | ({format:"text";language?:string;source?:string;type:"TextualBody";value:string; } | {purpose:"tagging";type:"TextualBody";value?:string; } | {id?:string;purpose:"describing";source?:string;type:"SpecificResource";value:any; } | {textType:string;type:"AnnotationType"; })[]
id
id:
string
motivation
motivation:
"tagging"|"classifying"
target?
optionaltarget: {processingLanguage?:string;selector?: {end:number;start:number;type:"TextPositionSelector"; } |object[];source?:string;textDirection?:"ltr"|"rtl";type:"Text"; } |object[]
Inherited from
AnnotationAdapter.getOriginalAnnotation
hover()
hover(
annotation):boolean
Defined in: libs/core/src/lib/adapter/annotation/AnnotationAdapter.ts:152
If return true, then on hover it becomes the active color
Parameters
annotation
end
number = ...
id?
string | number = annotationIdSchema
label?
string = ...
start
number = ...
textSelection?
string = ...
Returns
boolean
Inherited from
inject()
inject<
T>(token):T
Defined in: libs/core/src/lib/di/BaseAnnotationDiFn.ts:46
Inject a dependency from the annotation module's container.
Type Parameters
T
T
Parameters
token
Token<T>
The token identifying the service to inject
Returns
T
The service instance
Inherited from
parse()
parse(
annotation):object
Defined in: libs/core/src/lib/adapter/annotation/AnnotationAdapter.ts:95
Parameters
annotation
@context
string = ...
body?
{ format: "text"; language?: string; source?: string; type: "TextualBody"; value: string; } | { purpose: "tagging"; type: "TextualBody"; value?: string; } | { id?: string; purpose: "describing"; source?: string; type: "SpecificResource"; value: any; } | { textType: string; type: "AnnotationType"; } | ({ format: "text"; language?: string; source?: string; type: "TextualBody"; value: string; } | { purpose: "tagging"; type: "TextualBody"; value?: string; } | { id?: string; purpose: "describing"; source?: string; type: "SpecificResource"; value: any; } | { textType: string; type: "AnnotationType"; })[] = ...
id
string = ...
motivation
"tagging" | "classifying" = ...
target?
{ processingLanguage?: string; selector?: { end: number; start: number; type: "TextPositionSelector"; } | object[]; source?: string; textDirection?: "ltr" | "rtl"; type: "Text"; } | object[] = ...
Returns
object
_drawMetadata
_drawMetadata:
object=annotationDrawMetadataSchema
_drawMetadata.color?
optionalcolor:object
_drawMetadata.color.active
active:
object=annotationDrawColorSchema
_drawMetadata.color.active.border?
optionalborder:string
_drawMetadata.color.active.borderWidth
borderWidth:
number
_drawMetadata.color.active.fill?
optionalfill:string
_drawMetadata.color.default
default:
object=annotationDrawColorSchema
_drawMetadata.color.default.border?
optionalborder:string
_drawMetadata.color.default.borderWidth
borderWidth:
number
_drawMetadata.color.default.fill?
optionalfill:string
_drawMetadata.color.edit
edit:
object=annotationDrawColorSchema
_drawMetadata.color.edit.border?
optionalborder:string
_drawMetadata.color.edit.borderWidth
borderWidth:
number
_drawMetadata.color.edit.fill?
optionalfill:string
_drawMetadata.color.hover
hover:
object=annotationDrawColorSchema
_drawMetadata.color.hover.border?
optionalborder:string
_drawMetadata.color.hover.borderWidth
borderWidth:
number
_drawMetadata.color.hover.fill?
optionalfill:string
_drawMetadata.color.tag
tag:
object=tagColorSchema
_drawMetadata.color.tag.border?
optionalborder:string
_drawMetadata.color.tag.borderWidth
borderWidth:
number
_drawMetadata.color.tag.fill?
optionalfill:string
_drawMetadata.color.tag.text?
optionaltext:string
_drawMetadata.dimensions?
optionaldimensions:object
_drawMetadata.dimensions.x
x:
number
_drawMetadata.dimensions.y1
y1:
number
_drawMetadata.dimensions.y2
y2:
number
_drawMetadata.draws
draws:
object[]
_render
_render:
object=renderSchema
_render.isGutter
isGutter:
boolean
_render.lines
lines:
object[]
_render.render
render:
string
_render.style
style:
object=renderStyleSchema
_render.style.color
color:
object=annotationColorSchema
_render.style.color.background?
optionalbackground:string
_render.style.color.backgroundActive?
optionalbackgroundActive:string
_render.style.color.border?
optionalborder:string
_render.style.color.borderActive?
optionalborderActive:string
_render.style.color.color?
optionalcolor:string
_render.style.color.gutterColor?
optionalgutterColor:string
_render.style.color.tagBackground?
optionaltagBackground:string
_render.style.color.tagColor?
optionaltagColor:string
_render.style.renderStyle
renderStyle:
any
_render.weight?
optionalweight:number
end
end:
number
id?
optionalid:string|number=annotationIdSchema
label?
optionallabel:string
start
start:
number
textSelection?
optionaltextSelection:string
Inherited from
setConfig()
setConfig<
KEY>(key,value):void
Defined in: libs/core/src/lib/adapter/annotation/AnnotationAdapter.ts:190
Change the configuration of the adapter, it will update the eventlistener if rerendering of the annotations is needed. f.e. if the text direction changes, the adapter will emit a change event to update the annotations.
Type Parameters
KEY
KEY extends keyof AnnotationAdapter<BaseAnnotation>
Parameters
key
KEY
value
Returns
void
Inherited from
setConfigListener()
setConfigListener(
callback):void
Defined in: libs/core/src/lib/adapter/BaseAdapter.ts:14
Set a listener for configuration changes.
Parameters
callback
() => void
Returns
void
Inherited from
AnnotationAdapter.setConfigListener
setModule()
setModule(
module):void
Defined in: libs/core/src/lib/adapter/annotation/AnnotationAdapter.ts:89
Set the annotation module for dependency injection. This must be called before using inject().
Parameters
module
AnnotationModule
Returns
void
Inherited from
setText()
setText(
text,offsetStart):void
Defined in: libs/core/src/lib/adapter/annotation/AnnotationAdapter.ts:76
Parameters
text
string
offsetStart
number
Returns
void
Inherited from
tagLabel()
tagLabel(
annotation):string
Defined in: libs/core/src/lib/adapter/annotation/AnnotationAdapter.ts:145
Get the tag label of the annotation, it uses the tag function to determine the tag label.
Parameters
annotation
Pick<TextAnnotation, "id">
Returns
string