Commit 0e84ab27 authored by Porter Libby's avatar Porter Libby
Browse files

refactor for future use

parent 24129572
/*
#
# Datavis 2.0
# Porter Libby
# 2019
# Porter Libby - 2019 - initial setup
# pelibby16@earlham.edu
#
# Map and Data functions
*/
const db = require('./index');
// MAP //
function mapReady(){
......@@ -80,39 +78,4 @@ require([
});
});
// DATA //
// NAVIGATION / UTIL //
function switchToMap(){
document.getElementById("dataView").style.display = "none";
document.getElementById("graphView").style.display = "none";
document.getElementById("mapView").style.display = "block";
console.log('switched to map view');
}
function switchToGraph(){
document.getElementById("mapView").style.display = "none";
document.getElementById("dataView").style.display = "none";
document.getElementById("graphView").style.display = "block";
console.log('switched to graph view');
}
function switchToData(){
document.getElementById("mapView").style.display = "none";
document.getElementById("graphView").style.display = "none";
document.getElementById("dataView").style.display = "block";
console.log('switched to data view');
}
function select(tag){
console.log(tag);
var element = document.querySelector("#" + tag)
element.classList.add("btn-select");
element.classList.remove("btn-unselect");
}
function unselect(tag){
console.log(tag);
var element = document.querySelector("#" + tag)
element.classList.remove("btn-select");
element.classList.add("btn-unselect");
}
\ No newline at end of file
// DATA //
\ No newline at end of file
/*
#
# Datavis 2.0
# Porter Libby - 2019 - initial setup
# pelibby16@earlham.edu
#
# Query functions for database
*/
const pool = require('./pool');
const getTrips = (request, response) => {
......
/*
#
# Datavis 2.0
# Porter Libby - 2019 - initial setup
# pelibby16@earlham.edu
#
# DOM basics
*/
// NAVIGATION / UTIL //
function switchToMap(){
document.getElementById("dataView").style.display = "none";
document.getElementById("graphView").style.display = "none";
document.getElementById("mapView").style.display = "block";
console.log('switched to map view');
}
function switchToGraph(){
document.getElementById("mapView").style.display = "none";
document.getElementById("dataView").style.display = "none";
document.getElementById("graphView").style.display = "block";
console.log('switched to graph view');
}
function switchToData(){
document.getElementById("mapView").style.display = "none";
document.getElementById("graphView").style.display = "none";
document.getElementById("dataView").style.display = "block";
console.log('switched to data view');
}
function select(tag){
console.log(tag);
var element = document.querySelector("#" + tag)
element.classList.add("btn-select");
element.classList.remove("btn-unselect");
}
function unselect(tag){
console.log(tag);
var element = document.querySelector("#" + tag)
element.classList.remove("btn-select");
element.classList.add("btn-unselect");
}
\ No newline at end of file
......@@ -9,6 +9,7 @@
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://js.arcgis.com/4.12/"></script>
<script type="text/javascript" src="js/main.js"></script>
<script type="text/javascript" src="js/util.js"></script>
</head>
<body>
<div id='mapView'>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment