Code Monkey home page Code Monkey logo

project-2's Introduction

Project-2 Proposal

Team πŸ‘¨πŸ»β€πŸ’»πŸ‘¨πŸ»β€πŸ’»πŸ‘¨πŸ»β€πŸ’»πŸ‘©πŸ»β€πŸ’»πŸ‘©πŸ»β€πŸ’»

Topic and Rationale πŸŒƒπŸ”ͺπŸ©ΈπŸ“

Topic: Toronto Crime and Demographics

  • As residents of Toronto, we want to gain insights on Toronto safety and crime rates in different neighborhoods.
  • After completion of project 1, we are equipped with more skills that will allow us to further analyze and visualize different type of charts interactively.

Datasets πŸ—ƒ

Viz InspirationπŸ“Š πŸ“ˆ πŸ“‰

map scatter-plot bar-chart

Architecture DiagramπŸ–Š

Diagram

ETL Process

  • Extract: Toronto neighbourhood profiles and crime data were extracted from Toronto Police Open Data and Toronto Open Data - Neighbourhood Profiles using their API.

  • Transform: Using Jupyter Notebook and pandas, we cleaned and reorganized the data according to our needs.

  • Load: Looking at the unpredictable structure of our data from our sources, Mongodb was our database of choice.

Flask

Our Flask app connects to the mongo database and pulls in data, implements further transformation and hosts our API endpoints as follows:

  • /: The root endpoint directs the user to the index.html page which holds the visualization dashboard.

  • /api/v1/raw-data: This endpoint pulls data as is from the mongo database and returns a JSON format that is used by our code logic-map.js to create an interactive map.

  • /api/v1/neighbourhood-summary: This endpoint pulls another collection from the mongo database that holds neighbourhood demographics, used for plotting in logic.js. Before the data is returned in JSON format, some additional transformation is completed to get the data in exactly the way we need it for plotting.

Visualization

Our visualization dashboard consists of the following technologies:

  • HTML/CSS
  • Bootstrap
  • D3.js
  • Plotly.js
  • Leaflet.js

A map of Toronto is created using Leaflet.js/Mapbox, and data from our Flask API endpoint is used to create a marker cluster layer of crime incidents in the city. A Toronto neighbourhoods GeoJson was used to create an additional GeoJson layer to emphasize neighbourhood boundaries.

A toggle bar on the top right also allows the user to turn off neighbourhood boundaries or crime markers, or choose a light map vs. an outdoors map.

Clicking on a crime marker will display a tooltip with details.

Event listeners and Bootstrap aid in an interactive environment where users can click on a neighbourhood and see a Bootstrap modal that displays that particular neighbourhood's plot of top crimes and demographics.

We also used D3.js to generate a Crime vs. Demographics scatter plot that uses D3 transitions and other elements to dynamically display the plot according to the values chosen by the user.

Sources πŸ”—

project-2's People

Contributors

fengwang1991 avatar neha-nayeem avatar olivesun1213 avatar sssaso avatar

Watchers

 avatar  avatar

Forkers

sssaso

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.