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
54932fed
Commit
54932fed
authored
6 years ago
by
Winnie
Browse files
Options
Downloads
Patches
Plain Diff
Updates
parent
67f8d606
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
tomcat/webapps/Trawl/index.jsp
+2
-1
2 additions, 1 deletion
tomcat/webapps/Trawl/index.jsp
tomcat/webapps/Trawl/script.js
+31
-1
31 additions, 1 deletion
tomcat/webapps/Trawl/script.js
with
33 additions
and
2 deletions
tomcat/webapps/Trawl/index.jsp
+
2
−
1
View file @
54932fed
...
...
@@ -82,7 +82,8 @@ Double Handle Slider Modified from: http://jqueryui.com/slider/#range
</section>
<section
id=
"outputBox"
>
<!-- Map, Histogram Box. Histogram selected by default but we might want to have a loading screen instead.-->
<div
id=
"histogram"
></div>
<div
display=
"none"
id=
"histogram"
></div>
<div
display=
"none"
id=
"map"
></div>
<%--<div id="console">~~~ PSEUDO-CONSOLE ~~~<br></div>--%>
</section>
</section>
...
...
This diff is collapsed.
Click to expand it.
tomcat/webapps/Trawl/script.js
+
31
−
1
View file @
54932fed
...
...
@@ -183,6 +183,28 @@ function getTaxGroup() {
}
}
function
reqMap
(
params
){
var
path
=
'
doMap.do
'
;
var
xhr
=
new
XMLHttpRequest
();
xhr
.
open
(
"
POST
"
,
path
);
xhr
.
setRequestHeader
(
"
Content-type
"
,
"
application/x-www-form-urlencoded
"
);
//Send the proper header info
xhr
.
onreadystatechange
=
function
()
{
//Call a function when the state changes (i.e. response comes back)
// Update the dropdown when response is ready
if
(
xhr
.
readyState
==
XMLHttpRequest
.
DONE
&&
xhr
.
status
==
200
)
{
var
nodeList
=
JSON
.
parse
(
this
.
responseText
);
initMap
(
nodeList
[
"
x
"
],
nodeList
[
"
y
"
]);
document
.
getElementById
(
"
outputDetails
"
).
innerHTML
=
"
Found
"
+
nodeList
[
"
n
"
]
+
"
results
"
+
"
(
"
+
nodeList
[
"
time
"
]
+
"
seconds)<br> Total Population:
"
+
nodeList
[
"
individualCount
"
];
}
else
{
console
.
log
(
"
Server Response: Error
"
);
//RME
}
};
xhr
.
send
(
params
);
//send request to server
// document.getElementById("console").innerHTML += "Sent request to " + path + ": " + jsonString + "<br>"; //RME
}
function
callOutput
(){
var
pickOutputType
=
document
.
getElementsByName
(
'
pickOutput
'
);
var
outType
,
taxGroup
,
yearFrom
,
yearTo
;
...
...
@@ -200,11 +222,19 @@ function callOutput(){
var
params
=
JSON
.
stringify
({
taxId
:
Number
(
taxGroup
),
yearF
:
Number
(
yearFrom
),
yearT
:
Number
(
yearTo
)});
//Switch Output Display
document
.
getElementById
(
"
histogram
"
).
style
.
display
=
"
none
"
;
document
.
getElementById
(
"
map
"
).
style
.
display
=
"
none
"
;
if
(
outType
===
"
histogram
"
){
reqHistogram
(
params
);
document
.
getElementById
(
"
histogram
"
).
style
.
display
=
"
block
"
;
}
else
if
(
outType
===
"
map
"
){
reqMap
(
params
);
document
.
getElementById
(
"
map
"
).
style
.
display
=
"
block
"
;
}
else
{
console
.
log
(
"
Map or
Heatmap
"
)
;
console
.
log
(
"
Heatmap
/Cluster
"
)
}
}
...
...
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