Last updated

API / geotoolkit / deviation / scene / DeviatedCompositeNode / DeviatedCompositeNode

Class: DeviatedCompositeNode

scene.DeviatedCompositeNode.DeviatedCompositeNode

This class extends the composite node class to accept deviation (trajectory). This is only a container which allows to deviate a track when the trajectory is provided to it.
The method setDeviation described below sets the trajectory along the path. 'trajectory' is the only mandatory parameter; 'transformer', 'trackwidth' and 'offset' are optional.
The following code shows how to deviate a trackcontainer.

Example

import {Plot} from '@int/geotoolkit/plot/Plot';
import {Trajectory2d} from '@int/geotoolkit/deviation/Trajectory2d';
import {TrackContainer} from '@int/geotoolkit/welllog/TrackContainer';
import {DeviatedCompositeNode} from '@int/geotoolkit/deviation/scene/DeviatedCompositeNode';
// Create  plot
const plot = new Plot({...});
// Create TrackContainer and fill it in:
const trackContainer = new TrackContainer()
.addChild([...]);
// Create trajectory:
const trajectory = new Trajectory2d(...);
// Deviation options:
const deviation = {
'trajectory': trajectory,
'trackwidth': deviatedTrackWidth,
'offset': deviatedTrackOffset
};
// Create deviated node, set the options:
const deviatedNode = new DeviatedCompositeNode()
.setDeviation(deviation);
// Deviate the track container:
deviatedNode.addChild(trackContainer);
// Set the deviated node as a root one:
plot.setRoot(deviatedNode);

Hierarchy

Implements

Table of contents

Constructors
Methods
addChildaddCssClassaddInvalidateHandler
addListeneradjustPositionapplyOpacity
applyResponsiveStylechangeChildOrdercheckCollision
clearChildrencloneconnectStyle
copyConstructordisconnectStyledispose
enableClippingenableEventPropagationenumerateNodes
executefilterfindDepthRange
getAnimationStylegetBoundingBoxgetBounds
getChildgetChildrengetChildrenCount
getClassNamegetClipStylegetContentsArea
getContentsTransformgetCssgetCssClass
getCssClassesgetCssTransformgetDeviatedTransformation
getDeviationgetDeviceLimitsgetId
getInfiniteModegetInvalidateMethodgetLocalTransform
getMarginsStylegetModelLimitsgetName
getOpacitygetOpacityBlendModegetOutline
getParentgetPropertiesgetProperty
getPropertyKeysgetRenderingFiltergetResponsiveStyle
getRootgetScaleScrollStrategygetSceneTransform
getTaggetTrajectoryLimitsgetVisible
getVisibleDeviceLimitsgetVisibleModelLimitsgetWebGLRendering
getWorldTransformgetZIndexhasCssClass
hasEventListenerindexOfChildinsertChild
invalidateinvalidateParentinverseTransform
isClippingEnabledisDisposedisEventPropagationEnabled
isHorizontalFlipisNotificationEnabledisSelectable
isSilentisVerticalFlipmoveTo
notifynotifyRootoff
ononChildAddedonChildRemoved
onDeviationChangedonParentChangedonVisibilityChanged
postRenderingpreRenderingregisterAnimationStyle
removeChildremoveCssClassremoveInvalidateHandler
removeListenerrenderrenderAsync
renderChildrenrenderChildrenAsyncrenderContent
renderContentAsyncrotatescale
setAnimationStylesetBoundssetChild
setClipStylesetCsssetCssClass
setCssTransformsetDeviationsetId
setInfiniteModesetLocalTransformsetMarginsStyle
setNamesetNotificationsetOpacity
setPropertiessetPropertysetRenderingFilter
setResponsiveStylesetScaleScrollStrategysetSelectable
setSilentsetTagsetTrajectoryLimits
setVisiblesetVisibleModelLimitssetWebGLRendering
setZIndexshallowCloneshear
toStringtransformtransformFromLinear
transformToLineartranslateunregisterAnimationStyle
updateSceneTransformationupdateStateupdateTimeStamp
enableSceneGraphNotificationfindParentgetClassName
isSceneGraphNotificationEnabled
Css Properties
Name Type Description
clippingbooleanEnable clipping, this does not consider the clipstyle, it is related to bounds-clipping
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
idstring | numberId of the node, its a unique identifier
infinitybooleanMode to render outside the model limits
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
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
scalescrollstrategyScaleScrollStrategyScale scroll strategy
scalescrollstrategy-enabledbooleanEnable flag
selectablebooleanSelectable node, a boolean to determine if selection should consider this node
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
trajectorymodellimitsRectOptional model limits for provided trajectory
transformstringAdditional CSS transformation applied to node or 'none'
transformTransformationAdditional CSS transformation applied to node or 'none'
visiblebooleanVisibility of the node, a boolean to determine if the node should be rendered or not
z-indexnumberDefine node z-index

Contents

Constructors

new DeviatedCompositeNode(options)

new DeviatedCompositeNode(options?)

Parameters

Name Type
Optional optionsOptions

Overrides

CompositeNode.constructor

Methods

addChild

addChild(node): DeviatedCompositeNode

Add a child node

Parameters

Name Type Description
nodeNode | Iterator<Node> | Node[]the child node to be added

Returns

DeviatedCompositeNode

this

Inherited from

CompositeNode.addChild


addCssClass

addCssClass(cssclass): DeviatedCompositeNode

Adds new css class to node

Parameters

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

Returns

DeviatedCompositeNode

this

Inherited from

CompositeNode.addCssClass


addInvalidateHandler

addInvalidateHandler(handler): DeviatedCompositeNode

Add invalidate handler

Deprecated

since 4.0, use Node.on instead

Parameters

Name Type Description
handlerFunctionhandler to be notified about invalidation

Returns

DeviatedCompositeNode

this

Inherited from

CompositeNode.addInvalidateHandler


addListener

addListener(eventName, listener): DeviatedCompositeNode

Adds event listener

Deprecated

since 4.0 use DeviatedCompositeNode.on() instead

Parameters

Name Type Description
eventNamestringname of the event
listenerFunctionevent listener

Returns

DeviatedCompositeNode

this


adjustPosition

adjustPosition(area?, vAlign?, hAlign?): DeviatedCompositeNode

Adjust position of node to specified area

Parameters

Name Type Description
Optional areaRectspecified area. Default to Parent Model Limits
Optional vAlignstringvertical alignment. It can be "top", "bottom", "center". Defaults to "top".
Optional hAlignstringhorizontal alignment It can be "left", "right", "center". Defaults to "left".

Returns

DeviatedCompositeNode

this

Inherited from

CompositeNode.adjustPosition


applyOpacity

Protected applyOpacity(context): DeviatedCompositeNode

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

DeviatedCompositeNode

this

Inherited from

CompositeNode.applyOpacity


applyResponsiveStyle

Protected applyResponsiveStyle(): void

Apply a responsive style rules it is exists

Returns

void

Inherited from

CompositeNode.applyResponsiveStyle


changeChildOrder

changeChildOrder(node, order, anchor?): DeviatedCompositeNode

changes the z-order of the nodes being rendered.

Parameters

Name Type Description
nodeNodeany child added in the Composite node
orderNodeOrderposition to be added
Optional anchorNodeanchor node to specify changeOrder with respect to this node

Returns

DeviatedCompositeNode

this

Inherited from

CompositeNode.changeChildOrder


checkCollision

checkCollision(context): boolean

Check culling Returns true if object is inside of renderable area

Parameters

Name Type Description
contextRenderingContextRendering Context

Returns

boolean

true if node is collided

Inherited from

CompositeNode.checkCollision


clearChildren

clearChildren(disposeChildren?): DeviatedCompositeNode

Remove all child nodes from this composite group

Parameters

Name Type Description
Optional disposeChildrenbooleanautomatically dispose children. If it is true then method dispose is called for each child.

Returns

DeviatedCompositeNode

this

Inherited from

CompositeNode.clearChildren


clone

clone(): CompositeNode<Node>

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

Returns

CompositeNode<Node>

clone

Inherited from

CompositeNode.clone


connectStyle

connectStyle(style, type, callback): DeviatedCompositeNode

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

DeviatedCompositeNode

this

Inherited from

CompositeNode.connectStyle


copyConstructor

Protected copyConstructor(src, deepCopy?): DeviatedCompositeNode

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
srcCompositeNode<Node>Source to copy from
Optional deepCopybooleandeep copy

Returns

DeviatedCompositeNode

this

Inherited from

CompositeNode.copyConstructor


disconnectStyle

disconnectStyle(style, type, callback): DeviatedCompositeNode

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

DeviatedCompositeNode

this

Inherited from

CompositeNode.disconnectStyle


dispose

dispose(): void

Dispose node. Clear all listeners and disconnect style to avoid memory leaks

Returns

void

Inherited from

CompositeNode.dispose


enableClipping

enableClipping(doClip): DeviatedCompositeNode

Enables or disables clipping of this node. If enabled, shapes will not be rendered outside of its bounds.

Parameters

Name Type Description
doClipbooleanenable clipping on this node

Returns

DeviatedCompositeNode

this

Inherited from

CompositeNode.enableClipping


enableEventPropagation

