// Note: this is the old (NO LONGER WORKING) implementation of the tree diagram drawn using d3. //This function builds the tree using d3 (http://d3js.org/) //A good video explaining the tree: //http://www.youtube.com/watch?v=x8dwXoWODZ4 (part 1) //http://www.youtube.com/watch?v=iZ6MSHA4FMU (part 2) var treeData = {}; function buildTree() { //initialize tree treeData = {}; //clean up matInfo cleanMatInfo(); sortMatInfo(); //calculate number of levels var numberOfLevels = 1; for(var i=0; i numberOfLevels) numberOfLevels = currentLevel; } for(var i=0; i getNumUnderscores(endtag)) return -1; //error. this is not possible. for(var i=0; i getNthPos(endtag2,i)) return 1; } //endtags matched up to the end of one endtag so whichever is shorter goes first if(endtag1.length < endtag2.length) return -1; return 1; }