Skip to content
This repository has been archived by the owner on Mar 11, 2022. It is now read-only.

banditsbeware/dash

Repository files navigation

Repository archived!

The Cowiz dashboard is now maintained by ITLab's official organization.

dash

The Covid data visualization dashboard is one of UTA ITLab's research projects, focusing on multilayer network analysis. This web application showcases graph visualization techniques in two ways; a choropleth map shows changes in statistics across time, and a side-by-side line graph is used to compare statistics from various regions over a similar time period.

Local development

Clone this repository

$ git clone https://github.com/banditsbeware/dash.git
$ cd dash

Create python virtual environment and install required packages:

$ python3 -m virtualenv venv
$ source venv/bin/activate
$ pip install -r requirements.txt

If you prefer to use anaconda, you can install the required packages with:

$ conda create --prefix ./env python=3.8 pip
$ conda activate ./env
$ pip install -r requirements.txt

The app requires a New York Times API key in .env; e.g. NYTAPI_KEY=<api key>

Compile the csvGenerator:

$ g++ -o cowiz/usmap/csvLayers/csvGenerator cowiz/usmap/csvLayers/csvGenerator.cpp

Set the development flask environment variables:

$ export FLASK_APP=cowiz
$ export FLASK_ENV=development

To skip from having to set environment variables every time you activate venv, add the following lines to venv/bin/activate:

    ...
    
    # reset old environment variables
    # INSERT BELOW
    if ! [ -z "${_OLD_FLASK_APP:+_}" ] ; then
        FLASK_APP="$_OLD_FLASK_APP"
        export FLASK_APP
        unset _OLD_FLASK_APP
    fi
    if ! [ -z "${_OLD_FLASK_ENV:+_}" ] ; then
        FLASK_ENV="$_OLD_FLASK_ENV"
        export FLASK_ENV
        unset _OLD_FLASK_ENV
    fi
    # DONE INSERTING
    
    ...
    
export VIRTUAL_ENV

# INSERT BELOW
_OLD_FLASK_APP="$FLASK_APP"
FLASK_APP=cowiz
export FLASK_APP

_OLD_FLASK_ENV="$FLASK_ENV"
FLASK_ENV=development
export FLASK_ENV
# DONE INSERTING

Run the app:

$ flask run