Shape extends Element

This is the API model used to edit the area of the shape.

Methods

append(html)

The HTML String passed as an argument is added as a child at the back of the Element.

var shape = editor.getAPIModelById('id');
shape.append('<span>TEXT</span>');

prepend(html)

The HTML String passed as an argument is added as a child to the front of the Element.

var shape = editor.getAPIModelById('id');
shape.prepend('<span>TEXT</span>');

remove()

Removes the Element itself.

var shape = editor.getAPIModelById('id');
shape.remove();

replace(html)

Replaces the element itself with the HTML String passed as an argument.

var shape = editor.getAPIModelById('id');
shape.replace('<span>Shape replaced</span>');

setHTML(html)

Set the HTML string value passed as an argument to the internal HTML of the figure.

var shape = editor.getAPIModelById('id');
shape.setHTML('<p><span>Add HTML. All previously entered information will be erased.</span></p>');

setText(text)

Set the text string value passed as an argument to the internal Text of the figure.

var  shape = editor.getAPIModelById('id');
shape.setText('Sample text.');