enableEventPropagation(enable): DeviatedCompositeNode

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

DeviatedCompositeNode

this

Inherited from

CompositeNode.enableEventPropagation


enumerateNodes

enumerateNodes(callback, target?): void

Executes a provided function once for each child node

Parameters

Name Type Description
callbackCallback<Node>provided function
Optional targetQueryBuilder<any>target to pass to callback as a second parameter

Returns

void

Inherited from

CompositeNode.enumerateNodes


execute

execute(delegate): DeviatedCompositeNode

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: DeviatedCompositeNode) => voidFunction to execute

Returns

DeviatedCompositeNode

The result if any or this

Inherited from

CompositeNode.execute

execute<T>(delegate): T

Type parameters

Name
T

Parameters

Name Type
delegate(this: DeviatedCompositeNode) => T

Returns

T

Inherited from

CompositeNode.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

CompositeNode.filter


findDepthRange

findDepthRange(parentRect, outRange): Range

Computes the deviated node's depth range corresponding to its parent's rect area (if any)

Parameters

Name Type Description
parentRectRectRect for which to compute the depth
outRangeRangeoptional parameter used to return range

Returns

Range

the node's depth range if found; "null" otherwise


getAnimationStyle

getAnimationStyle(): AnimationStyle

Return animation style

Returns

AnimationStyle

animationStyle current animation style

Inherited from

CompositeNode.getAnimationStyle


getBoundingBox

getBoundingBox(tr?): Rect

Returns the bounding box of the area in the model space.

Parameters

Name Type Description
Optional trTransformationThe transformation from model to device space. if transformation is not passed then scene transformation is used

Returns

Rect


getBounds

getBounds(): Rect

Gets the node's bounds if set; trajectory limits otherwise

Returns

Rect

Overrides

CompositeNode.getBounds


getChild

getChild(i): Node

Return node by index

Parameters

Name Type Description
inumberindex of the node

Returns

Node

Inherited from

CompositeNode.getChild


getChildren

getChildren<S>(predicate, modify?): Iterator<S>

Return iterator by child nodes

Type parameters

NameType
Sextends Node<S>

Parameters

Name Type Description
predicate(value: Node) => value is Sa filter function
Optional modifybooleanAn option to specify if the iterator supports adding/removing items from the collection. false by default.

Returns

Iterator<S>

Inherited from

CompositeNode.getChildren

getChildren(filter?, modify?): Iterator<Node>

Returns an iterator for child nodes. The iterator does not support adding or deleting items from children by default. If it is necessary to modify a collection of children, pass true as the last parameter.

Example

// Gets a writable iterator
const it = node.getChildren(null, true);

Parameters

Name Type Description
Optional filter(node: Node) => booleanA filter function. Returns all nodes if null.
Optional modifybooleanAn option to specify if the iterator supports adding/removing items from the collection. false by default.

Returns

Iterator<Node>

An iterator for child nodes.

Inherited from

CompositeNode.getChildren


getChildrenCount

getChildrenCount(): number

Return number of child nodes

Returns

number

Inherited from

CompositeNode.getChildrenCount


getClassName

getClassName(): string

Returns

string

Inherited from

CompositeNode.getClassName


getClipStyle

getClipStyle(): ClipStyle

Gets the current clipping style

Returns

ClipStyle

clipping style

Inherited from

CompositeNode.getClipStyle


getContentsArea

getContentsArea(transformation?): Rect

Return area of content. By default it is equal to bounds.

Parameters

Name Type Description
Optional transformationTransformationscene transformation

Returns

Rect

Inherited from

CompositeNode.getContentsArea


getContentsTransform

getContentsTransform(): Transformation

Transformation of inner contents (i.e. trajectory limits) to bounds

Returns

Transformation

Overrides

CompositeNode.getContentsTransform


getCss

getCss(): CssStyle

Return CSS style

Returns

CssStyle

Inherited from

CompositeNode.getCss


getCssClass

getCssClass(): string

Returns css class name to be used to apply CSS style

Returns

string

the css class name

Inherited from

CompositeNode.getCssClass


getCssClasses

getCssClasses(): string[]

Gets list of css class names which applied to this node

Returns

string[]

Inherited from

CompositeNode.getCssClasses


getCssTransform

getCssTransform(): string

Returns CSS transformation

Returns

string

Inherited from

CompositeNode.getCssTransform


getDeviatedTransformation

getDeviatedTransformation(): DeviatedTransformation

Gets underlying deviated transformation

Returns

DeviatedTransformation


getDeviation

getDeviation(): Required<DeviationOptions>

Gets deviation options if set, null otherwise.

Returns

Required<DeviationOptions>


getDeviceLimits

getDeviceLimits(): Rect

