new Vecta.Symbol(node)
Vecta symbol object. Represents a symbol on a stencil.
| Name | Type | Description |
|---|---|---|
node | string|SVGElement | The symbol itself. Can be the symbol's ID, node or JQuery object. |
Properties
.$jQuery
The jQuery wrapped node for the symbol.
| Name | Type | Description |
|---|---|---|
$ | 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.
| Name | Type | Attributes | Description |
|---|---|---|---|
desc | string | optional | 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.
| Name | Type | Description |
|---|---|---|
x | number | X coordinate to drop symbol. |
y | number | 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.
| Name | Type | Attributes | Description |
|---|---|---|---|
shape | Vecta.Shape | optional | 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.
| Name | Type | Attributes | Description |
|---|---|---|---|
index | number | optional | 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.
| Name | Type | Attributes | Description |
|---|---|---|---|
json | number | optional | 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.
| Name | Type | Attributes | Description |
|---|---|---|---|
name | string | optional | 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.
| Name | Type | Attributes | Description |
|---|---|---|---|
tags | string | optional | 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.
| Name | Type | Attributes | Description |
|---|---|---|---|
type | string|number | optional | Undefined to get, valid type to set. |
Returns:
Returns type when get, or Vecta.Symbol when set.