Usage
Signature:
interface DvtDiagramLayoutContextNode<K1, D1 extends ojDiagram.Node<K1>|any>
Generic Parameters
Parameter Description K1 Type of key of the nodeData dataprovider D1 Type of data from the nodeData dataprovider
Typescript Import Format
//To use this interface, import as below.
import {DvtDiagramLayoutContextNode} from "ojs/ojdiagram";
For additional information visit:
Methods
-
getBounds : {{x: number, y: number, w: number, h: number}}
-
Get the bounds of the node. Currently the method returns the same value as getContentBounds(). The bounds are in the coordinate system of the node.
Properties:
Name Type Description h
number height w
number width x
number x-coordinate y
number y-coordinate Returns:
An object with the following properties for the bounds of the node
- Type
- {x: number, y: number, w: number, h: number}
-
getChildNodes : {DvtDiagramLayoutContextNode<K1, D1>[]}
-
Get visible child nodes for the disclosed container.
Returns:
array of DvtDiagramLayoutContextNode objects
- Type
- DvtDiagramLayoutContextNode<K1, D1>[]
-
getContainerId : {K1}
-
Get the id of this node's container, or null if this is a top-level node.
Returns:
- Type
- K1
-
getContentBounds : {{x: number, y: number, w: number, h: number}}
-
Get the bounds of the node content. Currently the method returns the same value as getBounds(). The bounds are in the coordinate system of the node.
Properties:
Name Type Description h
number height w
number width x
number x-coordinate y
number y-coordinate Returns:
An object with the following properties for the bounds of the node content
- Type
- {x: number, y: number, w: number, h: number}
-
getData : {D1}
-
Get the corresponding data object for the diagram node.
Returns:
a data object for the node
- Type
- D1
-
getId : {K1}
-
Get the id of the node.
Returns:
- Type
- K1
-
getLabelBounds : {{x: number, y: number, w: number, h: number}}
-
Get the label bounds. The bounds are in the coordinate system of the label.
Properties:
Name Type Description h
number height w
number width x
number x-coordinate y
number y-coordinate Returns:
An object with the following properties for the label bounds
- Type
- {x: number, y: number, w: number, h: number}
-
getLabelHalign : {('left'|'center'|'right')}
-
Get the horizontal alignment of the node label. The default value is left for locales with left-to-right reading direction and right for locales with right-to-left reading direction.
Supported Values:
Value center
left
right
Returns:
A string that specifies the horizontal label alignment
- Type
- ('left'|'center'|'right')
-
getLabelPosition : {{x: number, y: number}}
-
Get the position of the node label. The position is in the coordinate system of the node's container. The position represents the upper-left corner for locales with left-to-right reading direction and the upper-right corner for locales with right-to-left reading direction.
Properties:
Name Type Description x
number x-coordinate y
number y-coordinate Returns:
An object with the following properties for the position of the node label
- Type
- {x: number, y: number}
-
getLabelRotationAngle : {number}
-
Get the angle of rotation of the node label, relative to the label rotation point, in radians.
Returns:
- Type
- number
-
getLabelRotationPoint : {{x: number, y: number}}
-
Get the point about which to rotate the node label, in the coordinate system of the label.
Properties:
Name Type Description x
number x-coordinate y
number y-coordinate Returns:
An object with the following properties for the label rotation point
- Type
- {x: number, y: number}
-
getLabelValign : {('top'|'middle'|'bottom'|'baseline')}
-
Get the vertical alignment of the node label.
- Default Value:
"top"
Supported Values:
Value baseline
bottom
middle
top
Returns:
A string that specifies the vertical label alignment
- Type
- ('top'|'middle'|'bottom'|'baseline')
-
getLayoutAttributes : {Object}
-
Get the corresponding object from the nodes option array.
- Deprecated:
-
Since Description 2.1.0
This method is deprecated. Please use the getData method instead
Returns:
- Type
- Object
-
getPosition : {{x: number, y: number}}
-
Get the position of the node. The position is in the coordinate system of the node's container.
Properties:
Name Type Description x
number x-coordinate y
number y-coordinate Returns:
An object with the following properties for the position of the node
- Type
- {x: number, y: number}
-
getRelativePosition(containerId) : {{x: number, y: number}}
-
The method returns a position of the node relative to the specified ancestor container. If the container id is null, the method returns global position of the node. If the container id is not an ancestor id for the node, the method returns null.
Parameters:
Name Type Description containerId
K1 ancestor id Properties:
Name Type Description x
number x-coordinate y
number y-coordinate Returns:
An object with the following properties for the position of the node relative to the specified ancestor container
- Type
- {x: number, y: number}
-
getSelected : {boolean}
-
Determine whether this node is selected.
Returns:
- Type
- boolean
-
isDisclosed : {boolean}
-
Determine whether this container is disclosed.
Returns:
true if the node is a disclosed container
- Type
- boolean
-
setLabelHalign(halign) : {void}
-
Set the horizontal alignment of the node label. The default value is left for locales with left-to-right reading direction and right for locales with right-to-left reading direction.
Parameters:
Name Type Description halign
'left' | 'center' | 'right' A string that specifies the horizontal label alignment Supported Values:
Value center
left
right
Returns:
- Type
- void
-
setLabelPosition(pos) : {void}
-
Set the position of the node label. The position is in the coordinate system of the node's container. The position represents the upper-left corner for locales with left-to-right reading direction and the upper-right corner for locales with right-to-left reading direction.
Parameters:
Name Type Description pos
{x: number, y: number} An object with the following properties for position of the node label Properties:
Name Type Description x
number x-coordinate y
number y-coordinate Returns:
- Type
- void
-
setLabelRotationAngle(angle) : {void}
-
Set the angle of rotation of the node label, relative to the label rotation point, in radians.
Parameters:
Name Type Description angle
number angle of rotation Returns:
- Type
- void
-
setLabelRotationPoint(point) : {void}
-
Set the point about which to rotate the node label, in the coordinate system of the label.
Parameters:
Name Type Description point
{x: number, y: number} An object with the following properties for label rotation point Properties:
Name Type Description x
number x-coordinate y
number y-coordinate Returns:
- Type
- void
-
setLabelValign(valign) : {void}
-
Set the vertical alignment of the node label.
Parameters:
Name Type Description valign
'top' | 'middle' | 'bottom' | 'baseline' A string that specifies the vertical label alignment. The "baseline" value is not supported when applied to multiline labels. If "baseline" is applied to a multiline label, the text element will default to "top" alignment. - Default Value:
"top"
Supported Values:
Value baseline
bottom
middle
top
Returns:
- Type
- void
-
setPosition(pos) : {void}
-
Set the position of the node. The position is in the coordinate system of the node's container.
Parameters:
Name Type Description pos
{x: number, y: number} An object with the following properties for the position of the node Properties:
Name Type Description x
number x-coordinate y
number y-coordinate Returns:
- Type
- void