Return device limits

Returns

Rect

Inherited from

CompositeNode.getDeviceLimits


getId

getId(): string | number

Returns the associated identifier of the node

Returns

string | number

The node's id

Inherited from

CompositeNode.getId


getInfiniteMode

getInfiniteMode(): boolean

Return infinity mode flag

Returns

boolean

flag

Inherited from

CompositeNode.getInfiniteMode


getInvalidateMethod

Protected getInvalidateMethod(): AttributeCallback<EventDispatcher>

Gets invalidate method

Returns

AttributeCallback<EventDispatcher>

method to invalidate this object

Inherited from

CompositeNode.getInvalidateMethod


getLocalTransform

getLocalTransform(): Transformation

Retrieves the transformation of bounds to parent

Returns

Transformation

transform the local transform.

Inherited from

CompositeNode.getLocalTransform


getMarginsStyle

getMarginsStyle(): SpaceStyle<string | number>

Return margins style

Returns

SpaceStyle<string | number>

Inherited from

CompositeNode.getMarginsStyle


getModelLimits

getModelLimits(): Rect

Gets actual (there: non-deviated) model limits

Returns

Rect

Overrides

CompositeNode.getModelLimits


getName

getName(): string

Returns the node name

Returns

string

The node name

Inherited from

CompositeNode.getName


getOpacity

getOpacity(): number

Returns current node opacity

Returns

number

opacity

Inherited from

CompositeNode.getOpacity


getOpacityBlendMode

getOpacityBlendMode(): BlendMode

Returns current node opacity

Returns

BlendMode

opacity blend mode

Inherited from

CompositeNode.getOpacityBlendMode


getOutline

getOutline(tr): Polygon

Gets node outline

Parameters

Name Type Description
trTransformationtransformation which will be applied to outline

Returns

Polygon

Implementation of

ITransformable.getOutline


getParent

getParent(): Node

Return parent node

Returns

Node

parent node

Inherited from

CompositeNode.getParent


getProperties

getProperties(): OptionsOut

Gets all the properties pertaining to this object

Returns

OptionsOut

properties object

Overrides

CompositeNode.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

CompositeNode.getProperty


getPropertyKeys

getPropertyKeys(): string[]

Returns known properties keys

Returns

string[]

Inherited from

CompositeNode.getPropertyKeys


getRenderingFilter

getRenderingFilter(): IFilter

Return filter to be used for rendering and picking

Returns

IFilter

current filter

Inherited from

CompositeNode.getRenderingFilter


getResponsiveStyle

getResponsiveStyle(): ResponsiveStyle

Return responsive style

Returns

ResponsiveStyle

Inherited from

CompositeNode.getResponsiveStyle


getRoot

getRoot(): Node

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

Returns

Node

the root node

Inherited from

CompositeNode.getRoot


getScaleScrollStrategy

getScaleScrollStrategy(): Delegate

Gets scale scroll strategy

Returns

Delegate

scale scroll strategy

Inherited from

CompositeNode.getScaleScrollStrategy


getSceneTransform

getSceneTransform(): Transformation

Returns transformation from node to root scene

Returns

Transformation

a transformation from node to root scene

Inherited from

CompositeNode.getSceneTransform


getTag

getTag(): any

Returns the object associated with the node by user.

Returns

any

The node's user-object

Inherited from

CompositeNode.getTag


getTrajectoryLimits

getTrajectoryLimits(): Rect

Gets externally set trajectory limits if any or own trajectory limits if deviation (trajectory) is set; "null" otherwise

Returns

Rect


getVisible

getVisible(): boolean

Return visibility of the node

Returns

boolean

true if node is visible

Inherited from

CompositeNode.getVisible


getVisibleDeviceLimits

getVisibleDeviceLimits(ignoreModelLimits?): Rect

Return visible device limits

Parameters

Name Type Description
Optional ignoreModelLimitsbooleanflag defines whether to ignore ModelLimits or not

Returns

Rect

Inherited from

CompositeNode.getVisibleDeviceLimits


getVisibleModelLimits

getVisibleModelLimits(ignoreModelLimits?): Rect

Return visible model limits

Parameters

Name Type Description
Optional ignoreModelLimitsbooleanflag defines whether to ignore ModelLimits or not

Returns

Rect

Inherited from

CompositeNode.getVisibleModelLimits


getWebGLRendering

getWebGLRendering(): boolean

Gets webgl rendering

Returns

boolean

true if webgl rendering is enabled


getWorldTransform

getWorldTransform(): Transformation

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

Returns

Transformation

Inherited from

CompositeNode.getWorldTransform


getZIndex

getZIndex(): number

Returns node z-index (null if not set)

Returns

