Visualization of US Trade Data

The page is divided into five tabs: the domestic visualization, the international visualization, the raw data, the help section and the source reference.

Some interesting facts and trends are also documented on this page.

Please refer to the setup instructions for help on deploying the project.

User Manual

In both, the domestic and the internation trade visualization, the user may select any number of states, a trade type (imports, exports, or the difference (only on international view)) and a combination of the years 2009 to 2012. States are both selected and deselected by clicking on them. To avoid having to select all states for a country-wide view, when no states are selected, the visualization is the same as if all states were selected. This is the selection that is presented on page load. Selection is done via the highlighted ‘input box’ click states, years here.

The selection will then be tallied and passed into the charts located at the bottom of the screen. As can be seen, all states selected by default

On initial load, all three charts, histogram, pie chart, and column chart; are displayed. The user may remove/add the charts by clicking "Menu" which expands into a choice of pie chart, column chart and histogram, which will toggle their visibility. Menu

Selection of charts

While viewing the charts, a chart may be expanded by clicking on the chart element. This will make it appear in the bottom left window, which allows the user to zoom onto the the element. Once the element appears in the zoom window to enlarge the chart. The chart can be scaled back down by clicking on it. This view is particularly useful for comparing different graphs, as it will not change until another chart is selected to replace it. Expanded chart window

The default tab is "Commodities by U.S. state" to change your view, choose from the tabs at the top. Example: if you wish to see trade on the international scale select, "International Imports/Exports." Below the two windows you will see a sankey chat visually breaking down the quantities of trade between selected states and chosen country.

The "Raw Data" tab features a table of the visualization's data. After selection of the trade data, its rows are shown by state in relation to either commodity or country. Each column contains a quantity showing the breakdown between the state and country/commodity such as quantity per year, % share and changes in percent. The table can be sorted by clicking on its headers. Each row features a state and its target followed by a break down of data by column.

With the creation of the maps and charts to display import/export data a few trends begin to emerge. First and foremost, it is that states with high population tend to have higher levels of imports and exports. However defying the trend Texas has the highest level of exports, a state with two-thirds the population of California. In fact, it even surpasses the import levels of California.


This anomaly is explained by the NAFTA (North American Free Trade Agreement) which results in Mexico importing one-third of exports from Texas. The state also has the nations largest amount of railroads and has the busiest ports in the world and the busisiest in the united states.

The impact of ports and rail yards are nearly as high as that of population. Though somewhat common sense that is proven above. Now moving onto the nation's exports: Animal & Animal Products 1-5 Mineral Products 6-15 Foodstuffs 16-24 Mineral Products 25-27 Chemicals & Allied Industries 28-38 Textiles 50-63 and Metals 72-83 Machinery 84-85 Transportation 86-89

First and foremost, we see that the top four consumers of American Exports are Canada, Mexico, China and Brazil. When it comes to imports it is China, Canada, Mexico, and then Brazil/Germany/India.

Observing this it is simple to see why some Texas which is holds the majority of the border with Mexico is the largest state of raw imports and exports while despite having miles more coast line and population California is second. Additionally Northern states such as Illinois and Michigan share imports and exports through the lakes with Canada. Below we can see the majority of their trade going towards Canada:

Oddly enough, the exports AND imports have been growing incredibly fast between the USA and China between 2009 and 2012. Perhaps the most shocking statistic is the rate at which each has grown. China's imports from the USA has grown 63% while it's exports to the USA have grown 69%. Although the quantities do have a disparity since Chinese imports in the USA have grown from ~293k to ~422k while the exports from USA to China are only a mere ~69k to ~109k.

Some interesting statistics, Russia for being one of the world's largest nations imports less from the USA than Turkey, and exports and imports less than the a couple rather small of western European nations (UK, Italy, France, Germany). Additionally there are surprisingly less total imports from India than from Germany. Finally, Hawaii is the only state with Coffee as top export commodity


Page, Visualization, Code: Copyleft 2014, Andreas Brauchli, Alberto Gonzalez, Patryk Poborca.
Data extracted from
Harmonized System Codes extracted from