Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
2XB3FinalProject
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Analyze
Contributor analytics
Repository analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Christopher Schankula
2XB3FinalProject
Commits
9ce9288b
Commit
9ce9288b
authored
6 years ago
by
Ray Liu
Browse files
Options
Downloads
Patches
Plain Diff
Edited histogram
parent
c784de31
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
tomcat/webapps/Trawl/about.html
+37
-31
37 additions, 31 deletions
tomcat/webapps/Trawl/about.html
tomcat/webapps/Trawl/histogram.js
+36
-0
36 additions, 0 deletions
tomcat/webapps/Trawl/histogram.js
tomcat/webapps/Trawl/histogram.jsp
+22
-47
22 additions, 47 deletions
tomcat/webapps/Trawl/histogram.jsp
with
95 additions
and
78 deletions
tomcat/webapps/Trawl/about.html
+
37
−
31
View file @
9ce9288b
<!DOCTYPE html>
<html
lang=
"en"
>
<head>
<meta
charset=
"UTF-8"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1.0"
>
<meta
name=
"keywords"
content=
"insert, some, keywords"
>
<!--TODO-->
<meta
name=
"description"
content=
"insert a description"
>
<!--TODO-->
<title>
About|TrawlTool
</title>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"style.css"
>
<!--Fonts-->
<!--Open Sans Rg-400/Semi-600/Bd-700-->
<link
href=
"https://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700"
rel=
"stylesheet"
>
</head>
<body>
<header>
<div
class=
"headerWrapper"
>
<a
href=
"index.jsp"
>
TrawlTool
</a>
<span
class=
"nav-bar"
>
<a
href=
"about.html"
>
About
</a>
|
<a
href=
"index.jsp"
target=
"_blank"
>
Gitlab/Github Nonfunc!
</a>
</span>
</div>
</header>
<section>
Insert some info about the project, blah blah blah.
<br>
Add photo credit if applicable
</section>
</body>
<!DOCTYPE html>
<html
lang=
"en"
>
<head>
<meta
charset=
"UTF-8"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1.0"
>
<meta
name=
"keywords"
content=
"insert, some, keywords"
>
<!--TODO-->
<meta
name=
"description"
content=
"insert a description"
>
<!--TODO-->
<title>
About|TrawlTool
</title>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"style.css"
>
<script
src=
"https://cdn.plot.ly/plotly-latest.min.js"
></script>
<!--Fonts-->
<!--Open Sans Rg-400/Semi-600/Bd-700-->
<link
href=
"https://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700"
rel=
"stylesheet"
>
</head>
<body>
<header>
<div
class=
"headerWrapper"
>
<a
href=
"index.jsp"
>
TrawlTool
</a>
<span
class=
"nav-bar"
>
<a
href=
"about.html"
>
About
</a>
|
<a
href=
"index.jsp"
target=
"_blank"
>
Gitlab/Github Nonfunc!
</a>
</span>
</div>
</header>
<section>
Insert some info about the project, blah blah blah.
<br>
Add photo credit if applicable
</section>
<div
id=
"histogram"
>
</div>
</body>
<script
src=
"histogram.js"
></script>
</html>
\ No newline at end of file
This diff is collapsed.
Click to expand it.
tomcat/webapps/Trawl/histogram.js
0 → 100644
+
36
−
0
View file @
9ce9288b
function
histogram
(
x
,
y
){
console
.
log
(
"
Histogram
"
)
var
data
=
[
{
x
:
x
,
y
:
y
,
type
:
'
bar
'
,
marker
:
{
color
:
'
blue
'
,
},
}
];
var
layout
=
{
title
:
'
Individual count vs Year
'
,
xaxis
:{
title
:
'
Year
'
,
type
:
'
category
'
,
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
);
}
window
.
onload
=
histogram
([
1990
,
1991
,
1992
],[
54656
,
65654
,
32555
]);
This diff is collapsed.
Click to expand it.
tomcat/webapps/Trawl/histogram.jsp
+
22
−
47
View file @
9ce9288b
<%@ 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>
<%@page
import=
"org.json.simple.JSONArray"
%>
<%@page
import=
"org.json.simple.parser.JSONParser"
%>
<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
(
2
,
1960
,
2016
);
BST
<
Integer
,
Integer
>
histogram
=
result
.
histogram
();
Iterable
<
Integer
>
results
=
histogram
.
keys
();
out
.
print
(
"var y=[];"
);
out
.
print
(
"var x=[];"
);
JSONParser
parser
=
new
JSONParser
();
JSONObject
js
=
new
JSONObject
();
JSONArray
x
=
new
JSONArray
();
JSONArray
y
=
new
JSONArray
();
for
(
Integer
year:
results
){
out
.
print
(
"\ty.push("
+
histogram
.
get
(
year
)
+
");\n"
);
out
.
print
(
"\tx.push('"
+
year
+
"');\n"
);
x
.
add
(
year
);
y
.
add
(
histogram
.
get
(
year
)
);
}
js
.
put
(
"year"
,
x
);
js
.
put
(
"individualCount"
,
y
);
out
.
print
(
js
.
toJSONString
());
%>
var
data
=
[
{
x
:
x
,
y
:
y
,
type
:
'
bar
'
,
marker
:
{
color
:
'
blue
'
,
},
}
];
%>
var
layout
=
{
title
:
'
Individual count vs Year
'
,
xaxis
:{
title
:
'
Year
'
,
type
:
'
category
'
,
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
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment