block by curran 8838736cfa6f3f960e2c

Crime by Race Dataset

Full Screen

This is a dataset on crime in 2014, subdivided by race and offense. Originally found in table 43 in the FBI Web Site “2014 Crime in the United States”.

This example page provides the basic code required to load the data and display it on the page (as JSON) using D3.js.

Also, here’s a normalized version of this data, with “Race” represented as a single column.

Built with blockbuilder.org

forked from curran‘s block: Mother Jones Gun Violence Dataset

web counter

index.html

<!DOCTYPE html>
<head>
  <meta charset="utf-8">
  <script src="//cdnjs.cloudflare.com/ajax/libs/d3/3.5.9/d3.min.js"></script>
  <script src="//curran.github.io/dsv-dataset/dsv-dataset-v0.2.1.js"></script>
</head>

<body>
  <script>
    
    function render(data){
      d3.select("body")
        .append("pre")
        .text(JSON.stringify(data, null, 2));
    }

    d3.csv("data.csv", function(data){
      d3.json("data.json", function(metadata){
        var dataset = dsvDataset.parse({ data: data,  metadata: metadata });
        render(dataset.data);
      });
    });
    
  </script>
</body>

data.csv

Offense charged,Total,White,"Black or African American","American Indian or Alaska Native",Asian,"Native Hawaiian or Other Pacific Islander"
TOTAL,8730665,6056687,2427683,135599,100067,10629
Murder and nonnegligent manslaughter,8230,3807,4224,83,107,9
Rape,16326,10977,4888,212,222,27
Robbery,74077,31354,41379,616,617,111
Aggravated assault,291600,185612,96511,4372,4507,598
Burglary,186794,126242,56504,1703,1999,346
Larceny-theft,971199,671260,271788,15869,11355,927
Motor vehicle theft,53456,35551,16391,668,677,169
Arson,7298,5338,1709,142,98,11
Violent crime,390233,231750,147002,5283,5453,745
Property crime,1218747,838391,346392,18382,14129,1453
Other assaults,853887,558181,272068,13618,9173,847
Forgery and counterfeiting,44336,28272,15095,279,646,44
Fraud,109576,72424,34853,1116,1124,59
Embezzlement,12678,7851,4518,87,210,12
"Stolen property; buying, receiving, possessing",69912,45816,22538,662,812,84
Vandalism,154755,108531,41723,2761,1556,184
"Weapons; carrying, possessing, etc.",109891,62920,44705,803,1307,156
Prostitution and commercialized vice,37030,19867,15483,199,1434,47
Sex offenses (except rape and prostitution),43125,31279,10462,640,688,56
Drug abuse violations,1216225,837851,353862,10071,12893,1548
Gambling,4363,1560,2568,16,192,27
Offenses against the family and children,79075,50912,26048,1521,574,20
Driving under the influence,863598,722451,112107,12048,15938,1054
Liquor laws,246304,197559,35727,9539,3302,177
Drunkenness,327325,264906,51485,6952,3552,430
Disorderly conduct,338636,213342,114802,7734,2493,265
Vagrancy,21577,14819,6116,443,182,17
All other offenses (except traffic),2546822,1726091,750488,42980,23946,3317
Suspicion,1057,557,472,15,13,0
Curfew and loitering law violations,41513,21357,19169,450,450,87

data.json

{
  "columns":[
    { "name": "Offense charged", "type": "string" },
    { "name": "Total", "type": "number" },
    { "name": "White", "type": "number" },
    { "name": "Black or African American", "type": "number" },
    { "name": "American Indian or Alaska Native", "type": "number" },
    { "name": "Asian", "type": "number" },
    { "name": "Native Hawaiian or Other Pacific Islander", "type": "number" }
  ] 
}