Visualizes any type of flow between countries. Takes a CSV as input, applies filtering and aggregation (danfojs) to show relations and data in a number of visualizations (d3.js)
Visualizes any type of flow between countries. Takes a CSV as input, applies filtering and aggregation (danfojs) to show relations and data in a number of visualizations (d3.js)
The latest version of this tool is available at https://geoflow-visualizer.github.io/geoflow-visualizer/
Nodejs + npm
npm install
npm start
Use the file selector to select a CSV file that at least has the columns source
, target
and weight
.
In short, the application uses the React as the main framework, Danfo.js for data processing and filtering, and d3.js for visualization of the map and charts. Below is a more detailed overview of what can be found where.
The main GUI is specified in App
, which connects all the components to the data that is managed in the DataStore
class (below).
The DataStore
class is where all the loading and filtering happens. It largely relies on Danfo.js (a pandas clone for javascript) for this. The class a mobx observable, meaning that its computed properties can be observed in a component and it will re-render in a transparent way if the computed properties' inputs change.
Loading and filtering the data happens in several steps and only the required steps will execute if the inputs (such as the category selection) change. The steps are roughly as follows:
The map and country data is loaded in the GeoData
module. It is currently 'hard coded', i.e. cannot be specified by the user.
The world map is a topojson file: world_countries_neocarto.json. The geometries are used to display the map and they are linked to the visualization by their ISO-2 country codes. The other properties are ignored.
The capital of each country is used as its location (the node the arrows point to/from). Country capital positions are linked to the user data by their ISO-2 country codes. The capital data is in country-capitals.json. This is also where the country names (labels) are from.
The current map projection is geoAitoff and is set in the components/mappings
module.
Some semi-constant data, such as color maps, projections and number formatting functions are defined in the components/mappings
module.
The visualization of the map and its links are defined in components/LinkVis
. Properties that are not defined in the mappings
module can be customized there.
Some of the insights of the project process and development were used by one of the team members (Babic) to successfully apply for a grant by the Danish Independent Research Fund (DFF) in October 2022.
Tracking and visualizing states as fossil-fuel owners
An interactive web-based platform to investigate the dynamics of global corporate networks