Skip to content
Snippets Groups Projects
Commit 9ed71ad9 authored by Christopher Schankula's avatar Christopher Schankula :earth_africa:
Browse files

Merge branch 'web' of git@gitlab.cas.mcmaster.ca:schankuc/2XB3.git into

web

Conflicts:
	tomcat/webapps/Trawl/histogram.jsp
parents efeec5c3 32ecf716
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 -->
<script src="https://cdn.plot.ly/plotly-latest.min.js"></script>
</head>
<body>
<div id="histogram"><!-- Plotly chart will be drawn inside this DIV --></div>
<script src="https://cdn.plot.ly/plotly-latest.min.js"></script>
<script>
<%
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"));
%>
var data = [
{ x: x,
y: y,
type: 'bar',
orientation: 'h',
marker: {
color: 'blue',
},
}
];
var layout = {
title: 'Individual count vs Year',
xaxis:{title: 'Year',
autorange:'reversed'
},
yaxis:{title: 'Individual count',
side:'right'
}
}
Plotly.newPlot('histogram', data,layout);
</script>
</body>
<%@ page import="java.util.*, data.Record, model.TrawlExpert, search.BST, search.BasicSearchResult" %>
<head>
<!-- Plotly.js -->
<script src="https://cdn.plot.ly/plotly-latest.min.js"></script>
</head>
<body>
<div id="histogram"><!-- Plotly chart will be drawn inside this DIV --></div>
<script src="https://cdn.plot.ly/plotly-latest.min.js"></script>
<script>
<%
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"));
%>
var data = [
{ x: x,
y: y,
type: 'bar',
marker: {
color: 'blue',
},
}
];
var layout = {
title: 'Individual count vs Year',
xaxis:{title: 'Year',
titlefont: {
family: 'Courier New, monospace',
size: 18,
color: '#7f7f7f'
}
},
yaxis:{title: 'Individual count',
titlefont: {
family: 'Courier New, monospace',
size: 18,
color: '#7f7f7f'
}
}
}
Plotly.newPlot('histogram', data,layout);
</script>
</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 13:10:35 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,66 +123,68 @@ public final class histogram_jsp extends org.apache.jasper.runtime.HttpJspBase
out = pageContext.getOut();
_jspx_out = out;
out.write("\n");
out.write("\n");
out.write("\n");
out.write("\n");
out.write("\n");
out.write("\n");
out.write("<head>\n");
out.write(" <!-- Plotly.js -->\n");
out.write(" <script src=\"https://cdn.plot.ly/plotly-latest.min.js\"></script>\n");
out.write("</head>\n");
out.write("\n");
out.write("<body>\n");
out.write(" \n");
out.write(" <div id=\"histogram\"><!-- Plotly chart will be drawn inside this DIV --></div>\n");
out.write(" <script src=\"https://cdn.plot.ly/plotly-latest.min.js\"></script>\n");
out.write("\t<script>\n");
out.write("\n");
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"));
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("\tvar data = [\n");
out.write(" \t{ \tx: x,\n");
out.write(" \ty: y,\n");
out.write(" \ttype: 'bar',\n");
out.write(" \torientation: 'h',\n");
out.write(" \tmarker: {\n");
out.write(" \tcolor: 'blue',\n");
out.write(" \t},\n");
out.write(" \t}\n");
out.write("\t];\n");
out.write("\n");
out.write("\tvar layout = {\n");
out.write("\t\ttitle: 'Individual count vs Year',\n");
out.write(" \txaxis:{title: 'Year',\n");
out.write(" \t\tautorange:'reversed'\n");
out.write(" \t},\n");
out.write(" \tyaxis:{title: 'Individual count',\n");
out.write(" \t\tside:'right'\n");
out.write(" \t\t}\n");
out.write("\t}\n");
out.write("\tPlotly.newPlot('histogram', data,layout); \n");
out.write("\t</script>\n");
out.write("</body>\n");
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;
......
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