Skip to content

Instantly share code, notes, and snippets.

View sungeunanlee's full-sized avatar

Sungeun An sungeunanlee

  • Atlanta, GA
View GitHub Profile
@sungeunanlee
sungeunanlee / README.md
Last active August 9, 2019 02:39
D3 Food web network visualization

This example demonstrates how to visualize food web building on D3's force layout example (https://bl.ocks.org/mbostock/3750558).

The network generates from the focal species and retrieves its predators, prey, and competitors using data from Globi (https://www.globalbioticinteractions.org). When hovering over a node, its name, the relationship with the focal species, and the picture are shown in the right panel. Cliking the name will direct you to the detail species page in EOL. Cliking a new species node will trigeer a focal species transition, and such change will be shown in a slow animation.

The visualization leverages the json data retrieved from Globi: https://beta.eol.org/api/pages/328447/pred_prey.json, where 328447 is an eol id.

Also note that clicking the new node will take some time since it fetches new data from the server.

Main Interactions

  • Hover your mouse over the node to see its name and the picture.