Electra

Electra

The main Electra namespace.

Methods

.createLayoutSymbol(lay_sym, opt) Returns: Promise.<T>

Create layout symbol and add to stencil

NameTypeDescription
lay_symVecta.Shape

Must be a group shape

optobject

Options object

NameTypeAttributesDefaultDescription
is_circlebooleanoptionalfalse

Indicate this layout is circle or not. Default to false

rotate_menubooleanoptionaltrue

Flag to insert horizontal/vertical menu to the layout. Default to true

nameStringoptional'Untitled Symbol'

The symbol name. Default to 'Untitled Symbol'

descStringoptional''

The symbol description.

permStringoptionalopt.name

The symbol permanent link. Default to symbol name.

stencil_idStringoptional

Stencil id. Will create a new stencil if not passed.

Examples:
var opt = {
     is_circle: false,
     rotate_menu: true,
     name: 'My Layout',
     desc: 'My description',
     perm: 'My Layout',
     stencil_id: ...

};

Electra.createLayoutSymbol(lay_sym, opt).then(function() {
    //Layout symbol created
});
Electra Cloud