Skip to content

egberts/immigration

Repository files navigation

US Border Encounters & Enforcements 2023

Creates a Sankey graph of the flow of immigration from the world to the 'gotaways' and 'naturalized citizen' states, using Python.

To create a graph, execute in a CLI shell:

python plotly-sankey-immigration-working.py

How I Did This

The idea is vastly orthogonal to the use of most Sankey libraries which is by using column-based dataframes (except for Riley Xu's Sankeyflow is row-based dataframe).

By using row-based dataframe (datapoint) approach, it becomes easier to map the node blocks on the map (despite DS3Sankey.js chaotic slapping of nodes all over the place after 13th node added).

Once X:Y coordinate of using 0.000 to 1.000 : 0.000 to 1.000 range is supported ONLY within Nodes, it becomes easier to construct LARGE Sankey charts.

Prior Work

Based on Steve Rattner's work and aired on Morning Joe TV show.

Image

Citations: