Node-edge graphs (indra.assemblers.graph.assembler
)¶
- class indra.assemblers.graph.assembler.GraphAssembler(stmts=None, graph_properties=None, node_properties=None, edge_properties=None)[source]¶
The Graph assembler assembles INDRA Statements into a Graphviz node-edge graph.
- Parameters
stmts (Optional[list[indra.statements.Statement]]) – A list of INDRA Statements to be added to the assembler’s list of Statements.
graph_properties (Optional[dict[str: str]]) – A dictionary of graphviz graph properties overriding the default ones.
node_properties (Optional[dict[str: str]]) – A dictionary of graphviz node properties overriding the default ones.
edge_properties (Optional[dict[str: str]]) – A dictionary of graphviz edge properties overriding the default ones.
- graph¶
A pygraphviz graph that is assembled by this assembler.
- Type
pygraphviz.AGraph
- existing_nodes¶
The list of nodes (identified by node key tuples) that are already in the graph.
- existing_edges¶
The list of edges (identified by edge key tuples) that are already in the graph.
- edge_properties¶
A dictionary of graphviz edge properties used for assembly. Note that most edge properties are determined based on the type of the edge by the assembler (e.g. color, arrowhead). These settings cannot be directly controlled through the API.
- Type
dict[str: str]
- add_statements(stmts)[source]¶
Add a list of statements to be assembled.
- Parameters
stmts (list[indra.statements.Statement]) – A list of INDRA Statements to be appended to the assembler’s list.
- get_string()[source]¶
Return the assembled graph as a string.
- Returns
graph_string – The assembled graph as a string.
- Return type