Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Branch Selection React Component (#140)
* WIP branch selection react component * working on branch selection * branch selection edits with SW * absrel branch selection * integrate hyphy-vision * functional submital pages and more vision integration * working branch selection components for all methods that use branch selection * setup temporary CI for this branch
- Loading branch information
Ryan Velazquez
committed
Aug 21, 2018
1 parent
8d33a40
commit eb4b94e
Showing
31 changed files
with
615 additions
and
1,610 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,73 +1,42 @@ | ||
<%- include ../includes/header.ejs %> | ||
|
||
<!-- | ||
<link href="/assets/css/busted/font-awesome-4.2.0/css/font-awesome.css" rel="stylesheet"> | ||
<link href="/assets/lib/phylotree/phylotree.css" rel="stylesheet"> | ||
<link href="/assets/css/neighbor-join.css" rel="stylesheet"> | ||
--> | ||
|
||
<div class="container"> | ||
|
||
<%- include header.ejs %> | ||
|
||
<h2 class="page-header">Analysis Options</h2> | ||
|
||
<div class="col-lg-8 phylo-nav"> | ||
<div class="btn-group"> | ||
<button title="Expand spacing" id="expand_spacing" class="btn btn-default btn-sm" type="button"> | ||
<i class="fa fa-expand"></i> | ||
</button> | ||
<button title="Compress spacing" id="compress_spacing" class="btn btn-default btn-sm" type="button"> | ||
<i class="fa fa-compress"></i> | ||
</button> | ||
<button title="Sort deepest clades to the bototm" id="sort_ascending" class="btn btn-default btn-sm" type="button"> | ||
<i class="fa fa-sort-amount-asc"></i> | ||
</button> | ||
<button title="Sort deepsest clades to the top" id="sort_descending" class="btn btn-default btn-sm" type="button"> | ||
<i class="fa fa-sort-amount-desc"></i> | ||
</button> | ||
<button title="Restore original order" id="sort_original" class="btn btn-default btn-sm" type="button"> | ||
<i class="fa fa-sort"></i> | ||
</button> | ||
<button data-toggle="dropdown" class="btn btn-default btn-sm dropdown-toggle" type="button">Selection <span class="caret"></span></button> | ||
<ul class="dropdown-menu"> | ||
<li><a id="select_all" href="#">Select all</a></li> | ||
<li><a id="select_all_internal" href="#">Select only internal nodes</a></li> | ||
<li><a id="select_all_leaves" href="#">Select only leaf nodes</a></li> | ||
<li><a id="select_none" href="#">Clear selection</a></li> | ||
</ul> | ||
</div> | ||
</div> | ||
|
||
<% if (busted.msa[0].usertree) { %> | ||
<div id="tree-select-btn-group" class="col-lg-4 phylo-nav"> | ||
<div class="btn-group" data-toggle="buttons"> | ||
<label title="Highlight Test Branches" id="usertree-highlighter" class="btn btn-default btn-sm active" data-name='usertree'> | ||
<input type="radio" name="options" id="relax-ut-select" autocomplete="off" checked>User Defined Tree</input> | ||
</label> | ||
<label title="Highlight Reference Branches" id="nj-highlighter" class="btn btn-default btn-sm" data-name='nj'> | ||
<input type="radio" name="options" id="relax-nj-select" autocomplete="off" checked>Neighbor Joining Tree</input> | ||
</label> | ||
</div> | ||
</div> | ||
<% } %> | ||
|
||
<div id="neighbor-tree" data-tree="<%= busted.msa[0].nj %>" <% if (busted.msa[0].usertree) { %> data-usertree="<%= busted.msa[0].usertree %>"<% } %>> | ||
<div id="tree-body"> | ||
<div id='tree_container' class='tree-widget'></div> | ||
</div> | ||
</div> | ||
<h5 class="phylotree-header">Select Test Branches</h5> | ||
|
||
<form action="/busted/<%= busted._id %>/select-foreground" enctype="multipart/form-data" method="POST" name="modelForm"> | ||
<div> | ||
<button type="submit" class="btn pull-right"><span class="glyphicon | ||
glyphicon-play dm-continue-btn"></span></button> | ||
</div> | ||
</form> | ||
<div class="container" id="branch-selection-container"></div> | ||
|
||
</div> | ||
|
||
<%- include ../includes/modal.ejs %> | ||
<%- include ../includes/footer.ejs %> | ||
|
||
<script src="/assets/js/busted/fg-selection.js"></script> | ||
<script> | ||
// Get trees. | ||
var user_tree = "<%= busted.msa[0].usertree %>" | ||
var nj_tree = "<%= busted.msa[0].nj %>" | ||
// Create callback for posting annotated tree. | ||
datamonkey_post_annotated_tree = function (annotated_tree) { | ||
var formData = new FormData(); | ||
formData.append('nwk_tree', annotated_tree); | ||
var xhr = new XMLHttpRequest(); | ||
var id = "<%= busted._id %>" | ||
xhr.open('post','/busted/' + id + '/select-foreground', true); | ||
xhr.onload = function(res) { | ||
// Replace field with green text, name of file | ||
var result = JSON.parse(this.responseText); | ||
if('_id' in result.busted) { | ||
window.location.href = '/busted/' + result.busted._id; | ||
} else if ('error' in result) { | ||
datamonkey.errorModal(result.error); | ||
} | ||
}; | ||
xhr.send(formData); | ||
} | ||
render_branch_selection("branch-selection-container", user_tree , nj_tree , datamonkey_post_annotated_tree, 800, 600, false) | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.