Giter Club home page Giter Club logo

inclucivics's Introduction

IncluCivics

JavaScript Style Guide Build Status

IncluCivics is a data visualization app completed in partnership with the Human Relations Commission. It provides transparency on employee demographics within the Nashville Metropolitan Government.

Running

To run, make sure you have yarn installed, and run

yarn install && yarn start

to see the site live at http://localhost:3000.

This project is built using create-react-app. Check out the User Guide for more information about testing and building.

Adding Data

To add data:

  1. Run yarn data:fetch to download the latest file to the input/ directory.
  2. Run yarn data:import. This will produce new files in public/data/ that will be used in the Explore section of the grahps. Note: The import may fail because of changes to column names or data format. If you encouter a failure, please file an issue โœ๏ธ. This will also generate a summary of all files in the input/ directory
  3. Commit any changes and submit a pull request.

Deploying

Run yarn deploy. This will fail if you don't have push rights to the repository's gh-pages branch. The app is configured to use git over https. If you have two-factor authentication to github, you will need to create a personal access token with the 'public_repo' permission.

Contributing

Contributions are welcome. Look at the "Issues" tab to squash ๐Ÿ›s, add features and suggest improvements. If you are new to open source, check out How to Contribute to Open Source for a rundown.

License

MIT

inclucivics's People

Contributors

braindawg avatar combinatorist avatar coreyar avatar dependabot[bot] avatar enlore avatar gcziprusz avatar jackmoch avatar jcockhren avatar kazshak avatar kevinahuber avatar luketlancaster avatar moniquebt avatar mshenfield avatar staufferalexander avatar threepears avatar wduffee avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

inclucivics's Issues

Add Web Analytics

We want to know if the public are using/visiting the site. inclucivics.com

We have two options:

  • Google Analytics
  • Piwik

Automating builds and deploys

This issue is in regards to the following:

  • Hook up this repo to Sophicware hosted jenkins instance
  • [ ] Create jenkins job for building AMIs within C4N AWS account
  • Setup continuous deployment

Sort graph items

Not sure what the deal is with this, but a simple sorting of values either alphabetically or by numeric value would be helpful.

@colbydehart You think you could handle this one?

Heroku project setup.

@jchapin @JamesNix

Based on the discussions we had it seemed like the basic approach was to use mongo for the db and host the app using Heroku. I don't think MQL will be too difficult to pick up.

I started playing with Heroku, but am not particularly familar with it. Does either one of you want to try and setup a project that I can tag along into at the next hack night? I need a few python libraries, but from what I read Heroku should support it.

Also, if you want to begin working on an interface and testing rendering images using vega. Checkout vega. The vega editor has examples of JSON specifications for graphs that you could use for testing purposes.

seed database with "previous" socrata imports

The major problem with switching out the backend here is that we've got to maintain the data we had when we were importing from text files, and put it in a format identical that which is expected by socrata. I'm thinking here that I'm just going to manually create a database that has that data, complete with timestamps, and will provide a rethinkdb backup to be imported if the new database does not exit. This way we should be able to continue on as if we had been importing data all along.

Feature: add celery and associated tasks

I could pretty easily use celery to handle the periodic update request... seems like a bit of overkill for this, but ... I can set it up pretty fast. The real issue will be deployment.

Figure out a metric for measuring changes over time

@mshenfield

Potential metrics...:

Chi Square. Compare the Observed/Expected ratios for Metro as a whole and plot the resulting chisquare value overtime.

Advantages: Statistical backing, appropriate for this type of data, creates a single metric that can be plotted

Disadvantages: May be to sophisticated for average user, how do we handle multiple income levels?

Some metric that relates the number of departments at or near the values predicted by census ?

Mobile responsiveness

@bdfinlayson

We need your help here. The mobile version of this project looks absolutely atrocious. We can't have public attention on this platform when it looks like this. It will reflect poorly on Code for Nashville and what we are able to do as an organization.

If you can rally some people to fix this, or handle it yourself, it would be deeply appreciated.

look at www.inclucivics.com to get an idea

python cleanup/refactor

the python face of this is pretty rusty at this point. Going to go through and do some refactoring of that whole piece.

Update the paragraph on the home page

Content to Use

In January 2015, the Metro Human Relations Commission (MHRC) released the IncluCivics Report, analyzing the demographic makeup of 50 Metro Nashville departments. The data in the original report was provided by Metro Human Resources (Metro HR) in August 2014. Since then, Metro HR has provided more recent data (captured April 1, 2015) and has announced that updated data will be released quarterly. The original IncluCivics Report, and a recent and more robust Data Update are at https://www.nashville.gov/Human-Relations-Commission/IncluCivics.aspx.

This platform, graciously created and maintained free of charge by Code for Nashville, exists for two reasons. First, it is imperative to establish a baseline from which to assess our collective efforts at attaining a more diverse workforce in the future. Second, to further encourage transparency and public education, this platform will capture the demographic data provided quarterly by Metro HR, render it in user-friendly charts and graphs, and will track changes in the data over time.

