_drawing
An utility container that holds all the drawing related implementations
Table of Contents
-
Methods
- _addElement(e)
- _checkClick(evt)
- _draw()
- _drawAllIn(element)
- _getElementsSlim()
- _removeElement(e)
- _timedDrawing()
- _whenKeyDown(evt)
- _whenKeyUp(evt)
- _whenMouseMove(evt)
- _whenMouseUp(evt)
- addElement(element)
- getCanvasElement()
- getCanvasElement()
- getDataUrl(cropImage)
- getElements()
- getElementsSlim()
- initializeTimedDrawing()
- remove(element)
- Properties
- Static Methods
Methods
_addElement
-
e
Adds a given element from the canvas
Parameters:
-
e
_basicElementElement that is to be added
_checkClick
-
evt
Handles the click event
Parameters:
-
evt
EventEvent we're bubbling in
_draw
()
Plots each and every element to the canvas and registers all the event handlers delegates
_drawAllIn
-
element
Plots the element itself and all its related nodes into the canvas
Parameters:
-
element
_basicElementThe element being drawn to the canvas
Gathers all elements being ploted to the canvas and organizes it as a directed graph JSON
Returns:
Graph node information
_removeElement
-
e
Removes a given element from the canvas
Parameters:
-
e
_basicElementElement that is to be removed
_timedDrawing
()
Handles the periodic draw of the elements in this Raska instance
_whenKeyDown
-
evt
Handles de key down envent
Parameters:
-
evt
EventEvent we're bubbling in
_whenKeyUp
-
evt
Handles de key up envent
Parameters:
-
evt
EventEvent we're bubbling in
_whenMouseMove
-
evt
Handles de mouse move envent
Parameters:
-
evt
EventEvent we're bubbling in
_whenMouseUp
-
evt
Handles de mouse up envent
Parameters:
-
evt
EventEvent we're bubbling in
addElement
-
element
Add a given element to the drawing elements array
Parameters:
-
element
_basicElementThe element to be drawn
getCanvasElement
()
HTMLElement
Returns the corresponding Raska Canvas element
Returns:
Canvas
getCanvasElement
()
Returns the corresponding Raska Canvas element
getDataUrl
-
cropImage
Gets the canvas' dataURL
Parameters:
-
cropImage
BoolWhether or not to crop the exported image
Gathers all elements being ploted to the canvas
Returns:
Graph node information
Gathers all elements being ploted to the canvas and organizes it as a directed graph JSON
Returns:
Graph node information
initializeTimedDrawing
()
Initializes the drawing process
remove
-
element
Removes a given element from the canvas
Parameters:
-
element
_basicElementElement that is to be removed
Properties
_2dContext
Object
private
The 2dContext from the canvas element we're targeting
Default: null
_canvas
HTMLElement
private
The Canvas element we're targeting
Default: null
_canvasElement
_basicElement
private
The Canvas element (wraped by a Raska _basicElement)
Default: null
_elements
Array
private
Holds the elements that are to be drawn to the target canvas
Default: []
_timerRunning
Bool
private
Whether or not we have a timer running
Default: false
Static Methods
_drawing.reloadUsing
-
elements
Redefines the elements that are supposed to be ploted to the canvas
Parameters:
-
elements
_basicElements[]The elements that are going to be ploted