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
| Port | Type | Description |
|---|---|---|
graph | networkx.Graph | The graph (from a Graph from β¦ node). |
Outputs
| Port | Type | Description |
|---|---|---|
centrality | DataFrame | Columns: node, <measure>; sorted highest first. |
Fields
| Field | Type | Default | Choices |
|---|---|---|---|
| Measure | select | degree | degree, 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
| Port | Type | Description |
|---|---|---|
dataframe | DataFrame | Square adjacency matrix. |
Outputs
| Port | Type | Description |
|---|---|---|
graph | networkx.Graph | The graph (DiGraph if Directed). |
Fields
| Field | Type | Default | Choices |
|---|---|---|---|
| Directed | checkbox | false | |
| Edge threshold (|value| >) | float | 0.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
| Port | Type | Description |
|---|---|---|
dataframe | DataFrame | Edge list: one row per edge. |
Outputs
| Port | Type | Description |
|---|---|---|
graph | networkx.Graph | The graph (DiGraph if Directed). |
Fields
| Field | Type | Default | Choices |
|---|---|---|---|
| Source column | text | source | |
| Target column | text | target | |
| Weight column (optional) | text | ||
| Directed | checkbox | false |
πΈοΈ 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
| Port | Type | Description |
|---|---|---|
graph | networkx.Graph | The graph (from a Graph from β¦ node). |
centrality | DataFrame | Optional: output of Graph Centrality, to size / colour nodes by. |
Outputs
| Port | Type | Description |
|---|---|---|
graph | networkx.Graph | The input graph, unchanged. |
Fields
| Field | Type | Default | Choices |
|---|---|---|---|
| Layout | select | cose | cose, breadthfirst, circle, concentric, grid, random |
| Node label attribute | text | ||
| Node group/type attribute (colour) | text | ||
| Edge label attribute | text | ||
| Size by (centrality column) | text | ||
| Title | text | Graph |
π 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
| Port | Type | Description |
|---|---|---|
graph | networkx.Graph | The graph (from a Graph from β¦ node). |
centrality | DataFrame | Optional: output of Graph Centrality, to size / colour nodes by. |
Outputs
| Port | Type | Description |
|---|---|---|
graph | networkx.Graph | The input graph, unchanged. |
Fields
| Field | Type | Default | Choices |
|---|---|---|---|
| Layout | select | spring | spring, kamada_kawai, circular, shell, random |
| Size by (centrality column) | text | ||
| Colour by (centrality column) | text | ||
| Title | text | Graph |
π 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
| Port | Type | Description |
|---|---|---|
graph | networkx.Graph | The graph (from a Graph from β¦ node). |
Outputs
| Port | Type | Description |
|---|---|---|
summary | DataFrame | A 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
| Port | Type | Description |
|---|---|---|
graph | networkx.Graph | The graph (from a Graph from β¦ node). |
Outputs
| Port | Type | Description |
|---|---|---|
matrix | DataFrame | Square 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
| Port | Type | Description |
|---|---|---|
graph | networkx.Graph | The graph (from a Graph from β¦ node). |
Outputs
| Port | Type | Description |
|---|---|---|
edges | DataFrame | One 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
| Port | Type | Description |
|---|---|---|
graph | networkx.Graph | The graph (from a Graph from β¦ node). |
attrs | DataFrame | One row per edge: source, target, plus attribute columns. |
Outputs
| Port | Type | Description |
|---|---|---|
graph | networkx.Graph | A copy of the graph with the edge attributes set. |
Fields
| Field | Type | Default | Choices |
|---|---|---|---|
| Source column | text | source | |
| Target column | text | target |
π·οΈ 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
| Port | Type | Description |
|---|---|---|
graph | networkx.Graph | The graph (from a Graph from β¦ node). |
attrs | DataFrame | One row per node: the id column plus attribute columns. |
Outputs
| Port | Type | Description |
|---|---|---|
graph | networkx.Graph | A copy of the graph with the node attributes set. |
Fields
| Field | Type | Default | Choices |
|---|---|---|---|
| Node id column | text | node |