The raw data used on this platform is available to the public and can be found at https://data.nashville.gov/Metro-Government/General-Government-Employees-Demographics/4ibi-mxs4

Feed HR data to brigade open data portal and have a data integrity check there

I think this is an excellent use case to begin playing with our own open data portal.

I downloaded the CSV from data.nashville.gov only to find that the keynames had changed (surprise!) between the first dataset I got and the next. I resolved this temporarily by just editing the header myself, but obviously this is not a process

We need to handle basic ETL issues (type serialization, missing values, key_names). I'd like to be pulling this data from a staging area rather than from CSVs.

Add chart to show temporal changes in demographics

@mshenfield and I discussed this out, it would be best to put this chart on the initial load underneath the text snippet describing the intention of the site.

Should use highcharts and be a line graph of some sort. Even a preliminary with fake data would be progress at this point.

Update backend to handle datasets over time

This is probably just going to be a simple extension of the simple import job we're using to bring in data right now.

Eventually we'll want to figure out how to integrate with Metro's Open Data Portal and perhaps utilize our own Socrata portal as a staging ground for cleaned data. If we can do a JSON request from our own portal we may be able to eliminate rethinkdb as a dependency all together (which is to our advantage as I believe I am the only person who uses it. Shame though, great NoSQL db)

Importing from `ntp.*` fails on deployment, runs locally

For some reason, calling an import statement like from ntp.{module or modules} import {something} fails on the deployment server. However, these same statements run wtihout error on the VM from our Vagrantfile.

Removing all such statements in commit b755eee allowed the build to be deployed on the server.

The server and local versions are both running Python 2.7.6, and a fresh install is done each deployment.

Here are some example stack traces from the server deployment for commit 0d23ae7 where the ntp.* imports have not been removed. Haven't been able to recreate on the local VM running the sudo python {relative path e.g. /vagrant/ntp/}run_server.py from different directories.


Traceback (most recent call last):
File "/opt/inclucivics/ntp/run_server.py", line 8, in
from app import app
File "/opt/inclucivics/ntp/app/init.py", line 7, in
from api import departments, data
File "/opt/inclucivics/ntp/app/api.py", line 3, in
from include.functions import rdb_get_data_by_department, rdb_get_department_names#, rdb_get_temporal_values
File "/opt/inclucivics/ntp/app/include/functions.py", line 1, in
from ntp.data.include.rethinkdb.tables import RdbMostRecent, RdbChiMerged
ImportError: cannot import name RdbMostRecent


ImportError: cannot import name filter_str
Traceback (most recent call last):
File "/opt/inclucivics/ntp/run_server.py", line 2, in
from data.load import table_check
File "/opt/inclucivics/ntp/data/load.py", line 2, in
import sanitize as clean
File "/opt/inclucivics/ntp/data/sanitize.py", line 6, in


Traceback (most recent call last):
File "/opt/inclucivics/ntp/run_server.py", line 2, in
from data.load import table_check
File "/opt/inclucivics/ntp/data/load.py", line 1, in
import aggregate as agg
File "/opt/inclucivics/ntp/data/aggregate.py", line 1, in
from ntp.project.common.helpers import merge_json_like, sortDict
ImportError: cannot import name merge_json_like

Fix graph column alignment

Hey @beck410

I've added the graphs in, but I think you've modded the primary div container so that it only has a single column, but there are two divs of graphs that need to be compared side by side. Could you check the add_graphs branch and change it so that the graphs are aligned left and right?
screenshot 2015-02-22 20 51 41

README Update

Update README to say:

'launch the python webserver available on localhost:8082'

See PR #75

Apologies for pushing to my master branch...

Add other visualization types

The pie chart looks quite bad when your have big ranges of data. Bar charts are more appropriate for this data anyway. Rather than adjust the existing endpoints I just want to add multiple visualization options.

Develop new index

This project is now part of "The Nashville Transparency Project" and needs an index to introduce the ntp and provide a link to the hr reporting app

Add comparison graph

Add data for what census based demographics would look like probably best to calculate that on the back-end and expose through api.

/api/departments return 500 internal server error

The table reference RdbMostRecent, used to pull department data, is defined as None, causing an internal server error when /api/departments is called.

The table reference RdbMostRecent is defined in data.include.rethinkdb.tables.py. This module is imported within the initial run_server.py->load.py->aggregate.py, causing the reference to be defined before relevant tables have been created.

update department list

From Mark:

Need to combine or delete the departments that Jon and I previously discussed.

feature: Import and sanitize data from API

Known problems are mostly associated with type serialization.

Not uncommon to find the salary field with mixed string and floating types.

I.e.

"$37,000.00"
and "37000.00"

Simple answer is to split on "." filter non numeric values, and convert index 0 to int

Cosmetic changes

  • Change pie charts headings from "Actual Demographics" to "Metro Demographics."
  • Remove the income brackets from the "Census Predicted" pie charts
  • Correct the dates on the temporal graphs: Dates on the temporal graphs should be: 2014-August, 2015-January, and 2015-April

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.