pm4py.visualization.dfg.variants package

Submodules

pm4py.visualization.dfg.variants.frequency 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.dfg.variants.frequency.Parameters(value)[source]

Bases: enum.Enum

An enumeration.

ACTIVITY_KEY = 'pm4py:param:activity_key'
BGCOLOR = 'bgcolor'
END_ACTIVITIES = 'end_activities'
FONT_SIZE = 'font_size'
FORMAT = 'format'
MAX_NO_EDGES_IN_DIAGRAM = 'maxNoOfEdgesInDiagram'
START_ACTIVITIES = 'start_activities'
START_TIMESTAMP_KEY = 'pm4py:param:start_timestamp_key'
STAT_LOCALE = 'stat_locale'
TIMESTAMP_KEY = 'pm4py:param:timestamp_key'
pm4py.visualization.dfg.variants.frequency.apply(dfg: Dict[Tuple[str, str], int], log: Optional[pm4py.objects.log.obj.EventLog] = None, parameters: Optional[Dict[Any, Any]] = None, activities_count: Optional[Dict[str, int]] = None, soj_time: Optional[Dict[str, float]] = None) graphviz.graphs.Digraph[source]

Visualize a frequency directly-follows graph

Parameters
  • dfg – Frequency Directly-follows graph

  • log – (if provided) Event log for the calculation of statistics

  • activities_count – (if provided) Dictionary associating to each activity the number of occurrences in the log.

  • soj_time – (if provided) Dictionary associating to each activity the average sojourn time

  • parameters – Variant-specific parameters

Returns

Graphviz digraph

Return type

gviz

pm4py.visualization.dfg.variants.frequency.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.variants.frequency.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.variants.frequency.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.variants.frequency.graphviz_visualization(activities_count, dfg, image_format='png', measure='frequency', max_no_of_edges_in_diagram=100000, start_activities=None, end_activities=None, soj_time=None, font_size='12', bgcolor='transparent', stat_locale: Optional[dict] = None)[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

  • soj_time – For each activity, the sojourn time in the log

  • stat_locale – Dict to locale the stat strings

Returns

Digraph object

Return type

viz

pm4py.visualization.dfg.variants.performance 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.dfg.variants.performance.Parameters(value)[source]

Bases: enum.Enum

An enumeration.

ACTIVITY_KEY = 'pm4py:param:activity_key'
AGGREGATION_MEASURE = 'aggregation_measure'
BGCOLOR = 'bgcolor'
END_ACTIVITIES = 'end_activities'
FONT_SIZE = 'font_size'
FORMAT = 'format'
MAX_NO_EDGES_IN_DIAGRAM = 'maxNoOfEdgesInDiagram'
START_ACTIVITIES = 'start_activities'
START_TIMESTAMP_KEY = 'pm4py:param:start_timestamp_key'
STAT_LOCALE = 'stat_locale'
TIMESTAMP_KEY = 'pm4py:param:timestamp_key'
pm4py.visualization.dfg.variants.performance.apply(dfg: Dict[Tuple[str, str], int], log: Optional[pm4py.objects.log.obj.EventLog] = None, parameters: Optional[Dict[Any, Any]] = None, activities_count: Optional[Dict[str, int]] = None, soj_time: Optional[Dict[str, float]] = None) graphviz.graphs.Digraph[source]

Visualize a performance directly-follows graph

Parameters
  • dfg – Performance Directly-follows graph

  • log – (if provided) Event log for the calculation of statistics

  • activities_count – (if provided) Dictionary associating to each activity the number of occurrences in the log.

  • soj_time – (if provided) Dictionary associating to each activity the average sojourn time

  • parameters – Variant-specific parameters

Returns

Graphviz digraph

Return type

gviz

pm4py.visualization.dfg.variants.performance.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.variants.performance.get_activities_color_soj_time(soj_time)[source]

Gets the color for the activities based on the sojourn time

Parameters

soj_time – Sojourn time

Returns

Dictionary associating each activity to a color based on the sojourn time

Return type

act_color

pm4py.visualization.dfg.variants.performance.get_edges_color(duration_list: list) str[source]

Gets the color for the activities based on the sojourn time

Parameters

soj_time – Sojourn time

Returns

Dictionary associating each activity to a color based on the sojourn time

Return type

act_color

pm4py.visualization.dfg.variants.performance.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.variants.performance.graphviz_visualization(activities_count, dfg, image_format='png', measure='frequency', max_no_of_edges_in_diagram=100000, start_activities=None, end_activities=None, soj_time=None, font_size='12', bgcolor='transparent', stat_locale: Optional[dict] = None)[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 directly 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

  • soj_time – For each activity, the sojourn time in the log

  • stat_locale – Dict to locale the stat strings

Returns

Digraph object

Return type

viz

Module contents

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/>.