Skip to content

Instantly share code, notes, and snippets.

@smckissock
Last active November 7, 2015 14:09
Show Gist options
  • Save smckissock/766132353b2d39abc26c to your computer and use it in GitHub Desktop.
Save smckissock/766132353b2d39abc26c to your computer and use it in GitHub Desktop.
USG Outlays Test
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Week 2</title>
<script type="text/javascript" src="http://d3js.org/d3.v3.js"></script>
</head>
<body>
<svg width="800" height="400">
<g>
<text x="20" y="40" font-family="Helvetica" font-size="40" fill="blue">USG Outlays 1962-2020</text>
<rect x="20" y="100" width="30" height="180" fill="blue"></rect>
<rect x="60" y="80" width="30" height="200" fill="green"></rect>
<rect x="100" y="60" width="30" height="220" fill="red"></rect>
<rect x="140" y="120" width="30" height="160" fill="yellow"></rect>
<rect x="180" y="160" width="30" height="120" fill="purple"></rect>
</g>
</svg>
<script type="text/javascript">
//Load in contents of CSV file
d3.csv("OutlaysByAgency1962_2020.csv", function (data) {
//Now CSV contents have been transformed into
//an array of JSON objects.
//Log 'data' to the console, for verification.
console.log(data);
});
</script>
</body>
</html>
Department or other unit 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 TQ 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 estimate 2016 estimate 2017 estimate 2018 estimate 2019 estimate 2020 estimate
Legislative Branch 196 192 199 212 234 252 269 289 353 395 499 553 638 739 788 226 990 1,064 1,099 1,224 1,214 1,367 1,437 1,577 1,607 1,662 1,810 1,848 2,216 2,231 2,245 2,629 2,394 2,537 2,609 2,263 2,348 2,572 2,592 2,871 2,959 3,187 3,396 3,890 3,984 4,101 4,294 4,408 4,704 5,839 4,582 4,440 4,316 4,164 4,899 4,794 4,969 5,007 5,065 5,113
Judicial Branch 57 62 66 75 80 88 94 110 133 145 173 188 207 284 325 85 393 437 481 567 641 710 787 866 966 1,071 1,180 1,342 1,499 1,646 1,997 2,308 2,628 2,677 2,903 3,059 3,259 3,459 3,789 4,057 4,381 4,828 5,127 5,389 5,547 5,823 6,006 6,347 6,645 7,181 7,296 7,227 7,063 6,893 7,567 7,724 7,852 8,012 8,135 8,225
Department of Agriculture 6,437 7,414 7,569 6,940 5,633 5,952 7,430 8,446 8,412 8,673 11,021 10,167 10,302 15,518 17,682 5,009 23,287 30,179 31,698 34,721 41,541 45,623 52,317 41,928 55,435 58,599 49,507 43,930 48,256 45,858 53,990 56,320 63,019 60,615 56,550 54,218 52,393 53,800 62,690 75,071 68,071 68,622 72,737 71,560 85,308 93,533 84,427 90,795 114,440 129,459 139,397 139,717 155,895 141,808 147,536 147,863 153,151 152,653 148,559 146,030
Department of Commerce 215 354 702 736 485 477 582 607 778 783 850 934 992 1,077 1,484 396 2,010 4,720 3,538 3,129 2,296 2,054 1,925 1,894 2,139 2,083 2,127 2,278 2,570 3,734 2,585 2,566 2,797 2,915 3,401 3,702 3,782 4,036 5,020 7,788 5,003 5,312 5,665 5,829 6,147 6,372 6,475 7,721 10,718 13,236 9,930 10,273 9,140 7,895 9,971 10,441 9,321 11,907 13,722 17,032
Department of Defense--Military Programs 50,111 51,147 52,585 48,780 56,629 70,069 80,355 80,771 80,123 77,497 77,645 75,033 77,864 84,852 87,917 21,807 95,147 102,259 113,605 130,912 153,861 180,693 204,356 220,863 245,109 265,440 273,919 281,889 294,829 289,694 261,860 286,574 278,510 268,577 259,487 253,196 258,262 255,793 261,196 281,028 290,185 331,845 388,686 437,034 474,354 499,344 528,578 594,662 636,775 666,715 678,074 650,867 607,800 577,898 567,702 586,478 575,087 563,150 561,075 568,339
Department of Education 816 985 973 1,152 2,416 3,596 4,072 3,990 4,594 5,099 5,537 5,709 5,747 7,331 7,897 2,035 8,717 9,828 12,167 14,612 16,973 14,707 14,433 15,424 16,596 17,577 16,670 18,145 21,468 22,972 25,196 25,832 30,109 24,557 31,205 29,727 30,009 31,294 31,285 33,476 35,523 46,373 57,145 62,780 72,858 93,368 66,372 65,963 53,389 93,743 65,484 57,249 40,910 59,610 103,288 68,506 73,669 80,852 88,426 94,971
Department of Energy 2,755 2,700 2,726 2,579 2,343 2,253 2,474 2,393 2,393 2,200 2,299 2,304 2,233 3,230 3,841 1,048 5,049 6,412 7,441 7,260 11,756 11,656 10,590 10,990 10,586 11,025 10,692 11,165 11,386 12,083 12,472 15,515 16,933 17,830 17,608 16,195 14,458 14,414 15,879 14,971 16,319 17,669 19,379 19,892 21,271 19,649 20,116 21,400 23,683 30,778 31,371 32,484 24,731 23,638 30,140 28,303 28,348 27,611 28,359 29,398
Department of Health and Human Services 3,529 4,110 4,610 4,700 5,715 9,639 13,074 15,411 17,397 20,391 25,309 25,578 28,062 33,751 40,261 10,530 46,493 51,752 57,820 68,255 80,821 88,408 95,008 102,374 114,270 122,940 131,410 140,035 152,689 175,515 198,095 231,550 253,821 278,887 303,060 319,788 339,514 350,341 359,429 382,311 425,885 465,326 504,922 542,982 581,390 614,274 671,982 700,442 796,267 854,059 891,247 848,056 886,291 936,012 1,012,950 1,092,946 1,110,867 1,131,418 1,215,288 1,270,995
Department of Homeland Security 566 642 747 774 705 782 973 1,055 1,089 1,011 1,340 1,833 1,661 2,099 2,455 648 2,755 3,217 3,415 4,296 3,943 3,847 4,689 5,060 5,007 5,383 5,383 6,180 5,671 7,219 6,654 7,577 9,653 10,708 9,376 9,692 10,533 10,617 13,321 13,159 14,980 17,570 31,970 26,575 38,697 69,025 39,156 40,676 51,719 44,457 45,741 47,422 57,217 43,263 45,685 46,155 46,443 45,993 43,099 41,140
Department of Housing and Urban Development 826 -609 73 492 2,482 3,093 3,727 713 2,432 2,796 3,600 3,580 4,781 7,512 7,026 1,361 5,808 7,650 9,220 12,735 14,880 15,232 15,814 16,663 28,720 14,139 15,484 18,938 19,680 20,167 22,751 24,470 25,181 25,845 29,044 25,236 27,527 30,181 32,693 30,781 33,865 31,788 37,410 44,984 42,453 42,435 45,561 49,088 61,019 60,141 57,004 49,600 56,577 38,527 42,390 43,896 43,574 42,981 41,983 40,642
Department of the Interior 606 730 755 745 866 863 973 1,073 1,087 1,345 1,609 1,780 1,854 2,221 2,433 855 3,220 3,874 4,168 4,472 4,456 3,944 4,552 4,936 4,804 4,774 5,037 5,138 5,194 5,814 6,082 6,531 6,879 7,064 7,479 6,776 6,763 7,222 7,783 7,998 7,743 9,739 9,193 8,606 9,292 9,037 10,469 9,817 11,775 13,164 13,519 12,891 9,607 11,279 13,008 14,707 15,111 16,006 15,986 15,936
Department of Justice 236 256 275 327 305 336 359 423 537 801 1,053 1,460 1,728 1,985 2,140 548 2,220 2,248 2,353 2,438 2,438 2,325 2,493 2,816 3,182 3,336 3,807 4,656 5,275 5,886 7,670 9,208 9,485 9,369 10,149 11,049 13,076 14,045 16,181 16,846 18,443 21,178 20,790 29,601 22,361 23,324 23,349 26,545 27,711 29,556 30,519 31,159 29,745 28,620 36,087 32,463 35,333 33,900 34,387 36,419
Department of Labor 3,914 3,523 3,454 3,121 3,239 3,562 4,180 4,161 4,976 8,456 10,426 9,561 9,964 18,578 26,524 6,109 23,225 23,694 23,448 30,542 30,911 31,479 38,683 25,348 24,738 24,934 24,208 22,662 23,442 26,087 34,790 47,889 45,452 37,819 32,808 33,163 31,088 30,580 32,995 31,873 39,707 64,686 69,563 56,687 46,949 43,138 47,544 58,838 138,157 173,053 131,975 104,588 80,307 56,774 52,797 56,921 57,997 56,094 59,006 60,458
Department of State 457 572 455 552 629 655 645 631 661 680 747 807 955 1,075 1,393 407 1,449 1,658 1,987 2,382 2,347 2,684 2,793 2,982 3,303 3,590 3,572 4,217 4,576 4,796 5,149 5,927 6,385 6,784 6,263 5,730 6,029 5,396 6,554 6,687 7,487 9,327 9,343 10,915 12,748 12,953 13,737 17,493 21,427 23,802 24,354 26,947 25,972 27,483 30,521 30,189 30,567 28,935 28,770 28,528
Department of Transportation 3,854 4,145 4,736 5,201 5,145 5,242 5,555 5,724 6,136 7,039 7,244 7,834 7,724 9,144 11,709 2,902 11,978 12,791 14,642 18,166 20,922 17,931 18,239 20,507 22,510 24,885 22,851 23,698 23,828 25,642 27,237 29,098 30,958 33,563 35,132 35,144 36,072 35,554 37,672 41,555 49,231 56,252 50,764 54,879 56,596 60,139 61,697 64,944 73,004 77,750 77,302 75,149 76,322 76,174 80,208 83,932 90,187 94,047 95,293 96,815
Department of the Treasury 8,474 9,553 10,289 10,791 11,761 12,737 14,290 16,473 19,070 20,452 21,539 30,201 35,369 41,843 43,407 10,272 48,061 54,010 63,830 75,451 91,691 109,418 115,366 139,911 163,688 178,076 178,684 200,406 229,334 253,915 274,606 291,005 296,825 305,550 346,875 362,862 377,491 389,005 385,045 390,524 388,268 371,187 368,256 375,844 410,240 464,675 490,589 548,797 701,775 444,338 538,707 464,714 399,068 446,897 506,375 580,379 676,958 761,724 844,885 921,121
Department of Veterans Affairs 5,608 5,501 5,662 5,710 5,962 6,691 7,018 7,670 8,652 9,758 10,713 11,970 13,339 16,577 18,416 3,959 18,020 18,965 19,891 21,137 22,907 23,941 24,827 25,580 26,322 26,523 26,932 29,253 30,014 28,976 31,191 33,872 35,461 37,377 37,748 36,896 39,253 41,724 43,125 47,044 45,012 50,868 56,921 59,554 69,815 69,777 72,792 84,749 95,457 108,274 126,918 124,124 138,464 149,074 160,797 179,869 180,868 177,875 192,701 201,047
Corps of Engineers--Civil Works 944 1,065 1,091 1,171 1,245 1,273 1,252 1,222 1,168 1,337 1,490 1,676 1,664 2,031 2,112 581 2,271 2,564 2,898 3,218 3,139 2,962 2,918 3,036 2,998 2,806 2,757 3,028 3,256 3,324 3,341 3,565 3,354 3,483 3,745 3,627 3,598 3,775 3,934 4,229 4,640 4,727 4,682 4,728 4,719 6,944 3,918 5,075 6,842 9,876 10,138 7,777 6,299 6,535 7,463 7,595 6,731 6,561 6,340 6,208
Other Defense Civil Programs 956 1,077 1,287 1,465 1,681 1,937 2,206 2,557 2,974 3,510 4,002 4,505 5,216 6,319 7,358 1,958 8,251 9,203 10,315 11,961 13,788 14,997 16,004 16,536 15,809 17,483 17,962 19,039 20,230 21,690 23,238 24,746 25,957 26,969 27,972 28,947 30,279 31,204 31,987 32,801 34,131 35,136 39,874 41,726 43,481 44,435 47,112 45,785 57,276 54,032 54,775 77,313 56,811 57,370 59,725 63,757 61,460 59,701 65,946 67,366
Environmental Protection Agency 70 87 117 134 158 190 249 303 384 701 763 1,114 2,030 2,531 3,118 1,108 4,365 4,072 4,800 5,603 5,242 5,081 4,312 4,076 4,490 4,867 4,904 4,871 4,906 5,108 5,769 5,950 5,930 5,855 6,351 6,046 6,164 6,269 6,733 7,223 7,367 7,451 8,041 8,328 7,913 8,321 8,259 7,939 8,070 11,007 10,772 12,796 9,484 9,399 8,325 8,627 9,745 9,268 8,528 8,796
Executive Office of the President 12 13 15 16 16 19 21 24 29 38 47 50 67 93 80 16 74 75 81 96 96 95 94 96 111 108 110 122 124 158 193 186 194 231 215 202 221 237 417 283 246 451 386 3,349 7,686 5,379 2,956 1,173 743 582 484 405 380 375 401 472 861 718 532 515
General Services Administration 382 425 520 612 561 629 482 526 530 546 655 795 929 341 -13 30 70 213 211 573 795 550 528 463 364 713 462 -95 -444 -170 445 457 721 332 679 560 882 826 -413 74 -309 -684 589 -451 20 24 27 343 319 861 1,889 1,753 -368 -767 -1,178 -641 -76 -471 87 125
International Assistance Programs 3,171 3,169 3,226 3,248 3,260 3,375 2,814 2,803 2,655 2,888 2,980 2,317 3,029 3,665 3,742 1,329 3,616 5,123 3,757 7,747 8,127 7,922 7,878 10,835 11,858 11,040 10,406 7,252 4,291 10,085 11,723 11,107 11,524 10,497 11,128 9,665 10,075 8,886 10,070 12,087 11,804 13,289 13,449 13,639 15,024 13,917 12,752 11,359 14,797 20,041 20,583 20,009 19,672 18,740 24,006 25,866 24,746 23,435 22,982 23,213
National Aeronautics and Space Administration 1,257 2,552 4,171 5,092 5,933 5,425 4,722 4,251 3,752 3,382 3,423 3,312 3,255 3,269 3,671 953 4,002 4,164 4,380 4,959 5,537 6,155 6,853 7,055 7,251 7,403 7,591 9,092 11,036 12,429 13,878 13,961 14,305 13,694 13,378 13,881 14,360 14,194 13,636 13,428 14,092 14,405 14,610 15,152 15,602 15,125 15,861 17,833 19,168 18,906 17,618 17,190 16,975 17,095 18,097 18,732 18,915 19,210 19,488 19,688
National Science Foundation 183 206 310 309 368 415 449 490 464 522 567 585 647 662 733 207 753 803 870 912 976 1,099 1,055 1,193 1,309 1,536 1,547 1,644 1,736 1,821 2,064 2,230 2,429 2,605 2,814 2,988 3,093 3,143 3,246 3,448 3,662 4,155 4,690 5,092 5,403 5,510 5,488 5,785 5,958 6,719 7,146 7,255 7,417 7,053 7,082 7,487 8,605 7,717 7,820 7,743
Office of Personnel Management 1,017 1,175 1,304 1,454 1,726 1,934 2,154 2,284 2,652 3,167 3,776 4,607 5,708 7,062 8,323 2,354 9,633 10,962 12,663 15,056 18,096 19,983 21,278 22,590 23,727 23,955 26,966 29,191 29,073 31,949 34,808 35,596 36,794 38,596 41,276 42,870 45,404 46,297 47,519 48,655 50,894 52,540 54,135 56,547 59,500 62,400 58,431 64,393 72,302 69,915 74,090 79,457 83,867 87,917 94,672 97,185 96,363 99,491 103,363 107,224
Small Business Administration 230 142 133 243 210 151 284 110 253 333 452 1,317 753 666 624 94 758 2,820 1,699 2,026 2,032 773 661 510 680 557 -65 -54 85 692 613 546 785 779 677 873 333 -77 57 -421 -570 493 1,558 4,075 2,502 905 1,175 528 2,246 6,128 6,163 2,936 477 194 -571 990 855 1,065 1,096 1,104
Social Security Administration (On-Budget) 0 0 0 0 0 94 94 414 458 465 538 567 2,750 5,279 5,576 1,290 6,014 6,595 6,228 7,087 7,862 8,520 29,854 17,651 16,793 19,316 16,524 18,113 18,709 17,276 19,008 24,943 28,143 31,164 31,037 30,694 34,309 37,542 40,021 45,121 40,007 45,816 46,333 49,008 54,556 53,252 54,917 58,602 78,657 70,758 155,316 188,241 109,849 81,184 88,581 99,495 100,012 100,319 109,943 115,529
Social Security Administration (Off-Budget) 14,365 15,788 16,620 17,460 20,694 21,631 23,760 26,885 29,812 35,408 39,620 48,565 55,373 64,159 73,384 19,763 84,344 93,120 103,316 117,872 138,914 155,120 150,731 171,167 183,434 190,684 202,422 214,489 227,473 244,998 266,395 281,418 298,349 313,881 330,370 343,869 358,372 370,068 379,212 396,169 421,257 442,010 461,400 481,200 506,779 532,491 566,846 599,197 648,892 683,420 628,878 632,903 757,542 824,587 865,200 908,104 957,655 1,013,971 1,073,869 1,137,271
Other Independent Agencies (On-Budget) 2,283 1,615 1,178 1,815 2,494 3,683 4,290 2,918 4,263 5,223 5,082 5,497 7,076 8,595 8,490 3,297 9,433 9,022 10,324 13,953 11,802 9,184 8,644 8,846 7,051 8,871 10,475 19,020 30,727 68,704 76,870 14,405 -17,321 3,356 -5,996 2,743 -2,813 10,878 6,189 8,803 11,386 16,705 14,579 10,103 16,766 14,003 12,913 47,221 47,631 -7,525 17,457 30,021 28,180 9,087 20,265 19,973 19,055 19,168 21,214 24,530
Other Independent Agencies (Off-Budget) 0 0 0 0 0 0 0 0 0 0 355 157 773 1,112 1,085 -726 -173 -496 -891 -431 89 -553 322 360 142 42 943 1,712 -310 1,626 1,317 659 1,441 1,103 -1,969 -180 -49 217 1,021 2,029 2,302 -651 -5,245 -4,130 -1,791 -1,075 5,093 2,417 304 4,700 808 2,670 -1,913 -2,531 -558 -1,608 1,913 1,327 280 282
Allowances 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1,875 -22,254 20,563 67,855 37,389 39,289
Undistributed Offsetting Receipts (On-budget) -5,878 -6,450 -6,435 -6,746 -7,464 -8,371 -9,289 -9,407 -10,362 -12,288 -11,909 -15,870 -20,048 -17,547 -18,411 -4,135 -19,390 -20,788 -24,089 -28,445 -38,134 -38,448 -47,455 -46,975 -52,029 -57,850 -63,672 -66,992 -72,822 -77,371 -83,979 -87,372 -86,507 -87,857 -97,895 -92,212 -107,272 -107,353 -99,581 -105,586 -114,404 -115,009 -117,303 -114,967 -123,436 -128,201 -141,904 -150,928 -142,013 -134,448 -145,398 -102,697 -127,632 -130,155 -174,707 -141,786 -143,510 -139,736 -145,628 -151,995
Undistributed Offsetting Receipts (Off-budget) -830 -824 -886 -931 -979 -1,207 -1,424 -1,681 -2,205 -2,582 -2,763 -2,975 -3,284 -3,719 -3,775 -342 -3,627 -3,463 -3,338 -3,543 -3,718 -3,717 -3,623 -5,354 -6,627 -7,186 -8,590 -11,798 -16,252 -21,558 -26,026 -29,739 -33,203 -35,612 -39,737 -42,785 -47,697 -53,681 -59,455 -67,433 -76,721 -85,697 -93,146 -97,559 -102,777 -109,347 -118,302 -126,863 -132,180 -133,438 -131,080 -127,985 -121,818 -116,003 -112,022 -108,093 -106,397 -104,468 -105,351 -102,730
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment