Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
US Budget Visualization Using d3 (solomonkahn.com)
67 points by sethbannon on Sept 9, 2013 | hide | past | favorite | 52 comments


Why does it resort and regrow all the blocks when you switch between years or other settings? If the same blocks simply grew or shrunk, it would be a lot easier to follow the difference.

Actually, it sometimes simply converts blocks into others - switching between 2012 and 2013, the "Justice" block morphs into the "National Infrastructure Bank" block. Very confusing.


I agree with you, maybe this could help the author: http://bost.ocks.org/mike/constancy/


this is cool, will check it out tonight


I came here to say the same thing. Having one section morph into another is unnecessarily confusing, and mostly masks the entire point. Also, it would be nice to slice this data across time as well, by clicking on a particular box and viewing a plot below the main visualization.


yes! this is how it already works! if you click a box, it will show you a graph of how that item has changed over time. If you double click, it will create a new treemap made up of the underlying data for that box.


I don't think that's all that wrong since you are moving from one budget to another, but what confuses me is that the animations are not consistent. Although they seem to be fixed to the specific display state it's inconsistent. But I do like the replacing effect of the transitions to not simply change the labels and numbers which is not easily noticed.


this is because some blocks are added and removed from year to year. In this type of visualization, it's impossible to keep things the same size and position while also changing the amounts.

The best way to use this isn't to switch between years. If you click on any cell, you can see a graph of how that changes over time. If you double click on any of the cells, you can see a new visualization of everything that makes up that cell. For example, double clicking on the department of justice will show you it is made up of X billion from the department of prisons and X billion from the FBI.


It's definitely not because some blocks are added and removed. Click on the same year twice and the blocks animate all over the place. The animations are worse than useless -- they actually hinder the ability to compare two years.


No I think what he meant is why the "Defense--Military Programs" is not the same rectangle (with changing size/pos) between budgets.


maybe a Google Motion Chart like the Hans Rosling charts would be an interesting visualization to solve for that effect. https://developers.google.com/chart/interactive/docs/gallery...


This is not a very good visualization.

It makes it impossible to compare values in any meaningful sense - either in a relative growth, or the size of the budget as a whole. The animation serves no purpose, other than to make the user wait a few seconds between switching years.


The animation here is worse than useless, it's confusing. Better if it just flashed instantly from one view to the next without things flying about everywhere.

Edit: That said, to say something nice, the animation is technically done very well.


I took a stab at rewriting your comment so that it still got the point across but lost some of the tone that I felt was overly rude.

---------

This visualization, while technically impressive, could use a little work.

Comparing values is difficult because I can't see the relative growth between the boxes from year to year, or size of the budget as a whole. I don't quite see how the animation benefits the user, so you may want to scrap it for some sort of differential comparison. I also don't like the delay when I change from year to year. That could be optimized or reduced through the reduction of the animation time.

---------

Yeah, I know it's kind of snarky of me to correct your entire comment here, but I think our community (yeah I know I haven't had my account here long) is overly focused on criticizing. While all the content of your comment was awesome, it could have been stated in a more polite manner.

I'm not sure how to fix the attitude that crops up in developer communities, all I can think to do is point it out when people may be coming off in way they don't mean to. Which is probably the root cause for this https://news.ycombinator.com/item?id=6353957


My intent was to be terse, not rude, and to give actionable feedback - not hidden in language and subtext. And anyway, language is supposed to have edge! I didn't want to say "this is sort of kind of less than optimal." I wanted to say "This is not good! You can do better! Here is how it can be improved!". If everyone just thought "meh" and said "well, that's pretty good. A+ for effort" - or worse, said nothing - people wouldn't improve. Non-actionable positive feedback is as harmful as non-actionable negative feedback.

