Source code for pm4py.visualization.bpmn.visualizer

from pm4py.visualization.bpmn.variants import classic
from pm4py.util import exec_utils
from enum import Enum
from pm4py.visualization.common import gview
from pm4py.visualization.common import save as gsave
from pm4py.visualization.common.gview import serialize, serialize_dot


[docs]class Variants(Enum): CLASSIC = classic
DEFAULT_VARIANT = Variants.CLASSIC
[docs]def apply(bpmn_graph, variant=DEFAULT_VARIANT, parameters=None): """ Visualize a BPMN graph Parameters ------------- bpmn_graph BPMN graph variant Variant of the visualization, possible values: - Variants.CLASSIC parameters Version-specific parameters Returns ------------ gviz Graphviz representation """ return exec_utils.get_variant(variant).apply(bpmn_graph, parameters=parameters)
[docs]def save(gviz, output_file_path): """ Save the diagram Parameters ----------- gviz GraphViz diagram output_file_path Path where the GraphViz output should be saved """ gsave.save(gviz, output_file_path)
[docs]def view(gviz): """ View the diagram Parameters ----------- gviz GraphViz diagram """ return gview.view(gviz)
[docs]def matplotlib_view(gviz): """ Views the diagram using Matplotlib Parameters --------------- gviz Graphviz """ return gview.matplotlib_view(gviz)