number

Inherited from

CompositeNode.getZIndex


hasCssClass

hasCssClass(cssClass): boolean

Check if node has specified css class

Parameters

Name Type Description
cssClassstringcss class name

Returns

boolean

Inherited from

CompositeNode.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

CompositeNode.hasEventListener


indexOfChild

indexOfChild(node): number

Return index of child ( index of the specified child or -1 if node is not found)

Parameters

Name Type Description
nodeNodenode to check index

Returns

number

Inherited from

CompositeNode.indexOfChild


insertChild

insertChild(index, node): DeviatedCompositeNode

Insert child node at specified index

Parameters

Name Type Description
indexnumberspecified index
nodeNodea child node to add

Returns

DeviatedCompositeNode

this

Inherited from

CompositeNode.insertChild


invalidate

invalidate(bounds?, force?): DeviatedCompositeNode

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

DeviatedCompositeNode

this

Inherited from

CompositeNode.invalidate


invalidateParent

Protected invalidateParent(bounds?, force?): DeviatedCompositeNode

Invalidate parent and notify all listeners. NOTE: Don't keep arguments of the event, because instance can be changed

Fires

Events.Invalidate

Parameters

Name Type Description
Optional boundsRectbounds of the invalid rectangle in the inner node coordinates
Optional forcebooleanforce rendering

Returns

DeviatedCompositeNode

this

Inherited from

CompositeNode.invalidateParent


inverseTransform

inverseTransform(point): Point

Transforms point from device space to node space

Parameters

Name Type Description
pointPointpoint to transform

Returns

Point

transformed point

Implementation of

ITransformable.inverseTransform


isClippingEnabled

isClippingEnabled(): boolean

Returns if clipping is enabled or not for this node.

Returns

boolean

Inherited from

CompositeNode.isClippingEnabled


isDisposed

isDisposed(): boolean

Returns whether this object has been disposed

Returns

boolean

Inherited from

CompositeNode.isDisposed


isEventPropagationEnabled

isEventPropagationEnabled(): boolean

Return true if event propagation is enabled from child to parent

Returns

boolean

Inherited from

CompositeNode.isEventPropagationEnabled


isHorizontalFlip

isHorizontalFlip(): boolean

Return true if the representation is flipped horizontally

Returns

boolean

Inherited from

CompositeNode.isHorizontalFlip


isNotificationEnabled

isNotificationEnabled(): boolean

return state of notification

Returns

boolean

current notification state

Inherited from

CompositeNode.isNotificationEnabled


isSelectable

isSelectable(): boolean

Returns true if node can be picked/selected.

Returns

boolean

The selectable flag

Inherited from

CompositeNode.isSelectable


isSilent

isSilent(): boolean

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

Returns

boolean

Inherited from

CompositeNode.isSilent


isVerticalFlip

isVerticalFlip(): boolean

Return true if the representation is flipped vertically

Returns

boolean

Inherited from

CompositeNode.isVerticalFlip


moveTo

moveTo(area, vAlign?, hAlign?): DeviatedCompositeNode

MoveTo position of node to specified area

Parameters

Name Type Description
areaRectspecified area
Optional vAlignstringvertical alignment. It can be "top", "bottom", "center".
Optional hAlignstringhorizontal alignment It can be "left", "right", "center".

Returns

DeviatedCompositeNode

this

Inherited from

CompositeNode.moveTo


notify

notify<E>(type, source, args?): DeviatedCompositeNode

Notify listeners of the Node

Type parameters

NameType
Eextends string

Parameters

Name Type Description
typeEtype of event
sourceDeviatedCompositeNodesource who called the event
Optional argsEventMap[E]event arguments

Returns

DeviatedCompositeNode

this

Overrides

CompositeNode.notify


notifyRoot

Protected notifyRoot(event, source, args?): Node

Notify an even to root node

Parameters

Name Type Description
eventstringtype of event
sourceNodesource who called the event
Optional argsanyevent arguments

Returns

Node

this

Inherited from

CompositeNode.notifyRoot


off

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

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: DeviatedCompositeNode, args: EventMap[E]) => voidfunction to be called

Returns

DeviatedCompositeNode

this

Overrides

CompositeNode.off


on

on<E>(type, callback): DeviatedCompositeNode

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: DeviatedCompositeNode, args: EventMap[E]) => voidto be called

Returns

DeviatedCompositeNode

this

Overrides

CompositeNode.on


onChildAdded

Protected onChildAdded(child): void

This method is called it child or children are added

Parameters

Name Type Description
childNode | Iterator<Node>added child

Returns

void

Inherited from

CompositeNode.onChildAdded


onChildRemoved

Protected onChildRemoved(child): void

