Data Visualizing Global International Trade

Posted on Nov 6, 2016
The skills the author demoed here can be learned through taking Data Science with Machine Learning bootcamp with NYC Data Science Academy.


When looking at global trade data, it is often a challenge to get quick insights about the relationships between trade partners. This is because of the inherent complexity of the data.
Effective visualizations of trade flows can enhance our understanding of a country's economic activity.

Data Visualizing Global Trade

The most common way of visualizing flow between countries is drawing lines on a geographic map. This type of visualization is often very effective for small datasets with limited complexity. However, because of the amount of data in global trade and the number of trading partners a country has, the resulting visualization is just a clutter of overlaying arrows with little insight to be drawn. Case in point is the map below.

Data Visualizing Global International Trade

Figure 1. Map with links overlay.

Tree Maps

The source of my global trade data, World Integrated Trade Solution presents a number of visualization techniques to relay insight behind the numbers. Tree maps were used to present each country's trade volume with other countries.

Data Visualizing Global International Trade

Figure 2. Tree map visualization.

Network Graphs

Network graphs where countries are depicted as nodes and links as trade routes was used to show which countries trade with each other. Additional information can be derived from the network graph such as the volume of the trade route; depicted by the thickness of the links, and the proportion of the import and export; depicted by the size of the node.


Figure 3. Network graph visualization.

An Alternative

Visualization of global trade data have to depict a large amount of information. The most important of which are the information of origin and destination, and the volume of trade.

A proposed alternative is the use of chord diagrams. This diagram is a circular plot which can arguably present global trade data in an intuitively graspable way.

Aside from being more visually appealing than Figure 1, some key elements of the design help us gain insight with just a quick glance at the diagram.

The trading countries are represented by the circle's sectors. Each country is assigned a unique color which can be randomly chosen or can be picked from a gradient scale to depict economic indicators. For example, darker colors can represent higher GDP. For simplicity, a random color was used in this chord diagram.


Data Visualizing Global International Trade

Figure 4. Circle sectors representing trading countries.

β€’ The flow of trade is encoded by the origin color. In the closeup shown Figure 5, Indonesia is assigned a light blue color, Japan is encoded purple. Hence, the flow from Indonesia to Japan is colored light blue, and the smaller counter flow from Japan to Indonesia is colored purple. The direction of the flow is also indicated by a gap between flow and circle segment at the destination.


Figure 5. Flow representing import and export.

β€’ The volume of trade is indicated by the width of the flow and the radians of each sector. The trade's corresponding dollar value is also indicated by tick marks on the outside of the circle’s segments.
β€’ The net trade movement are identified through the relative differences in the radians. In Figure 5 we see that Japan is a net importer with most of its trade volume incoming rather than out.

Data Insights Gained

The chord diagram was implemented using circlize library in R. The shiny app was designed to be flexible in terms of choosing which countries to investigate. By picking a few countries at a time, the chord complexity is minimized. The data collected and presented were that of 2010 to 2015. The shiny app can be found here.

A quick look at the trading activities of the members of G8 countries consistently show the United States as the top in trade activity. The United States is a net importer with its import volume overshadowing its exports by as much as 55% in 2010.
Among BRIC nations, China overshadowed all its partners in terms of trade activity throughout the period. Aside from being a net exporter with as much as 63% more exports than imports in 2010, the country showed a steady increase of exports from 2010 to 2014.

Future Work

The visualization is only as good as the data which is available. Upon further investigation of the dataset, it showed that not all countries were able to report their trade activities consistently. The current library used has limitations in terms of interactivity. It would have been better if a user can click on a particular flow and see a breakdown in terms of the product category which makes up the flow. For now, this is augmented by a table next to the chord diagram.

About Author

Oamar Gianan

Oamar Gianan has about 15 years of experience in the information technology industry primarily in cloud computing. He developed a passion for data analysis by working on infrastructure where big data is processed. Before moving to New York,...
View all posts by Oamar Gianan >

Leave a Comment

No comments found.

View Posts by Categories

Our Recent Popular Posts

View Posts by Tags

#python #trainwithnycdsa 2019 2020 Revenue 3-points agriculture air quality airbnb airline alcohol Alex Baransky algorithm alumni Alumni Interview Alumni Reviews Alumni Spotlight alumni story Alumnus ames dataset ames housing dataset apartment rent API Application artist aws bank loans beautiful soup Best Bootcamp Best Data Science 2019 Best Data Science Bootcamp Best Data Science Bootcamp 2020 Best Ranked Big Data Book Launch Book-Signing bootcamp Bootcamp Alumni Bootcamp Prep boston safety Bundles cake recipe California Cancer Research capstone car price Career Career Day citibike classic cars classpass clustering Coding Course Demo Course Report covid 19 credit credit card crime frequency crops D3.js data data analysis Data Analyst data analytics data for tripadvisor reviews data science Data Science Academy Data Science Bootcamp Data science jobs Data Science Reviews Data Scientist Data Scientist Jobs data visualization database Deep Learning Demo Day Discount disney dplyr drug data e-commerce economy employee employee burnout employer networking environment feature engineering Finance Financial Data Science fitness studio Flask flight delay gbm Get Hired ggplot2 googleVis H20 Hadoop hallmark holiday movie happiness healthcare frauds higgs boson Hiring hiring partner events Hiring Partners hotels housing housing data housing predictions housing price hy-vee Income Industry Experts Injuries Instructor Blog Instructor Interview insurance italki Job Job Placement Jobs Jon Krohn JP Morgan Chase Kaggle Kickstarter las vegas airport lasso regression Lead Data Scienctist Lead Data Scientist leaflet league linear regression Logistic Regression machine learning Maps market matplotlib Medical Research Meet the team meetup methal health miami beach movie music Napoli NBA netflix Networking neural network Neural networks New Courses NHL nlp NYC NYC Data Science nyc data science academy NYC Open Data nyc property NYCDSA NYCDSA Alumni Online Online Bootcamp Online Training Open Data painter pandas Part-time performance phoenix pollutants Portfolio Development precision measurement prediction Prework Programming public safety PwC python Python Data Analysis python machine learning python scrapy python web scraping python webscraping Python Workshop R R Data Analysis R language R Programming R Shiny r studio R Visualization R Workshop R-bloggers random forest Ranking recommendation recommendation system regression Remote remote data science bootcamp Scrapy scrapy visualization seaborn seafood type Selenium sentiment analysis sentiment classification Shiny Shiny Dashboard Spark Special Special Summer Sports statistics streaming Student Interview Student Showcase SVM Switchup Tableau teachers team team performance TensorFlow Testimonial tf-idf Top Data Science Bootcamp Top manufacturing companies Transfers tweets twitter videos visualization wallstreet wallstreetbets web scraping Weekend Course What to expect whiskey whiskeyadvocate wildfire word cloud word2vec XGBoost yelp youtube trending ZORI