[ Launch: Honolulu Budget 2-int ] beff297b93ad870e5419 by axelson
[ Launch: Honolulu Budget 2-int ] 627266396397bad65ace by axelson
[ Launch: Honolulu Budget 2 ] 393c6689f7606a0c99f0 by bentut
[ Launch: D3 Basics ] 8e0e8350a766a79d97fa by axelson
[ Launch: Jason Test ] 8da7744ab1eb9456929f by axelson
[ Launch: test ] 4653053 by enjalot
[ Launch: test ] 4652017 by enjalot
[ Launch: test ] 4582399 by enjalot
-
-
Save axelson/beff297b93ad870e5419 to your computer and use it in GitHub Desktop.
Honolulu Budget 3-int
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Department Name | FY 2011 Actual | Object Code Name | |
---|---|---|---|
Budget and Fiscal Services | 4064 | Holiday Overtime Pay | |
Budget and Fiscal Services | 312285 | Non-Holiday Overtime Pay | |
Budget and Fiscal Services | 13653147 | Regular Pay | |
Corporation Counsel | 250 | Non-Holiday Overtime Pay | |
Corporation Counsel | 4931218 | Regular Pay | |
Customer Services | 2660 | Holiday Overtime Pay | |
Customer Services | 55830 | Non-Holiday Overtime Pay | |
Customer Services | 9753807 | Regular Pay | |
Community Services | -1 | Holiday Overtime Pay | |
Community Services | 59636 | Non-Holiday Overtime Pay | |
Community Services | 7090938 | Regular Pay | |
Design and Construction | 86768 | Non-Holiday Overtime Pay | |
Design and Construction | 4231 | Holiday Overtime Pay | |
Design and Construction | 9456549 | Regular Pay | |
Emergency Management | 1101 | Holiday Overtime Pay | |
Emergency Management | 505282 | Regular Pay | |
Emergency Management | 58495 | Non-Holiday Overtime Pay | |
Enterprise Services | 245313 | Holiday Overtime Pay | |
Enterprise Services | 8655365 | Regular Pay | |
Enterprise Services | 400026 | Non-Holiday Overtime Pay | |
Facility Maintenance | 19142508 | Regular Pay | |
Facility Maintenance | 162292 | Holiday Overtime Pay | |
Facility Maintenance | 1423334 | Non-Holiday Overtime Pay | |
Human Resources | 0 | Holiday Overtime Pay | |
Human Resources | 4211042 | Regular Pay | |
Human Resources | 37457 | Non-Holiday Overtime Pay | |
Information Technology | 37088 | Holiday Overtime Pay | |
Information Technology | 6959343 | Regular Pay | |
Information Technology | 163713 | Non-Holiday Overtime Pay | |
Planning and Permitting | 12873542 | Regular Pay | |
Planning and Permitting | 59777 | Non-Holiday Overtime Pay | |
Parks and Recreation | 300606 | Holiday Overtime Pay | |
Parks and Recreation | 27100762 | Regular Pay | |
Parks and Recreation | 591983 | Non-Holiday Overtime Pay | |
Transportation Services | 0 | Holiday Overtime Pay | |
Transportation Services | 4628038 | Regular Pay | |
Transportation Services | 222738 | Non-Holiday Overtime Pay | |
Environmental Services | 9054505 | Non-Holiday Overtime Pay | |
Environmental Services | 36882190 | Regular Pay | |
Environmental Services | 1341547 | Holiday Overtime Pay | |
Emergency Services | 17958290 | Regular Pay | |
Emergency Services | 563386 | Holiday Overtime Pay | |
Emergency Services | 4897125 | Non-Holiday Overtime Pay | |
Fire | 4638020 | Holiday Overtime Pay | |
Fire | 67427324 | Regular Pay | |
Fire | 6689604 | Non-Holiday Overtime Pay | |
Police | 159931266 | Regular Pay | |
Police | 15120019 | Non-Holiday Overtime Pay | |
Police | 5645372 | Holiday Overtime Pay | |
Mayor | 384505 | Regular Pay | |
Mayor | 0 | Non-Holiday Overtime Pay | |
Managing Director | 2387 | Non-Holiday Overtime Pay | |
Managing Director | 1388729 | Regular Pay | |
Medical Examiner | 17741 | Holiday Overtime Pay | |
Medical Examiner | 734738 | Regular Pay | |
Medical Examiner | 31180 | Non-Holiday Overtime Pay | |
Neighborhood Commission | 570565 | Regular Pay | |
Neighborhood Commission | 152 | Non-Holiday Overtime Pay | |
Prosecuting Attorney | 12913827 | Regular Pay | |
Prosecuting Attorney | 260 | Holiday Overtime Pay | |
Prosecuting Attorney | 10360 | Non-Holiday Overtime Pay | |
Royal Hawaiian Band | 44258 | Non-Holiday Overtime Pay | |
Royal Hawaiian Band | 1514864 | Regular Pay |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"description":"Honolulu Budget 3-int","endpoint":"","display":"svg","public":true,"require":[{"name":"d3","url":"http://d3js.org/d3.v3.min.js"}],"fileconfigs":{"inlet.js":{"default":true,"vim":false,"emacs":false,"fontSize":12},"_.md":{"default":true,"vim":false,"emacs":false,"fontSize":12},"config.json":{"default":true,"vim":false,"emacs":false,"fontSize":12},"budget.csv":{"default":true,"vim":false,"emacs":false,"fontSize":12}},"play":false,"loop":false,"restart":false,"autoinit":true,"pause":true,"loop_type":"period","bv":false,"nclones":15,"clone_opacity":0.4,"duration":3000,"ease":"linear","dt":0.01,"tab":"edit","display_percent":0.7,"thumbnail":"http://i.imgur.com/PtOHeTu.png","fullscreen":false,"ajax-caching":true} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var data = tributary.budget; | |
console.log("start"); | |
tributary.trace = true; | |
data.forEach(function(d) { | |
d['FY 2011 Actual'] = parseInt(d['FY 2011 Actual'], 10); | |
}); | |
var margin = {top: 23, right: 20, bottom: 123, left: 74}, | |
width = 1178 - margin.left - margin.right, | |
height = 702 - margin.top - margin.bottom; | |
var x = d3.scale.linear().range([ 0, height]) | |
var y = d3.scale.linear().range([height, 0]); | |
var color = d3.scale.ordinal() | |
.range(["#98abc5", "#8a89a6", "#7b6888", "#6b486b", "#a05d56", "#d0743c", "#ff8c00"]); | |
var xAxis = d3.svg.axis() | |
.scale(x) | |
.orient("bottom") | |
.tickFormat(d3.format("$.2s")); | |
var yAxis = d3.svg.axis() | |
.scale(y) | |
.orient("left") | |
.tickFormat(d3.format("$.2s")); | |
var svg = d3.select("svg") | |
.attr("width", width + margin.left + margin.right) | |
.attr("height", height + margin.top + margin.bottom) | |
.append("g") | |
.attr("transform", "translate(" + margin.left + "," + margin.top + ")"); | |
function get_division(d) { return d['Department Name']; } | |
var divisions = d3.nest() | |
.key(get_division) | |
.rollup(function(leaves) { | |
var overtime = leaves.filter(function(d) { return d['Object Code Name'] !== "Regular Pay"; }); | |
var regular = leaves.filter(function(d) { return d['Object Code Name'] == "Regular Pay"; }); | |
var overtime_sum = d3.sum(overtime, function(d) { return d['FY 2011 Actual']; }); | |
var regular_sum = d3.sum(regular, function(d) { return d['FY 2011 Actual']; }); | |
return {regular: regular_sum, | |
overtime: overtime_sum | |
} | |
}) | |
.entries(data); | |
var max_y_val = d3.max(divisions, function(d) { | |
return d.values.regular; | |
}); | |
var max_x_val = d3.max(divisions, function(d) { | |
return d.values.overtime; | |
}); | |
y.domain([0, max_y_val]); | |
x.domain([0, max_x_val]); | |
var x_axis_svg = svg.append("g") | |
.attr("class", "x axis") | |
.attr("transform", "translate(0," + height + ")") | |
.call(xAxis) | |
x_axis_svg | |
// Rotate x-axis label | |
.selectAll("text") | |
.style("text-anchor", "start") | |
.attr("dx", ".8em") | |
.attr("dy", ".15em") | |
.attr("transform", "rotate(65)"); | |
x_axis_svg | |
.append("text") | |
.attr("x",height) | |
.attr("text-anchor","end") | |
.attr("dy", -10) | |
.text("Overtime Pay") | |
svg.append("g") | |
.attr("class", "y axis") | |
.call(yAxis) | |
.append("text") | |
.attr("transform", "rotate(-90)") | |
.attr("y", 6) | |
.attr("dy", ".71em") | |
.style("text-anchor", "end") | |
.text("Pay"); | |
svg.selectAll("path").attr("fill","none").attr("stroke","#CCC") | |
svg.selectAll("line").attr("fill","none").attr("stroke","#CCC") | |
svg.selectAll("text").attr("fill","#828282") | |
svg.append("text").attr("class", "readout").attr("x", 200).attr("y",50) | |
var division = svg.selectAll(".division") | |
.data(divisions) | |
.enter().append("g") | |
.attr("class", "g") | |
division.append("circle") | |
.attr("r",11.04) | |
.attr("fill-opacity", 0.3) | |
.on("mouseover", function(d) { | |
console.log(d) | |
d3.select(this).attr("fill","red") | |
d3.select("text.readout").text(d.key) | |
}) | |
.on("mouseout", function(d) { | |
d3.select(this).attr("fill","black") | |
d3.select("text.readout").text("") | |
}) | |
.attr("cx", function(d) {return x(d.values.overtime)}) | |
.attr("cy", function(d) {return y(d.values.regular)}) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment