create-graph-from-datatable
Description
create-graph-from-datatable
adaptor creates a graph structure from a datatable containing edge data.
Requires selection of two columns from a datatable - a source and target column. By default, directed is FALSE, which creates a graph with no directionality to the connections. When changed to TRUE, the directionality is set as going from the 'source' to 'target' column.
Inputs
data
Type: datatable
Required: Yes
The datatable containing edge data.
from column
Type: text
Required: Yes
The name of the column containing the origin node of the edge.
to column
Type: text
Required: Yes
The name of the column containing the destination node of the edge.
directed
Type: boolean
Required: No
Specifies whether the graph is directed or not. If unspecified, defaults to False
.
Outputs
graph
Type: graph
A graph structure defining nodes and edges.
Examples
Example 1: Default behaviour.
Inputs:
data
:
1
A
B
2
B
C
3
C
A
4
C
D
from column:
from
to column:
to
directed:
false
Outputs:
graph
:
-> Created an undirected graph from the datatable.
Example 2: Create a directed graph.
Inputs:
data
:
1
A
B
2
B
C
3
C
A
4
C
D
from column:
from
to column:
to
directed:
true
Outputs:
graph
:
-> Created a directed graph from the datatable.
Use Cases
Converting a datatable to a graph, which can then be converted to DOT format
export-graph-to-dot-file
, which can then be fed into the network argument in theexport-to-microreact-project
adaptor.Formatting the data from a spreadsheet before exporting as a DOT file (using
export-graph-to-dot-file
adaptor)Preparing data for the
apply-force-directed-layout
.
Last updated