Constructor
new SVGRect(optsopt)
Creates svgext.SVGRect instance
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
opts |
rectOpts |
<optional> |
- Mixes In:
- Source:
Extends
Members
(constant) NS :String
SVG namespace
Type:
- String
- Inherited From:
- Default Value:
- http://www.w3.org/2000/svg
- Source:
Methods
activate() → {SVGElement}
Adds an active class
- Inherited From:
- Source:
Fires:
- svgext.SVGElement#event:activated
Returns:
- Type
- SVGElement
addClass(newClass) → {SVGElement}
Adds a new class to the element
Parameters:
Name | Type | Description |
---|---|---|
newClass |
String | Class name or several classes separated by a space |
- Inherited From:
- Source:
Returns:
- Type
- SVGElement
attr(key, valueopt) → {SVGElement}
SVGElement node attributes setter & getter
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
key |
String | ||
value |
String |
<optional> |
- Inherited From:
- Source:
Fires:
- svgext.SVGElement#event:change[ATTR_NAME]
Returns:
- Type
- SVGElement
bringToFront() → {SVGElement}
Brings an element above another
- Inherited From:
- Source:
Returns:
- Type
- SVGElement
deactivate() → {SVGElement}
Removes an active class
- Inherited From:
- Source:
Fires:
- svgext.SVGElement#event:deactivated
Returns:
- Type
- SVGElement
destroy()
Destroys an object
- Overrides:
- Source:
drag()
SVGDraggable drag implementation
- Source:
(abstract) drag(delta)
Changes element position on mouse move
Parameters:
Name | Type | Description |
---|---|---|
delta |
coordinates |
- Mixes In:
- Source:
emit(type, …arguments)
Emits custom event on the element
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
type |
String | ||
arguments |
* |
<repeatable> |
- Inherited From:
- Source:
getContainerRect() → {TextRectangle}
Svg container bounding client rect getter
- Inherited From:
- Source:
Returns:
- Type
- TextRectangle
getRect() → {TextRectangle}
Element bounding client rect getter
- Inherited From:
- Source:
Returns:
- Type
- TextRectangle
getValue(relativeopt) → {resolution}
Rectangle value getter
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
relative |
Boolean |
<optional> |
false | Returns relative coordinates if true |
- Source:
Returns:
- Type
- resolution
getX() → {Number}
Rectangle X coordinate getter
- Source:
Returns:
- Type
- Number
getY() → {Number}
Rectangle Y coordinate getter
- Source:
Returns:
- Type
- Number
hasClass(className) → {Boolean}
Checks if instance has a class
Parameters:
Name | Type | Description |
---|---|---|
className |
String |
- Inherited From:
- Source:
Returns:
- Type
- Boolean
height(heightopt) → {Number|SVGRect}
Sets or gets rectangle height
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
height |
Number |
<optional> |
- Source:
Returns:
- Type
- Number | SVGRect
hide() → {SVGElement}
Hides an elment
- Inherited From:
- Source:
Returns:
- Type
- SVGElement
normalizeCoords()
SVGDraggable normalizeCoords implementation
- Source:
(abstract) normalizeCoords(delta) → {coordinates}
Checks if a new element position won't cross the border
and changes delta object to avoid border crossing
Parameters:
Name | Type | Description |
---|---|---|
delta |
coordinates |
- Mixes In:
- Source:
Returns:
- Type
- coordinates
off(type, listener) → {SVGElement}
Removes an event listener
Parameters:
Name | Type | Description |
---|---|---|
type |
String | Event name |
listener |
function | Event handler |
- Inherited From:
- Source:
Returns:
- Type
- SVGElement
offDoubleTap(tap) → {SVGElement}
Removes double tap event handler
Parameters:
Name | Type | Description |
---|---|---|
tap |
function |
- Inherited From:
- Source:
Returns:
- Type
- SVGElement
on(type, listener) → {SVGElement}
Adds an event listener
Parameters:
Name | Type | Description |
---|---|---|
type |
String | Event name |
listener |
function | Event handler |
- Inherited From:
- Source:
Returns:
- Type
- SVGElement
onAppend(container)
Fires when an element is appended to the DOM
Parameters:
Name | Type | Description |
---|---|---|
container |
SVGBlock | New element container |
- Inherited From:
- Source:
onDoubleTap(listener) → {function}
Adds double tap event handler
Parameters:
Name | Type | Description |
---|---|---|
listener |
function |
- Inherited From:
- Source:
Returns:
- Type
- function
removeClass(className) → {SVGElement}
Removes class
Parameters:
Name | Type | Description |
---|---|---|
className |
String |
- Inherited From:
- Source:
Returns:
- Type
- SVGElement
removeDndHandlers()
Removes all handlers
- Mixes In:
- Source:
setX(x) → {SVGRect}
Rectangle X coordinate setter
Parameters:
Name | Type | Description |
---|---|---|
x |
Number |
- Source:
Returns:
- Type
- SVGRect
setY(y) → {SVGRectangle}
Rectangle Y coordinate setter
Parameters:
Name | Type | Description |
---|---|---|
y |
Number |
- Source:
Returns:
- Type
- SVGRectangle
show() → {SVGElement}
Shows an elment
- Inherited From:
- Source:
Returns:
- Type
- SVGElement
width(widthopt) → {Number|SVGRect}
Sets or gets rectangle width
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
width |
Number |
<optional> |
- Source:
Returns:
- Type
- Number | SVGRect