Skip to content
Snippets Groups Projects
Commit b7906cdf authored by Ray Liu's avatar Ray Liu
Browse files
web

# Please enter a commit message to explain why this merge is necessary,
# especially if it merges an updated upstream into a topic branch.
#
# Lines starting with '#' will be ignored, and an empty message aborts
# the commit.
parents d539968b 9ed71ad9
No related branches found
No related tags found
No related merge requests found
<%@ page import="java.util.*, data.Record, model.TrawlExpert, search.BST, search.BasicSearchResult" %>
<head>
<!-- Plotly.js -->
......@@ -62,4 +57,4 @@
}
Plotly.newPlot('histogram', data,layout);
</script>
</body>
</body>
\ No newline at end of file
/*
* Generated by the Jasper component of Apache Tomcat
* Version: Apache Tomcat/9.0.6
* Generated at: 2018-03-28 12:47:47 UTC
* Generated at: 2018-03-28 13:19:07 UTC
* Note: The last modified time of this file was set to
* the last modified time of the source file after
* generation to assist with modification tracking.
......@@ -123,50 +123,68 @@ public final class histogram_jsp extends org.apache.jasper.runtime.HttpJspBase
out = pageContext.getOut();
_jspx_out = out;
out.write("\n");
out.write("<script src=\"https://cdn.plot.ly/plotly-latest.min.js\"></script>\n");
out.write("<script>\n");
out.write("\n");
TrawlExpert te = (TrawlExpert)request.getServletContext().getAttribute("trawl");
BasicSearchResult result = te.rangeSearch(159512, 1960, 2016);
BST<Integer, Integer> histogram = result.histogram();
Iterable<Integer> results = histogram.keys();
out.print("var y=[];");
out.print("var x=[];");
for (Integer year: results){
out.print("y.push("+ histogram.get(year) +");");
out.print("x.push("+ year +");");
}
out.print((String) request.getAttribute("url"));
out.write("\n");
out.write("\n");
out.write("var data = [\n");
out.write(" { x: x,\n");
out.write(" y: y,\n");
out.write(" type: 'bar',\n");
out.write(" orientation: 'h',\n");
out.write(" marker: {\n");
out.write(" color: 'blue',\n");
out.write(" },\n");
out.write(" }\n");
out.write("];\n");
out.write("\n");
out.write("var layout = {\n");
out.write(" xaxis:{\n");
out.write(" autorange:'reversed'\n");
out.write(" },\n");
out.write(" yaxis:{\n");
out.write(" side:'right'\n");
out.write(" }\n");
out.write("}\n");
out.write("Plotly.newPlot('Histogram', data,layout); \n");
out.write("</script>");
out.write("\r\n");
out.write("<head>\r\n");
out.write(" <!-- Plotly.js -->\r\n");
out.write(" <script src=\"https://cdn.plot.ly/plotly-latest.min.js\"></script>\r\n");
out.write("</head>\r\n");
out.write("\r\n");
out.write("<body>\r\n");
out.write(" \r\n");
out.write(" <div id=\"histogram\"><!-- Plotly chart will be drawn inside this DIV --></div>\r\n");
out.write(" <script src=\"https://cdn.plot.ly/plotly-latest.min.js\"></script>\r\n");
out.write("\t<script>\r\n");
out.write("\r\n");
out.write("\t");
TrawlExpert te = (TrawlExpert)request.getServletContext().getAttribute("trawl");
BasicSearchResult result = te.rangeSearch(159512, 1960, 2016);
BST<Integer, Integer> histogram = result.histogram();
Iterable<Integer> results = histogram.keys();
out.print("var y=[];");
out.print("var x=[];");
for (Integer year: results){
out.print("y.push("+ histogram.get(year) +");");
out.print("x.push("+ year +");");
}
out.print((String) request.getAttribute("url"));
out.write("\r\n");
out.write("\r\n");
out.write("\tvar data = [\r\n");
out.write(" \t{ \tx: x,\r\n");
out.write(" \ty: y,\r\n");
out.write(" \ttype: 'bar',\r\n");
out.write(" \tmarker: {\r\n");
out.write(" \tcolor: 'blue',\r\n");
out.write(" \t},\r\n");
out.write(" \t}\r\n");
out.write("\t];\r\n");
out.write("\r\n");
out.write("\tvar layout = {\r\n");
out.write("\t\ttitle: 'Individual count vs Year',\r\n");
out.write(" \txaxis:{title: 'Year',\r\n");
out.write(" \t\ttitlefont: {\r\n");
out.write(" \t\t\tfamily: 'Courier New, monospace',\r\n");
out.write(" \t\t\tsize: 18,\r\n");
out.write(" \t\t\tcolor: '#7f7f7f'\r\n");
out.write(" \t\t\t}\r\n");
out.write(" \t},\r\n");
out.write(" \tyaxis:{title: 'Individual count',\r\n");
out.write(" \t\ttitlefont: {\r\n");
out.write(" \t\t\tfamily: 'Courier New, monospace',\r\n");
out.write(" \t\t\tsize: 18,\r\n");
out.write(" \t\t\tcolor: '#7f7f7f'\r\n");
out.write(" \t\t\t}\r\n");
out.write(" \t\t}\r\n");
out.write("\t}\r\n");
out.write("\tPlotly.newPlot('histogram', data,layout); \r\n");
out.write("\t</script>\r\n");
out.write("</body>");
} catch (java.lang.Throwable t) {
if (!(t instanceof javax.servlet.jsp.SkipPageException)){
out = _jspx_out;
......
/*
* Generated by the Jasper component of Apache Tomcat
* Version: Apache Tomcat/9.0.6
* Generated at: 2018-03-27 23:07:59 UTC
* Generated at: 2018-03-28 13:10:15 UTC
* Note: The last modified time of this file was set to
* the last modified time of the source file after
* generation to assist with modification tracking.
......@@ -117,9 +117,7 @@ public final class index_jsp extends org.apache.jasper.runtime.HttpJspBase
out.write("\n");
out.write("<!--\n");
out.write("\n");
out.write("Double Handle Slider Modified from: http://jqueryui.com/slider/#range\n");
out.write("\n");
out.write("-->\n");
out.write("\n");
out.write("<!DOCTYPE html>\n");
......@@ -146,7 +144,6 @@ public final class index_jsp extends org.apache.jasper.runtime.HttpJspBase
out.write("\n");
out.write(" <!--Plugins-->\n");
out.write("</head>\n");
out.write("\n");
out.write("<body>\n");
out.write(" <header>\n");
out.write(" <a href=\"index.html\" >TrawlTool</a>\n");
......@@ -161,32 +158,28 @@ public final class index_jsp extends org.apache.jasper.runtime.HttpJspBase
out.write(" <section id=\"nameDropdownIn\">\n");
out.write(" <form method=\"POST\" action=\"doBioLookup.do\"> <!--.do extension is not necessary. This field is the servlet's url in web.xml-->\n");
out.write(" Phylum:\n");
out.write(" <select name=\"phylum\" size=\"1\">\n");
out.write(" <option>Arthropoda</option>\n");
out.write(" <select name=\"phylum\" size=\"1\" onChange=\"this.form.submit()\">\n");
out.write(" <option value=\"0\">Arthropoda</option>\n");
out.write(" <option>Chordata</option>\n");
out.write(" <option>Mollusca</option>\n");
out.write(" </select>\n");
out.write(" <input type=\"SUBMIT\">\n");
out.write("\n");
out.write(" Class:\n");
out.write(" <select name=\"class\" size=\"1\">\n");
out.write(" <select name=\"class\" size=\"1\" onChange=\"alert()\">\n");
out.write(" <option>SomeClass</option>\n");
out.write(" </select>\n");
out.write(" <!--<input type=\"SUBMIT\">-->\n");
out.write("\n");
out.write(" Order:\n");
out.write(" <select name=\"order\" size=\"1\">\n");
out.write(" </select>\n");
out.write(" <!--<input type=\"SUBMIT\">-->\n");
out.write("\n");
out.write(" Family:\n");
out.write(" <select name=\"family\" size=\"1\">\n");
out.write(" </select>\n");
out.write(" <!--<input type=\"SUBMIT\">-->\n");
out.write("\n");
out.write(" Genus:\n");
out.write(" <select name=\"genus\" size=\"1\">\n");
out.write(" </select>\n");
out.write(" <!--<input type=\"SUBMIT\">-->\n");
out.write("\n");
out.write(" Species:\n");
out.write(" <select name=\"species\" size=\"1\">\n");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment