Class Arrow
represents arrow
Defined in: raphaelsm.src.js.
Constructor Attributes | Constructor Name and Description |
---|---|
Arrow(raphael, params)
Arrow
|
Field Attributes | Field Name and Description |
---|---|
angle of the object
|
|
cos of this.angle
|
|
length of arrow head [pixel]
|
|
width of arrow head [pixel]
|
|
actual raphael object
|
|
svg array (list) of the object
|
|
raphael instance connected to the object
|
|
sin of this.angle
|
|
size of the object
|
|
x coordinate of the object
|
|
z coordinate of the object
|
Method Attributes | Method Name and Description |
---|---|
constructorArrow(raphael, params)
Constructor, see Arrow for parameters description
|
|
<static> |
Arrow.create(raphael, params)
Creates new Arrow object, for parameters meaning see Arrow
|
makeCopy()
Returns copy of receiver
|
|
resize(newSize)
Resize receiver in both direction
|
|
rotate(phi)
Rotate receiver by given angle (this.angle += phi)
|
|
setAngle(phi)
Set angle of receiver (this.angle = phi)
|
|
Sets svg path of receiver
|
|
setX(x)
Sets new x position of receiver (this.x = x)
|
|
setXZ(x, z)
Sets new x and z position of receiver (this.x = x; this.z = z)
|
|
setZ(z)
Sets new z position of receiver (this.z = z)
|
|
translate(dx, dz)
Translate receiver in x and z direction (this.x += dx; this.z += dz)
|
|
translateX(dx)
Translate receiver in x direction (this.x += x)
|
|
translateZ(dz)
Translate receiver in x direction (this.z += dz)
|
|
up()
Update receiver (set this.pathList for given internal variables - x,z,angle.
|
Class Detail
Arrow(raphael, params)
Arrow
- Parameters:
- {Raphael} raphael
- raphael instance
- {Object} params
- parameters, see below
- {float} params.x Optional, Default: 0.
- x coordinate of arrow tip [pixel]
- {float} params.z Optional, Default: 0.
- z coordinate of arrow tip [pixel]
- {float} params.size Optional, Default: 100.
- length of the whole arrow (its size) [pixel]
- {float} params.angle Optional, Default: 0.
- the arrow will be rotated by this angle [deg]
- {float} params.headLen Optional, Default: size/4.
- length of the arrow head [pixel]
- {float} params.headWidth Optional, Default: size/16.
- width of the arrow head [pixel]
Field Detail
angle
angle of the object
cos
cos of this.angle
{float}
headLen
length of arrow head [pixel]
{float}
headWidth
width of arrow head [pixel]
obj
actual raphael object
pathList
svg array (list) of the object
raphael
raphael instance connected to the object
sin
sin of this.angle
size
size of the object
x
x coordinate of the object
z
z coordinate of the object
Method Detail
constructorArrow(raphael, params)
Constructor, see Arrow for parameters description
- Parameters:
- raphael
- params
<static>
{Arrow}
Arrow.create(raphael, params)
Creates new Arrow object, for parameters meaning see Arrow
- Parameters:
- raphael
- params
- Returns:
- {Arrow} new Arrow object
{Arrow}
makeCopy()
Returns copy of receiver
- Returns:
- {Arrow} copy of receiver
resize(newSize)
Resize receiver in both direction
- Parameters:
- {float} newSize
- new size of receiver
rotate(phi)
Rotate receiver by given angle (this.angle += phi)
- Parameters:
- {float} phi
- angle of rotation
setAngle(phi)
Set angle of receiver (this.angle = phi)
- Parameters:
- {float} phi
- angle of rotation
setPathList()
Sets svg path of receiver
setX(x)
Sets new x position of receiver (this.x = x)
- Parameters:
- {float} x
- new x coordinate [pixel]
setXZ(x, z)
Sets new x and z position of receiver (this.x = x; this.z = z)
- Parameters:
- {float} x
- new x coordinate [pixel]
- {float} z
- new z coordinate [pixel]
setZ(z)
Sets new z position of receiver (this.z = z)
- Parameters:
- {float} z
- new z coordinate [pixel]
translate(dx, dz)
Translate receiver in x and z direction (this.x += dx; this.z += dz)
- Parameters:
- {float} dx
- distance to be translated in x direction [pixel]
- {float} dz
- distance to be translated in z direction [pixel]
translateX(dx)
Translate receiver in x direction (this.x += x)
- Parameters:
- {float} dx
- distance to be translated [pixel]
translateZ(dz)
Translate receiver in x direction (this.z += dz)
- Parameters:
- {float} dz
- distance to be translated [pixel]
up()
Update receiver (set this.pathList for given internal variables - x,z,angle... - as well as its copies)