Primary class for management of the user interactive view.
Self-invoking function added to avoid namespace pollution.
Methods
(static) clearSelection()
Clears the selected boxes for creating a line
(static) createBox(x, y)
Places the box in a given location and adds various event handlers
to handle dragging, input, and data sanitation
Parameters:
Name | Type | Description |
---|---|---|
x |
Float | x-coordinate to place the box |
y |
Float | y-coordinate to place the box |
(static) createFormula(key0, key1, changeSymbol)
Builds a formula composed of the operands and symbol and creates a function
before placing it into the formula object
Parameters:
Name | Type | Description |
---|---|---|
key0 |
String | Key of the operand box to be added to the formula |
key1 |
String | Key of the operator box to used in the formula |
changeSymbol |
Boolean | True if only the symbol is being changed |
(static) deleteBox(e)
Deletes a box and its accompanying lines, dependents, and formulas
Parameters:
Name | Type | Description |
---|---|---|
e |
Event | Event which triggered the calling of this function |
(static) drawLine(e)
Draws a line between two boxes if valid and handles the creation
of dependents and formulas depending on context
Parameters:
Name | Type | Description |
---|---|---|
e |
Event | An event of the last selected box |
(static) setFunction(type, data)
Creates an evaluation function for constrained variables
Parameters:
Name | Type | Description |
---|---|---|
type |
String | Determines what kind of function to create |
data |
String | Input data to determine return value of created function |
(static) update()
Iterates over all variables updating ones marked invalid and handles variable DOM updates
(static) verifyInput(input) → {Object}
Determine whether an input is satisfactory and of what type
the input is (symbol, variable, or string)
Parameters:
Name | Type | Description |
---|---|---|
input |
String | String to be parsed |
Returns:
{ result: Bool, type: String }
- Type
- Object