This method is called it child or children are removed

Parameters

Name Type Description
childNoderemoved child

Returns

void

Inherited from

CompositeNode.onChildRemoved


onDeviationChanged

Protected onDeviationChanged(): void

Returns

void


onParentChanged

Protected onParentChanged(node): DeviatedCompositeNode

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

Parameters

Name Type Description
nodeNodenode to change parent

Returns

DeviatedCompositeNode

this

Inherited from

CompositeNode.onParentChanged


onVisibilityChanged

Protected onVisibilityChanged(): void

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

Returns

void

Inherited from

CompositeNode.onVisibilityChanged


postRendering

Protected postRendering(context, callback?): void

To be called after rendering, used for PDF output

Parameters

Name Type Description
contextRenderingContextRendering Context
Optional callback() => voidcallback to be called after rendering

Returns

void

Inherited from

CompositeNode.postRendering


preRendering

Protected preRendering(context, callback?): void

Occurs before child rendering

Parameters

Name Type Description
contextRenderingContextRendering Context
Optional callback() => voidcallback to be called after rendering of geometry

Returns

void

Inherited from

CompositeNode.preRendering


registerAnimationStyle

registerAnimationStyle(root): void

Register animation style.

Parameters

Name Type Description
rootNoderoot node for node

Returns

void

Inherited from

CompositeNode.registerAnimationStyle


removeChild

removeChild(node, disposeChildren?): DeviatedCompositeNode

Remove child node

Parameters

Name Type Description
nodeNode | Node[]node or array of nodes to be removed
Optional disposeChildrenbooleanautomatically dispose children. If it is true then method dispose is called for each child.

Returns

DeviatedCompositeNode

this

Inherited from

CompositeNode.removeChild


removeCssClass

removeCssClass(cssclass): DeviatedCompositeNode

Removes css class from node

Parameters

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

Returns

DeviatedCompositeNode

this

Inherited from

CompositeNode.removeCssClass


removeInvalidateHandler

removeInvalidateHandler(handler): DeviatedCompositeNode

Remove invalidate handler

Deprecated

since 4.0, use Node.off instead

Parameters

Name Type Description
handlerFunctionhandler to be notified about invalidation

Returns

DeviatedCompositeNode

this

Inherited from

CompositeNode.removeInvalidateHandler


removeListener

removeListener(eventName, listener): DeviatedCompositeNode

Removes event listener

Deprecated

since 4.0 use DeviatedCompositeNode.off() instead

Parameters

Name Type Description
eventNamestringevent name
listenerFunctionevent listener

Returns

DeviatedCompositeNode

this


render

render(context): void

Render composite node and children

Parameters

Name Type Description
contextRenderingContextRendering Context

Returns

void

Inherited from

CompositeNode.render


renderAsync

renderAsync(context, callback): void

Render node in asynchronous mode

Parameters

Name Type Description
contextRenderingContextThe rendering context to be used to draw the node
callback() => voidcallback function

Returns

void

Inherited from

CompositeNode.renderAsync


renderChildren

Protected renderChildren(context): void

Render children

Parameters

Name Type Description
contextRenderingContextRendering Context

Returns

void

Inherited from

CompositeNode.renderChildren


renderChildrenAsync

Protected renderChildrenAsync(context, callback): void

Render children async

Parameters

Name Type Description
contextRenderingContextRendering Context
callback() => voidcallback function to be called then all children are rendered

Returns

void

Inherited from

CompositeNode.renderChildrenAsync


renderContent

Protected renderContent(context): void

render to specified context. This method calls preRendering, renderChildren, postRendering

Parameters

Name Type Description
contextRenderingContextRendering Context

Returns

void

Inherited from

CompositeNode.renderContent


renderContentAsync

Protected renderContentAsync(context, callback): void

Render children in asynchronous mode

Parameters

Name Type Description
contextRenderingContextThe rendering context to be used to draw the node
callback() => voidcallback function to be called then all children are rendered

Returns

void

Inherited from

CompositeNode.renderContentAsync


rotate

rotate(theta, x, y): DeviatedCompositeNode

Rotate bounds around a given coordinate

Parameters

Name Type Description
thetanumberangle to rotate node, in radians
xnumberx coordinate to rotate around
ynumbery coordinate to rotate around

Returns

DeviatedCompositeNode

this

Inherited from

CompositeNode.rotate


scale

scale(xx, yy): DeviatedCompositeNode

Scale node

Parameters

Name Type Description
xxnumberx scale factor
yynumbery scale factor

Returns

DeviatedCompositeNode

this

Inherited from

CompositeNode.scale


setAnimationStyle

setAnimationStyle(animationStyle): DeviatedCompositeNode

