Class: TextLineAdapterImpl
@ghentcdh/annotated-text / TextLineAdapterImpl
Class: TextLineAdapterImpl
Defined in: libs/core/src/lib/adapter/text/textline/TextLineAdapter.ts:45
This adapter is used to parse a text that includes line numbers.
f.e. 1.Χ[αι]ρήμ[ων] Ἀπολλωνίωι τῶι\n2.[φι]λτάτωι χαίρειν. will be parsed into an array of TextLine objects of 2 lines, in the gutter the line number will appear.
Extends
Constructors
Constructor
new TextLineAdapterImpl():
TextLineAdapterImpl
Returns
TextLineAdapterImpl
Inherited from
Properties
annotationAdapter
protectedannotationAdapter:AnnotationAdapter<any>
Defined in: libs/core/src/lib/di/BaseAnnotationDiFn.ts:51
Inherited from
annotationModule
protectedannotationModule:AnnotationModule
Defined in: libs/core/src/lib/di/BaseAnnotationDiFn.ts:27
Inherited from
flatText
flatText:
boolean=false
Defined in: libs/core/src/lib/adapter/text/TextAdapter.ts:37
Inherited from
limit
limit:
object=null
Defined in: libs/core/src/lib/adapter/text/TextAdapter.ts:38
end
end:
number
The end position in the text up to which to consider lines. This is exclusive.
ignoreLines?
optionalignoreLines:boolean
If true, characters that are outside the range will be ignored. If false, lines that intersect with the range will be included. Defaults to false.
start
start:
number
The start position in the text from which to consider lines. This is inclusive.
Inherited from
lines
lines:
TextLine[] =[]
Defined in: libs/core/src/lib/adapter/text/TextAdapter.ts:43
Inherited from
name
name:
string='TextLineAdapter'
Defined in: libs/core/src/lib/adapter/text/textline/TextLineAdapter.ts:46
Name of the adapter. Be unique 😃.
Overrides
style
style:
object
Defined in: libs/core/src/lib/adapter/text/TextAdapter.ts:40
lineHeight
lineHeight:
number=22
lineOffset
lineOffset:
number=2
padding
padding:
number=6
Inherited from
svgModel
protectedsvgModel:SvgModel
Defined in: libs/core/src/lib/di/BaseAnnotationDiFn.ts:52
Inherited from
textAdapter
protectedtextAdapter:TextAdapter
Defined in: libs/core/src/lib/di/BaseAnnotationDiFn.ts:50
Inherited from
textDirection
textDirection:
TextDirection='ltr'
Defined in: libs/core/src/lib/adapter/text/TextAdapter.ts:36
Inherited from
textLength
textLength:
number=0
Defined in: libs/core/src/lib/adapter/text/TextAdapter.ts:41
Inherited from
textOffset
textOffset:
number=0
Defined in: libs/core/src/lib/adapter/text/TextAdapter.ts:39
Inherited from
Methods
changeConfig()
changeConfig():
void
Defined in: libs/core/src/lib/adapter/BaseAdapter.ts:18
Returns
void
Inherited from
clear()
clear():
void
Defined in: libs/core/src/lib/adapter/text/TextAdapter.ts:110
Returns
void
Inherited from
getLimit()
getLimit(
lines?):Pick<{end:number;ignoreLines?:boolean;start:number; },"start"|"end">
Defined in: libs/core/src/lib/adapter/text/TextAdapter.ts:52
Parameters
lines?
TextLine[]
Returns
Pick<{ end: number; ignoreLines?: boolean; start: number; }, "start" | "end">
Inherited from
getLine()
getLine(
lineUid):TextLine
Defined in: libs/core/src/lib/adapter/text/TextAdapter.ts:106
Parameters
lineUid
string
Returns
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(
text):TextLine[]
Defined in: libs/core/src/lib/adapter/text/textline/TextLineAdapter.ts:48
Parses the given text into an array of TextLine objects. The parser is also responsible for handling text limits.
Parameters
text
string
Returns
TextLine[]
Overrides
setConfig()
setConfig<
KEY>(key,value):void
Defined in: libs/core/src/lib/adapter/text/TextAdapter.ts:83
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 TextAdapter
Parameters
key
KEY
value
TEXT_CONFIG_VALUES<KEY>
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
setLineHeight()
setLineHeight(
height):void
Defined in: libs/core/src/lib/adapter/text/TextAdapter.ts:70
Parameters
height
number
Returns
void
Inherited from
setLines()
setLines(
lines):void
Defined in: libs/core/src/lib/adapter/text/TextAdapter.ts:65
Parameters
lines
TextLine[]
Returns
void
Inherited from
setModule()
setModule(
module):void
Defined in: libs/core/src/lib/di/BaseAnnotationDiFn.ts:33
Set the annotation module for dependency injection. This must be called before using inject().
Parameters
module
AnnotationModule
Returns
void