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
xxxxxxxxxx
<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>
https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.9/d3.min.js
https://curran.github.io/dsv-dataset/dsv-dataset-v0.2.1.js