Sets animation style

Parameters

Name Type Description
animationStyleTypeanimation style

Returns

DeviatedCompositeNode

Inherited from

CompositeNode.setAnimationStyle


setBounds

setBounds(bounds): DeviatedCompositeNode

Sets bounds of the node in the parent coordinates

Parameters

Name Type Description
boundsRectbound of the node in the parent coordinates

Returns

DeviatedCompositeNode

this


setChild

setChild(index, node): DeviatedCompositeNode

Replace child node by index

Parameters

Name Type Description
indexnumberindex of the node
nodeNodenode

Returns

DeviatedCompositeNode

this

Inherited from

CompositeNode.setChild


setClipStyle

setClipStyle(style): DeviatedCompositeNode

Sets a new clipping style

Parameters

Name Type Description
styleGraphicsPath | ClipStyle | Optionsa new clipping style

Returns

DeviatedCompositeNode

this

Inherited from

CompositeNode.setClipStyle


setCss

setCss(style, merge?): DeviatedCompositeNode

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

DeviatedCompositeNode

this

Inherited from

CompositeNode.setCss


setCssClass

setCssClass(name): DeviatedCompositeNode

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

DeviatedCompositeNode

this

Inherited from

CompositeNode.setCssClass


setCssTransform

setCssTransform(transform): DeviatedCompositeNode

Set CSS transformation

Parameters

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

Returns

DeviatedCompositeNode

this

Inherited from

CompositeNode.setCssTransform


setDeviation

setDeviation(options): DeviatedCompositeNode

Sets deviation options. Fires 'onDeviationChanged' event.

Parameters

Name Type Description
optionsDeviationOptionsdeviation options

Returns

DeviatedCompositeNode

this


setId

setId(id): DeviatedCompositeNode

Allows the user to associate any identifier

Parameters

Name Type Description
idstring | numberobject id

Returns

DeviatedCompositeNode

this

Inherited from

CompositeNode.setId


setInfiniteMode

setInfiniteMode(infinityMode): DeviatedCompositeNode

Set infinity mode flag to draw composite without collision check

Parameters

Name Type Description
infinityModebooleaninfinity mode flag

Returns

DeviatedCompositeNode

this

Inherited from

CompositeNode.setInfiniteMode


setLocalTransform

setLocalTransform(localTransform, force?): DeviatedCompositeNode

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

DeviatedCompositeNode

this

Inherited from

CompositeNode.setLocalTransform


setMarginsStyle

setMarginsStyle(margins, merge?): DeviatedCompositeNode

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

DeviatedCompositeNode

this

Inherited from

CompositeNode.setMarginsStyle


setName

setName(name): DeviatedCompositeNode

Sets name of the node

Parameters

Name Type Description
namestringThe node name

Returns

DeviatedCompositeNode

this

Inherited from

CompositeNode.setName


setNotification

setNotification(notify, force?): DeviatedCompositeNode

set notification state

Parameters

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

Returns

DeviatedCompositeNode

this

Inherited from

CompositeNode.setNotification


setOpacity

setOpacity(opacity, blendMode?): DeviatedCompositeNode

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

DeviatedCompositeNode

this

Inherited from

CompositeNode.setOpacity


setProperties

setProperties(properties?): DeviatedCompositeNode

Sets all the properties pertaining to this object

Parameters

Name Type Description
Optional propertiesOptionsAn object containing the properties to set

Returns

DeviatedCompositeNode

this

Overrides

CompositeNode.setProperties


setProperty

setProperty(name, value): DeviatedCompositeNode

Sets dynamic property by name

Parameters

Name Type Description
namestringproperty name
valueanyproperty value

Returns

DeviatedCompositeNode

this

Inherited from

CompositeNode.setProperty


setRenderingFilter

setRenderingFilter(filter): DeviatedCompositeNode

Sets filter to be applied before rendering and picking

Parameters

Name Type Description
filterIFilterfilter to set

Returns

DeviatedCompositeNode

this

Inherited from

CompositeNode.setRenderingFilter


setResponsiveStyle

setResponsiveStyle(style): DeviatedCompositeNode

Sets responsive style.

Parameters

Name Type Description
styleOptions | ResponsiveStyleresponsive style

Returns

DeviatedCompositeNode

this

Inherited from

CompositeNode.setResponsiveStyle


setScaleScrollStrategy

setScaleScrollStrategy(strategy?): DeviatedCompositeNode

Sets scale scroll strategy

Parameters

Name Type Description
Optional strategyDelegatescale scroll strategy

Returns

DeviatedCompositeNode

this

Inherited from

CompositeNode.setScaleScrollStrategy


setSelectable

setSelectable(selectable): DeviatedCompositeNode

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

