Skip to content
This repository has been archived by the owner on Jan 11, 2020. It is now read-only.

Commit

Permalink
Merge pull request #79 from okfde/78-transparency
Browse files Browse the repository at this point in the history
Transparenz Waffenexporte
  • Loading branch information
milafrerichs committed Dec 9, 2014
2 parents cb2a66a + 985a470 commit 6d98a01
Show file tree
Hide file tree
Showing 6 changed files with 78 additions and 14 deletions.
20 changes: 20 additions & 0 deletions source/data/security/transparenz/saferworld.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
"Country","Information on report publication","Information on policy","Information on licence applications","Information on export licences ","Information on brokering licences ","Information on transit licences ","Information on licence denials, revocations, suspensions and extensions","Information on export deliveries ","Information on enforcement ","Information on activities which have an impact of arms' proliferation ","Average"
"Austria","0","0","0","4","0","0","0","4","0","0","1"
"Belgium","40","67"," 0","76"," 0","18","57"," 0"," 0"," 0","26"
"Czech Republic","100"," 92"," 50"," 58"," 50"," 23"," 24"," 83"," 86"," 29"," 59"
"Denmark"," 0","83"," 0","73"," 0"," 5","43"," 0"," 0"," 0","20"
"Finland","100"," 75"," 0"," 69"," 0"," 0"," 0"," 91"," 0"," 0"," 34"
"France","40","83"," 0","65"," 0"," 0","32"," 4","14","29","27"
"Germany ","100"," 92"," 50"," 89"," 71"," 0"," 65"," 43"," 0"," 29"," 54"
"Greece","0","0","0","0","0","0","0","0","0","0","0"
"Hungary","40","92"," 0","18"," 5"," 0"," 0","22","14"," 0","19"
"Ireland"," 0","92","17","65"," 0"," 0"," 3"," 0","71"," 0","25"
"Italy"," 40","100"," 0"," 64"," 0"," 5"," 3"," 17"," 14"," 14"," 26"
"Luxembourg","0","0","0","0","0","0","0","0","0","0","0"
"Netherlands","40","92"," 0","47"," 0","48","59"," 0"," 0","14","30"
"Poland","40","83"," 0","56","40"," 0","16"," 9"," 0","14","26"
"Portugal","40","83"," 0","36"," 5"," 5"," 0","43","14"," 0","23"
"Slovakia","100"," 75"," 0"," 51"," 0"," 0"," 3"," 26"," 14"," 0"," 27"
"Spain","100"," 92"," 33"," 69"," 0"," 9"," 51"," 91","100"," 86"," 63"
"Sweden","100","100"," 17"," 55"," 17"," 55"," 16"," 30"," 86"," 57"," 53"
"UK"," 40","100"," 17"," 67"," 38"," 0"," 35"," 0","100"," 43"," 44"
37 changes: 24 additions & 13 deletions source/javascripts/components/barchart.coffee
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
class @Barchart extends @D3Graph
constructor: (@data, @options = {}) ->
@options = _.defaults(@options, { width: 800, height: 200, margin: {top: 40, right: 30, bottom: 120, left: 40}, ticks: { y: 5, x: 4 }, rotate: { x: true, y: false } })
@options = _.defaults(@options, { width: 800, height: 200, margin: {top: 40, right: 30, bottom: 120, left: 40}, ticks: { y: 5, x: 4 }, rotate: { x: false, y: false }, showExtent: false })
@extentClass = "extent"

createYAxis: ->
@svgSelection.append("g")
Expand All @@ -14,30 +15,40 @@ class @Barchart extends @D3Graph
setGroupKey: (key='group') ->
@groupKey = key

showExtent: ->
@countries.append('rect')
.attr('y',0).attr('width', @xScale.rangeBand())
.attr('height', @options.height)
.attr('class', @extentClass)

rotateLabels: (axis) ->
@svgSelection.select("g.#{axis}.axis")
.selectAll("text")
.attr("y", 0)
.attr("x", 9)
.attr("dy", ".30em")
.attr("transform", "rotate(90)")
.style("text-anchor", "start")

