Symbol

Vecta.Symbol

new Vecta.Symbol(node)

Vecta symbol object. Represents a symbol on a stencil.

NameTypeDescription
nodestring|SVGElement

The symbol itself. Can be the symbol's ID, node or JQuery object.

Properties

.$jQuery

The jQuery wrapped node for the symbol.

NameTypeDescription
$jQuery

jQuery wrapper for symbol node.

Methods

.delete()

Deletes a symbol from the stencil, requires owner or edit and share permissions.

.desc([desc]) Returns: string|Vecta.Symbol

Get or set the symbol description.

NameTypeAttributesDescription
descstringoptional

Undefined to get, valid description to set.

Returns:

Returns the description when get or Vecta.Symbol when set.

.drop(x, y) Returns: Vecta.Shape

Drop or insert a symbol onto a drawing.

NameTypeDescription
xnumber

X coordinate to drop symbol.

ynumber

Y coordinate to drop symbol.

Returns:

Returns the dropped symbol as a Vecta.Shape in the drawing.

.icon([shape]) Returns: string|Vecta.Symbol

Get or set icon for symbol.

NameTypeAttributesDescription
shapeVecta.Shapeoptional

Undefined if get, null to reset to default icon or valid Vecta.Shape if set.

Returns:

Returns the icon string if get or Vecta.Symbol if set.

.id() Returns: string

Returns the symbol's id. Read only.

.index([index]) Returns: number|Vecta.Symbol

Get or set the index of a symbol. Index returned is zero-based.

NameTypeAttributesDescription
indexnumberoptional

Undefined to get or a valid index number to set.

Returns:

Returns the index or Vecta.Symbol if set.

.json([json]) Returns: object|Vecta.Symbol

Get or set the custom JSON for a symbol.

NameTypeAttributesDescription
jsonnumberoptional

Undefined to get or a valid JSON to set.

Returns:

Returns the custom JSON or Vecta.Symbol if set.

.name([name]) Returns: string|Vecta.Symbol

Get or set the symbol name.

NameTypeAttributesDescription
namestringoptional

Undefined to get, valid name to set.

Returns:

Returns the symbol name when get or Vecta.Symbol when set.

.stencil() Returns: Vecta.Stencil|null

Get the containing stencil.

Returns:

Returns the containing stencil or null if not found.

.tags([tags]) Returns: string|Vecta.Symbol

Get or set the symbol tags.

NameTypeAttributesDescription
tagsstringoptional

Undefined to get, valid tags to set.

To set multiple tags, pass in a string separated with commas, eg: "colors, icons, brands"

Returns:

Returns tags when get, or Vecta.Symbol when set.

.type([type]) Returns: string|Vecta.Symbol

Get or set the symbol type.

NameTypeAttributesDescription
typestring|numberoptional

Undefined to get, valid type to set.

Returns:

Returns type when get, or Vecta.Symbol when set.

vecta.io Early Access