# Global

##

### 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:
  - src/mainfunctions.js, line 223

#### ApplyOperation()

The core of the shunting yard algorithm. Better not to modify.

Source:
  - src/search.js, line 108

#### 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:
  - src/mainfunctions.js, line 311

#### 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:
  - src/mainfunctions.js, line 245

#### 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:
  - src/search.js, line 38

#### defineColorPicker2()

Creates the color picker and attaches events to it.

Source:
  - src/uifunctions.js, line 39

#### 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:
  - src/uifunctions.js, line 13

#### DefinePrioritiesOfOperators()

Defines the priorities of the operators NOT, AND, OR. The higher the number, the higher the priority.

Source:
  - src/search.js, line 145

#### EmptyStacks()

Finishes the shunting yard algorithm. Better not to modify.

Source:
  - src/search.js, line 154

#### 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:
  - src/search.js, line 62

#### 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:
  - src/mainfunctions.js, line 144

#### HandleShowFoundNodesChange()

What to do when the "show found nodes" box is changed

Source:
  - src/mainfunctions.js, line 87

#### HandleSizeAttenuationChange()

What to do when the user clicks on the size attenuation box

Source:
  - src/mainfunctions.js, line 73

#### 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:
  - src/search.js, line 96

#### 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:
  - src/mainfunctions.js, line 51

#### InitEventHandlers()

Initializes the check boxes and the event handlers for the checkboxes

Source:
  - src/mainfunctions.js, line 60

#### InitGlobalDataVariables()

Initiates the global variables

Source:
  - src/mainfunctions.js, line 7

#### InitializeGraph()

Initializes the graph

Source:
  - src/mainfunctions.js, line 123

#### Is_operator()

Evaluates if the string word is in the list [AND, OR, NOT]

Source:
  - src/search.js, line 85

#### LoadAllNodes()

Loads all points from the data file in the graph

Source:
  - src/mainfunctions.js, line 116

#### 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:
  - src/mainfunctions.js, line 36

#### LoadDataInGraph(data)

Loads all data in the graph

##### Parameters:

Name | Type | Description
--- | --- | ---
`data` | dictionary | the data as loaded from the json file

Source:
  - src/mainfunctions.js, line 203

#### LoadLocalDataSet()

Is called when the user selects a file to upload

Source:
  - src/mainfunctions.js, line 20

#### LoadOnlyFoundNodes()

Loads only the points that result from a search in the graph. At least 15 nodes are loaded, however.

Source:
  - src/mainfunctions.js, line 99

#### 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:
  - src/mainfunctions.js, line 170

#### 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:
  - src/mainfunctions.js, line 182

#### redrawInitialScene()

Redraws the graph in the initial scene. The camera is re-positioned to look at all points

Source:
  - src/mainfunctions.js, line 302

#### redrawSameScene()

Redraws the graph in the same scene. The position of the camera will not change.

Source:
  - src/mainfunctions.js, line 295

#### RemoveAllNodes()

Removes all nodes from the graph. The graph is empty afterwards

Source:
  - src/mainfunctions.js, line 234

#### ReturnAllColors()

Returns the color of all nodes to their previous colors

Source:
  - src/mainfunctions.js, line 329

#### ReturnPreviousColor()

Returns the color of a node to its previous color * @param {Graph.node} node - the node that changes color

Source:
  - src/mainfunctions.js, line 320

#### 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:
  - src/search.js, line 5

#### searchSequence()

Defines what happens when the user has pressed the search button

Source:
  - src/uifunctions.js, line 4