Code Monkey home page Code Monkey logo

data-vis-final's Introduction

data-vis-final

Overview

The primary goal of this visualizaiton is to find patterns and trends of crash fatalities. Using this visualization you can see multiple aspects of the National Highways Data in an easy to see and understand way.

When first visited, the site displays a heatmap of the United States with the number of fatalities for a given year. The hue of the state shows the relative number of fatal crashes for that state. Obviously, the states with a larger population have more fatal accidents than states with lower population. When a state is selected, the location of each fatality is displayed. Population centers and major highways are made easily visible due to the plotted points. While the US map shows the location and density of fatal accidents, the treemap shows trends for time of the year (month, day, and hour) and the parallel set displays their causes (weather, drunk driving, etc)

Code Analysis

TreeMap Class-

The treemap class utilizes two D3 libraries, d3.nest and d3.treemap. The first library gets the data into a nested structure that the treemap library can then read from and have a sense of hierarchy.

Map Class-

The map class utilizes d3.geoAlbersUsa for the map projection. We also found an example of drawing a similar map at https://bl.ocks.org/adamjanes this was adapted to work for our needs.

Parallel Sets Class-

The parellel sets class uses the library d3.parsets. It was not originally written for d3 v5 so some tweaking was involved to comply with that version of d3. It is the same library used for the Titanic visualization found here.

ToolTip Class-

We came across most of the code for a tool tip in a git repo. We were then able to modify it for our needs.

Links

Two And A Half Beards Web Site
Screen Cast

data-vis-final's People

Contributors

bradybod avatar palexander21 avatar zcjhnsn avatar

Watchers

John Edwards avatar  avatar  avatar

Forkers

bradybod

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.