Commit 2a61fba8 authored by Porter Libby's avatar Porter Libby
Browse files

remove readme docs, relocated to wiki

parent 07af4aff
# Docs: Customization Guide
[[ Main README ]](../README.md)
## Styles for front-end
The main style file, found at `/public/css/main.css`. This file contains the definition for most of the mutabile colors in the front-end, and is made to be easy to access and modify. The structure for this defined as follows:
```css
:root {
--datacolor1: #1D976C;
--datacolor2:#93F9B9;
--theme1: #444;
--theme2: #888;
--theme3: #bbb;
--theme4: #ddd;
--themeh: white;
--themep: black;
}
```
### ***datacolor1* and *datacolor2***
These two colors define the notification glow for the **map view** and **graph view** buttons when new data as added for viewing.
### ***theme* colors**
Theme colors 1-4 define different UI colors to be used in the background of different elements. This is most visible in **data view**, but should theoretically make all three views follow the same color scheme, even though the other views are mostly covered by a map and a graph respectively.
### ***themeh* and *themep***
These two colors define default text colors for header size and paragraph size text respectively.
## Customizing the map
In `/public/js/map.js`, the following control variables can be found:
```javascript
maptype1 = "topo";
maptype2 = "satellite";
```
These can be used to modify the map modes shown in the **map view**. Possible values can be [found here](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap) on the ArcGIS API website.
\ No newline at end of file
# Docs: Database Guide
[[ Main README ]](../README.md)
The purpose of this readme is to outline the IFS **field_science** database, and describe the tables which are used in processing Fieldday information. The database is hosted on the Earlham College cluster, using postgreSQL.
## Tables
the **field_science** database contains the following tables which are necissary for the datavis tool to function. If the tables in your database are different, then the **queries.js** file will need to be tweaked to accomodate your data.
This section also includes an example for each table, showing how data might be aquired from the database.
### *fieldday_platform*
| column | type | example |
|---|---|---|
| platformid | char(8) | "4ef" |
| platformtype | char(16) | "Ambiance" |
| platformname | char(16) | "Grace" |
### *fieldday_sensor*
| column | type | example |
|---|---|---|
| platformid | char(8) | "4ef" |
| sensorid | char(8) | "55a" |
| sensortype | char(30) | "Reletive Humidity" |
| sensorunits | char(8) | "%" |
### *fieldday_trip*
***example:*** `SELECT * FROM fieldday_trip;`
| column | type | example |
|---|---|---|
| tripid | int | 23 |
| tripname | char(128) | "Iceland 2016" |
### *fieldday_site*
***example:*** `SELECT * FROM fieldday_site WHERE tripid=23;`
| column | type | example |
|---|---|---|
| tripid | int | 23 |
| siteid | int | 24 |
| sitename | char(128) | "Pingvellir" |
| sitenotes | text | "Notes about site" |
### *fieldday_sector*
***example:*** `SELECT * FROM fieldday_sector WHERE tripid=23 AND siteid=2;`
| column | type | example |
|---|---|---|
| tripid | int | 23 |
| siteid | int | 24 |
| sectorid | int | 231 |
| sectorname | char(128) | "Pingvellir" |
| sectornotes | text | "Notes about sector" |
### *fieldday_spot*
***example:*** `SELECT * FROM fieldday_spot WHERE tripid=23 AND siteid=2 AND sectorid=1;`
| column | type | example |
|---|---|---|
| tripid | int | 23 |
| siteid | int | 24 |
| sectorid | int | 231 |
| spotid | int | 3 |
| spotiamgefolder | char(128) | dir_name |
| spotnotes | text | "Notes about sector" |
### *fieldday_streaming*
| column | type | example |
|---|---|---|
| tripid | int | 24 |
| siteid | int | 24 |
| sectorid | int | 231 |
| platformid | char(8) | "ev5" |
| sensorid | char(8) | "83a" |
| hostid | char(30) | "08f5b5cf" |
| recordtime | timestamp | 2019-04-30 15:08:05-04 |
| longitude | double | -84.91287 |
| latitude | double | 39.824677 |
| elevation | double | 246.8 |
| quality | double | 0 |
| accuracy | double | 11 |
| satellites | int | 8 |
| value_1 | numeric | 98758.67 |
| value_2 | numeric | 0.0 |
| value_3 | numeric | 0.0 |
| value_4 | numeric | 0.0 |
| value_5 | numeric | 0.0 |
| value_6 | numeric | 0.0 |
### *fieldday_reading*
| column | type | example |
|---|---|---|
| tripid | int | 24 |
| siteid | int | 24 |
| sectorid | int | 231 |
| spotid | int | 3 |
| platformid | char(8) | "ev5" |
| sensorid | char(8) | "83a" |
| hostid | char(30) | "08f5b5cf" |
| imagefilename | text | file_name |
| readingnotes | text | "reading notes" |
| recordtime | timestamp | 2019-04-30 15:08:05-04 |
| longitude | double | -84.91287 |
| latitude | double | 39.824677 |
| elevation | double | 246.8 |
| quality | double | 0 |
| accuracy | double | 11 |
| satellites | int | 8 |
| value | numeric | 98758.67 |
| value_2 | numeric | 0.0 |
| value_3 | numeric | 0.0 |
| value_4 | numeric | 0.0 |
| value_5 | numeric | 0.0 |
| value_6 | numeric | 0.0 |
\ No newline at end of file
# Docs: Developer Guide
[[ Main README ]](../README.md)
## Javascript Files
Server-side JS:
- **index.js** - Main server-side file. Passes routes from queries to client-side.
- **queries.js** - Another server-side file, contains all the servers query routes and templates for getting information from the PSQL database.
The `public/js` folder contains all the client-side JS:
- **public / js / main.js** - contains the `ready()` function which performs setup when `views/index.ejs` loads.
- **public / js / data.js** - contains all the client-side functions for getting data from the PSQL database. Most of these are references to routes which get information on the server side, and then use this information to create additional selectors on the `data` screen, or render content.
- **public / js / graph.js** - handles creation of graphs and tables for the `graph` view of the tool. Uses chartJS.
- **public / js / map.js** - handles creation of maps and points for the `map` view. Uses ARC GIS JS API.
- **public / js / util.js** - handles odd things, such as generation of `HTML` for the template, and disabling/enabling views.
## Creating a new PSQL Query
The process of adding new server-side queries and allowing the client-side to access those functions, without providing access to the data, can be a little tricky. I have outlined the process I use here in the hopes that it will be helpful.
1. In `queries.js` create a new function to get information using a programmed query string. This should look something like the example below:
```js
...
const getSomething = (request, response) => {
var query = 'SELECT something from SOMETABLE;'
serverOut(query); // print the query text
pool.query(query, (error, results) => {
if (error) {
throw error // error from query string
}
response.status(200).json(results.rows) // return the results
})
}
module.exports = {
...
getSomething, // this must match the route in index.js
...
}
```
2. In `index.js`, create a route so that the client-side will be able to access the routes in `queries.js`. This should look something like this:
```js
app.get('/something', q.getSomething); // should match the name in module.exports
```
3. We can now access the route from client-side. For example, in the file `public/js/data.js`. This should look something like this:
```js
function getSomthing(){
$.ajax({
type: 'GET',
url: '/something', // should match the name in index.js
success: function(response) {
console.table(response); // show the full result
// a renderer could be made to use this data here
},
error: function(xhr, status, err) {
console.log(xhr.responseText); // if query fails
}
});
}
```
## HTML Template
For style and `CSS` information, refer to the [ customization guide](CUSTOM.md).
HTML template exists in `views/index.ejs`.
\ No newline at end of file
# Docs: Mobile App
[[ Main README ]](../README.md)
The purpose of this document is to support the `datavis-mobile` android application, which is a `submodule` of this repository. The original repository for `datavis-mobile` can be found [here](https://github.com/probably-not-porter/datavis-mobile).
## Version Information
## Testing Information
\ No newline at end of file
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