Library globals

Class globals . canvas . api . group . Group

View source

-------------------------------------------------------------------------------
canvas.Group
-------------------------------------------------------------------------------
Class for a group element on a canvas

Functions

createChild

Create a child of given type with specified id. type can be group, text

createChildren

Create multiple children of given type

getChildren

Get a vector of all child elements

getChildrenOfType

Recursively get all children of class specified by first param

getElementById

Get first child with given id (breadth-first search) @note Use with care as it can take several miliseconds (for me eg. ~2ms). TODO check with new C++ implementation

new

rect

Create a path child drawing a (rounded) rectangle @param x Position of left border @param y Position of top border @param w Width @param h Height @param cfg Optional settings (eg. {"border-top-radius": 5})

removeAllChildren

Remove all children

setColor

Set color to children of type Path and Text. It is possible to optionally specify which types of children should be affected by passing a vector as the last agrument, ie. my_group.setColor(1,1,1,[Path]);