pm4py.visualization.networkx.variants package#

This file is part of PM4Py (More Info: https://pm4py.fit.fraunhofer.de).

PM4Py is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

PM4Py is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with PM4Py. If not, see <https://www.gnu.org/licenses/>.

Submodules#

pm4py.visualization.networkx.variants.digraph module#

This file is part of PM4Py (More Info: https://pm4py.fit.fraunhofer.de).

PM4Py is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

PM4Py is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with PM4Py. If not, see <https://www.gnu.org/licenses/>.

class pm4py.visualization.networkx.variants.digraph.Parameters(value)[source]#

Bases: Enum

An enumeration.

FORMAT = 'format'#
BGCOLOR = 'bgcolor'#
RANKDIR = 'rankdir'#
INCLUDE_NODE_ATTRIBUTES = 'include_node_attributes'#
INCLUDE_EDGE_ATTRIBUTES = 'include_edge_attributes'#
pm4py.visualization.networkx.variants.digraph.apply(G: DiGraph, parameters: Optional[Dict[Any, Any]] = None) Digraph[source]#

Creates a Graphviz Digraph from a NetworkX DiGraph object.

Minimum viable example:

import pm4py from pm4py.visualization.networkx import visualizer as nx_to_gv_vis

log = pm4py.read_xes(“../tests/input_data/running-example.xes”) # gets an ‘event graph’ where events, cases and their relationships # are represented in a graph (NetworkX DiGraph) event_graph = pm4py.convert_log_to_networkx(log)

# visualize the NX DiGraph using Graphviz gviz = nx_to_gv_vis.apply(event_graph, parameters={“format”: “svg”}) nx_to_gv_vis.view(gviz)

Parameters#

G

NetworkX DiGraph

parameters

Parameters of the visualization, including: - Parameters.FORMAT => format of the visualization (.png, .svg) - Parameters.BGCOLOR => background color of the visualization (transparent, white) - Parameters.RANKDIR => direction of the graph (LR or TB) - Parameters.INCLUDE_NODE_ATTRIBUTES => includes the node attributes in the node’s label in the representation - Parameters.INCLUDE_EDGE_ATTRIBUTES => includes the edge attributes in the edge’s label in the representation

Returns#

digraph

Graphviz DiGraph object