Visualizing World Trade

Geospatial versus force-directed network graphs

International trade is a classic example of a network. Because nodes are countries, an attractive way to visualize this is to use geospatial positioning – that is, superimposing the network onto a map. This allows users to parse complex relationships against familiar geography.

At the same time, this approach has a few weaknesses: see for instance how tiny Europe crams many large nodes. A bigger shortcoming is that a key part of network science is lost, which is in studying the centrality of nodes in a network. An alternative visualization is a force-directed graph, where physics simulations determine the positioning of nodes. In an interactive setting, users may even be able to drag nodes around to see their impact on other nodes.

The best choice ultimately depends on the use case. Toggle below between either approach and compare for yourself.

Geospatial
Force-directed

Edge thickness is mapped to the value of import flows while node size is mapped to total imports. Highlighting a node shows the country's top import partners.

Source: UN COMTRADE (via CEPII BACI).

Notes

Graphics were created using D3 while data wrangling was done in R. Map data are from a TopoJSON redistribution of Natural Earth data. The primary source of trade data is UN COMTRADE. A validated version of this is provided by the CEPII BACI dataset, which is released with a lag of two years. The above values are therefore for 2023. For visual clarity, only the top ten import partners of any given country are visible.