This is a dataset on gun violence.
Originally published in US Mass Shootings, 1982-2015: Data From Mother Jones’ Investigation. Downloaded in CSV format from https://github.com/hepplerj/gun-violence/blob/master/data/motherjones.csv. Column types were manually annotated in data.json
for use with the automatic type parsing library dsv-dataset
This example page provides the basic code required to load the data and display it on the page (as JSON) using D3.js.
Built with blockbuilder.org
forked from curran‘s block: The Iris Dataset
<!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>
{
"columns":[
{ "name": "Case", "type": "string" },
{ "name": "Location", "type": "string" },
{ "name": "Date", "type": "date", "format": "%m/%d/%y" },
{ "name": "Year", "type": "date", "format": "%Y" },
{ "name": "Summary", "type": "string" },
{ "name": "Fatalities", "type": "number" },
{ "name": "Injured", "type": "number" },
{ "name": "Total victims", "type": "number" },
{ "name": "Venue", "type": "string" },
{ "name": "Prior signs of possible mental illness", "type": "string" },
{ "name": "Mental Health", "type": "string" },
{ "name": "Weapons obtained legally", "type": "string" }, { "name": "Where obtained", "type": "string" },
{ "name": "Type of weapons", "type": "string" },
{ "name": "Weapon details", "type": "string" },
{ "name": "Race", "type": "string" }, { "name": "Gender", "type": "string" },
{ "name": "Sources", "type": "string" },
{ "name": "Mental Health Sources", "type": "string" },
{ "name": "latitude", "type": "number", "geo": "latitude" },
{ "name": "longitude", "type": "number", "geo": "longitude" },
{ "name": "Type", "type": "string" }
]
}