pm4py.util.vis_utils module#

PM4Py – A Process Mining Library for Python Copyright (C) 2026 Process Intelligence Solutions GmbH

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

pm4py.util.vis_utils.human_readable_stat(timedelta, stat_locale: Dict[str, str] | None = None) → str[source]#

Transform a timedelta into a human readable string

Parameters:

timedelta – Timedelta

Returns:

Human readable string

Return type:

string

pm4py.util.vis_utils.get_arc_penwidth(arc_measure, min_arc_measure, max_arc_measure)[source]#

Calculate arc width given the current arc measure value, the minimum arc measure value and the maximum arc measure value

Parameters:
  • arc_measure – Current arc measure value

  • min_arc_measure – Minimum measure value among all arcs

  • max_arc_measure – Maximum measure value among all arcs

Returns:

Current arc width in the graph

Return type:

penwidth

pm4py.util.vis_utils.get_trans_freq_color(trans_count, min_trans_count, max_trans_count)[source]#

Gets transition frequency color

Parameters:
  • trans_count – Current transition count

  • min_trans_count – Minimum transition count

  • max_trans_count – Maximum transition count

Returns:

Frequency color for visible transition

Return type:

color

pm4py.util.vis_utils.get_base64_from_gviz(gviz)[source]#

Get base 64 from string content of the file

Parameters:

gviz – Graphviz diagram

Returns:

Base64 string

Return type:

base64

pm4py.util.vis_utils.get_base64_from_file(temp_file)[source]#

Get base 64 from string content of the file

Parameters:

temp_file – Temporary file path

Returns:

Base64 string

Return type:

base64

pm4py.util.vis_utils.check_visualization_inside_jupyter()[source]#

Checks if the visualization of the model is performed inside a Jupyter notebook

pm4py.util.vis_utils.view_image_in_jupyter(file_name)[source]#

Visualizes a picture inside the Jupyter notebooks

Parameters:

file_name – Name of the file

pm4py.util.vis_utils.open_opsystem_image_viewer(file_name)[source]#

Visualizes a picture using the image viewer of the operating system

Parameters:

file_name – Name of the file

pm4py.util.vis_utils.get_corr_hex(num)[source]#

Gets correspondence between a number and an hexadecimal string

Parameters:

num – Number

Returns:

Hexadecimal string

Return type:

hex_string

pm4py.util.vis_utils.value_to_color(val, min_value, max_value)[source]#