1

I am currently trying to implement edge bundling for a .json file that contains countries and their trade partners. However, I'm having trouble understanding how to create the hierarchy out the data I currently have as Mike Bostock does here:

enter image description here

Here is a snippet of what my data file looks like:

[
    {
        "name": "Angola",
        "alpha2_code": "ao",
        "country_id": 4,
        "longitude": 13.242,
        "years": [
            {
                "gdp": 12650000000.0,
                "life_expectancy": 42.0514634146341,
                "top_partners": [
                    {
                        "total_export": 2036096161.9550002,
                        "country_id": 223
                    },
                    {
                        "total_export": 224173637.056,
                        "country_id": 50
                    },
                    {
                        "total_export": 158327929.5,
                        "country_id": 16
                    }
                ]
            }
        ]
VividD
  • 10,456
  • 6
  • 64
  • 111
user3783615
  • 81
  • 1
  • 1
  • 3

0 Answers0