Skip to main content

Graphs

NetworkX graph construction, analysis and drawing.

10 nodes. Right-click any node in the editor to read this documentation in the app.

Graph​

🎯 Graph Centrality​

id graph_centrality Β· Graph Β· Python export: yes

Score every node by degree, betweenness, closeness, eigenvector centrality or PageRank, highest first. Wire the result into a Graph Plot to size or colour nodes by it.

Inputs

PortTypeDescription
graphnetworkx.GraphThe graph (from a Graph from … node).

Outputs

PortTypeDescription
centralityDataFrameColumns: node, <measure>; sorted highest first.

Fields

FieldTypeDefaultChoices
Measureselectdegreedegree, betweenness, closeness, eigenvector, pagerank

πŸ”² Graph from Adjacency Matrix​

id graph_from_adjacency Β· Graph Β· Python export: yes

Build a NetworkX graph from a square adjacency-matrix DataFrame (rows and columns are the nodes, cell values the edge weights). Weights at or below the threshold are dropped.

Inputs

PortTypeDescription
dataframeDataFrameSquare adjacency matrix.

Outputs

PortTypeDescription
graphnetworkx.GraphThe graph (DiGraph if Directed).

Fields

FieldTypeDefaultChoices
Directedcheckboxfalse
Edge threshold (|value| >)float0.0

πŸ•ΈοΈ Graph from Edge List​

id graph_from_edgelist Β· Graph Β· Python export: yes

Build a NetworkX graph from a DataFrame with one row per edge: name the source and target columns, optionally a weight column, and tick Directed for a directed graph.

Inputs

PortTypeDescription
dataframeDataFrameEdge list: one row per edge.

Outputs

PortTypeDescription
graphnetworkx.GraphThe graph (DiGraph if Directed).

Fields

FieldTypeDefaultChoices
Source columntextsource
Target columntexttarget
Weight column (optional)text
Directedcheckboxfalse

πŸ•ΈοΈ Graph Plot (Interactive)​

id graph_plot_interactive Β· Graph Β· Python export: yes

Draggable, zoomable Cytoscape.js view of a graph with several layouts. Colour and label nodes and edges by any attribute (handy for knowledge graphs) and size nodes by a centrality column. Right- click the preview for full screen. In exported Python this node is skipped (the graph passes through) β€” use Graph Plot (Static) to draw the network in a script.

Inputs

PortTypeDescription
graphnetworkx.GraphThe graph (from a Graph from … node).
centralityDataFrameOptional: output of Graph Centrality, to size / colour nodes by.

Outputs

PortTypeDescription
graphnetworkx.GraphThe input graph, unchanged.

Fields

FieldTypeDefaultChoices
Layoutselectcosecose, breadthfirst, circle, concentric, grid, random
Node label attributetext
Node group/type attribute (colour)text
Edge label attributetext
Size by (centrality column)text
TitletextGraph

πŸ”— Graph Plot (Static)​

id graph_plot_static Β· Graph Β· Python export: yes

Plotly network plot of a graph using a networkx layout (spring, Kamada-Kawai, circular, shell, random). Size or colour nodes by a centrality column. Less interactive than the Cytoscape view, but it exports to Python.

Inputs

PortTypeDescription
graphnetworkx.GraphThe graph (from a Graph from … node).
centralityDataFrameOptional: output of Graph Centrality, to size / colour nodes by.

Outputs

PortTypeDescription
graphnetworkx.GraphThe input graph, unchanged.

Fields

FieldTypeDefaultChoices
Layoutselectspringspring, kamada_kawai, circular, shell, random
Size by (centrality column)text
Colour by (centrality column)text
TitletextGraph

πŸ“Š Graph Summary​

id graph_summary Β· Graph Β· Python export: yes

One-row table of headline statistics: node and edge counts, density, connectivity, number of components, average clustering and diameter (skipped for disconnected or 500+ node graphs).

Inputs

PortTypeDescription
graphnetworkx.GraphThe graph (from a Graph from … node).

Outputs

PortTypeDescription
summaryDataFrameA single row of graph statistics.

πŸ”³ Graph to Adjacency Matrix​

id graph_to_adjacency Β· Graph Β· Python export: yes

Turn a graph into an adjacency-matrix DataFrame (edge weights, 0 where there is no edge).

Inputs

PortTypeDescription
graphnetworkx.GraphThe graph (from a Graph from … node).

Outputs

PortTypeDescription
matrixDataFrameSquare matrix, rows and columns are the nodes.

πŸ“‹ Graph to Edge List​

id graph_to_edgelist Β· Graph Β· Python export: yes

Turn a graph back into an edge-list DataFrame (source, target and any edge attributes).

Inputs

PortTypeDescription
graphnetworkx.GraphThe graph (from a Graph from … node).

Outputs

PortTypeDescription
edgesDataFrameOne row per edge.

🏷️ Set Edge Attributes​

id graph_set_edge_attrs Β· Graph Β· Python export: yes

Attach attributes to edges from a DataFrame: each row is matched to an edge by its source and target columns and the other columns become attributes (e.g. a 'relation' label).

Inputs

PortTypeDescription
graphnetworkx.GraphThe graph (from a Graph from … node).
attrsDataFrameOne row per edge: source, target, plus attribute columns.

Outputs

PortTypeDescription
graphnetworkx.GraphA copy of the graph with the edge attributes set.

Fields

FieldTypeDefaultChoices
Source columntextsource
Target columntexttarget

🏷️ Set Node Attributes​

id graph_set_node_attrs Β· Graph Β· Python export: yes

Attach attributes to nodes from a DataFrame: each row is matched to a node by the node-id column and its other columns become attributes (e.g. a 'type' to colour a knowledge graph by).

Inputs

PortTypeDescription
graphnetworkx.GraphThe graph (from a Graph from … node).
attrsDataFrameOne row per node: the id column plus attribute columns.

Outputs

PortTypeDescription
graphnetworkx.GraphA copy of the graph with the node attributes set.

Fields

FieldTypeDefaultChoices
Node id columntextnode