Constructor
new WordTag(val, word, config, top)
Creates a new WordTag instance
Parameters:
Name | Type | Default | Description |
---|---|---|---|
val |
String
|
The raw text for this WordTag |
|
word |
Word
|
The parent Word for this WordTag |
|
config |
Config~Config
|
The Config object for the parent TAG instance |
|
top |
Boolean
|
true |
True if this WordTag should be drawn above the parent Word, false if it should be drawn below |
- Source:
Members
textWidth
Returns the width of the bounding box of the WordTag's SVG text element
- Source:
Methods
draw()
(Re-)draws this WordTag's SVG elements onto the visualisation
- Source:
centre()
Centres this WordTag and its line horizontally against the base Word's current position (N.B.: SVG Text elements are positioned on the x-axis by their centres)
- Source:
remove() → {*}
Removes this WordTag's SVG elements from the visualisation
If this instance is not deleted, it can be redrawn with the .draw()
method
- Source:
drawTagLine()
Draws a connecting line between this WordTag and its parent Word, if this is a top WordTag.
- Source:
text(val) → {*}
Sets the text of this WordTag, or returns this WordTag's SVG text element
Parameters:
Name | Type | Description |
---|---|---|
val |
- Source:
boxWidth()
Returns the width of the bounding box for this WordTag
- Source:
drawBbox()
Draws the outline of this component's bounding box
- Source:
drawTextBbox()
Draws the outline of the text element's bounding box
- Source: