VULCAN VEIL Analyst's AI workbench

Docs · Desktop · Main chat

Drawing network graphs

A network graph shows who is linked to whom. Attach a table of people and a table of links, ask for a graph, and press Run. The graph is drawn on your computer, and you can click a person to see their details and who they are linked to.

Follow along: download gang-nodes.csv (under 1 KB) and gang-edges.csv (under 1 KB) and attach them to a new chat. They are the small gang network that comes with crimepy: 22 people and the links between them.

Expand

1. Attach the two tables

Drag both files onto the chat, or press Attach and choose them. One lists the people, one row each; the other lists the links, with the two people each one joins.

The two CSV files attached to the chat, above the message boxExpand

2. Ask for a graph

Say which columns to show. Here: "Turn these into a network graph. Color the people by Attended and size them by TotalInc." The assistant writes Python with network_graph, the app's graph drawing.

The assistant's answer with Python that calls network_graphExpand

3. Press Run

The graph appears in the chat, with a legend for the colors and sizes. Drag a person to move them, and scroll to zoom.

A network graph of 22 people, colored by Attended and sized by TotalIncExpand

4. Look at one person

Click a person, or type a name in Find a node (here "20"). The panel shows their columns and who they are linked to, and everyone else fades. Click a name in the panel to go to that person.

One person chosen, with a panel of their details and the people linked to themExpand

5. Change the layout

Layout sets how the people are placed. Tree starts from the chosen person and puts the people linked to them below, then the people linked to those.

The same graph as a tree from the chosen personExpand

Good to know

  • A notebook works the same way: end a cell with network_graph(...). Find, the details panel, and the layouts are there too.
  • network_graph takes a networkx graph as well, so you can size people by a measure from networkx, such as betweenness centrality.
  • Save graph under the graph saves it as an HTML file that opens in any browser.
  • Exports and Send output to chat include a picture of the graph as it is on screen.