Last updated

API / geotoolkit / report / elements / TextElement / TextElement

Class: TextElement

elements.TextElement.TextElement

Define representation of DOM text element

Hierarchy

Implements

Table of contents

Constructors
Methods
addCssClassaddInvalidateHandlerapplyOpacity
applyResponsiveStylecheckCollisionclone
connectStylecopyConstructordisconnectStyle
disposedropCacheenableEventPropagation
executefiltergetAltText
getAnchorgetAnchorPointgetAnchorType
getAnchorXgetAnchorYgetAnimationStyle
getAspectRatiogetAutoSizegetBounds
getClassNamegetClipStylegetCornerRadius
getCssgetCssClassgetCssClasses
getCssTransformgetDisplayableTextgetDomElement
getElementStylegetEllipsisOptionsgetEllipsisString
getFillStylegetHeightgetId
getInvalidateMethodgetIsPointingUpgetLayoutStyle
getLineStylegetLocalTransformgetMarginsStyle
getMaxSizegetMinSizegetName
getOpacitygetOpacityBlendModegetPadding
getPaddingStylegetParentgetPreferredElementBounds
getPreserveAspectRatiogetPreserveReadingOrientationgetPreserveRightAngle
getPropertiesgetPropertygetPropertyKeys
getRenderingFiltergetResponsiveStylegetRoot
getRotationAnglegetScaleScrollStrategygetSceneTransform
getShowEllipsisgetSizegetSizeIsInDeviceSpace
getSizeModegetTaggetText
getTextStylegetTextTransformgetUseMinMaxSize
getUserHeightgetUserWidthgetVisible
getWidthgetWorldTransformgetZIndex
hasCssClasshasEventListenerhitTest
invalidateinvalidateParentisDisposed
isEventPropagationEnabledisNotificationEnabledisSelectable
isSilentisSimplenotify
offononDomElementChanged
onParentChangedonVisibilityChangedpostRendering
preRenderingrebuildDomLayoutregisterAnimationStyle
removeCssClassremoveInvalidateHandlerrender
renderAsyncrotatescale
setAltTextsetAnchorsetAnchorType
setAnchorXsetAnchorYsetAnimationStyle
setAutoSizesetBoundssetClipStyle
setCornerRadiussetCsssetCssClass
setCssTransformsetDomElementsetElementStyle
setEllipsisOptionssetEllipsisStringsetFillStyle
setHeightsetIdsetIsPointingUp
setLayoutStylesetLineStylesetLocalTransform
setMarginsStylesetMaxSizesetMinSize
setNamesetNotificationsetOpacity
setPaddingsetPaddingStylesetPreserveAspectRatio
setPreserveReadingOrientationsetPreserveRightAnglesetProperties
setPropertysetRectsetRenderingFilter
setResponsiveStylesetRotationAnglesetScaleScrollStrategy
setSelectablesetShowEllipsissetSilent
setSizesetSizeIsInDeviceSpacesetSizeMode
setTagsetTextsetTextStyle
setTextTransformsetTextWithElementssetUseMinMaxSize
setUserSizesetVisiblesetWidth
setZIndexsheartoString
translateunregisterAnimationStyleupdateGeometry
updateSceneTransformationupdateStateupdateTimeStamp
enableSceneGraphNotificationfindParentgetAnchorPosition
getClassNameintersectsBoundsisSceneGraphNotificationEnabled
Css Properties
Name Type Description
alignmentAnchorTypeAlignment according to the anchor point
autosizebooleanAutomatically fit shape bounds to text size, default is true Set it to false if you have more than one paragraph inside with different alignment
axnumberAnchor x position
aynumberAnchor y position
clipstyleClipStyleClipping style
clipstyle-evenoddbooleanTrue if evenodd mode is on ('nonzero' mode otherwise)
clipstyle-geometryGraphicsPathClipping geometry
clipstyle-geometry-boundsRectBounds
clipstyle-geometry-bounds-heightnumberHeight
clipstyle-geometry-bounds-readonlybooleanReadonly
clipstyle-geometry-bounds-widthnumberWidth
clipstyle-geometry-bounds-xnumberLeft
clipstyle-geometry-bounds-ynumberTop
clipstyleGraphicsPathClipping style
cssclassstringThe css class name of this node
csscursorstringCSS cursor associated with node
cssstylestringCSS style to be applied to inserted elements
ellipsisstringstringString ellipsis that renders if ellipsis is true
fillstylestringStyle applied on fill
fillstyleFillStyleStyle applied on fill
fillstyle-colorstringColor in CSS form
fillstyle-evenoddmodebooleanEven-odd fill mode
fillstyle-fillpatternPatternPattern
fillstyle-fillpattern-containernamestringAn optional container name, which creates an image pattern. This parameter is used for serialization if you want to save are reference to pattern instead of the pattern itself
fillstyle-fillpattern-patternnamestringName of this pattern for indexing
fillstyle-fillpattern-scalablebooleanFlag that sets scalability of the pattern coordinates, or relative to the shape it is filling (It is not supported)
fillstyle-foregroundstringForeground color
fillstyle-patternPatternPattern
heightnumberShape height
idstring | numberId of the node, its a unique identifier
ispointingupbooleanDefines whether the shape is always pointing up
layoutstyleLayoutStyleLayout style to specify how to lay out shape
layoutstyle-constraintSizeConstraintLayout constrains
layoutstyle-flexgrownumberNumber specifying how much the item will grow relative to the rest of the items inside the same container
layoutstyle-flexshrinknumberNumber specifying how much the item will shrink relative to the rest of the items inside the same container
layoutstyle-floatstringFloat position
layoutstyle-positionstringLayout position
layoutstyle-sizenumber | stringLayout size
linestylestringStyle applied on outline
linestyleLineStyleStyle applied on outline
linestyle-colorstringColor in CSS form
linestyle-fillstringOptional fill style to be used to fill lines generated with this style
linestyle-fillFillStyleOptional fill style to be used to fill lines generated with this style
linestyle-linecapCapStyleThe line cap style
linestyle-linedashoffsetnumberLine dash offset of dashed line
linestyle-linejoinJoinStyleThe line join style
linestyle-pixelsnapmodebooleanPixel Snap Mode, default(
linestyle-scalablebooleanTrue if width should depend on transformation
linestyle-unitstringOptional unit for the width
linestyle-widthnumber | stringThe line thickness
localtransformTransformationLocal transformation
localtransform-dxnumberX axis translation
localtransform-dynumberY axis translation
localtransform-xxnumberX scale
localtransform-xynumberXy skew
localtransform-yxnumberYx skew
localtransform-yynumberY scale
marginsnumber | stringIt has properties for specifying the margins for each side
maxdimensionDimensionMaximum size for rendering
maxdimension-heightnumberHeight of dimension
maxdimension-widthnumberWidth of dimension or properties
mindimensionDimensionMinimum size for rendering
namestringName of the node. It is often used for debugging purposes or to simplify queries
opacitynumberNode opacity (from 0 to 1). If it is undefined or null it inherits property from the parent. It changes globalAlpha on the rendering context
opacityblendmodeBlendModeNode opacity mode to blend it
paddingnumber
paddingstylenumber | stringInner padding style in device coordinates
preserveaspectratiobooleanPreserve aspect ratio of the anchored shape
preservereadingorientationbooleanPreserve reading orientation for local transform
preserverightanglebooleanPreserve right angle for local transformation
radiusnumberBorder radius in device coordinates
rotationanglenumberRotation angle at anchor
scalescrollstrategyScaleScrollStrategyScale scroll strategy
scalescrollstrategy-enabledbooleanEnable flag
selectablebooleanSelectable node, a boolean to determine if selection should consider this node
showellipsisbooleanEllipsis flag
sizeisindevicespacebooleanIs coordinate in device space
sizemodeSizeModeText size mode, default value depends on width and height settings
taganyCustom information associated with node. It is a user object which can be used by client code to store information or attach an application object to the shape
textstringText to display
textstylestringTextStyle to display
textstyleTextStyleTextStyle to display
textstyle-alignmentAlignmentStyleAlignment
textstyle-autosizebooleanAuto font size on high definition display
textstyle-backgroundstringBackground style
textstyle-backgroundFillStyleBackground style
textstyle-baselineBaseLineStyleBase line
textstyle-colorstringColor in CSS form
textstyle-fillFillStyleText fill style
textstyle-fontstringFont see
textstyle-fonturlstringThe place from which the font will be loaded, if null - uses system fonts. It can be base64 with url keyword
textstyle-lineheightstring | numberLine height
textstyle-multilinebooleanAllow multi-line text
textstyle-outlinestringOutline style
textstyle-outlineLineStyleOutline style
textstyle-overflowwrapOverflowWrapStyleOverflow wrap
textstyle-strikethroughstringStrikethrough style
textstyle-strikethroughLineStyleStrikethrough style
textstyle-textoverflowTextOverflowStyleText overflow
textstyle-underlinestringUnderline style
textstyle-underlineLineStyleUnderline style
textstyle-underlineoffsetstring | numberUnderline offset distance
textstyle-whitespaceWhiteSpaceStyleWhite space
textstyle-wordbreakWordBreakStyleWord break
texttransformTransformText-transform (uppercase, lowercase, capitalize)
transformstringAdditional CSS transformation applied to node or 'none'
transformTransformationAdditional CSS transformation applied to node or 'none'
useminmaxdimensionsbooleanUse the min max dimensions to limit visual size
userheightnumberHeight
userwidthnumberWidth
visiblebooleanVisibility of the node, a boolean to determine if the node should be rendered or not
widthnumberShape width
z-indexnumberDefine node z-index

Contents

Constructors

new TextElement(options, ax, ay, width, height, textStyle, sizeIsInDeviceSpace, alignment)

new TextElement(options?, ax?, ay?, width?, height?, textStyle?, sizeIsInDeviceSpace?, alignment?)

Parameters

Name Type Description
Optional optionsstring | number | Optionstext to display or object, which contains shape properties
Optional axnumberx coordinate of anchor
Optional aynumbery coordinate of anchor
Optional widthnumberdesired width
Optional heightnumberdesired height
Optional textStyleTextStyletextStyle to display
Optional sizeIsInDeviceSpacebooleansize Is In Device Space
Optional alignmentAnchorTypeanchor type

Overrides

Text.constructor

Methods

addCssClass

addCssClass(cssclass): TextElement

Adds new css class to node

Parameters

Name Type Description
cssclassstring | string[]css class name('s)

Returns

TextElement

this

Inherited from

Text.addCssClass


addInvalidateHandler

addInvalidateHandler(handler): TextElement

Add invalidate handler

Deprecated

since 4.0, use Node.on instead

Parameters

Name Type Description
handlerFunctionhandler to be notified about invalidation

Returns

TextElement

this

Inherited from

Text.addInvalidateHandler


applyOpacity

Protected applyOpacity(context): TextElement

This method is called to apply opacity if it is specified on the rendering context. The default implementation sets global alpha on the rendering context

Parameters

Name Type Description
contextRenderingContextRendering Context

Returns

TextElement

this

Inherited from

Text.applyOpacity


applyResponsiveStyle

Protected applyResponsiveStyle(): void

Apply a responsive style rules it is exists

Returns

void

Inherited from

Text.applyResponsiveStyle


checkCollision

checkCollision(context): boolean

Check if this node is within the area being rendered by the context

Parameters

Name Type Description
contextRenderingContextRendering Context

Returns

boolean

true if object is inside of renderable area

Inherited from

Text.checkCollision


clone

clone(): TextElement

All subclasses should override copyConstructor or provide custom implementation for this method

Returns

TextElement

clone

Overrides

Text.clone


connectStyle

connectStyle(style, type, callback): TextElement

Connects style.

This convenience method subscribes a listener to given style for the specified type.
And automatically un-subscribes listener if node is disposed to prevent memory leaks

Parameters

Name Type Description
styleEventDispatcherconnect style
typestringtype of event or property
callbackAttributeCallback<EventDispatcher>function to be called

Returns

TextElement

this

Inherited from

Text.connectStyle


copyConstructor

Protected copyConstructor(src, deepCopy?): TextElement

Copy constructor function.
Function used as part of the cloning mechanism.
Implementations should copy the given instance state to this instance.

Parameters

Name Type Description
srcTextElementSource to copy from
Optional deepCopybooleandeep copy

Returns

TextElement

this

Overrides

Text.copyConstructor


disconnectStyle

disconnectStyle(style, type, callback): TextElement

Disconnect style
This convenience method un-subscribes a listener to given style for the specified type.

Parameters

Name Type Description
styleEventDispatcherconnect style
typestringtype of event or property
callbackAttributeCallback<EventDispatcher>function to be called

Returns

TextElement

this

Inherited from

Text.disconnectStyle


dispose

dispose(): void

Disposes this node, once disposes a node should not be used anymore.
Clear all listeners, and disconnect styles to avoid memory leaks.
Also aggressively 'cleanup' this node by setting some of its members to null.

Returns

void

Inherited from

Text.dispose


dropCache

dropCache(clearCache?): TextElement

Drop cache

Parameters

Name Type Description
Optional clearCachebooleanclear flag

Returns

TextElement

this


enableEventPropagation

enableEventPropagation(enable): TextElement

Enable event propagation from the node hierarchy from bottom to top

This option is similar to DOM Event bubbling, which allows to get any event from child node. By default it is disabled for better performance.

Example

import {Group} from '@int/geotoolkit/scene/Group';
import {Events as SceneEvents} from '@int/geotoolkit/scene/Node';
const parentGroup = new Group()
.setName('ParentGroup')
.enableEventPropagation(true);
const childGroup = new Group()
.setName('ChildGroup');

parentGroup.addChild(childGroup);
parentGroup.on(SceneEvents.Invalidate, (eventName, sender, args) => {
// Got notifications from all children of parent group
});
childGroup.invalidate();

Parameters

Name Type Description
enablebooleanenable

Returns

TextElement

this

Inherited from

Text.enableEventPropagation


execute

execute(delegate): TextElement

Executes delegate and return the result. It allows us to keep all initialization calls in one place,
and we do not need to scroll up or down in IDE to find how and where it was initialized.

Example

// All setters (.setName() for example) returns reference to the this.
// In order to modify inner object like LineStyle or Pattern, to get this object (property) we should call getter to get object reference.
// Then modify it as shown below in Option 1 or you can use execute methods shown in Option 2.
import {Group} from '@int/geotoolkit/scene/Group';
import {Rect} from '@int/geotoolkit/util/Rect';
// Option 1
const group = new Group()
.setName('MyGroup')
.setBounds(new Rect(0, 0, 42, 16))
.enableClipping(true)
.setTag({'type': 'sometype'});

group.getLineStyle().setPattern('pattern');
return group;

// Options 2 ( using execute method )
return group
.execute(function () {
this.getLineStyle()
.setPattern("pattern");
});

Parameters

Name Type Description
delegate(this: TextElement) => voidFunction to execute

Returns

TextElement

The result if any or this

Inherited from

Text.execute

execute<T>(delegate): T

Type parameters

Name
T

Parameters

Name Type
delegate(this: TextElement) => T

Returns

T

Inherited from

Text.execute


filter

Protected filter(context): boolean

Filter node

Parameters

Name Type Description
contextRenderingContextRendering Context

Returns

boolean

flag filter flag ("true" to render node; "false" otherwise)

Inherited from

Text.filter


getAltText

getAltText(): string

Return alt text

Returns

string


getAnchor

getAnchor(tr?): Point

Gets the anchor

Parameters

Name Type Description
Optional trTransformationtransformation to transform anchor

Returns

Point

Inherited from

Text.getAnchor


getAnchorPoint

getAnchorPoint(context): object

Update geometry

Parameters

Name Type Description
contextRenderingContextRendering Context

Returns

object

anchor point


getAnchorType

getAnchorType(): AnchorType

Returns the current anchor type.

Returns

AnchorType

current anchor type

Inherited from

Text.getAnchorType


getAnchorX

getAnchorX(): number

Return anchored x position

Returns

number

Inherited from

Text.getAnchorX


getAnchorY

getAnchorY(): number

Return anchored y position

Returns

number

Inherited from

Text.getAnchorY


getAnimationStyle

getAnimationStyle(): AnimationStyle

Return animation style

Returns

AnimationStyle

animationStyle current animation style

Inherited from

Text.getAnimationStyle


getAspectRatio

getAspectRatio(): number

Returns aspect ratio of the content of the shape Returns 1

Returns

number

Inherited from

Text.getAspectRatio


getAutoSize

getAutoSize(): boolean

Return auto size mode

Returns

boolean

Inherited from

Text.getAutoSize


getBounds

getBounds(): Rect

Return bound in the parent coordinates

Returns

Rect

Inherited from

Text.getBounds


getClassName

getClassName(): string

Returns

string

Inherited from

Text.getClassName


getClipStyle

getClipStyle(): ClipStyle

Gets the current clipping style

Returns

ClipStyle

clipping style

Inherited from

Text.getClipStyle


getCornerRadius

getCornerRadius(): number

return corner radius

Returns

number

radius

Inherited from

Text.getCornerRadius


getCss

getCss(): CssStyle

Return CSS style

Returns

CssStyle

Inherited from

Text.getCss


getCssClass

getCssClass(): string

Returns css class name to be used to apply CSS style

Returns

string

the css class name

Inherited from

Text.getCssClass


getCssClasses

getCssClasses(): string[]

Gets list of css class names which applied to this node

Returns

string[]

Inherited from

Text.getCssClasses


getCssTransform

getCssTransform(): string

Returns CSS transformation

Returns

string

Inherited from

Text.getCssTransform


getDisplayableText

getDisplayableText(): string

Returns the text string that will be rendered depending on textStyle's wrapping value.

Returns

string

the text string that will be rendered

Inherited from

Text.getDisplayableText


getDomElement

getDomElement(): AbstractTextElement

Returns DOM element

Returns

AbstractTextElement

return DOM element

Implementation of

IElement.getDomElement


getElementStyle

getElementStyle(elementStyle?): any

Returns element style

Parameters

Name Type Description
Optional elementStylestringelement style

Returns

any

return element style

Implementation of

IElement.getElementStyle


getEllipsisOptions

getEllipsisOptions(): EllipsisOptions

Returns

EllipsisOptions

ellipsis options

Inherited from

Text.getEllipsisOptions


getEllipsisString

getEllipsisString(): string

Get ellipsis text

Returns

string

Inherited from

Text.getEllipsisString


getFillStyle

getFillStyle(): FillStyle

Return fill style

Returns

FillStyle

fillStyle current fill style

Inherited from

Text.getFillStyle


getHeight

getHeight(): number

Return height of the shape

Returns

number

Inherited from

Text.getHeight


getId

getId(): string | number

Returns the associated identifier of the node

Returns

string | number

The node's id

Inherited from

Text.getId


getInvalidateMethod

Protected getInvalidateMethod(): AttributeCallback<EventDispatcher>

Gets invalidate method

Returns

AttributeCallback<EventDispatcher>

method to invalidate this object

Inherited from

Text.getInvalidateMethod


getIsPointingUp

getIsPointingUp(): boolean

Returns true if the shape is always pointing up

Returns

boolean

true if the shape is always pointing up

Inherited from

Text.getIsPointingUp


getLayoutStyle

getLayoutStyle(): LayoutStyle<string | number>

Return desired layout style

Returns

LayoutStyle<string | number>

Inherited from

Text.getLayoutStyle


getLineStyle

getLineStyle(): LineStyle

Return line style

Returns

LineStyle

lineStyle current line style

Inherited from

Text.getLineStyle


getLocalTransform

getLocalTransform(): Transformation

Retrieves the transformation of bounds to parent

Returns

Transformation

transform the local transform.

Inherited from

Text.getLocalTransform


getMarginsStyle

getMarginsStyle(): SpaceStyle<string | number>

Return margins style

Returns

SpaceStyle<string | number>

Inherited from

Text.getMarginsStyle


getMaxSize

getMaxSize(): Dimension

returns the maximum device space rendering dimension only works when setUseMinMaxSize is enabled.

Returns

Dimension

max size

Inherited from

Text.getMaxSize


getMinSize

getMinSize(): Dimension

returns the minimum device space rendering dimension only works when setUseMinMaxSize is enabled.

Returns

Dimension

min size

Inherited from

Text.getMinSize


getName

getName(): string

Returns the node name

Returns

string

The node name

Inherited from

Text.getName


getOpacity

getOpacity(): number

Returns current node opacity

Returns

number

opacity

Inherited from

Text.getOpacity


getOpacityBlendMode

getOpacityBlendMode(): BlendMode

Returns current node opacity

Returns

BlendMode

opacity blend mode

Inherited from

Text.getOpacityBlendMode


getPadding

getPadding(): number

return inner padding

Deprecated

since 4.1 use getPaddingStyle instead

Returns

number

padding

Inherited from

Text.getPadding


getPaddingStyle

getPaddingStyle(): SpaceStyle<string | number>

Return padding style

Returns

SpaceStyle<string | number>

padding

Inherited from

Text.getPaddingStyle


getParent

getParent(): ElementContent

Return parent node

Returns

ElementContent

parent node

Overrides

Text.getParent


getPreferredElementBounds

Protected getPreferredElementBounds(limits, cssLayout): Rect

Calculate layout bounds

Parameters

Name Type Description
limitsRectcontainer limits
cssLayoutLayoutStyle<string | number>element layout

Returns

Rect

preferred bounds


getPreserveAspectRatio

getPreserveAspectRatio(): boolean

Returns true if aspect ratio is preserved

Returns

boolean

true if aspect ratio is preserved

Inherited from

Text.getPreserveAspectRatio


getPreserveReadingOrientation

getPreserveReadingOrientation(): boolean

Returns true if the shape is always in a readable orientation

Returns

boolean

true if the shape is always in a readable orientation

Inherited from

Text.getPreserveReadingOrientation


getPreserveRightAngle

getPreserveRightAngle(): boolean

Returns true if right angles are preserved

Returns

boolean

true if right angles are preserved

Inherited from

Text.getPreserveRightAngle


getProperties

getProperties(context?): OptionsOut

Gets all the properties pertaining to this object

Parameters

Name Type Description
Optional contextISerializationContextserialization context

Returns

OptionsOut

properties

Inherited from

Text.getProperties


getProperty

getProperty(name): any

Gets dynamic property by name. These properties can be used as a property bags

Parameters

Name Type Description
namestringproperty name

Returns

any

Inherited from

Text.getProperty


getPropertyKeys

getPropertyKeys(): string[]

Returns known properties keys

Returns

string[]

Inherited from

Text.getPropertyKeys


getRenderingFilter

getRenderingFilter(): IFilter

Return filter to be used for rendering and picking

Returns

IFilter

current filter

Inherited from

Text.getRenderingFilter


getResponsiveStyle

getResponsiveStyle(): ResponsiveStyle

Return responsive style

Returns

ResponsiveStyle

Inherited from

Text.getResponsiveStyle


getRoot

getRoot(): Node

Returns root node.
If node doesn't have parent then it returns itself.

Returns

Node

the root node

Inherited from

Text.getRoot


getRotationAngle

getRotationAngle(): number

Returns rotation angle (in radians)

Returns

number

rotationAngle rotation angle at anchor

Inherited from

Text.getRotationAngle


getScaleScrollStrategy

getScaleScrollStrategy(): Delegate

Gets scale scroll strategy

Returns

Delegate

scale scroll strategy

Inherited from

Text.getScaleScrollStrategy


getSceneTransform

getSceneTransform(): Transformation

Returns transformation from node to root scene

Returns

Transformation

a transformation from node to root scene

Inherited from

Text.getSceneTransform


getShowEllipsis

getShowEllipsis(): boolean

Returns ellipsis flag

Returns

boolean

ellipsis flag

Inherited from

Text.getShowEllipsis


getSize

getSize(): Dimension

Returns the size as a dimension object.

Returns

Dimension

size

Inherited from

Text.getSize


getSizeIsInDeviceSpace

getSizeIsInDeviceSpace(): boolean

Returns true if the shape size is set in device space

Returns

boolean

true if size is defined in device space

Inherited from

Text.getSizeIsInDeviceSpace


getSizeMode

getSizeMode(): SizeMode

Returns how the size is computed

Returns

SizeMode

size mode

Inherited from

Text.getSizeMode


getTag

getTag(): any

Returns the object associated with the node by user.

Returns

any

The node's user-object

Inherited from

Text.getTag


getText

getText(): string

Get this text's contents as a string.

Returns

string

text

Inherited from

Text.getText


getTextStyle

getTextStyle(): TextStyle

The style associated with this text.

Returns

TextStyle

text style

Inherited from

Text.getTextStyle


getTextTransform

getTextTransform(): string

Returns text transform type

Returns

string

Inherited from

Text.getTextTransform


getUseMinMaxSize

getUseMinMaxSize(): boolean

true if using the min max device space sizes

Returns

boolean

true if using the min max device space sizes

Inherited from

Text.getUseMinMaxSize


getUserHeight

getUserHeight(): number

Returns user defined height (if exists)

Returns

number

Inherited from

Text.getUserHeight


getUserWidth

getUserWidth(): number

Returns user defined width (if exists)

Returns

number

Inherited from

Text.getUserWidth


getVisible

getVisible(): boolean

Return visibility of the node

Returns

boolean

true if node is visible

Inherited from

Text.getVisible


getWidth

getWidth(): number

Return width of the shape

Returns

number

Inherited from

Text.getWidth


getWorldTransform

getWorldTransform(): Transformation

Retrieves the local transformation of the node which represents multiplication of parent to bounds and contents transformations.

Returns

Transformation

transform the world transform.

Inherited from

Text.getWorldTransform


getZIndex

getZIndex(): number

Returns node z-index (null if not set)

Returns

number

Inherited from

Text.getZIndex


hasCssClass

hasCssClass(cssClass): boolean

Check if node has specified css class

Parameters

Name Type Description
cssClassstringcss class name

Returns

boolean

Inherited from

Text.hasCssClass


hasEventListener

hasEventListener(type, callback?): boolean

Check if a list of event listeners for this type contains this listener

Parameters

Name Type Description
typestringtype of event or property
Optional callbackFunctionto be called, if null, check if any callback is registered

Returns

boolean

Inherited from

Text.hasEventListener


hitTest

hitTest(area, radius?): Hits

Hit test in the device coordinate. This method checks if any point is intersects <html>node inside text

Parameters

Name Type Description
areaAreamodel area or position
Optional radiusnumberradius of selection

Returns

Hits

properties

Inherited from

Text.hitTest


invalidate

invalidate(bounds?, force?): TextElement

Invalidate area of the shape. This method invalidates parent by default. invalidated from parent to root node.

Parameters

Name Type Description
Optional boundsRectbounds of the invalid rectangle in the inner node coordinates
Optional forcebooleantrue if parent should be invalidated immediately if null is provided then cache (if any will be completely refreshed) otherwise only specified rect or node.bounds will be refreshed

Returns

TextElement

this

Inherited from

Text.invalidate


invalidateParent

invalidateParent(bounds?, force?): TextElement

Invalidate bounds

Parameters

Name Type Description
Optional boundsRectif null is provided then cache (if any will be completely refreshed) otherwise only specified rect or node.bounds will be refreshed
Optional forcebooleanflag indicating if the parent must be forcibly invalidated

Returns

TextElement

this

Inherited from

Text.invalidateParent


isDisposed

isDisposed(): boolean

Returns whether this object has been disposed

Returns

boolean

Inherited from

Text.isDisposed


isEventPropagationEnabled

isEventPropagationEnabled(): boolean

Return true if event propagation is enabled from child to parent

Returns

boolean

Inherited from

Text.isEventPropagationEnabled


isNotificationEnabled

isNotificationEnabled(): boolean

return state of notification

Returns

boolean

current notification state

Inherited from

Text.isNotificationEnabled


isSelectable

isSelectable(): boolean

Returns true if node can be picked/selected.

Returns

boolean

The selectable flag

Inherited from

Text.isSelectable


isSilent

isSilent(): boolean

Return true if the event dispatcher doesn't notify any events

Returns

boolean

Inherited from

Text.isSilent


isSimple

isSimple(): boolean

Returns true if text element is simple

Returns

boolean


notify

notify<E>(event, source, args?): TextElement

Notify listeners of the Node

Type parameters

NameType
Eextends string

Parameters

Name Type Description
eventEtype of event
sourceAbstractNodesource who called the event
Optional argsEventMap[E]event arguments

Returns

TextElement

this

Inherited from

Text.notify


off

off<E>(type?, callback?): TextElement

Detach listener on event. Calling .off() with no arguments removes all attached listeners. Calling .off(type) with no callback removes all attached listeners for specific type.

Type parameters

NameType
Eextends string

Parameters

Name Type Description
Optional typeEtype of the event
Optional callback(eventType: E, sender: TextElement, args: EventMap[E]) => voidfunction to be called

Returns

TextElement

this

Inherited from

Text.off


on

on<E>(type, callback): TextElement

Attach listener on event that will be called whenever the specified event is delivered to the target

If the callback function is already in the list of event listeners for this target, the function is not added a second time.

If a particular anonymous function is in the list of event listeners registered for a certain target, and then later in the code, an identical anonymous function is given in an "on" call, the second function will also be added to the list of event listeners for that target.

Type parameters

NameType
Eextends string

Parameters

Name Type Description
typeEtype of event or property
callback(eventType: E, sender: TextElement, args: EventMap[E]) => voidto be called

Returns

TextElement

this

Inherited from

Text.on


onDomElementChanged

Protected onDomElementChanged(eventType, sender, eventArgs): TextElement

Update element from domElement

Parameters

Name Type Description
eventTypestringevent type
senderElement
eventArgsNodeEventArgsargument args

Returns

TextElement


onParentChanged

Protected onParentChanged(node): TextElement

This method is called when parent changes. Do not call it directly.

Parameters

Name Type Description
nodeNodenode to change parent

Returns

TextElement

this

Inherited from

Text.onParentChanged


onVisibilityChanged

Protected onVisibilityChanged(): void

This method is called if visibility is changed. Send event Events.VisibilityChanged

Returns

void

Inherited from

Text.onVisibilityChanged


postRendering

Protected postRendering(context): void

To be called after rendering. Call this method if you override method render

Parameters

Name Type Description
contextRenderingContextRendering Context

Returns

void

Inherited from

Text.postRendering


preRendering

Protected preRendering(context): void

Occurs before rendering this method sets clipping by default. Call this method if you override method render

Parameters

Name Type Description
contextRenderingContextRendering Context

Returns

void

Inherited from

Text.preRendering


rebuildDomLayout

rebuildDomLayout(): TextElement

Rebuild DOM layout

Returns

TextElement

Implementation of

IElement.rebuildDomLayout


registerAnimationStyle

registerAnimationStyle(root): void

Register animation style.

Parameters

Name Type Description
rootNoderoot node for node

Returns

void

Inherited from

Text.registerAnimationStyle


removeCssClass

removeCssClass(cssclass): TextElement

Removes css class from node

Parameters

Name Type Description
cssclassstring | string[]css class name('s)

Returns

TextElement

this

Inherited from

Text.removeCssClass


removeInvalidateHandler

removeInvalidateHandler(handler): TextElement

Remove invalidate handler

Deprecated

since 4.0, use Node.off instead

Parameters

Name Type Description
handlerFunctionhandler to be notified about invalidation

Returns

TextElement

this

Inherited from

Text.removeInvalidateHandler


render

render(context): void

Renders node

Parameters

Name Type Description
contextRenderingContextThe rendering context to be used to draw the node

Returns

void

Inherited from

Text.render


renderAsync

renderAsync(context, callback): void

Render node in asynchronous mode. Default implementation creates call method "render" inside

Parameters

Name Type Description
contextRenderingContextThe rendering context to be used to draw the node
callbackFunctioncallback function

Returns

void

Overrides

Text.renderAsync


rotate

rotate(theta, x?, y?): TextElement

Rotate bounds around a given coordinate or anchor point

Parameters

Name Type Description
thetanumberangle to rotate node, in radians
Optional xnumberx coordinate to rotate around, use anchor-x if not specified
Optional ynumbery coordinate to rotate around, use anchor-y if not specified

Returns

TextElement

this

Inherited from

Text.rotate


scale

scale(xx, yy): TextElement

Scale node

Parameters

Name Type Description
xxnumberx scale factor
yynumbery scale factor

Returns

TextElement

this

Inherited from

Text.scale


setAltText

setAltText(altText): TextElement

Set alt text

Parameters

Name Type Description
altTextstringalt text

Returns

TextElement


setAnchor

setAnchor(p): TextElement

Sets anchor point to given position

Parameters

Name Type Description
pPointpoint

Returns

TextElement

this

Inherited from

Text.setAnchor

setAnchor(x, y): TextElement

Sets anchor point to given position

Parameters

Name Type Description
xnumberx coordinate
ynumbery coordinate

Returns

TextElement

this

Inherited from

Text.setAnchor


setAnchorType

setAnchorType(alignment): TextElement

Sets the anchor type.

Parameters

Name Type Description
alignmentAnchorTypeanchor alignment

Returns

TextElement

this

Inherited from

Text.setAnchorType


setAnchorX

setAnchorX(ax): TextElement

Sets x anchor position

Parameters

Name Type Description
axnumberanchor x position

Returns

TextElement

this

Inherited from

Text.setAnchorX


setAnchorY

setAnchorY(ay): TextElement

Sets y anchor position

Parameters

Name Type Description
aynumberanchor x position

Returns

TextElement

this

Inherited from

Text.setAnchorY


setAnimationStyle

setAnimationStyle(animationStyle): TextElement

Sets animation style

Parameters

Name Type Description
animationStyleTypeanimation style

Returns

TextElement

Inherited from

Text.setAnimationStyle


setAutoSize

setAutoSize(autoSize): TextElement

Automatically fit shape bounds to text size, default is true Set it to false if you have more than one paragraph inside with different alignment

Parameters

Name Type Description
autoSizebooleanauto size mode

Returns

TextElement

this

Inherited from

Text.setAutoSize


setBounds

setBounds(bounds): TextElement

Sets bounds of the node in the parent coordinates. This method takes anchor position and width and height if size is not in device space. This method was added to support layout.

Parameters

Name Type Description
boundsRectbound of the node in the parent coordinates

Returns

TextElement

this

Inherited from

Text.setBounds


setClipStyle

setClipStyle(style): TextElement

Sets a new clipping style

Parameters

Name Type Description
styleGraphicsPath | ClipStyle | Optionsa new clipping style

Returns

TextElement

this

Inherited from

Text.setClipStyle


setCornerRadius

setCornerRadius(radius): TextElement

Set border radius in device coordinates.

Parameters

Name Type Description
radiusnumberborder radius in device coordinates

Returns

TextElement

this

Inherited from

Text.setCornerRadius


setCss

setCss(style, merge?): TextElement

Sets CSS style. This style will be applied for all inserted elements

Parameters

Name Type Description
styleTypeCSS style to be applied to inserted elements
Optional mergebooleanmerge flag

Returns

TextElement

this

Inherited from

Text.setCss


setCssClass

setCssClass(name): TextElement

Sets css class name of the node to be used to apply CSS style

Parameters

Name Type Description
namestringcss class name of the node

Returns

TextElement

this

Inherited from

Text.setCssClass


setCssTransform

setCssTransform(transform): TextElement

Set CSS transformation

Parameters

Name Type Description
transformstring | Transformationtransformation css transformation instruction or Transformation instance

Returns

TextElement

this

Inherited from

Text.setCssTransform


setDomElement

setDomElement(domElement): TextElement

Set DOM element

Parameters

Name Type Description
domElementElementDOM element

Returns

TextElement

this

Implementation of

IElement.setDomElement


setElementStyle

setElementStyle(elementStyle, styleValue?): TextElement

Set element style

Parameters

Name Type Description
elementStylestring | Record<string, any> | ElementStyleelement style
Optional styleValueanyvalue

Returns

TextElement

this

Implementation of

IElement.setElementStyle


setEllipsisOptions

setEllipsisOptions(options): TextElement

Sets text overflow ellipsis options

Parameters

Name Type Description
optionsEllipsisOptionstext-overflow ellipsis options

Returns

TextElement

this

Inherited from

Text.setEllipsisOptions


setEllipsisString

setEllipsisString(ellipsisValue): TextElement

Sets ellipsis text to string under 15 characters

Parameters

Name Type Description
ellipsisValuestringvalue in the current section

Returns

TextElement

Inherited from

Text.setEllipsisString


setFillStyle

setFillStyle(fillStyle, merge?): TextElement

Sets fill style

Parameters

Name Type Description
fillStyleTypea new fill style
Optional mergebooleantrue if you want to merge fillStyle with existing attribute, false by default

Returns

TextElement

this

Inherited from

Text.setFillStyle


setHeight

setHeight(height): TextElement

Set text height. If height set to zero, text will get its height from font.

Parameters

Name Type Description
heightnumbertext height

Returns

TextElement

this

Inherited from

Text.setHeight


setId

setId(id): TextElement

Allows the user to associate any identifier

Parameters

Name Type Description
idstring | numberobject id

Returns

TextElement

this

Inherited from

Text.setId


setIsPointingUp

setIsPointingUp(isPointingUp): TextElement

Sets whether the shape is always pointing up. Particularly useful for text.

Parameters

Name Type Description
isPointingUpbooleanflag setting whether the shape is always pointing up

Returns

TextElement

this

Inherited from

Text.setIsPointingUp


setLayoutStyle

setLayoutStyle(layoutStyle, merge?): TextElement

Specify desired layout style

Parameters

Name Type Description
layoutStyleLayoutStyle<string | number> | Options<string | number>desired layout style
Optional mergebooleantrue if you want to merge layoutStyle with existing attribute, false by default

Returns

TextElement

Inherited from

Text.setLayoutStyle


setLineStyle

setLineStyle(lineStyle, merge?): TextElement

Sets line style

Parameters

Name Type Description
lineStyleTypeline style or options
Optional mergebooleantrue if you want to merge lineStyle with existing attribute, false by default

Returns

TextElement

this

Inherited from

Text.setLineStyle


setLocalTransform

setLocalTransform(localTransform, force?): TextElement

Sets local transformation to be used to transform from local to parent coordinate

Parameters

Name Type Description
localTransformTransformationlocal transformation for this node
Optional forcebooleanboolean flag to force update event if transformations are equal, false by default

Returns

TextElement

this

Inherited from

Text.setLocalTransform


setMarginsStyle

setMarginsStyle(margins, merge?): TextElement

Sets margins style

Parameters

Name Type Description
marginsType<string | number>margins style
Optional mergebooleantrue if you want to merge marginsStyle with existing attribute, false by default

Returns

TextElement

this

Inherited from

Text.setMarginsStyle


setMaxSize

setMaxSize(maxSize): TextElement

sets the maximum device space rendering dimension

Parameters

Name Type Description
maxSizeDimensionmaximum device space rendering dimension

Returns

TextElement

Inherited from

Text.setMaxSize


setMinSize

setMinSize(minSize): TextElement

sets the minimum device space rendering dimension only works when setUseMinMaxSize is enabled.

Parameters

Name Type Description
minSizeDimensionminimum device space rendering dimension

Returns

TextElement

this

Inherited from

Text.setMinSize


setName

setName(name): TextElement

Sets name of the node

Parameters

Name Type Description
namestringThe node name

Returns

TextElement

this

Inherited from

Text.setName


setNotification

setNotification(notify, force?): TextElement

set notification state

Parameters

Name Type Description
notifybooleanflag set to invalidate parent or not
Optional forcebooleantrue if parent should be invalidated immediately

Returns

TextElement

this

Implementation of

IElement.setNotification

Inherited from

Text.setNotification


setOpacity

setOpacity(opacity, blendMode?): TextElement

Sets node opacity

Parameters

Name Type Description
opacitynumbernode opacity from 0 to 1
Optional blendModeBlendModeopacity blend mode. If it is normal, opacity will be replaced.

Returns

TextElement

this

Inherited from

Text.setOpacity


setPadding

setPadding(padding): TextElement

Set inner padding in device coordinates.

Deprecated

since 4.1 use setPaddingStyle instead

Parameters

Name Type Description
paddingnumberinner padding in device coordinates

Returns

TextElement

this

Inherited from

Text.setPadding


setPaddingStyle

setPaddingStyle(paddingStyle, merge?): TextElement

Sets padding style

Parameters

Name Type Description
paddingStyleType<string | number>padding style
Optional mergebooleantrue if you want to merge paddingStyle with existing attribute, false by default

Returns

TextElement

this

Inherited from

Text.setPaddingStyle


setPreserveAspectRatio

setPreserveAspectRatio(preserveAspectRatio): TextElement

Sets whether aspect ratio is preserved

Parameters

Name Type Description
preserveAspectRatiobooleanflag Sets whether aspect ratio is preserved

Returns

TextElement

this

Inherited from

Text.setPreserveAspectRatio


setPreserveReadingOrientation

setPreserveReadingOrientation(preserveReadingOrientation): TextElement

Sets whether the shape is always in a readable orientation. Particularly useful for text. Prevents mirror effects

Parameters

Name Type Description
preserveReadingOrientationbooleansets flag whether the shape is always in a readable orientation

Returns

TextElement

this

Inherited from

Text.setPreserveReadingOrientation


setPreserveRightAngle

setPreserveRightAngle(preserveRightAngle): TextElement

Sets whether right angles are preserved

Parameters

Name Type Description
preserveRightAnglebooleanflag setting if right angles are preserved

Returns

TextElement

this

Inherited from

Text.setPreserveRightAngle


setProperties

setProperties(properties?): TextElement

Sets all the properties pertaining to this object

Parameters

Name Type Description
Optional propertiesOptionsobject containing the properties to set

Returns

TextElement

Inherited from

Text.setProperties


setProperty

setProperty(name, value): TextElement

Sets dynamic property by name

Parameters

Name Type Description
namestringproperty name
valueanyproperty value

Returns

TextElement

this

Inherited from

Text.setProperty


setRect

setRect(x1): TextElement

Sets rectangle geometry.

Parameters

Name Type Description
x1Rectrect

Returns

TextElement

this

Inherited from

Text.setRect

setRect(x1, y1, x2, y2): TextElement

Sets rectangle geometry.

Parameters

Name Type Description
x1numberx coordinate of the top left corner
y1numbery coordinate of the top left corner
x2numberx coordinate of the bottom right corner
y2numbery coordinate of the bottom right corner

Returns

TextElement

this

Inherited from

Text.setRect


setRenderingFilter

setRenderingFilter(filter): TextElement

Sets filter to be applied before rendering and picking

Parameters

Name Type Description
filterIFilterfilter to set

Returns

TextElement

this

Inherited from

Text.setRenderingFilter


setResponsiveStyle

setResponsiveStyle(style): TextElement

Sets responsive style.

Parameters

Name Type Description
styleOptions | ResponsiveStyleresponsive style

Returns

TextElement

this

Inherited from

Text.setResponsiveStyle


setRotationAngle

setRotationAngle(rotationAngle): TextElement

Set rotation angle

Parameters

Name Type Description
rotationAnglenumberrotation angle (in radians) at anchor

Returns

TextElement

this

Inherited from

Text.setRotationAngle


setScaleScrollStrategy

setScaleScrollStrategy(strategy?): TextElement

Sets scale scroll strategy

Parameters

Name Type Description
Optional strategyDelegatescale scroll strategy

Returns

TextElement

this

Inherited from

Text.setScaleScrollStrategy


setSelectable

setSelectable(selectable): TextElement

Allows to select node. If node is not selectable then child node is not selectable.

Parameters

Name Type Description
selectablebooleanflag to allow node selection

Returns

TextElement

this

Inherited from

Text.setSelectable


setShowEllipsis

setShowEllipsis(showEllipsis): TextElement

Set show ellipsis

Parameters

Name Type Description
showEllipsisbooleanshowEllipsis boolean flag that enables/disables ellipsis in case if text is too long

Returns

TextElement

this

Inherited from

Text.setShowEllipsis


setSilent

setSilent(bool): TextElement

Set silent mode

Parameters

Name Type Description
boolbooleanflag to enable silent mode

Returns

TextElement

this

Implementation of

IElement.setSilent

Inherited from

Text.setSilent


setSize

setSize(width, height): TextElement

Set size

Parameters

Name Type Description
widthnumbertext width
heightnumbertext height

Returns

TextElement

this

Inherited from

Text.setSize


setSizeIsInDeviceSpace

setSizeIsInDeviceSpace(sizeIsInDeviceSpace): TextElement

Sets whether the shape size is set in device space.

Parameters

Name Type Description
sizeIsInDeviceSpacebooleantrue if the shape size is fixed in device space; otherwise, false.

Returns

TextElement

this

Inherited from

Text.setSizeIsInDeviceSpace


setSizeMode

setSizeMode(sizeMode): TextElement

Sets how text size is computed

Parameters

Name Type Description
sizeModeSizeModeEnum of size modes

Returns

TextElement

this

Inherited from

Text.setSizeMode


setTag

setTag(tag): TextElement

Allows the user to associate any arbitrary object with the node.

Parameters

Name Type Description
taganyThe object to be associated with the node.

Returns

TextElement

this

Inherited from

Text.setTag


setText

setText(text): TextElement

Update the string this text displays.

Example

text.setText('Temperature <b style="font-color:red">110&amp;deg;</b> (<i style="font-color:gray">Fahrenheit</i>')

Parameters

Name Type Description
textstringnew text for this shape * can contains text formatting tags,

see https://www.w3schools.com/html/html_formatting.asp each tags except
can contains style attribute with set of 'font-size', 'font-family', 'font-weight', 'font-style', 'font-color' properties

Returns

TextElement

this

Inherited from

Text.setText


setTextStyle

setTextStyle(textStyle, merge?): TextElement

Set text style

Parameters

Name Type Description
textStyleTypea new shape text style
Optional mergebooleantrue if you want to merge textStyle with existing attribute, false by default

Returns

TextElement

this

Inherited from

Text.setTextStyle


setTextTransform

setTextTransform(textTransform): TextElement

Set text transformation

Parameters

Name Type Description
textTransformstringText transformation type

Returns

TextElement

Inherited from

Text.setTextTransform


setTextWithElements

setTextWithElements(text, textElements?, callback?): TextElement

Parameters

Name Type Description
textstringnew text for this shape
Optional textElementsTextElement[]textElements
Optional callbackFunctioncallback

Returns

TextElement


setUseMinMaxSize

setUseMinMaxSize(useMinMaxSize): TextElement

Sets whether to use the min max device space sizes

Parameters

Name Type Description
useMinMaxSizebooleantrue if using the min max device space sizes otherwise, false.

Returns

TextElement

this

Inherited from

Text.setUseMinMaxSize


setUserSize

setUserSize(width, height): TextElement

Called internally to save user size.

Parameters

Name Type Description
widthnumberwidth
heightnumberheight

Returns

TextElement

this

Inherited from

Text.setUserSize


setVisible

setVisible(value): TextElement

Sets visibility of the node. Send event Events.VisibilityChanged

Parameters

Name Type Description
valuebooleanflag specifying visibility of the node

Returns

TextElement

this

Inherited from

Text.setVisible


setWidth

setWidth(width): TextElement

Set text width. If width set to zero, text will accept size from font.

Parameters

Name Type Description
widthnumbertext width

Returns

TextElement

this

Inherited from

Text.setWidth


setZIndex

setZIndex(value): TextElement

Sets z-index for node (set null for default)

Parameters

Name Type Description
valuenumberindex determining node z-position

Returns

TextElement

this

Inherited from

Text.setZIndex


shear

shear(shx, shy): TextElement

Shear this node's bounds

Parameters

Name Type Description
shxnumberx-axis shear
shynumbery-axis shear

Returns

TextElement

this

Inherited from

Text.shear


toString

toString(): string

Returns a string representation of this object (generally the classname)

Returns

string

A string representation

Inherited from

Text.toString


translate

translate(tx, ty): TextElement

Translate bounds

Parameters

Name Type Description
txnumberx translation
tynumbery translation

Returns

TextElement

this

Inherited from

Text.translate


unregisterAnimationStyle

unregisterAnimationStyle(root): void

Unregister animation style.

Parameters

Name Type Description
rootNoderoot node for node

Returns

void

Inherited from

Text.unregisterAnimationStyle


updateGeometry

Protected updateGeometry(context): TextElement

Update geometry

Parameters

Name Type Description
contextRenderingContextRendering Context

Returns

TextElement

this

Inherited from

Text.updateGeometry


updateSceneTransformation

updateSceneTransformation(): TextElement

Update scene transformation

Returns

TextElement

this

Inherited from

Text.updateSceneTransformation


updateState

updateState(regions?, changes?): TextElement

Update state. These methods reset node state and update state for children. this method is useful to refresh a scene graph

Parameters

Name Type Description
Optional regionsRect[]optional array to return invalid rectangles in the parent coordinates
Optional changesStateChangesoptional parameter to specify a reason of changes

Returns

TextElement

this

Inherited from

Text.updateState


updateTimeStamp

Protected updateTimeStamp(): TextElement

Update time stamp to indicate that Node or Children has been changed.

Returns

TextElement

this

Inherited from

Text.updateTimeStamp


enableSceneGraphNotification

Static enableSceneGraphNotification(enabled): void

Enable / disable all notifications

Parameters

Name Type Description
enabledbooleansets if this object sends notifications

Returns

void

Inherited from

Text.enableSceneGraphNotification


findParent

Static findParent<T>(node, classType, filter?): InstanceType<T>

Find root of the node with specified type

Type parameters

NameType
Textends Constructor<any>

Parameters

Name Type Description
nodeNodenode to start search
classTypeTtype of the class to search for
Optional filter(node: Node) => booleanadditional filter to apply

Returns

InstanceType<T>

Inherited from

Text.findParent

Static findParent(node, classType, filter?): Node

Find root of the node with specified type

Parameters

Name Type Description
nodeNodenode to start search
classTypestringinterface name to search for
Optional filter(node: Node) => booleanadditional filter to apply

Returns

Node

Inherited from

Text.findParent


getAnchorPosition

Static getAnchorPosition(rect, anchorType): Point

Return anchor position

Parameters

Name Type Description
rectRectrectangle to get anchor position
anchorTypeAnchorTypeanchor type

Returns

Point

anchor

Inherited from

Text.getAnchorPosition


getClassName

Static getClassName(): string

Returns

string

Inherited from

Text.getClassName


intersectsBounds

Static intersectsBounds(bounds, localTransformation, parentInvalidArea, expand?): boolean

Check collision of the shape bounds with parent invalid area

Parameters

Name Type Description
boundsRectshape bounds
localTransformationTransformationlocal transformation of the bounds
parentInvalidAreaRectinvalid parent area
Optional expandDimensionoptional expand the bounds in model coordinate

Returns

boolean

true if bounds intersect the invalid area

Inherited from

Text.intersectsBounds


isSceneGraphNotificationEnabled

Static isSceneGraphNotificationEnabled(): boolean

Return status of the global notification for all nodes.

Returns

boolean

Inherited from

Text.isSceneGraphNotificationEnabled