-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path2015-17-proposed-budget-flow.html
66 lines (60 loc) · 6.85 KB
/
2015-17-proposed-budget-flow.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<!DOCTYPE html><html><head><meta name="viewport" content="width=device-width"><link rel="stylesheet" href="/css/main.css"><title>Cash Flow: Mayor's 2015-17 Proposed Policy Budget - Open Budget: Oakland</title><script>(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-35908939-3', 'openbudgetoakland.org');
ga('send', 'pageview');
</script><script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script><script src="https://code.jquery.com/jquery-migrate-1.2.1.js"></script><script src="//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.2.0/js/bootstrap.min.js"></script><script src="//cdnjs.cloudflare.com/ajax/libs/d3/3.4.5/d3.min.js"></script></head><body class="undefined"><div id="wrapper"><nav class="main-nav"><div class="navbar navbar-default navbar-fixed-top"><div class="container"><div class="navbar-header"><button type="button" data-toggle="collapse" data-target=".navbar-collapse" class="navbar-toggle"><span class="sr-only">Toggle navigation</span><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span></button><a href="/" class="navbar-brand">Open Budget: Oakland</a></div><div class="navbar-collapse collapse"><ul class="nav navbar-nav navbar-right"><li class="dropdown"><a href="#" data-toggle="dropdown" class="dropdown-toggle">About<b class="caret"></b></a><ul class="dropdown-menu"><li><a href="what-we-do.html">What and How</a></li><li><a href="who-we-are.html">Who We Are</a></li><li><a href="news.html">News</a></li><li><a href="contact.html">Contact Us</a></li></ul></li><li><a href="/budget-visuals.html">Visualizations</a></li><li><a href="http://data.openoakland.org/dataset/city-oakland-budget" target="_blank">Data</a></li><li class="dropdown"><a href="#" data-toggle="dropdown" class="dropdown-toggle">Resources<b class="caret"></b></a><ul class="dropdown-menu"><li><a href="oakland-budget-101.html">Oakland Budget 101</a></li><li><a href="tools-projects.html">Tools and Projects</a></li></ul><li><a href="feedback.html">Feedback</a></li></li></ul></div></div></div></nav><div class="container"> <div class="row"><div class="intro col-md-12"><h2>Cash Flow: Mayor's 2015-17 Proposed Policy Budget</h2><p>This diagram depicts the flow of money through Oakland's budget: from revenue sources (on the left), to the General Fund or various non-discretionary funds (in the center), and finally to the various city departments' expenses (on the right).</p><p> <em>Mouse over a flow line to highlight it; click on a bar to highlight all its flows.</em></p></div></div><div class="row"><div class="col-md-3"><h4>Fiscal Year</h4><select id="fy" class="form-control"></select></div></div><div id="sankey"><div id="chart"></div></div><h6>Data source: <a href="https://data.oaklandnet.com">data.oaklandnet.com</a></h6><h6>Data transformation notes: Revenue rows are aggregated by the second "Account Type" column. Expense rows are aggregated by the "Department" column. Funds are aggregated by the "Funds - Description" column, and all values other than "1010 - General Fund: General Purpose" are grouped under the heading "Non-discretionary funds."</h6><div id="hover_description"></div><section id="comments"><div class="row"><div class="col-md-12"><h4>Comments</h4><div id="disqus_thread"></div></div></div></section></div><script type="text/javascript">var disqus_identifier = "2015-17-proposed-budget-flow";
</script><script type="text/javascript">/* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */
var disqus_shortname = 'openbudgetoakland';
/* * * DON'T EDIT BELOW THIS LINE * * */
(function() {
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
})();</script><noscript>Please enable JavaScript to view the<a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript><script src="js/sankey.js" charset="utf-8"></script><script src="js/flow.js" charset="utf-8"></script><script type="text/javascript">var datafiles = [
{filename: "FY16-17__proposed.csv"},
{filename: "FY15-16__proposed.csv"}
];</script><script>// process filenames to generate display names
datafiles = datafiles.map(function(datafile){
var nameParts = datafile.filename.slice(0,-4).split("__");
datafile.displayName = nameParts.join(" ");
datafile.fy = nameParts[0];
datafile.type = nameParts[1];
return datafile;
});
datafiles.sort(function(a,b){
// years in descending order,
// types in order of (adjusted, adopted, proposed)
// (which happens to be ascending)
var sortYear = d3.descending(a.fy, b.fy);
var sortType = d3.ascending(a.type, b.type);
return sortYear !== 0 ? sortYear : sortType;
});
d3.select("#fy.form-control").selectAll('option')
.data(datafiles)
.enter()
.append('option')
.attr('value', function(d){ return d.filename; })
.property('selected', function(d,i){ return i == 0;})
.text(function(d){return d.displayName;})
;
d3.select("#fy.form-control")
.on('change', drawFlow)
;
// run once to initially populate the chart
drawFlow();
function drawFlow(){
// get currently selected value
var filename = d3.select('#fy.form-control')[0][0].value;
var fy = filename.split('__')[0];
d3.csv("data/flow/" + filename, function(error, data){
if (error) {
console.log('error', error);
return false;
}
var final_data = data_wrangle(data, fy);
do_with_budget(final_data);
});
}</script><div id="wrapper-footer"></div></div><footer id="footer"><div class="container"><div class="row"><div class="col-md-6 col-sm-9"><p>
Open Budget: Oakland is an open-source project by <a href="http://openoakland.org">OpenOakland</a> to help citizens better understand Oakland's spending and budget process.</p><ul class="list-inline"><li><a href="http://openoakland.org"><img src="/images/global/openoakland-logo.png" width="150"></a></li><li><a href="https://twitter.com/openbudgetoak"><img src="/images/global/twitter-icon.png"></a></li><li><a href="https://github.com/openoakland/openbudgetoakland"><img src="/images/global/github-icon.png"></a></li></ul></div><div class="col-sm-3 col-md-push-3"><ul class="list-unstyled"><li><a href="who-we-are.html">About the Project</a></li><li><a href="http://www.meetup.com/OpenOakland">Get Involved</a></li><li><a href="feedback.html">Give Feedback</a></li></ul></div></div></div></footer><link href="https://fonts.googleapis.com/css?family=Arvo:400,700" rel="stylesheet" type="text/css"></body></html>