pm4py.visualization.dfg.util.dfg_gviz module#
- pm4py.visualization.dfg.util.dfg_gviz.get_activities_color(activities_count)[source]#
Get frequency color for attributes
- Parameters:
activities_count – Count of attributes in the log
- Returns:
Color assigned to attributes in the graph
- Return type:
activities_color
- pm4py.visualization.dfg.util.dfg_gviz.get_activities_color_serv_time(serv_time)[source]#
Gets the color for the activities based on the service time
- Parameters:
serv_time – Service time
- Returns:
Dictionary associating each activity to a color based on the service time
- Return type:
act_color
- pm4py.visualization.dfg.util.dfg_gviz.get_min_max_value(dfg)[source]#
Gets min and max value assigned to edges in DFG graph
- Parameters:
dfg – Directly follows graph
- Returns:
min_value – Minimum value in directly follows graph
max_value – Maximum value in directly follows graph
- pm4py.visualization.dfg.util.dfg_gviz.assign_penwidth_edges(dfg)[source]#
Assign penwidth to edges in directly-follows graph
- Parameters:
dfg – Direcly follows graph
- Returns:
Graph penwidth that edges should have in the direcly follows graph
- Return type:
penwidth
- pm4py.visualization.dfg.util.dfg_gviz.sort_dfg_reachability(dfg: List[Tuple[str, str]], start_activities_to_include: List[str], end_activities_to_include: List[str]) Tuple[List[str], List[Tuple[str, str]]][source]#
Sort the edges of the directly-follows graph based on reachability principles (start activities are putting at the beginning, end activities at the end)
- Parameters:
dfg – List of edges of the directly-follows graph (without frequency/performance annotation)
start_activities_to_include – Start activities
end_activities – End activities
- Returns:
sorted_activities – Activities sorted by reachability
sorted_edges – Edges sorted by reachability
- pm4py.visualization.dfg.util.dfg_gviz.graphviz_visualization(activities_count, dfg, image_format='png', measure='frequency', max_no_of_edges_in_diagram=100000, start_activities=None, end_activities=None, serv_time=None, font_size='12', bgcolor='white', rankdir='LR', enable_graph_title: bool = False, graph_title: str = 'Directly-Follows Graph')[source]#
Do GraphViz visualization of a DFG graph
- Parameters:
activities_count – Count of attributes in the log (may include attributes that are not in the DFG graph)
dfg – DFG graph
image_format – GraphViz should be represented in this format
measure – Describes which measure is assigned to edges in direcly follows graph (frequency/performance)
max_no_of_edges_in_diagram – Maximum number of edges in the diagram allowed for visualization
start_activities – Start activities of the log
end_activities – End activities of the log
serv_time – For each activity, the service time in the log
font_size – Size of the text on the activities/edges
bgcolor – Background color of the visualization (i.e., ‘transparent’, ‘white’, …)
rankdir – Direction of the graph (“LR” for left-to-right; “TB” for top-to-bottom)
enable_graph_title – Enables the visualization of a graph’s title
graph_title – Graph title to display (if enable_graph_title)
- Returns:
Digraph object
- Return type:
viz