draw: (data) ->
countries = @svgSelection.selectAll('g.countries').data(@data)
countries
@countries = @svgSelection.selectAll('g.countries').data(@data)
@countries
.enter()
.append('g')
.attr('class', (d) => "countries #{d[@groupKey]}")
.attr('transform', (d) => "translate(#{@xScale(d[@groupKey])},0)")

values = countries.append('rect')
if @options.showExtent
@showExtent()
values = @countries.append('rect')
values
.attr('y', (d) => @yScale(d[@valueKey]))
.attr('width', @xScale.rangeBand())
.attr('height', (d,i) => @options.height - @yScale(d[@valueKey]))
countries.append('text')
@countries.append('text')
.text((d) => d[@valueKey])
.attr('y', (d) => @yScale(d[@valueKey]) - 10)
.attr('x', @xScale.rangeBand()/2)
.attr('text-anchor', 'middle')
.attr('class', 'label')
if @options.rotate.x
@svgSelection.select('g.x.axis')
.selectAll("text")
.attr("y", 0)
.attr("x", 9)
.attr("dy", ".30em")
.attr("transform", "rotate(90)")
.style("text-anchor", "start")
@rotateLabels("x")
13 changes: 13 additions & 0 deletions source/javascripts/transparenz.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
$ ->
if $('#transparenz .saferworld').length > 0
saferworldPath = "#{rootPath}/data/security/transparenz/saferworld.csv"
d3.csv saferworldPath, (data) ->
options = { showExtent: true, rotate: { x: true } }
saferworldChart = new @Barchart(data, options)
_.map(data, (d) -> d.Average = parseInt(d.Average))
data = _.sortBy(data, (d) -> d.Average)
saferworldChart.setXDomain(data.map((d) -> d.Country))
saferworldChart.setYDomain([d3.min(data, (d) -> d.Average),100])
saferworldChart.setValueKey('Average')
saferworldChart.setGroupKey('Country')
saferworldChart.render('.saferworld')
2 changes: 1 addition & 1 deletion source/sicherheit/index.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ block: "sicherheit"
= link_to "/sicherheit/friedensfoerderung/index.html" do
%h5 Zivile Friedensförderung
%li
%a
= link_to "/sicherheit/transparenz/index.html" do
%h5 Transparenz des Waffenexports
.cdi
#cdi-index
Expand Down
18 changes: 18 additions & 0 deletions source/sicherheit/transparenz/index.html.haml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
title: Entwicklungsbarometer - Transparenz
---
#sicherheit.indikator.sub-indikator
= link_to "/sicherheit/index.html" do
%h1.sicherheit Sicherheit
#transparenz
.navbar
%ul.nav
%li.active
%h4 Transparenz des Waffenexports
.saferworld.barchart

%h2 Transparenz des Waffenexports
.explanation
%p Waffenexporte sind ein kontroverses Thema, vor allem wenn es darum geht, Waffen in nicht-demokratische Staaten zu liefern. Nicht umsonst müssen alle Waffenexporte vom Bundeswirtschaftsministerium explizit genehmigt werden. Eine Debatte darüber, wann, welche Waffen an wen geliefert werden ist daher wichtig für eine entwicklungsfreundliche Sicherheitspolitik.
.explanation
%p Die Daten für diesen Indikator stammen von der britischen NGO Saferworld. Saferworld sammelt für alle EU Länder qualitative Informationen zu etwa 170 Details im Hinblick auf die Transparenz des Waffenhandels. Für das Entwicklungsbarometer wurde lediglich die Daten für Waffenexport berücksichtigt. Informationen zu Waffenimporten eines EU Landes wurden nicht genutzt. In Konsultation mit Saferworld wurden eine Auswahl von 98 Unterindikatoren in insgesamt 10 Informationskategorien getroffen und gewichtet. Die hier angegebenen Daten stellen dar, zu welchem Grad ein Land diese Transparenzkriterien erfüllt.
2 changes: 2 additions & 0 deletions source/stylesheets/pages/_sicherheit.sass
Original file line number Diff line number Diff line change
Expand Up @@ -82,3 +82,5 @@ section#panzer
fill: $light-blue
.label
font-size: 0.6em
rect.extent
fill: #f3f3f3

0 comments on commit 6d98a01

Please sign in to comment.