DeviatedCompositeNode

this

Inherited from

CompositeNode.setSelectable


setSilent

setSilent(bool): DeviatedCompositeNode

Set silent mode

Parameters

Name Type Description
boolbooleanflag to enable silent mode

Returns

DeviatedCompositeNode

this

Inherited from

CompositeNode.setSilent


setTag

setTag(tag): DeviatedCompositeNode

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

Parameters

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

Returns

DeviatedCompositeNode

this

Inherited from

CompositeNode.setTag


setTrajectoryLimits

setTrajectoryLimits(limits): DeviatedCompositeNode

Sets trajectory model limits. If set it will override trajectory's own limits

Parameters

Name Type Description
limitsTypethe trajectory model limits

Returns

DeviatedCompositeNode


setVisible

setVisible(value): DeviatedCompositeNode

Sets visibility of the node. Send event Events.VisibilityChanged

Parameters

Name Type Description
valuebooleanflag specifying visibility of the node

Returns

DeviatedCompositeNode

this

Inherited from

CompositeNode.setVisible


setVisibleModelLimits

setVisibleModelLimits(visibleModelBounds, deviceBounds?): DeviatedCompositeNode

Set visible model limits

Parameters

Name Type Description
visibleModelBoundsRectvisible model limits or bounds
Optional deviceBoundsRectdevice bounds

Returns

DeviatedCompositeNode

this

Inherited from

CompositeNode.setVisibleModelLimits


setWebGLRendering

setWebGLRendering(webGLEnabled): DeviatedCompositeNode

Sets webgl rendering

Parameters

Name Type Description
webGLEnabledbooleantrue for webgl rendering

Returns

DeviatedCompositeNode

this


setZIndex

setZIndex(value): DeviatedCompositeNode

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

Parameters

Name Type Description
valuenumberindex determining node z-position

Returns

DeviatedCompositeNode

this

Inherited from

CompositeNode.setZIndex


shallowClone

shallowClone(): DeviatedCompositeNode

Returns shallow copy of node

Returns

DeviatedCompositeNode


shear

shear(shx, shy): DeviatedCompositeNode

Shear this node's bounds

Parameters

Name Type Description
shxnumberx-axis shear
shynumbery-axis shear

Returns

DeviatedCompositeNode

this

Inherited from

CompositeNode.shear


toString

toString(): string

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

Returns

string

A string representation

Inherited from

CompositeNode.toString


transform

transform(point): Point

Transforms point from node space to device space

Parameters

Name Type Description
pointPointpoint to transform

Returns

Point

transformed point

Implementation of

ITransformable.transform


transformFromLinear

transformFromLinear(point): Point

Transforms point from linear space to node space

Parameters

Name Type Description
pointPointpoint to transform

Returns

Point

transformed point

Implementation of

ITransformable.transformFromLinear


transformToLinear

transformToLinear(point): Point

Transforms point from node space to linear space

Parameters

Name Type Description
pointPointpoint to transform

Returns

Point

transformed point

Implementation of

ITransformable.transformToLinear


translate

translate(tx, ty): DeviatedCompositeNode

Translate bounds

Parameters

Name Type Description
txnumberx translation
tynumbery translation

Returns

DeviatedCompositeNode

this

Inherited from

CompositeNode.translate


unregisterAnimationStyle

unregisterAnimationStyle(root): void

Unregister animation style.

Parameters

Name Type Description
rootAnimatedNoderoot node for node

Returns

void

Inherited from

CompositeNode.unregisterAnimationStyle


updateSceneTransformation

updateSceneTransformation(): DeviatedCompositeNode

Update scene transformation

Returns

DeviatedCompositeNode

this

Inherited from

CompositeNode.updateSceneTransformation


updateState

updateState(regions?, changes?): DeviatedCompositeNode

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

DeviatedCompositeNode

this

Inherited from

CompositeNode.updateState


updateTimeStamp

Protected updateTimeStamp(): DeviatedCompositeNode

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

Returns

DeviatedCompositeNode

this

Inherited from

CompositeNode.updateTimeStamp


enableSceneGraphNotification

Static enableSceneGraphNotification(enabled): void

Enable / disable all notifications

Parameters

Name Type Description
enabledbooleansets if this object sends notifications

Returns

void

Inherited from

CompositeNode.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

CompositeNode.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

CompositeNode.findParent


getClassName

Static getClassName(): string

Returns

string

Inherited from

CompositeNode.getClassName


isSceneGraphNotificationEnabled

Static isSceneGraphNotificationEnabled(): boolean

Return status of the global notification for all nodes.

Returns

boolean

Inherited from

CompositeNode.isSceneGraphNotificationEnabled