Your correction (which I don't mind in and of itself) adds complexity and obscures the meaning of my statements. It says in 85 words what I said more clearly (and sharply) in 51. You add a white lie - "technically impressive" - to mask the true meaning of the point that is being made. And the tone is changed to reads as though you're talking to a child.

And - would a person whose second or third language was English more clearly understand your version or mine?

I agree that the community can be overly critical, but I don't think that this sort of criticism is the problem. The kind of criticism that is a problem is non-actionable criticism - insults to the person, or just "X already did this" or "nobody wants this".

I want terse, actionable feedback.

Also - "yeah I know I haven't had my account here long" are defense mechanisms, don't use them. You're a member of the community now, you get a voice like everyone else.


I agree that not everyone deserves a gold star but I tend to try the carrot over the stick in most instances. I do beat around the bush more than I should, and that's something I personally need to work on.

I realize that a lot of times terse can be better, and you modified your own comment better than I ever could. >"You can do better! Here is how it can be improved!"

That little bit of encouragement could be the support that changes the recipients reaction from "F-U man you don't know me" to "Wow, thanks for that criticism, I'll get on that." And you've only added 11 words.

High ranking HN comments tend to be negative, which leads me to feel like HN is not very supportive. This isn't the only metric, but having a good ratio of positive to negative feedback (assuming everything is equally actionable) is important. http://blogs.hbr.org/cs/2013/03/the_ideal_praise-to-criticis...

>Also - "yeah I know I haven't had my account here long" are defense mechanisms, don't use them. You're a member of the community now, you get a voice like everyone else. Thank you, https://news.ycombinator.com/item?id=5636314 this kind of thing has made me hesitant to use terms like "our community".


Please. Political Correctness does no one any good.


not sure if you saw that you could click for a graph or double click to see a new treemap of any department. This visualization is built for people to explore what's in each of the departments, not really to compare departments with each other.

For example, you can see that in 2012 that 2.89% of the budget went to education, but if you double click, you can see that only 13.73% of that went to elementary and secondary education.

You can also single click anywhere and see a graph of how things have changed over time. So you can see that in 2009 there was a huge spike in elementary and secondary education, and you can go to 2009 to further investigate, and find there was a "State Fiscal Stabilization Fund" in 2009 that sent $14 billion to education, and then went away.

I think another visualization comparing departments would be pretty cool, and might build that one next.


Author here! There seems to be some confusion about this visualization, but we can solve it with just two words: Start Clicking!

The thing that makes this visualization different than other visualizations is that you can see the individual components of what makes up the large departments. Just double click on any of the boxes. If you single click on any box, you can see how that box changed over time.

So, for example, you can see that in 2012 that 2.89% of the budget went to education, but if you double click, you can see that only 13.73% of that went to elementary and secondary education.

You can also single click anywhere and see a graph of how things have changed over time. So you can see that in 2009 there was a huge spike in elementary and secondary education, and you can go to 2009 to further investigate, and find there was a "State Fiscal Stabilization Fund" in 2009 that sent $14 billion to education, and then went away.

As many have noted, this doesn't do a good job at comparing different departments to each other over time. This isn't a surprise, since a treemap is the completely wrong format to be able to do that. However, it is a very good format for exploring what agencies, bureaus and line items make up the large departments, which is data I've never seen anywhere else before, and why I built this visualization.


NYT has a 2013 budget proposal visualization in d3, made I believe by Mike Bostock himself: http://www.nytimes.com/interactive/2012/02/13/us/politics/20...


It says "By Shan Carter" on the webpage.


Ah, missed that.


Failed to load resource http://solomonkahn.com/us_budget/public/facebox.js

Uncaught TypeError: Cannot read property 'settings' of undefined

Chrome/Linux


are you on the latest version of chrome?


Does this include discretionary spending? I feel like that's pretty essential to understanding exactly what's going on... Mil-spending would look a lot more massive, I believe.


Basically everything beyond Social Security and Medicare/Medicaid is discretionary spending. If you get rid of those, then yes, military spending looks huge as a share of discretionary spending.

There are dozens of sites breaking down the spending (this is just another attempt at visualizing the data). A quick search led me to http://nationalpriorities.org/budget-basics/federal-budget-1... where you can find discretionary spending separated out on its own.


Well, if you mean [some people] get together and figure out what to do spend money on and call it "the budget." Yes, I guess so.

But I mean, my understanding is that there is un-allotted money the government is willing to spend, beyond whatever budget they approve. My understanding was that, in particular, the military budget increases dramatically under these mechanisms.

Also - Social Security should also be separate, really, it's a trust fund with a very specific money - if we turned Social Security off tomorrow, it isn't like the money collected could go elsewhere. Money collected into that fund & being spent into that fund should not be able to be reallocated elsewhere.


It's pretty shocking how much more expensive Federal unemployment benefits have been for this most recent recession, assuming that's what's responsible for the massive spike in the Department of Labor's budget.

Compare with the 2001-2002 tech bust, for example.


The bubble destroyed US employment, and there has been very little improvement from the lowest percentage reached of prime aged workers that are employed:

http://stateofworkingamerica.org/charts/drop-in-employment-d...

I assume that as unemployment benefits drop, these people will begin to move into homelessness.


if you double click on the department of labor, you can see what makes up the spike!


Please correct me, but there seems to be something wrong. Look at the 2013 budget, "Per Capita", and "Inflation Adjusted". Those numbers should essentially be the same as "Plain Dollars", which is multiples larger.


The base year for inflation is 1976, so the multiple is because a dollar in 1976 is worth multiples of a dollar in 2013.


OK, that explains things now. But I don't think that's the best default display, especially since it is not explained anywhere. I don't recall any examples where the base inflation year is the past by default.

It's great to allow users to adjust the base year in case they want to, e.g., for purposes of inform how past past dollars relate to today's circumstances (e.g. Neil Cavuto expressing how he worked for $2 an hour when he was younger and loved it and so can we), but 1976 being the base year is not very productive, it's a floating reference that loses relevance as a default.


So basically since 1976, the US is only on the positive side of the budget for 4 years (1998-2001). For all other (34) years, there has been a deficit. Yicks. If the US was a person, that person would be considered a financial disaster.


Lucky for us then, that the US is not a person.

Unlucky for us, it's even harder to determine a healthy budget than looking at income vs. outlays. E.g. if the money supply grows faster than the national debt then even a small but constant deficit may still be an entirely healthy thing.


The important thing is that Treasury category. It shows how much of the budget is going to debt service payments. It was almost 1/4 of the budget in 1995, but came back down.


That's like comparing an aircraft carrier to a rubber ducky. Budgeting for a country of 300 million bears no resemblance to household budgeting. The priorities and general principles are completely different.


This visualized well enough the difference in sectors for the same year but not the difference between years. Might be nice that selecting one section will show a line graph indicating the change over the years for that sector.


this is exactly how the visualization works! If you click on any cell, it shows you how that has changed over time. If you double click, you can see more details about whatever you clicked on.

For example, if you double click on the department of Justice, you can see it is made up of X billion of the FBI, X billion of the department of prisons, etc...


I totally missed that I am truly sorry! well done!


Actually, the US budget is not at all inaccessible ... this is one in among thousands of budget visualizations that are done every year for all sorts of publications. It is nice, doesn't need the hype.


"hype"? Your bar for exaggeration is quite a bit lower than mine, which is impressive in and of itself. I thought we are just looking at it, constructively critiquing it, and supporting the effort, discovering any possible innovative or unique aspects, and informing people. But I guess some might see hype there instead.


Are there any other ones that let you explore what makes up the agencies and departments? I was looking but couldn't find any that let you explore beyond the high level amounts.


The color profile on this chart makes it really hard to process... http://grab.by/q7ja It may be the text also and the choice of shapes.


that being said. I still enjoyed the insight.


You can almost see Gingrich's "Contract with America" happening in 1994-1996 as debt payments ballooned to almost a quarter of the budget.


This is nice, but it would be useful to have a display mode that graphs categories' change in their fraction of overall expenditure over time.


Why is there a Railroad Retirement Board in the US budget? Shouldn't that somehow be combined with Social Security?


Read up on the history of the railroad sector. It's corrupt, it's nasty, it's disgusting, and it's depressing.


Nice! I think the inflation adjusted graphs should be the default though.


Health and Human Services - 921.61B USD, important and interesting.


HHS spending is almost entirely spending for Medicare and Medicaid Services (see http://en.wikipedia.org/wiki/United_States_Department_of_Hea...)


you can use the visualization to see exactly what makes up the health and human services budget item, by double clicking on it. Then you can also see the individual programs that make up medicare and medicaid.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: