Skip to content

Latest commit

 

History

History
39 lines (24 loc) · 1.48 KB

Node.md

File metadata and controls

39 lines (24 loc) · 1.48 KB

Docs ▸ Introduction | Development | Demo   ////   API Reference ▸ Force | Node | Renderer

labella.Node

Node is an instance to wrap each of your label. You have to specify a desired position (idealPos) and width for each label. You may also attach data to the node, such as label text.

# var node = new labella.Node(idealPos:Number, width:Number [, data:Any]);

Fields

# node.idealPos

Desired position for this node

# node.currentPos

Current position of this node, set to idealPos automatically in the beginning. This field will be updated by the force to the position appropriate for drawing this node.

# node.width

The width of this node. Note that this width means the width along the main axis, so if the axis is vertical, this field should be the height of the label.

# node.data

Attach data about each label. This can be any value (String, Number, etc.)

Functions

# node.getLayerIndex()

Return index of the layer that this node was placed in. (In the beginning of the layout process, the force distribute nodes into multiple layers if all nodes cannot fit within one layer.)