Methods
AddNode(data, key)
Adds a node from data into the graph
Parameters:
| Name | Type | Description |
|---|---|---|
data |
dictionary | the data as loaded from the json file |
key |
string | the ID of the node |
- Source:
ApplyOperation()
The core of the shunting yard algorithm. Better not to modify.
- Source:
ChangeColor(node, color)
Changes the color of a node
Parameters:
| Name | Type | Description |
|---|---|---|
node |
Graph.node | the node that changes color |
color |
Three.color | the new color of the node |
- Source:
Colorize(col, indexOfProperty)
Colorizes the nodes in different shades of a certain color based on intensity of a property
Parameters:
| Name | Type | Description |
|---|---|---|
col |
Three.color | the color in which to colorize |
indexOfProperty |
indexOfProperty | the index of the property based on which to colorize |
- Source:
Contains(node, word)
Evaluates if a the metadata of a node (id + categories) contains the regular expression word
Parameters:
| Name | Type | Description |
|---|---|---|
node |
Graph.node | the node that is being evaluated |
word |
string | a regular expression |
- Source:
defineColorPicker2()
Creates the color picker and attaches events to it.
- Source:
defineCombo(data)
Creates the combobox and populates it with properties names from the data
Parameters:
| Name | Type | Description |
|---|---|---|
data |
dictionary | as loaded from the json file |
- Source:
DefinePrioritiesOfOperators()
Defines the priorities of the operators NOT, AND, OR. The higher the number, the higher the priority.
- Source:
EmptyStacks()
Finishes the shunting yard algorithm. Better not to modify.
- Source:
Evaluate(node, expression)
Evaluates if the metadata (id + categories) of a node satisfies the expression. Not case sensitive. Implements the 'shunting yard' algorithm
Parameters:
| Name | Type | Description |
|---|---|---|
node |
Graph.node | the node that is evaluated |
expression |
string | the expression under which the node is evaluated. A boolean expression of regular expression. Ex: xx AND Y OR NOT zz. xx, yy, and zz are regular expressions. The presedence of the boolean operators is defined in DefinePrioritiesOfOperators(). |
- Source:
HandleNodeHovering(node)
Defines what happens when a user hovers over a node (point)
Parameters:
| Name | Type | Description |
|---|---|---|
node |
Graph.node | a node from the graph that was hovered over |
- Source:
HandleShowFoundNodesChange()
What to do when the "show found nodes" box is changed
- Source:
HandleSizeAttenuationChange()
What to do when the user clicks on the size attenuation box
- Source:
HasHigherPriority(operatorsStack, operator)
Evaluates if an operator has a higher priority than the top of the operatorsStack
Parameters:
| Name | Type | Description |
|---|---|---|
operatorsStack |
list | the stack of operators as defined in the shunting yard algorithm by Dijkstra |
operator |
string | one of NOT, AND, and OR. |
- Source:
InitDrawing(data)
Initializes rendering frame and draws the graph in an initial scene
Parameters:
| Name | Type | Description |
|---|---|---|
data |
dictionary | The dictionary of points as loaded from the json file |
- Source:
InitEventHandlers()
Initializes the check boxes and the event handlers for the checkboxes
- Source:
InitGlobalDataVariables()
Initiates the global variables
- Source:
InitializeGraph()
Initializes the graph
- Source:
Is_operator()
Evaluates if the string word is in the list [AND, OR, NOT]
- Source:
LoadAllNodes()
Loads all points from the data file in the graph
- Source:
LoadDataFromFile(file)
Loads data from file and makes initializations necessary to render data points
Parameters:
| Name | Type | Description |
|---|---|---|
file |
file | The file selected by the user |
- Source:
LoadDataInGraph(data)
Loads all data in the graph
Parameters:
| Name | Type | Description |
|---|---|---|
data |
dictionary | the data as loaded from the json file |
- Source:
LoadLocalDataSet()
Is called when the user selects a file to upload
- Source:
LoadOnlyFoundNodes()
Loads only the points that result from a search in the graph. At least 15 nodes are loaded, however.
- Source:
PrepareColorZero(coords)
Prepares the initial colors of the points based on their coordinates. Optional.
Parameters:
| Name | Type | Description |
|---|---|---|
coords |
list | The three coordinates of the point |
- Source:
PrepareNodeAndAddIt(data, key, colorpoint)
Takes a point from data and makes a node of the graph out of it
Parameters:
| Name | Type | Description |
|---|---|---|
data |
list | a list of points |
key |
string | the id of the point |
colorpoint |
string | the desired color of the point |
- Source:
redrawInitialScene()
Redraws the graph in the initial scene. The camera is re-positioned to look at all points
- Source:
redrawSameScene()
Redraws the graph in the same scene. The position of the camera will not change.
- Source:
RemoveAllNodes()
Removes all nodes from the graph. The graph is empty afterwards
- Source:
ReturnAllColors()
Returns the color of all nodes to their previous colors
- Source:
ReturnPreviousColor()
Returns the color of a node to its previous color
* @param {Graph.node} node - the node that changes color
- Source:
SearchAndColorizeByExpression(expression)
Searches the nodes that are already loaded in the graph and colorizes in red those whose metadata or id satisfies the expression
Parameters:
| Name | Type | Description |
|---|---|---|
expression |
string | a boolean expression of regular expression. Ex: xx AND Y OR NOT zz. xx, yy, and zz are regular expressions. The presedence of the boolean operators is defined in DefinePrioritiesOfOperators(). |
- Source:
searchSequence()
Defines what happens when the user has pressed the search button
- Source: