Show:
Module: raska

All public avaliable methods from the Raska library

Methods

remove
(
  • element
)
private chainable

Defined in src\raska.js:3047

Removes a given element from the canvas

Parameters:

Properties

positionTypes

_positionTypes static

Defined in src\raska.js:2974

Retrieves all possible position types

toggleFullScreen

Unknown static

Defined in src\raska.js:2962

Toggles fullscreen mode on/off

Static Methods

_public.checkCollisionOn
(
  • x
  • y
)
Bool

Defined in src\raska.js:3015

Checks whether or not an element does exists at a given coordinate

Parameters:

  • x Number

    X position

  • y Number

    Y position

Returns:

Bool:

Wheter or not an element can be found at these coordinates

_public.clear ()
chainable

Defined in src\raska.js:3072

Clears all elements from the canvas

_public.exportImage
(
  • cropImage
)
_public
chainable

Defined in src\raska.js:2844

Exports current canvas data as an image to a new window

Parameters:

  • cropImage Bool

    Whether or not to crop the exported image

Returns:

_public:

Reference to the '_public' pointer

_public.getCanvasBoundaries () MaxW:number, maxH:number

Defined in src\raska.js:3060

Gathers the target canvas boundaries

Returns:

MaxW:number, maxH:number
_public.getElementsData () String

Defined in src\raska.js:2880

Retrieves the ENTIRE directed graph represented by the elements in the canvas

Returns:

String:

The stringfied JSON that represents the current directed graph drawn to the canvas

_public.getElementsRaw () Json

Defined in src\raska.js:2858

Retrieves the raw elements from the drawing stack

Returns:

Json:

The JSON object that represents ALL the Raska elements in the canvas

_public.getElementsSlim () Json

Defined in src\raska.js:2869

Retrieves the directed graph represented by the elements in the canvas

Returns:

Json:

The JSON object that represents the current directed graph drawn to the canvas

_public.installUsing
(
  • configuration
)
_public
chainable

Defined in src\raska.js:2985

Configures the Raska library to target a given canvas using the configuration passed as a parameter

Parameters:

  • configuration _defaultConfigurations.library

    Configuration data that should be used to configure this Raska instance

Returns:

_public:

Reference to the '_public' pointer

_public.loadElementsFrom
(
  • source
)
chainable

Defined in src\raska.js:2891

Redefines the elements that are supposed to be ploted to the canvas

Parameters:

  • source _basicElements[]

    The elements that are going to be ploted

_public.newCircle () _defaultConfigurations.circle

Defined in src\raska.js:2820

Adds a new Circle to the target canvas

Returns:

_defaultConfigurations.circle:

Copy of '_defaultConfigurations.circle' object

_public.newLabel () _defaultConfigurations.label

Defined in src\raska.js:2786

Adds a new Label to the target canvas

Returns:

_defaultConfigurations.label:

Copy of '_defaultConfigurations.label' object

_public.newSquare () _defaultConfigurations.square

Defined in src\raska.js:2797

Adds a new Square to the target canvas

Returns:

_defaultConfigurations.square:

Copy of '_defaultConfigurations.square' object

_public.newTriangle () _defaultConfigurations.square

Defined in src\raska.js:2809

Adds a new Triangle to the target canvas

Returns:

_defaultConfigurations.square:

Copy of '_defaultConfigurations.triangle' object

_public.onElementInteraction
(
  • iteractionType
  • trigger
)
chainable

Defined in src\raska.js:3001

Registers a handler to be trigered by any interaction taken place against the canvas

Parameters:

  • iteractionType String

    When to trigger the iteraction handler

  • trigger Function

    What to do whenever an element iteraction happens

_public.plot () _public
chainable

Defined in src\raska.js:2831

Plots an element to the canvas

Returns:

_public:

Reference to the '_public' pointer

_public.tryGetElementOn
(
  • x
  • y
)
_basicElement

Defined in src\raska.js:3028

Tries to get the element that exists at a given coordinate

Parameters:

  • x Number

    X position

  • y Number

    Y position

Returns:

_basicElement:

Raska basic element (if any) or null