Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ejw-data/proj-election-dashboard
Heroku Flask App with Postgres Database that provides interactive graphics
https://github.com/ejw-data/proj-election-dashboard
bootstrap css d3-visualization flask-application html jupyter-notebook leafletjs postgresql python sqlalchemy
Last synced: about 2 months ago
JSON representation
Heroku Flask App with Postgres Database that provides interactive graphics
- Host: GitHub
- URL: https://github.com/ejw-data/proj-election-dashboard
- Owner: ejw-data
- Created: 2019-12-20T14:14:36.000Z (about 5 years ago)
- Default Branch: ejw
- Last Pushed: 2023-08-09T20:00:10.000Z (over 1 year ago)
- Last Synced: 2023-08-09T20:57:50.921Z (over 1 year ago)
- Topics: bootstrap, css, d3-visualization, flask-application, html, jupyter-notebook, leafletjs, postgresql, python, sqlalchemy
- Language: Jupyter Notebook
- Homepage: http://election-dashboard.herokuapp.com/
- Size: 96.7 MB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# dashboard-election
Author: Erin James Wills - [email protected]
![](./static/images/mount_rushmore.jpg)
## Overview
## Database Setup
1. Create a database named `election_db` in pgAdmin (postgreSQL).
1. Open a query tool and generate the schema by running the contents of `development/data/postgres/sql_erd_final.txt`.
1. Insert the table data by importing the contents of `development/data/postgres/data_db.csv`
1. Confirm your username and port number by going to the properties of the server and going to the connections tab. Username and port are listed on this tab.
1. Update this information in the app.py within the `create_engine()` function.## Serializing Postgres Responses
* One option is to use Marshmallow since it's schema can be used to assist with this.
* Otherwise, each needed postgres column can be extracted by using the .__dict__ constructor. This is a fast way of fixing the problem.
* The final method is to extract each key manually into a new dictionary and jsonify this new dictionary.## Map Setup
Two of the leaflet setups are standard and don't require much work. The two maps might be able to be combined into one map.
The map that has two geojson overlays is a bit more difficult to manage sonce both overlays are on at the same time. I think the code can be rewritten to get this to work.
## Future tasks
1. rename js files and refactor
1. merge two maps into one
1. reconfigure if possible the green black map so the data is brought in differently. This might be a geopandas task to create a new layer.## Other Documents
[Original Page](./application.md)