Skip to content

Commit

Permalink
Actualización de datos de 2017
Browse files Browse the repository at this point in the history
  • Loading branch information
picandocodigo committed Apr 9, 2018
1 parent 970812b commit 604508b
Show file tree
Hide file tree
Showing 7 changed files with 952 additions and 5 deletions.
471 changes: 471 additions & 0 deletions data/2017.csv

Large diffs are not rendered by default.

471 changes: 471 additions & 0 deletions data/Datos+Abiertos+2017.csv

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions data/process.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ iconv -f ISO_8859-1 -t UTF-8 Fallecidos_2013.csv > 2013.csv
iconv -f ISO_8859-1 -t UTF-8 Fallecidos_2014.csv > 2014.csv
iconv -f ISO_8859-1 -t UTF-8 Fallecidos_2015.csv > 2015.csv
iconv -f ISO_8859-1 -t UTF-8 Fallecidos_2016.txt | sed 's/\t/";"/g' | sed 's/\"//g' > 2016.csv
iconv -f ISO_8859-1 -t UTF-8 Datos+Abiertos+2017.csv > 2017.csv
1 change: 1 addition & 0 deletions index.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
2014 => DeadPeople.new(2014),
2015 => DeadPeople.new(2015),
2016 => DeadPeople.new(2016),
2017 => DeadPeople.new(2017)
},
current_page: 'data',
title: 'Datos de accidentes de tránsito en bicicleta'
Expand Down
3 changes: 2 additions & 1 deletion lib/dead_people.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ def metadata
2013 => {bike_col: 4, fall_col: 3},
2014 => {bike_col: 5, fall_col: 4},
2015 => {bike_col: 5, fall_col: 4},
2016 => {bike_col: 5, fall_col: 4}
2016 => {bike_col: 5, fall_col: 4},
2017 => {bike_col: 4, fall_col: 3}
}
end
end
8 changes: 5 additions & 3 deletions public/js/data.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,31 +5,33 @@ var total2013 = parseInt($("#2013total").text().trim());
var total2014 = parseInt($("#2014total").text().trim());
var total2015 = parseInt($("#2015total").text().trim());
var total2016 = parseInt($("#2016total").text().trim());
var total2017 = parseInt($("#2017total").text().trim());

var bike2012 = parseInt($("#2012bikes").text().trim());
var bike2013 = parseInt($("#2013bikes").text().trim());
var bike2014 = parseInt($("#2014bikes").text().trim());
var bike2015 = parseInt($("#2015bikes").text().trim());
var bike2016 = parseInt($("#2016bikes").text().trim());
var bike2017 = parseInt($("#2017bikes").text().trim());

var data = {
labels: ["2012", "2013", "2014", "2015", "2016"],
labels: ["2012", "2013", "2014", "2015", "2016", "2017"],
datasets: [
{
label: "Total muertes",
fillColor: "rgba(220,220,220,0.5)",
strokeColor: "rgba(220,220,220,0.8)",
highlightFill: "rgba(220,220,220,0.75)",
highlightStroke: "rgba(220,220,220,1)",
data: [total2012, total2013, total2014, total2015, total2016]
data: [total2012, total2013, total2014, total2015, total2016, total2017]
},
{
label: "Accidentes en bicicleta",
fillColor: "rgba(151,187,205,0.5)",
strokeColor: "rgba(151,187,205,0.8)",
highlightFill: "rgba(151,187,205,0.75)",
highlightStroke: "rgba(151,187,205,1)",
data: [bike2012, bike2013, bike2014, bike2015, bike2016]
data: [bike2012, bike2013, bike2014, bike2015, bike2016, bike2017]
}
]
};
Expand Down
2 changes: 1 addition & 1 deletion views/data.haml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
%a{href: 'http://unasev.gub.uy/inicio/sinatran/informes_siniestralidad_vial_uruguay/'}
http://unasev.gub.uy/inicio/sinatran/informes_siniestralidad_vial_uruguay/

- [2016, 2015, 2014, 2013, 2012].each do |year|
- [2017, 2016, 2015, 2014, 2013, 2012].each do |year|
.row
.col-md-12
= haml :year_data, locals: {data: data[year], year: year}
Expand Down

0 comments on commit 604508b

Please sign in to comment.