View, filter and summarize incident data from the police department.
This tool has been built with Detroit's neighborhood radio patrols in mind, and beta versions have been tested by patrol members who regularly monitor and report on crime statistics in their neighborhoods.
We build this with Mapbox GL, Highcharts, jQuery, and Lodash. Behind the scenes, we use Babel to compile, Browserify and Watchify to bundle, and Uglify to minify our code. Unit testing is handled with Mocha.js, Should.js and Node's assert.
This project assumes three global dependencies: Browserify, Watchify and Uglify
If you don't have them yet, install them:
npm install -g browserify watchify uglify-js
To run tests, you should also install Mocha.js globally:
npm install -g mocha
Clone this project:
git clone https://github.com/CityOfDetroit/crime-viewer.git cd crime-viewer npm install
npm run watch and open
public/index.html in your browser.
This is listening for changes in
src/main.js and will automatically rebuild, so you just need to refresh your browser to see changes.
Or, more conveniently, try:
- Python 3.x:
npm run watch & python -m http.server 9966
- Python 2.x:
npm run watch & python -m SimpleHTTPServer 9966
This will watch & serve the page at
npm run deploy. This pipes
src/main.js through Uglify to minify it, writes to
public/bundle.js, and then publishes the
public/ directory to
npm test. This runs
mocha test plus a Babel compiler and looks for test files in the