Global

Members

color_val

Source:

stage

Source:

viewer

Source:

visible_components

Source:

xmlhttp

Source:

Methods

expandPDB(tree)

function allows webserver to load for a second to retrieve data associated to a PDB (eg. maybe split into chains, cartoon view, stick view, etc.) TODO: NEED TO ADD DATA CHANGES AFTER EXPANSION

Parameters:
Name Type Description
tree smart-tree
Source:

(async) getXML(id, files, cnt)

Asynchronous load using XMLHttpRequest.

  • Setup xmlhttp with functions and requests to be called upon send(). First get list of files[] containing all files to be viewed, and open all. When a file is "ready", format XML and then load data. TODO: No need to format for now but left here just in case. Recursive getXML() call to loop through all files. TODO: Recursion isn't great but it works here, so I'll leave it. Finally, send() requests to server.
Parameters:
Name Type Description
id string
files string
cnt int

index for surf object

Source:

loadData(file)

Function to load surf files.

After loading, we make arrays of vertices, normals, and faces.
	We then create a custom object using these 3 arrays.
	This code essentially takes care of all the viewer loading
	and rendering that need to be done.
Parameters:
Name Type Description
file string
Source:

(async) loadHBond(File)

Async function to load hydrogen bond files.

After loading, we make an array of vertices and pair together the vertices that form each hydrogen bond. We then create a custom object composed of cylinders using the vertex pairs.

Parameters:
Name Type Description
File string

name in uploads folder.

Source:

loadPDB(id, pdb_file)

####################################################### Utils for PDB file loading #######################################################

Parameters:
Name Type Description
id string

name to set object in NGL

pdb_file string

file name in uploads folder

Source:

makeTree(tree, id, files)

Creates tree from a list of files

Parameters:
Name Type Description
tree smart-tree
id string
files string
Source:

(async) set_up_tree(dir)

Sets up the file tree

Parameters:
Name Type Description
dir string

Directory where files are located

Source:

treeSelectionEventHandler(tree, dir_list) → {None}

treeSelectionEventHandler() handles visibility of objects when the associated index of the file tree is checked or unchecked using an eventListener().

Parameters:
Name Type Description
tree smart-tree
dir_list Array.<string>
Source:
Returns:
Type
None

viewData(face, file, normal, vertex)

Function to view surf objects after loading

Set colors and add objects to stage here. This function is called at the end of loadData()

Parameters:
Name Type Description
face Array.<int>
file string
normal Array.<int>
vertex Array.<int>
Source:

viewHBond(file, bonds, bondPairs)

Function to view hydrogen bonds after loading data

Set colors and add objects to stage here. This function is called at the end of loadHBond()

Parameters:
Name Type Description
file string
bonds Array.<array>
bondPairs Array.<array>
Source: