pm4py.visualization.networkx.variants package#

PM4Py – A Process Mining Library for Python

Copyright (C) 2024 Process Intelligence Solutions UG (haftungsbeschränkt)

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or any later version.

This program 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 Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see this software project’s root or visit <https://www.gnu.org/licenses/>.

Website: https://processintelligence.solutions Contact: info@processintelligence.solutions

Submodules#

pm4py.visualization.networkx.variants.digraph module#

PM4Py – A Process Mining Library for Python

Copyright (C) 2024 Process Intelligence Solutions UG (haftungsbeschränkt)

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or any later version.

This program 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 Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see this software project’s root or visit <https://www.gnu.org/licenses/>.

Website: https://processintelligence.solutions Contact: info@processintelligence.solutions

class pm4py.visualization.networkx.variants.digraph.Parameters(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]#

Bases: Enum

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: Dict[Any, Any] | None = 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