diff --git a/plasmid/source/html/yeastlabbrowser/button.css b/plasmid/source/html/yeastlabbrowser/button.css index 7194dfefdd23092147f113f095ccbf3dbb711436..d2f2664c47921dbffaef01b89cd216f2285c76c3 100644 --- a/plasmid/source/html/yeastlabbrowser/button.css +++ b/plasmid/source/html/yeastlabbrowser/button.css @@ -60,6 +60,10 @@ width:120px; text-align:center; padding:4px; text-decoration:none; +border: 40; +border-radius: 5px; +border-bottom: 1px solid #222; +margin: 0; } #chemical_browser a:hover { @@ -78,6 +82,10 @@ width:120px; text-align:center; padding:4px; text-decoration:none; +border: 40; +border-radius: 5px; +border-bottom: 1px solid #222; +margin: 0; } #oligo_browser a:hover { @@ -95,6 +103,10 @@ width:120px; text-align:center; padding:4px; text-decoration:none; +border: 40; +border-radius: 5px; +border-bottom: 1px solid #222; +margin: 0; } #yeast_browser a:hover { @@ -112,6 +124,10 @@ width:120px; text-align:center; padding:4px; text-decoration:none; +border: 40; +border-radius: 5px; +border-bottom: 1px solid #222; +margin: 0; } #plasmid_browser a:hover { @@ -120,4 +136,23 @@ color:#FFFFFF; } - +#filter-button a:link +{ +display:block; +font-weight:bold; +color:#FFFFFF; +background-color:#0000FF; +width:120px; +text-align:center; +padding:4px; +text-decoration:none; +border: 40; +border-radius: 5px; +border-bottom: 1px solid #222; +margin: 0; +} +#filter-button a:hover +{ +background-color:steelblue; +color:#FFFFFF; +} diff --git a/plasmid/source/html/yeastlabbrowser/chemical-body-style.css b/plasmid/source/html/yeastlabbrowser/chemical-body-style.css index 84dc02c25acf0e597ed38ade168549ef7b2b1201..6b5d95be8be6c5dddb5e3967088acec45ed7ce57 100644 --- a/plasmid/source/html/yeastlabbrowser/chemical-body-style.css +++ b/plasmid/source/html/yeastlabbrowser/chemical-body-style.css @@ -7,121 +7,31 @@ div#vis { padding-top: 10px; font: 12px "Verdana", sans-serif; } } -div#vis div { padding-top: 2px;} -.oligo-table-data-cell { - overflow: hidden; -} - -#oligo-table tr:nth-child(odd) { - background-color:#94B8B8; -} - -#oligo-table tr:nth-child(even) { - background-color:#ECEFEF; - -} - -#oligo-table tr.oligo-table-data:hover { - font-size : 105%; - font-weight: bold; - -} - - -#oligo-table td{ - -padding:5px; -} - -#oligo-table tr.oligo-table-header { - font-size:18px; - font-weight: bold; - color:#fff; - background-color:#426262; -} .chemical-table-data-cell { overflow: hidden; } -#chemical-table tr:nth-child(odd) { +#chemical-table tr:nth-child(odd) td{ background-color:#B2B2B2; } -#chemical-table tr:nth-child(even) { - background-color:#ECEFEF; -} -#chemical-table td{ -padding:5px; -} - -#chemical-table tr.chemical-table-header { - font-size:18px; - font-weight: bold; - color:#fff; - background-color:#767676; -} - -.plasmid-table-data-cell { - overflow: hidden; -} - -#plasmid-table tr:nth-child(odd) { - background-color:#DC7E9E; -} - -#plasmid-table tr:nth-child(even) { +#chemical-table tr:nth-child(even) td{ background-color:#ECEFEF; } -#plasmid-table tr.plasmid-table-data:hover { - font-size : 105%; - font-weight: bold; - -} - -#plasmid-table td{ +#chemical-table td{ padding:5px; } -#plasmid-table tr.plasmid-table-header { +#chemical-table tr.chemical-table-header { font-size:18px; font-weight: bold; color:#fff; - background-color:#6E3F4F; -} - -.yeast-table-data-cell { - overflow: hidden; -} - -#yeast-table tr:nth-child(odd) { - background-color:#A6A64D; -} - -#yeast-table tr:nth-child(even) { - background-color:#ECEFEF; - -} - -#yeast-table tr.yeast-table-data:hover { - font-size : 105%; - font-weight: bold; - -} - -#yeast-table td{ - -padding:5px; + background-color:#767676; } -#yeast-table tr.yeast-table-header { - font-size:18px; - font-weight: bold; - color:#fff; - background-color:#5C5C1F; -} diff --git a/plasmid/source/html/yeastlabbrowser/chemicals-browser.html b/plasmid/source/html/yeastlabbrowser/chemicals-browser.html index 39394b91d8e849706195a08dddc9987a1af29b4b..70408c45a2b60dfe1ea46ca25af2fc39329dea91 100644 --- a/plasmid/source/html/yeastlabbrowser/chemicals-browser.html +++ b/plasmid/source/html/yeastlabbrowser/chemicals-browser.html @@ -387,6 +387,13 @@ function visualize(nameFilterText, supplierFilterText, artnumFilterText, locidFi .attr("class", "chemical-table-data-cell") .text(String) + selection.style("display", + function(data) { + return "table-row" + }); + + +/* selection.style("display", function(data) { if ($.inArray(data, displayedChemicals) != -1) { @@ -395,6 +402,7 @@ function visualize(nameFilterText, supplierFilterText, artnumFilterText, locidFi return "none" } }); +*/ } @@ -492,6 +500,18 @@ $(document).ready(function() { }); }); +function ShowHide(divId) +{ + if(document.getElementById(divId).style.display == 'none') + { + document.getElementById(divId).style.display='block'; + } + else + { + document.getElementById(divId).style.display = 'none'; + } +} + </script> </head> @@ -522,22 +542,21 @@ $(document).ready(function() { <div id="chemical_browser" style="position: absolute; left:200px; top:15px"> <a href="file:///Users/barillac/workspace/plasmid/source/html/yeastlabbrowser/chemicals-browser.html">Chemicals</a> </div> - <div style= "padding-top:50px; font-weight: bold; font-size:18px">Filter by:</div> - <div> - <div style="padding-top: 15px"><span style="font-weight: bold; padding-left: 100px">Name</style> <input style="width: 200px" id="name_filter" type="text"></div> - </div> - <div> - <div style="padding-top: 15px"><span style="font-weight: bold; padding-left: 100px">Supplier</style> <input style="width: 200px" id="supplier_filter" type="text"></div> - </div> - <div> - <div style="padding-top: 15px"><span style="font-weight: bold; padding-left: 100px">Article Number</style> <input style="width: 200px" id="artnum_filter" type="text"></div> - </div> - <div> - <div style="padding-top: 15px"><span style="font-weight: bold; padding-left: 100px">Local ID</style> <input style="width: 200px" id="locid_filter" type="text"></div> - </div> - <div> - <div style="padding-top: 15px"><span style="font-weight: bold; padding-left: 100px">Storage</style> <input style="width: 200px" id="storage_filter" type="text"></div> + + + <div id="filter-button" style="padding-left:20px; padding-top:70px; font-weight:bold; padding-bottom:30px;"> + <a onclick ="javascript:ShowHide('HiddenDiv')" href="javascript:;" >Filters</a> + </div> + <div class="mid" id="HiddenDiv" style="DISPLAY: none;"> + <table> + <tr style="padding-top: 15px"><td style="font-weight: bold; padding-left: 100px">Chemical Name</td><td><input style="width: 200px" id="name_filter" type="text"></td></tr> + <tr style="padding-top: 15px"><td style="font-weight: bold; padding-left: 100px">Supplier</td><td><input style="width: 200px" id="supplier_filter" type="text"></td></tr> + <tr style="padding-top: 15px"><td style="font-weight: bold; padding-left: 100px">Art. Number</td><td> <input style="width: 200px" id="artnum_filter" type="text"></td></tr> + <tr style="padding-top: 15px"><td style="font-weight: bold; padding-left: 100px">Local ID</td><td> <input style="width: 200px" id="locid_filter" type="text"></td></tr> + <tr style="padding-top: 15px"><td style="font-weight: bold; padding-left: 100px">Storage</td><td> <input style="width: 200px" id="storage_filter" type="text"></td></tr> + </table> </div> + <div id="vis"> <table cellspacing="10" cellpadding="20"> diff --git a/plasmid/source/html/yeastlabbrowser/oligo-body-style.css b/plasmid/source/html/yeastlabbrowser/oligo-body-style.css index 215019bec93b725dcdc2fe55f812b63d3f17810d..d58c1af421942fb3c2dfc5ca979c4e878cc1b43a 100644 --- a/plasmid/source/html/yeastlabbrowser/oligo-body-style.css +++ b/plasmid/source/html/yeastlabbrowser/oligo-body-style.css @@ -90,36 +90,25 @@ input:focus{ background-color: white; } -/* Legend */ +/* Table */ -.legend .sequenced circle { - font: 14px "Verdana", sans-serif; - stroke-width: 1.5px; - fill: white; - stroke: DarkGreen; -} -.legend .notsequenced circle { - font: 14px "Verdana", sans-serif; - stroke-width: 1.5px; - fill: white; - stroke: DarkRed; -} .oligo-table-data-cell { overflow: hidden; } + #oligo-table tr:nth-child(odd) { background-color:#94B8B8; } #oligo-table tr:nth-child(even) { background-color:#ECEFEF; - } + + #oligo-table tr.oligo-table-data:hover { - font-size : 105%; font-weight: bold; } @@ -138,100 +127,3 @@ padding:5px; } -.chemical-table-data-cell { - overflow: hidden; -} - -#chemical-table tr:nth-child(odd) { - background-color:#B2B2B2; -} - -#chemical-table tr:nth-child(even) { - background-color:#ECEFEF; - -} - -#chemical-table tr.chemical-table-data:hover { - font-size : 105%; - font-weight: bold; - -} - - -#chemical-table td{ - -padding:5px; -} - -#chemical-table tr.chemical-table-header { - font-size:18px; - font-weight: bold; - color:#fff; - background-color:#767676; -} - - -.plasmid-table-data-cell { - overflow: hidden; -} - -#plasmid-table tr:nth-child(odd) { - background-color:#DC7E9E; -} - -#plasmid-table tr:nth-child(even) { - background-color:#ECEFEF; -} - -#plasmid-table tr.plasmid-table-data:hover { - font-size : 105%; - font-weight: bold; - -} - -#plasmid-table td{ - -padding:5px; -} - -#plasmid-table tr.plasmid-table-header { - font-size:18px; - font-weight: bold; - color:#fff; - background-color:#6E3F4F; -} - - - - -.yeast-table-data-cell { - overflow: hidden; -} - -#yeast-table tr:nth-child(odd) { - background-color:#A6A64D; -} - -#yeast-table tr:nth-child(even) { - background-color:#ECEFEF; - -} - -#yeast-table tr.yeast-table-data:hover { - font-size : 105%; - font-weight: bold; - -} - -#yeast-table td{ - -padding:5px; -} - -#yeast-table tr.yeast-table-header { - font-size:18px; - font-weight: bold; - color:#fff; - background-color:#5C5C1F; -} - diff --git a/plasmid/source/html/yeastlabbrowser/oligo-browser.html b/plasmid/source/html/yeastlabbrowser/oligo-browser.html index 867c490644bba22a7bff31cdecddae1f67d330f7..d795126d6aae7ee6e423fe3f86e97c2634ff46d0 100644 --- a/plasmid/source/html/yeastlabbrowser/oligo-browser.html +++ b/plasmid/source/html/yeastlabbrowser/oligo-browser.html @@ -415,6 +415,14 @@ function visualize(codeFilterText, targetFilterText, directionFilterText, enzyme .attr("class", "oligo-table-data-cell") .text(String) + + selection.style("display", + function(data) { + return "table-row" + }); + + +/* selection.style("display", function(data) { if ($.inArray(data, displayedOligos) != -1) { @@ -423,6 +431,7 @@ function visualize(codeFilterText, targetFilterText, directionFilterText, enzyme return "none" } }); +*/ } @@ -524,6 +533,18 @@ $(document).ready(function() { }); }); +function ShowHide(divId) +{ + if(document.getElementById(divId).style.display == 'none') + { + document.getElementById(divId).style.display='block'; + } + else + { + document.getElementById(divId).style.display = 'none'; + } +} + </script> </head> @@ -554,20 +575,20 @@ $(document).ready(function() { <div id="chemical_browser" style="position: absolute; left:200px; top:15px"> <a href="file:///Users/barillac/workspace/plasmid/source/html/yeastlabbrowser/chemicals-browser.html">Chemicals</a> </div> - <div style= "padding-top:50px; font-weight: bold; font-size:18px">Filter by:</div> - <div> - <div style="padding-top: 15px"><span style="font-weight: bold; padding-left: 100px">Target</style> <input style="width: 200px" id="target_filter" type="text"></div> - </div> - <div> - <div style="padding-top: 15px"><span style="font-weight: bold; padding-left: 100px">Direction</style> <input style="width: 200px" id="direction_filter" type="text"></div> - </div> - <div> - <div style="padding-top: 15px"><span style="font-weight: bold; padding-left: 100px">Restriction Enzyme</style> <input style="width: 200px" id="enzyme_filter" type="text"></div> - </div> - <div> - <div style="padding-top: 15px"><span style="font-weight: bold; padding-left: 100px">Project</style> <input style="width: 200px" id="project_filter" type="text"></div> + +<div id="filter-button" style="padding-left:20px; padding-top:70px; font-weight:bold; padding-bottom:30px;"> + <a onclick ="javascript:ShowHide('HiddenDiv')" href="javascript:;" >Filters</a> + </div> + <div class="mid" id="HiddenDiv" style="DISPLAY: none;"> + <table> + <tr style="padding-top: 15px"><td style="font-weight: bold; padding-left: 100px">Target</td><td><input style="width: 200px" id="target_filter" type="text"></td></tr> + <tr style="padding-top: 15px"><td style="font-weight: bold; padding-left: 100px">Direction</td><td><input style="width: 200px" id="direction_filter" type="text"></td></tr> + <tr style="padding-top: 15px"><td style="font-weight: bold; padding-left: 100px">Restriction Enzyme</td><td> <input style="width: 200px" id="enzyme_filter" type="text"></td></tr> + <tr style="padding-top: 15px"><td style="font-weight: bold; padding-left: 100px">Project</td><td> <input style="width: 200px" id="project_filter" type="text"></td></tr> + </table> </div> - + + <div id="vis"> <table cellspacing="10" cellpadding="20"> <table id="oligo-table" style="float: left"> diff --git a/plasmid/source/html/yeastlabbrowser/plasmid-body-style.css b/plasmid/source/html/yeastlabbrowser/plasmid-body-style.css index a3fbbe94538cff733d332195ff66778acb56ee3b..1a4d6a148a53648d6acee0c3830465b1ab4d1d22 100644 --- a/plasmid/source/html/yeastlabbrowser/plasmid-body-style.css +++ b/plasmid/source/html/yeastlabbrowser/plasmid-body-style.css @@ -12,7 +12,7 @@ div#vis div { padding-top: 2px;} /* Inspector */ div.inspector { - font: 14px "Verdana", sans-serif; + font: 10px "Verdana", sans-serif; padding: 10px; border: 1px solid gray; margin: 10px 2px; @@ -31,7 +31,7 @@ div.inspector { .properties td:nth-child(odd) { background-color:#DC7E9E; - width:30%; + width:50%; } .properties td:nth-child(even) { @@ -88,102 +88,26 @@ input:focus{ background-color: white; } -/* Legend */ - -.legend .sequenced circle { - font: 14px "Verdana", sans-serif; - stroke-width: 1.5px; - fill: white; - stroke: DarkGreen; -} - -.legend .notsequenced circle { - font: 14px "Verdana", sans-serif; - stroke-width: 1.5px; - fill: white; - stroke: DarkRed; -} -.oligo-table-data-cell { - overflow: hidden; -} - -#oligo-table tr:nth-child(odd) { - background-color:#94B8B8; -} - -#oligo-table tr:nth-child(even) { - background-color:#ECEFEF; - -} - -#oligo-table tr.oligo-table-data:hover { - font-size : 105%; - font-weight: bold; - -} - - -#oligo-table td{ - -padding:5px; -} - -#oligo-table tr.oligo-table-header { - font-size:18px; - font-weight: bold; - color:#fff; - background-color:#426262; -} - - -.chemical-table-data-cell { - overflow: hidden; -} - -#chemical-table tr:nth-child(odd) { - background-color:#B2B2B2; -} - -#chemical-table tr:nth-child(even) { - background-color:#ECEFEF; - -} - -#chemical-table tr.chemical-table-data:hover { - font-size : 105%; - font-weight: bold; - -} - - -#chemical-table td{ - -padding:5px; -} - -#chemical-table tr.chemical-table-header { - font-size:18px; - font-weight: bold; - color:#fff; - background-color:#767676; -} +/* Table */ .plasmid-table-data-cell { overflow: hidden; + } -#plasmid-table tr:nth-child(odd) { + +#plasmid-table tr:nth-child(odd) td{ background-color:#DC7E9E; } -#plasmid-table tr:nth-child(even) { + +#plasmid-table tr:nth-child(even) td{ background-color:#ECEFEF; } #plasmid-table tr.plasmid-table-data:hover { - font-size : 105%; - font-weight: bold; + font-weight: bold; } @@ -202,34 +126,3 @@ padding:5px; -.yeast-table-data-cell { - overflow: hidden; -} - -#yeast-table tr:nth-child(odd) { - background-color:#A6A64D; -} - -#yeast-table tr:nth-child(even) { - background-color:#ECEFEF; - -} - -#yeast-table tr.yeast-table-data:hover { - font-size : 105%; - font-weight: bold; - -} - -#yeast-table td{ - -padding:5px; -} - -#yeast-table tr.yeast-table-header { - font-size:18px; - font-weight: bold; - color:#fff; - background-color:#5C5C1F; -} - diff --git a/plasmid/source/html/yeastlabbrowser/plasmid-browser.html b/plasmid/source/html/yeastlabbrowser/plasmid-browser.html index 3c205b99bd237da715b79ad2fc253df885392718..dee047b429ddb6db557bd49116b2676c8cfdaf84 100644 --- a/plasmid/source/html/yeastlabbrowser/plasmid-browser.html +++ b/plasmid/source/html/yeastlabbrowser/plasmid-browser.html @@ -233,10 +233,12 @@ function filelist(plasmid, dataset, files) { for (var i in files.result) { if (!files.result[i].isDirectory) { var inspector = inspectors.select("#"+plasmid.code+"_INSPECTOR"); - var fileTable = inspector.select("table"); var pathInDataSet = files.result[i].pathInDataSet; var downloadUrl = 'https://openbis-csb.ethz.ch:443/datastore_server/'+dataset.code+"/"+pathInDataSet+"?sessionID=" + openbisServer.sessionToken; - fileTable.append("tr").append("td").attr("colspan", "1").append("a").attr("href", downloadUrl).text(pathInDataSet); + + inspector.select("td.data_sets").append("a").attr("href", downloadUrl).text(pathInDataSet) + inspector.select("td.data_sets").append("br"); + if (/\.svg$/.test(pathInDataSet)) { // Retrieve the svg file and inject it into the DOM d3.xml(downloadUrl, "image/svg+xml", function(xml) { @@ -314,6 +316,16 @@ function updateInspectors(duration) .append("table") .attr("width", "100%") .attr("class", "downloads"); + + // Add table row for data sets + var dataSetRow = box.select("table.properties").append("tr"); + dataSetRow + .append("td") + .attr("class", "property") + .text("DATA_SETS"); + dataSetRow + .append("td") + .attr("class", "data_sets"); } @@ -422,6 +434,12 @@ function visualize(ownerFilterText, ownerNumFilterText, plasmidNameFilterText, b .attr("class", "plasmid-table-data-cell") .text(String) + selection.style("display", + function(data) { + return "table-row" + }); + +/* selection.style("display", function(data) { if ($.inArray(data, displayedPlasmids) != -1) { @@ -430,7 +448,8 @@ function visualize(ownerFilterText, ownerNumFilterText, plasmidNameFilterText, b return "none" } }); - +*/ + } /** @@ -531,6 +550,17 @@ $(document).ready(function() { }); }); +function ShowHide(divId) +{ + if(document.getElementById(divId).style.display == 'none') + { + document.getElementById(divId).style.display='block'; + } + else + { + document.getElementById(divId).style.display = 'none'; + } +} </script> </head> @@ -561,25 +591,23 @@ $(document).ready(function() { <div id="chemical_browser" style="position: absolute; left:200px; top:15px"> <a href="file:///Users/barillac/workspace/plasmid/source/html/yeastlabbrowser/chemicals-browser.html">Chemicals</a> </div> - <div style= "padding-top:50px; font-weight: bold; font-size:18px">Filter by:</div> - <div> - <div style="padding-top: 15px"><span style="font-weight: bold; padding-left: 100px">Owner</style> <input style="width: 200px" id="owner_filter" type="text"></div> - </div> - <div> - <div style="padding-top: 15px"><span style="font-weight: bold; padding-left: 100px">Owner Number</style> <input style="width: 200px" id="ownerNum_filter" type="text"></div> - </div> - <div> - <div style="padding-top: 15px"><span style="font-weight: bold; padding-left: 100px">Plasmid Name</style> <input style="width: 200px" id="plasmidName_filter" type="text"></div> - </div> - <div> - <div style="padding-top: 15px"><span style="font-weight: bold; padding-left: 100px">Backbone</style> <input style="width: 200px" id="backbone_filter" type="text"></div> - </div> - <div> - <div style="padding-top: 15px"><span style="font-weight: bold; padding-left: 100px">Bacterial Antibitioc Resistance</style> <input style="width: 200px" id="antibiotic_filter" type="text"></div> - </div> - <div> - <div style="padding-top: 15px"><span style="font-weight: bold; padding-left: 100px">(Yeast) Marker</style> <input style="width: 200px" id="marker_filter" type="text"></div> - </div> + + <div id="filter-button" style="padding-left:20px; padding-top:70px; font-weight:bold; padding-bottom:30px;"> + <a onclick ="javascript:ShowHide('HiddenDiv')" href="javascript:;" >Filters</a> + </div> + <div class="mid" id="HiddenDiv" style="DISPLAY: none;"> + <table> + <tr style="padding-top: 15px"><td style="font-weight: bold; padding-left: 100px">Owner</td><td><input style="width: 200px" id="owner_filter" type="text"></td></tr> + <tr style="padding-top: 15px"><td style="font-weight: bold; padding-left: 100px">Owner Number</td><td><input style="width: 200px" id="ownerNum_filter" type="text"></td></tr> + <tr style="padding-top: 15px"><td style="font-weight: bold; padding-left: 100px">Plasmid Name</td><td> <input style="width: 200px" id="plasmidName_filter" type="text"></td></tr> + <tr style="padding-top: 15px"><td style="font-weight: bold; padding-left: 100px">Backbone</td><td> <input style="width: 200px" id="backbone_filter" type="text"></td></tr> + <tr style="padding-top: 15px"><td style="font-weight: bold; padding-left: 100px">Bacterial Antibitioc Resistance</td><td> <input style="width: 200px" id="antibiotic_filter" type="text"></td></tr> + <tr style="padding-top: 15px"><td style="font-weight: bold; padding-left: 100px">(Yeast) Marker</td><td> <input style="width: 200px" id="marker_filter" type="text"></td></tr> + </table> + </div> + + + <div id="vis"> <table cellspacing="10" cellpadding="20"> diff --git a/plasmid/source/html/yeastlabbrowser/plasmid-browser2.html b/plasmid/source/html/yeastlabbrowser/plasmid-browser2.html deleted file mode 100644 index c2332f50bba21320297736b97f38c22422cd7a27..0000000000000000000000000000000000000000 --- a/plasmid/source/html/yeastlabbrowser/plasmid-browser2.html +++ /dev/null @@ -1,581 +0,0 @@ -plasmid-browser.html<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"> -<html> -<head> - <title>Plasmid Browser</title> - <link type="text/css" rel="stylesheet" href="plasmid-body-style.css" /> - <link type="text/css" rel="stylesheet" href="button.css" /> - <script type="text/javascript" src="d3.js"></script> - <script type="text/javascript" src="d3.layout.js"></script> - <script type="text/javascript" src="d3.time.js"></script> - <script type="text/javascript" src="jquery.js"></script> - <script type="text/javascript" src="openbis.js"></script> - <script type="text/javascript" src="infra.js"></script> - <!-- To speed development, cache the requests --> - <!-- <script type="text/javascript" src="openbis-request-cache.js"></script> --> -<script> - -/// The openbisServer we use for our data -openbisServer = new openbis('https://openbis-csb.ethz.ch/openbis/openbis', 'https://openbis-csb.ethz.ch:443/datastore_server'); - -// Some global variables we refer to - -/// All plasmids -var plasmids = null; - -/// The plasmids that are currently being inspected -var inspectedPlasmids = []; - -/// The width of the inspectors section -var inspectorsWidth = 450; - -function getAppHeight(){ - return Math.max($(window).height() - 50, getVisibleLeafsCountForNode(root) * 30); -} - -function getAppWidth(){ - return $(window).width(); -} - - -var didCreateVis = false; - -/// The visualization, referenced by functions that display content -var vis; - -/// The inspectors, referenced by functions that show or hide inspectors -var inspectors; - -/** - * Create the DOM elements to store the visualization (tree + inspectors) - */ -function createVis() -{ - if (didCreateVis) return; - - // Create a div to house the tree visualization and the inspectors - vis = d3.select("#vis"); - - // An element for the inspectors. - inspectors = d3.select("#inspectorsContainer") - .style("width", + inspectorsWidth + "px") - .style("position", "relative") - .style("overflow", "auto") - .style("float", "right") - .style("top", "20px") - .style("display", "none"); - - didCreateVis = true; -} - -function translateSrc(d) -{ - var translate; - if (d.parent != undefined) { - var y0 = (null != d.parent.y0) ? d.parent.y0 : d.parent.y; - var x0 = (null != d.parent.x0) ? d.parent.x0 : d.parent.x; - translate = "translate(" + y0 + "," + x0 + ")"; - } else { - translate = "translate(" + 0 + "," + 0 + ")"; - } - - return translate; -} - -function translateDst(d) -{ - d.x0 = d.x; - d.y0 = d.y; - var translate = "translate(" + d.y + "," + d.x + ")"; - - return translate; -} - -/** - * Convert properties to pairs - */ -function props_to_pairs1(data) -{ - - d = data.properties; - - var pairs = []; - for (var prop in d) { - var pair = [prop, d[prop]]; - pairs.push(pair); - } - - - - order1 = ["OWNER", "OWNER_NUMBER", "PLASMID_NAME", "BACKBONE", "BACTERIAL_ANTIBIOTIC_RESISTANCE", "YEAST_MARKER", "OTHER_MARKER", "FLANKING_RESTRICTION_ENZYME", "COMMENTS"] - new_list1 = [] - for (var i in order1) { - for (var j in pairs) { - if (pairs[j][0] == order1[i]) { - new_list1.push(pairs[j]); - break; - } - } - } - return new_list1; -} - - -function props_to_pairs2(data) -{ - - d = data.properties; - - var pairs = []; - for (var prop in d) { - var pair = [prop, d[prop]]; - pairs.push(pair); - } - - pairs.push(["REGISTRATION_DATE", new Date(data.registrationDetails.registrationDate)]); - - order2 = ["BOX_NUMBER", "ROW", "COLUMN","REGISTRATION_DATE"] - new_list2 = [] - for (var a in order2) { - for (var b in pairs) { - if (pairs[b][0] == order2[a]) { - new_list2.push(pairs[b]); - break; - } - } - } - return new_list2; -} - - -/** Initialize the plasmids variable */ -function initializePlasmids(result) -{ - // Split the plasmids into two groups, the ones that start with FRP in their sample name and the other ones. - var frpPlasmids = [], otherPlasmids = []; - var frpRegex = /^FRP[0-9]+/; - frpRegex.compile(frpRegex); - result.forEach(function(sample) { - if (frpRegex.test(sample.code)) { - frpPlasmids.push(sample); - } else { - otherPlasmids.push(sample); - } - }); - - // Sort each of the groups - otherPlasmids.sort(function(a, b) { - return (a.code < b.code) ? -1 : 1; - }); - - frpPlasmids.sort(function(a, b) { - // Sort based on the FRP number - var frpNumberA = parseInt(a.code.substring(3)); - var frpNumberB = parseInt(b.code.substring(3)); - return (frpNumberA < frpNumberB) ? -1 : 1; - }); - - // Combine the two groups back together to produce the full collection of plasmids - plasmids = frpPlasmids.concat(otherPlasmids); -} - -/** Set the size of the plasmid-table based on whether or not inspectors are visible */ -function resizePlasmidTable() -{ - var cellWidth; - var areInspectorsVisible; - var padding = 20; - if (inspectedPlasmids.length > 0) { - cellWidth = ((getAppWidth() - inspectorsWidth) /6 ) - padding + "px"; - areInspectorsVisible = true; - } else { - cellWidth = "100%"; - areInspectorsVisible = false; - } - var plasmidTableTransition = d3.selectAll('div.plasmid-table-data-cell'); - plasmidTableTransition.style('width', cellWidth); - if (areInspectorsVisible) { - $("#inspectorsContainer").show(); - } else { - $("#inspectorsContainer").hide(); - } -} - -function inspectPlasmid(plasmid) -{ - if (inspectedPlasmids.indexOf(plasmid) < 0) { - inspectedPlasmids.push(plasmid); - openbisServer.listDataSetsForSample(plasmid, true, dataset.curry(plasmid)); - } - resizePlasmidTable(); - updateInspectors(1000); -} - -function closeInspector(plasmid) -{ - var index = inspectedPlasmids.indexOf(plasmid); - if (index < 0) { - return; - } - - inspectedPlasmids.splice(index, 1); - resizePlasmidTable(); - updateInspectors(1000); -} - -function dataset(plasmid, data) { - for (var i in data.result) { - openbisServer.listFilesForDataSet(data.result[i].code, "/", true, filelist.curry(plasmid, data.result[i])); - } -} - -function filelist(plasmid, dataset, files) { - for (var i in files.result) { - if (!files.result[i].isDirectory) { - var inspector = inspectors.select("#"+plasmid.code+"_INSPECTOR"); - var fileTable = inspector.select("table"); - var pathInDataSet = files.result[i].pathInDataSet; - var downloadUrl = 'https://openbis-csb.ethz.ch:443/datastore_server/'+dataset.code+"/"+pathInDataSet+"?sessionID=" + openbisServer.sessionToken; - fileTable.append("tr").append("td").attr("colspan", "2").append("a").attr("href", downloadUrl).text(pathInDataSet); - if (/\.svg$/.test(pathInDataSet)) { - // Retrieve the svg file and inject it into the DOM - d3.xml(downloadUrl, "image/svg+xml", function(xml) { - var importedNode = document.importNode(xml.documentElement, true); - d3.select(importedNode) - .attr("width", inspectorsWidth - 20) - .attr("height", inspectorsWidth - 20) - .attr("viewBox", "200 200 650 650"); - inspector.node().appendChild(importedNode); - }); - } - } - } -} - - -/** - * Draw / update node inspectors - */ -function updateInspectors(duration) -{ - // Draw / update the inspectors - var inspector = inspectors.selectAll("div.inspector").data(inspectedPlasmids, function (d) { return d.code }); - - var box = inspector - .enter() - .append("div") - .attr("class", "inspector") - .attr("id", function(d) {return d.code+"_INSPECTOR"}) - .text(function(d) { return d.code }); - - box.append("span") - .attr("class", "close") - .on("click", closeInspector) - .text("x"); - - inspector - .exit() - .transition() - .duration(duration) - .style("opacity", "0") - .remove(); - - var propsTable = box.append("table").attr("class", "properties"); - propsTable.selectAll("tr").data(function(d) { return props_to_pairs1(d) }) - .enter() - .append("tr") - .selectAll("td").data(function(d) { return d }).enter() - .append("td") - .attr("class", "property") - .style("opacity", "0") - .text(function(d) { return d }) - .transition() - .duration(duration) - .style("opacity", "1"); - - - - var propsTable2 = box.append("table").attr("class", "properties"); - propsTable2.selectAll("tr").data(function(d) { return props_to_pairs2(d) }) - .enter() - .append("tr") - .selectAll("td").data(function(d) { return d }).enter() - .append("td") - .attr("class", "property") - .style("opacity", "0") - .text(function(d) { return d }) - .transition() - .duration(duration) - .style("opacity", "1"); - - - - var downloadTable = inspector.selectAll("table.downloads").data(function(d) { return [d] }); - - downloadTable - .enter() - .append("table") - .attr("width", "100%") - .attr("class", "downloads"); - - -} - - -/** - * Display the samples returned by the server - */ -function displayReturnedSamples(data) -{ - if (data.error) { - console.log(error); - vis.append("p").text("Could not retrieve data."); - return; - } - - initializePlasmids(data.result); - - // This will show the object in the log -- helpful for debugging - // console.log(data.result); - if (plasmids.length < 1) { - vis.append("p").text("No data found."); - return; - } - - visualize(); -} - -function plasmidFilter(filter, property, element, index, array) { - - filter = filter.toLowerCase(); - - if (property == "CODE") { - if (element.code.toLowerCase().indexOf(filter) != -1) { - return true; - } - } - - if (element.properties[property] == undefined) { - return false; - } - - if (element.properties[property].toLowerCase().indexOf(filter) != -1) { - return true; - } - - return false; -} - - -function visualize(ownerFilterText, ownernumFilterText, plasmidnameFilterText, antibioticFilterText, markerFilterText) -{ - if (ownerFilterText == undefined) - { - ownerFilterText = ""; - } - - if (ownernumFilterText == undefined) - { - ownernumFilterText = ""; - } - - if (plasmidnameFilterText == undefined) - { - plasmidnameFilterText = ""; - } - - if (antibioticFilterText == undefined) - { - antibioticFilterText = ""; - } - - if (markerFilterText == undefined) - { - markerFilterText = ""; - } - - var displayedPlasmids = plasmids.filter(plasmidFilter.curry(ownerFilterText, "CODE")); - displayedPlasmids = displayedPlasmids.filter(plasmidFilter.curry(ownernumFilterText, "TARGET")); - displayedPlasmids = displayedPlasmids.filter(plasmidFilter.curry(plasmidnameFilterText, "DIRECTION")); - displayedPlasmids = displayedPlasmids.filter(plasmidFilter.curry(antibioticFilterText, "RESTRICTION_ENZYME")); - displayedPlasmids = displayedPlasmids.filter(plasmidFilter.curry(markerFilterText, "PROJECT")); - - - var selection = d3.select("#vis").select("#plasmid-table").selectAll("tr.plasmid-table-data").data(plasmids); - // Code under enter is run if there is no HTML element for a data element - - selection - .enter() - .append("tr") - .attr("class", "plasmid-table-data") - .style("cursor", "pointer") - .on("click", inspectPlasmid) - .selectAll("td").data(function(sample) { return [sample.identifier, sample.properties.OWNER, sample.properties.OWNER_NUMBER, sample.properties.PLASMID_NAME, sample.properties.BACKBONE, sample.properties.BACTERIAL_ANTIBIOTIC_RESISTANCE,sample.properties.YEAST_MARKER]; }) - .enter() - .append("td") - .append("div") - .attr("class", "plasmid-table-data-cell") - .text(String) - - selection.style("display", - function(data) { - if ($.inArray(data, displayedPlasmids) != -1) { - return "table-row" - } else { - return "none" - } - }); - -} - -/** - * Request samples matching some criteria frpm the server and show them in the Page. - */ -function showMatchingSamples() -{ - var sampleCriteria = - { - matchClauses : - [ {"@type":"AttributeMatchClause", - fieldType : "ATTRIBUTE", - attribute : "TYPE", - desiredValue : "PLASMID" - } ], - operator : "MATCH_ALL_CLAUSES" - }; - - openbisServer.searchForSamples(sampleCriteria, displayReturnedSamples); -} - - -function enterApp(data) -{ - if(data.result == null){ - alert("Login or password incorrect"); - $("#username").focus(); - return; - } - - $("#login-form-div").hide(); - $("#main").show(); - - $('#openbis-logo').height(30); - - createVis() - showMatchingSamples(); -} - - -$(document).ready(function() { - $('#main').hide(); - - if(username.value.length==0) { - $("#username").focus(); - } - else { - $("#login-button").focus(); - } - - $('#logout-button').click(function() { - openbisServer.logout(function(data) { - $("#login-form-div").show(); - $("#main").hide(); - $("#username").focus(); - }); - }); - - $('#login-form').submit(function() { - openbisServer.login( $.trim($('#username').val()), $.trim($('#password').val()), function(data) { enterApp(data) }) - }); - - $('#owner_filter').keyup(function() { - visualize($('#owner_filter').val(), $('#ownernum_filter').val(), $('#plasmidname_filter').val(), $('#antibiotic_filter').val(), $('#marker_filter').val()); - }); - - $('#ownernum_filter').keyup(function() { - visualize($('#owner_filter').val(), $('#ownernum_filter').val(), $('#plasmidname_filter').val(), $('#antibiotic_filter').val(), $('#marker_filter').val()); - }); - - $('#plasmidname_filter').keyup(function() { - visualize($('#owner_filter').val(), $('#ownernum_filter').val(), $('#plasmidname_filter').val(), $('#antibiotic_filter').val(), $('#marker_filter').val()); - }); - - $('#antibiotic_filter').keyup(function() { - visualize($('#owner_filter').val(), $('#ownernum_filter').val(), $('#plasmidname_filter').val(), $('#antibiotic_filter').val(), $('#marker_filter').val()); - }); - - $('#marker_filter').keyup(function() { - visualize($('#owner_filter').val(), $('#ownernum_filter').val(), $('#plasmidname_filter').val(), $('#antibiotic_filter').val(), $('#marker_filter').val()); - }); - - - - - - - openbisServer.ifRestoredSessionActive(function(data) { enterApp(data) }); - - // Make the ENTER key the default button - $("login-form input").keypress(function (e) { - if ((e.which && e.which == 13) || (e.keyCode && e.keyCode == 13)) { - $('button[type=submit].default').click(); - return false; - } else { - return true; - } - }); -}); - -</script> - -</head> -<body> - <img id="openbis-logo" src="images/openBIS_Logo.png" alt="openBIS" style="position: absolute; left: 10px; height: 100px;"/> - <div id="login-form-div"style="position: absolute; left: 300px; top: 200px;"> - <h1>openBIS YeastLab</h1> - <form id="login-form" action="javascript:"> - <input id="username" type="text" required="required"> - <input id="password" type="password" required="required"> - <button class="login-button" id="login-button" type="submit">Login</button> - </form> - </div> - - <div id="main"> - <div id="button-group"> - <button id="logout-button" style="position: absolute; right:10px;">Logout</button> - </div> - <div id="yeast_browser" style="position: absolute; left:800px; top:15px"> - <a href="file:///Users/barillac/workspace/plasmid/source/html/yeastlabbrowser/yeast-browser.html">Yeasts</a> - </div> - <div id="plasmid_browser" style="position: absolute; left:600px; top:15px"> - <a href="file:///Users/barillac/workspace/plasmid/source/html/yeastlabbrowser/plasmid-browser.html">Plasmids</a> - </div> - <div id="plasmid_browser" style="position: absolute; left:400px; top:15px"> - <a href="file:///Users/barillac/workspace/plasmid/source/html/yeastlabbrowser/plasmid-browser.html">Plasmids</a> - </div> - <div id="chemical_browser" style="position: absolute; left:200px; top:15px"> - <a href="file:///Users/barillac/workspace/plasmid/source/html/yeastlabbrowser/chemicals-browser.html">Chemicals</a> - </div> - <div style= "padding-top:50px; font-weight: bold; font-size:18px">Filter by:</div> - <div> - <div style="padding-top: 15px"><span style="font-weight: bold; padding-left: 100px">Target</style> <input style="width: 200px" id="ownernum_filter" type="text"></div> - </div> - <div> - <div style="padding-top: 15px"><span style="font-weight: bold; padding-left: 100px">Direction</style> <input style="width: 200px" id="plasmidname_filter" type="text"></div> - </div> - <div> - <div style="padding-top: 15px"><span style="font-weight: bold; padding-left: 100px">Restriction Enzyme</style> <input style="width: 200px" id="antibiotic_filter" type="text"></div> - </div> - <div> - <div style="padding-top: 15px"><span style="font-weight: bold; padding-left: 100px">Project</style> <input style="width: 200px" id="marker_filter" type="text"></div> - </div> - - <div id="vis"> - <table cellspacing="10" cellpadding="20"> - <table id="plasmid-table" style="float: left"> - <tr class="plasmid-table-header"><th>Plasmid Code</th><th>Owner</th><th>Owner Number</th><th>Plasmid Name</th><th>Backbone</th><th>Bacterial Antibiotic Resistance</th><th>(Yeast) Marker</th></tr> - </table> - <span id="inspectorsContainer"></span> - </div> - </div> -</body> -</html> diff --git a/plasmid/source/html/yeastlabbrowser/yeast-body-style.css b/plasmid/source/html/yeastlabbrowser/yeast-body-style.css index bada2dc0d3584bb529269fbc6ee4133a6a930d2b..edc89f3324bafbc399e238e1e61572be4037fe7e 100644 --- a/plasmid/source/html/yeastlabbrowser/yeast-body-style.css +++ b/plasmid/source/html/yeastlabbrowser/yeast-body-style.css @@ -89,135 +89,54 @@ background-color: white; } -.oligo-table-data-cell { - overflow: hidden; -} - -#oligo-table tr:nth-child(odd) { - background-color:#94B8B8; -} - -#oligo-table tr:nth-child(even) { - background-color:#ECEFEF; - -} - -#oligo-table tr.oligo-table-data:hover { - font-size : 105%; - font-weight: bold; - -} - - -#oligo-table td{ - -padding:5px; -} - -#oligo-table tr.oligo-table-header { - font-size:18px; - font-weight: bold; - color:#fff; - background-color:#426262; -} - - -.chemical-table-data-cell { - overflow: hidden; -} - -#chemical-table tr:nth-child(odd) { - background-color:#B2B2B2; -} - -#chemical-table tr:nth-child(even) { - background-color:#ECEFEF; - -} - -#chemical-table tr.chemical-table-data:hover { - font-size : 105%; - font-weight: bold; - -} - - -#chemical-table td{ -padding:5px; -} - -#chemical-table tr.chemical-table-header { - font-size:18px; - font-weight: bold; - color:#fff; - background-color:#767676; -} +yeast.table { counter-reset: line-number; } -.plasmid-table-data-cell { +.yeast-table-data-cell { overflow: hidden; + + } -#plasmid-table tr:nth-child(odd) { - background-color:#DC7E9E; -} -#plasmid-table tr:nth-child(even) { - background-color:#ECEFEF; +#yeast-table tr:nth-of-type(odd) { + background-color:#A6A64D; } -#plasmid-table tr.plasmid-table-data:hover { - font-size : 105%; - font-weight: bold; - +#yeast-table tr:nth-of-type(even) { + background-color:#ECEFEF; } -#plasmid-table td{ -padding:5px; -} -#plasmid-table tr.plasmid-table-header { - font-size:18px; +#yeast-table tr.yeast-table-data:hover { font-weight: bold; - color:#fff; - background-color:#6E3F4F; } - - -.yeast-table-data-cell { - overflow: hidden; - +#yeast-table tr.yeast-table-data td { + padding: 5px; } -#yeast-table tr:nth-child(odd) { - background-color:#A6A64D; -} - -#yeast-table tr:nth-child(even) { - background-color:#ECEFEF; - -} - -#yeast-table tr.yeast-table-data:hover { - font-size : 105%; - font-weight: bold; - +#yeast-table tr.yeast-table-data:hover td { + padding: 5px 2px; } #yeast-table td{ padding:5px; - } #yeast-table tr.yeast-table-header { font-size:18px; font-weight: bold; color:#fff; - background-color:#5C5C1F; + background-color:#5C5C1F; +} + +#yeast-table th { + padding-left:5px; + padding-right:5px; } diff --git a/plasmid/source/html/yeastlabbrowser/yeast-browser.html b/plasmid/source/html/yeastlabbrowser/yeast-browser.html index 5ad573889ba301f380b9f112dc52fec8bcab9ccf..6da914e81414e25e3f11bdbafa4a4289b852ddb5 100644 --- a/plasmid/source/html/yeastlabbrowser/yeast-browser.html +++ b/plasmid/source/html/yeastlabbrowser/yeast-browser.html @@ -531,6 +531,13 @@ function visualize(ownerFilterText, ownerNumFilterText, yeastNameFilterText, pro .attr("class", "yeast-table-data-cell") .text(String) + selection.style("display", + function(data) { + return "table-row" + }); + + +/* Original function -> not displaying all samples! selection.style("display", function(data) { if ($.inArray(data, displayedYeasts) != -1) { @@ -539,7 +546,7 @@ function visualize(ownerFilterText, ownerNumFilterText, yeastNameFilterText, pro return "none" } }); - +*/ } /** @@ -659,7 +666,8 @@ function ShowHide(divId) document.getElementById(divId).style.display = 'none'; } } - + + </script> </head> @@ -691,10 +699,10 @@ function ShowHide(divId) <a href="file:///Users/barillac/workspace/plasmid/source/html/yeastlabbrowser/chemicals-browser.html">Chemicals</a> </div> - <div id="filter-button" style="position: absolute; left:20px; top:70px; font-weight:bold"> + <div id="filter-button" style="padding-left:20px; padding-top:70px; font-weight:bold; padding-bottom:30px;"> <a onclick ="javascript:ShowHide('HiddenDiv')" href="javascript:;" >Filters</a> </div> - <div class="mid" id="HiddenDiv" style="DISPLAY: none; padding-top: 90px;"> + <div class="mid" id="HiddenDiv" style="DISPLAY: none;"> <table> <tr style="padding-top: 15px"><td style="font-weight: bold; padding-left: 100px">Owner</td><td><input style="width: 200px" id="owner_filter" type="text"></td></tr> <tr style="padding-top: 15px"><td style="font-weight: bold; padding-left: 100px">Owner Number</td><td><input style="width: 200px" id="ownerNum_filter" type="text"></td></tr> @@ -709,7 +717,7 @@ function ShowHide(divId) <div id="vis"> - <table id="yeast-table" style="float: left; padding-top:100px;"> + <table id="yeast-table" style="float: left; "> <tr class="yeast-table-header"><th>Yeast Code</th><th>Owner</th><th>Owner Number</th><th>Yeast Strain Name</th><th>Project</th><th>Plasmids</th><th>Yeast Parents</th><th>Genetic Background</th><th>Mating Type</th></tr> </table> <span id="inspectorsContainer"></span>