Show:
Extends _basicElement
Module: _defaultConfigurations
Parent Module: raska

Creates a cricle.

Methods

$disabled ()
private

A simple helper function to be used whenever this instance gets disable (if ever)

addChild
(
  • child
)
_basicElement
chainable

Adds a new child element to this node

Parameters:

  • child _basicElement

    Element that will be added to the child array into this element

Returns:

_basicElement:

Updated Raska element reference

addLinkFrom
(
  • element
)
Bool

Links this element to another Raska element as this instance being the target node

Parameters:

  • element _basicElement

    Element that will be linked as a source from this element node

Returns:

Bool:

Whether or not the link was added

addLinkTo
(
  • element
)
Bool

Creates a link between this and another element, using the later as a dependency of this instance

Parameters:

  • element _basicElement

    Element that will be linked as a destination from this element node

Returns:

Bool:

Whether or not the link was added

adjustPosition
(
  • newX
  • newY
)
chainable

[ABSTRACT] Adjusts the position of the current element taking in consideration it's parent positioning constraints

Parameters:

  • newX Number

    X position

  • newY Number

    Y position

beforeRemoveLinkFrom
(
  • doWhat
)
chainable

Event triggered before a link gets removed from this element

Parameters:

  • doWhat Function

    A delegate with the 'this' poiting to this instance and the first paramenter being the reference to the element which is being remove as a link to this instance

beforeRemoveLinkTo
(
  • doWhat
)
chainable

Event triggered before a link gets removed to this element

Parameters:

  • doWhat Function

    A delegate with the 'this' poiting to this instance and the first paramenter being the reference to the element which is being remove as a link from this instance

canReach () Bool

Whether or not this element can reach another element via a linked relation

Returns:

Bool:

Whether or not a link exists

clearLinksFrom
(
  • source
  • each
)
Array
private

Clears all links that point to and from this Raska element

Parameters:

  • source Object

    Object that defines the source of the link removal (start node)

  • each Function

    Delegates that handle the process of removing the references

Returns:

Array:

Empty array

click
(
  • x
  • y
  • ele
  • evt
)
chainable

Triggered whenever a click iteraction occurs within the boundaries of this element.

  • This event is only supported on selected elements. Check for the canHandleEvents property value before relying on this delegate

Parameters:

  • x Number

    Element's current X position

  • y Number

    Element's current Y position

  • ele _basicElement

    The element that was clicked

  • evt Event

    Event that triggered the delegate

disable ()
chainable

Clears all references and child elements from this instance

elementDisabledNotification ()
chainable

Handles element disabling notifications

existsIn
(
  • x
  • y
)
Bool

Inherited from _basicElement but overwritten in src\raska.js:1361

Whether or not this element existis withing the boudaries of the given x/y coordinates

Parameters:

  • x Number

    X Coordinate

  • y Number

    Y Coordinate

Returns:

Bool:

If this element is contained within the X/Y coordinates

getAdjustedCoordinates () X:Number,y:Number

Gathers adjusted x/y coordinates for the currente element taking into consideration the type of positining set to it and wheter or not a parent node is present

Returns:

X:Number,y:Number:

Adjusted coordinates

getBoundaries () Object

Retrieves the element boundaries information

Returns:

Object:

Data regarding x, y, minX and minY from this element

getChildElements () Array

Gathers all child elements from this node

Returns:

Array:

All child elements

getHeight () Number

[ABSTRACT] Gets the current Height for this element

Returns:

Number:

The Height of this element

getLinksFrom () Array

Gathers all dependecies/linked elements related to this instance

Returns:

Array:

All elements that this node references from

getLinksTo () Array

Gathers all elements that this instance depends on

Returns:

Array:

All elements that this node references TO

getParent () _basicElement

Get the parent node to this element

Returns:

_basicElement:

Reference to de parent node (null if none)

getWidth () Number

[ABSTRACT] Gets the current width for this element

Returns:

Number:

The width of this element

isLinkable () Bool

Is this element passive of being linked at all?

Returns:

Bool:

Whether or not a link can be created either from or to this element

isSerializable () Bool

Is this element passive of being serialized at all?

Returns:

Bool:

Whether or not this element is suposed to be serialized

normalize ()
chainable

Transposes the getter data to a field attached to this instance

notifyDisableStateOn ()
chainable

Notifies a given element whenever (if ever) this element gets disabled

release
(
  • x
  • y
  • ele
  • evt
)
chainable

Triggered whenever a 'clickUp' iteraction occurs within the boundaries of this element.

  • This event is only supported on selected elements. Check for the canHandleEvents property value before relying on this delegate

Parameters:

  • x Number

    Element's current X position

  • y Number

    Element's current Y position

  • ele _basicElement

    The element that was clicked

  • evt Event

    Event that triggered the delegate

removeLinkFrom
(
  • element
)
_basicElement
chainable

Removes the link to this element from another Raska element

Parameters:

  • element _basicElement

    Element that will have its link from this element removed

Returns:

_basicElement:

Updated Raska element reference

removeLinkTo
(
  • element
)
_basicElement
chainable

Removes the dependency from this element to another Raska element

Parameters:

  • element _basicElement

    Element that will have its link to this element removed

Returns:

_basicElement:

Updated Raska element reference

setHeight
(
  • newHeight
)
chainable

[ABSTRACT] Sets the current Height for this element

Parameters:

  • newHeight Number

    The height for this element

setParent
(
  • parent
)
_basicElement
chainable

Sets the parent node to this element

Parameters:

  • parent _basicElement

    Element that will be added as a parent to this element

Returns:

_basicElement:

Updated Raska element reference

setWidth
(
  • newWidth
)
chainable

[ABSTRACT] Sets the current width for this element

Parameters:

  • newWidth Number

    The width for this element

toggleFullScreen
(
  • The
  • strContainerId
)

Toggles canvas in/out fullscreen mode

Parameters:

  • The HTMLElement | Node

    Canvas element

  • strContainerId String

    The id for the canvas toolbar (or undefined if nothing needs to be done there)

Properties

$beforeRemoveLinkFrom

Function

Holds the reference to the delegate triggered before a link gets removed from an element

Default: null

$beforeRemoveLinkTo

Function

Holds the reference to the delegate triggered before a link gets removed to an element

Default: null

$childElements

_basicElement private

Points to series of child Raska element (if any) that, usually, are contained inside this node

Default: []

$hitTestCanvas

CanvasRenderingContext2D protected

A simple canvas used to perform a pixel model hit test agains this element

$linksFrom

_basicElement private

Points to a Raska element [as an arrow] (if any) that depends on this instance

Default: []

$linksTo

_basicElement private

Points to a Raska element [as an arrow] (if any) related as a dependency from this node

Default: []

$parent

Unknown private

Points to a parent Raska element (if any)

Default: null

active

Bool

Whether or not a border should be rendered

Default: false

attr

Object

Just an empty attribute bag where you can save extra stuff that you need/want to serialize

Default: "{}"

canHandleEvents

Bool

Whether or not this element handle event interactions

Default: false

color

String

Element border color

Default: null

getType

_elementTypes

The element type

Default: _elementTypes.basic

graphNode

Bool

Wheter or not this element is part of the graph as a node

Default: true

name

String

The element name

Default: "anonymous"

position

_positionTypes

Element position type

Default: _positionTypes.relative

width

Number

Border width

Default: 0

x

Number

Element x position

Default: 50

y

Number

Element y position

Default: 50

Attributes

border

Details regarding this element' border