48 lines
1014 B
JavaScript
48 lines
1014 B
JavaScript
/** Class implementing the tree view. */
|
|
class Tree {
|
|
/**
|
|
* Creates a Tree Object
|
|
*/
|
|
constructor() {
|
|
}
|
|
|
|
/**
|
|
* Creates a node/edge structure and renders a tree layout based on
|
|
* the input data
|
|
*
|
|
* @param treeData an array of objects that contain parent/child
|
|
* information.
|
|
*/
|
|
createTree(treeData) {
|
|
|
|
// ******* TODO: PART VI *******
|
|
|
|
// Create a tree and give it a size() of 800 by 300.
|
|
|
|
// Create a root for the tree using d3.stratify();
|
|
|
|
// Add nodes and links to the tree.
|
|
|
|
};
|
|
|
|
/**
|
|
* Updates the highlighting in the tree based on the selected team.
|
|
* Highlights the appropriate team nodes and labels.
|
|
*
|
|
* @param row a string specifying which team was selected in the table.
|
|
*/
|
|
updateTree(row) {
|
|
// ******* TODO: PART VII *******
|
|
|
|
}
|
|
|
|
/**
|
|
* Removes all highlighting from the tree.
|
|
*/
|
|
clearTree() {
|
|
// ******* TODO: PART VII *******
|
|
|
|
// You only need two lines of code for this! No loops!
|
|
}
|
|
}
|