Class: ShapeComponent

ShapeComponent

new ShapeComponent(_desc)

ShapeComponent Class - represents individual component for a shape. A Shape can contain many shape components such as - line, rectangle, polygon, circle, path etc.
Parameters:
Name Type Description
_desc object is object that has the following structure {"dimension":{}, "param":{}, "properties":{}}
Source:

Methods

applyProperty()

This function applies any changes to component property
Source:
Returns:
nothing

calculateDimensions()

This function converts the % dimensions to real pixel
Source:
Returns:
nothing

construct() → {HTMLElement}

This will paint the component. This method is invoked from Shape.draw
Source:
Returns:
dom
Type
HTMLElement

drawOnCanvas() → {HTMLElement}

This function is used to convert svg to canvas
Source:
Returns:
- dom
Type
HTMLElement

save() → {Object}

This function returns saved json format
Source:
Returns:
saved JSON
Type
Object

updateText(_text)

This function is used to update any text. Only applies if component type is text
Parameters:
Name Type Description
_text String
Source: