Elements API
Last updated
Was this helpful?
Last updated
Was this helpful?
Element Creation
createEl takes Element config as an input which contains element 'el' type with 'attr' attributes and 'style' properties.
Examples:
-- update this example
CreateEls can be used to create more than one element, based on the data array. It accepts data array as a first argument and Element config as a second element. It creates elements for every data value. property values can be an access function, which receives data as an argument.
Set attributes. It takes either a single key, value pair, or an object as an argument. The Value of a property can be a function. if you send 'null' as
Set style properties to the element. It takes either a single key, value pair , or an object with multiple key-value pairs.
To fetch attribute value. It takes attribute name input, gives value as an output.
To fetch DOM style value. It takes style property input, gives value as an output.
To perform animation transitions of one or more elements from the current state to the target state in a given duration(ms).
To interrupt transitions on the context node. By calling the interrupt it kills all the transitions on the node.
To bind event handlers on the graphical element. Accepts eventType and eventHandler as arguments. The handler receives the event object as an argument.
API to fetch Dom node. Returns Dom object(SVG) and VDom node(Canvas/WebGL).
API to fetch/set data bound to the graphical node.
API to remove the current element from the parent element. Node on which remove invoked will be removed from the parent's children list
API to remove the child from its child's list. Takes node instance as an argument.
Fetches single child node for a given CSS selector. It also accepts data object as a second argument, optional param, to fetch based on bound data. It takes a simple CSS- as an input and returns instance.
Fetches multiple children for a given CSS selector. It also accepts data array as a second argument, optional param, to fetch based on bound data. It takes a simple CSS- as an input and returns s instance.