_public
All public avaliable methods from the Raska library
Table of Contents
- Methods
- Properties
-
Static Methods
- _public.checkCollisionOn(xy)
- _public.clear()
- _public.exportImage(cropImage)
- _public.getCanvasBoundaries()
- _public.getElementsData()
- _public.getElementsRaw()
- _public.getElementsSlim()
- _public.installUsing(configuration)
- _public.loadElementsFrom(source)
- _public.newCircle()
- _public.newLabel()
- _public.newSquare()
- _public.newTriangle()
- _public.onElementInteraction(iteractionTypetrigger)
- _public.plot()
- _public.tryGetElementOn(xy)
Methods
remove
-
element
Removes a given element from the canvas
Parameters:
-
element
_basicElementElement that is to be removed
Properties
positionTypes
_positionTypes
static
Retrieves all possible position types
toggleFullScreen
Unknown
static
Toggles fullscreen mode on/off
Static Methods
_public.checkCollisionOn
-
x
-
y
Checks whether or not an element does exists at a given coordinate
Parameters:
-
x
NumberX position
-
y
NumberY position
Returns:
Wheter or not an element can be found at these coordinates
_public.clear
()
Clears all elements from the canvas
Exports current canvas data as an image to a new window
Parameters:
-
cropImage
BoolWhether or not to crop the exported image
Returns:
Reference to the '_public' pointer
_public.getCanvasBoundaries
()
MaxW:number, maxH:number
Gathers the target canvas boundaries
Returns:
_public.getElementsData
()
String
Retrieves the ENTIRE directed graph represented by the elements in the canvas
Returns:
The stringfied JSON that represents the current directed graph drawn to the canvas
_public.getElementsRaw
()
Json
Retrieves the raw elements from the drawing stack
Returns:
The JSON object that represents ALL the Raska elements in the canvas
_public.getElementsSlim
()
Json
Retrieves the directed graph represented by the elements in the canvas
Returns:
The JSON object that represents the current directed graph drawn to the canvas
Configures the Raska library to target a given canvas using the configuration passed as a parameter
Parameters:
-
configuration
_defaultConfigurations.libraryConfiguration data that should be used to configure this Raska instance
Returns:
Reference to the '_public' pointer
_public.loadElementsFrom
-
source
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
Adds a new Circle to the target canvas
Returns:
Copy of '_defaultConfigurations.circle' object
_public.newLabel
()
_defaultConfigurations.label
Adds a new Label to the target canvas
Returns:
Copy of '_defaultConfigurations.label' object
_public.newSquare
()
_defaultConfigurations.square
Adds a new Square to the target canvas
Returns:
Copy of '_defaultConfigurations.square' object
_public.newTriangle
()
_defaultConfigurations.square
Adds a new Triangle to the target canvas
Returns:
Copy of '_defaultConfigurations.triangle' object
_public.onElementInteraction
-
iteractionType
-
trigger
Registers a handler to be trigered by any interaction taken place against the canvas
Parameters:
-
iteractionType
StringWhen to trigger the iteraction handler
-
trigger
FunctionWhat to do whenever an element iteraction happens
Tries to get the element that exists at a given coordinate
Parameters:
-
x
NumberX position
-
y
NumberY position
Returns:
Raska basic element (if any) or null