Comparison of 16 CBO Forecasts of U.S. Publicly Held Debt as Percent of GDP (2009-2021)
Explore this visualization that compares 16 CBO forecasts from 2009 to 2021 of U.S. publicly held debt as a percent of GDP.. [Updated Sep. 22, 2021]
About this visualization
I (Richard Evans) created this visualization for a report I was working on in 2021 on U.S. debt and deficits. This plot shows how U.S. forecasts by the Congressional Budget Office (CBO) of publicly held debt as a percent of GDP have changed over time.
Functionality of the dynamic visualization
This dynamic visualization allows the user to customize some different views and manipulations of the data using the following functionalities.
- Highlight or mute specific recession time series by clicking on the series label in the legend on the right side of the plot. Even when muted, the time series are still faintly visible.
- Hovertool display. If you move your cursor over any of the plotted lines in the visualization, a dialogue box will apear with information about each point in each time series.
- Pan different areas of the data. If you click on the pan button on the left side of the plot, you can use your cursor to click and drag on the data window and change your view of the data.
- Zoom in or out on the data. You can zoom in or zoom out on the data series in three different ways. You can use the box zoom functionality by clicking on its button on the left side of the plot and clicking and dragging a box on the area of the plot that you want to zoom in on. You can also zoom in by clicking on the zoom in button on the left side of the plot, then clicking on the area of the plot you want to center your zoom in around. Or you can zoom out by clicking on the zoom out button on the left side of the plot, then clicking on the area of the plot you want to center your zoom out around.
- Save current view of data as .png file. You can save your current view of the data as a .png file to your local hard drive by clicking on the save button on the left side of the plot.
- Undo and redo actions. You can undo or redo any of the plot changes that you make using the undo button or the redo button on the left side of the plot.
- Reset the plot. After any changes you make to the plot, you can reset it to its original position by using the reset button on the left side of the plot.
Contributing to this visualization code
This dynamic visualization was created using the tseries_pubdebt_gdp_frcsts.py script, written in the Python programming language. I used the Bokeh plotting library to create the JavaScript for the visualization. All of the scripts, data, and detailed documentation are available on the GitHub page for this visualization (https://github.com/OpenSourceEcon/DeficitParty). You can fork that repository and follow the instructions in the README.md to create and modify this visualization on your own machine. If you wish to improve or enhance this code or if you find errors or bugs, please consider the following ways to contribute to this project.
- Browse the repository Issues for known areas that need attention.
- Submit questions or suggestions by submitting a new issue in the repository Issues.
- Submit a pull request with your proposed changes.
References
Evans, Richard W., “Repository of data, code, and dynamic visualizations of U.S. debt and deficits over time by political party prevalence in the White House and Congress,” https://github.com/OpenSourceEcon/DeficitParty, (Sep. 22, 2021).