I have a Dash app built in which I would like to visualize a simple process map (dfg) using the PM4PY library. Here's a sample code (data can be downloaded from here):
# Import packages
import dash as dash
from dash import Dash, html, dash_table
import pm4py
# Initialize the app
app = Dash(__name__)
# Event log preparation
log = pm4py.read_xes(r'C:\Users\~\running-example.xes')
dataframe = pm4py.format_dataframe(log, case_id='case:concept:name', activity_key='Activity', timestamp_key='time:timestamp')
# DFG preparation
dfg, start_activities, end_activities = pm4py.discover_dfg(dataframe)
p = pm4py.view_dfg(dfg, start_activities, end_activities)
# App layout
app.layout = html.Div([
html.Div(children='My First App with Data'),
dash_table.DataTable(data=dataframe.to_dict('records'), page_size=10, sort_action='native')
])
# Run the app
if __name__ == '__main__':
app.run_server(debug=True)
When the application is launched, the process map appears as a separate image:
In the application, I would like to add a process map below the table. Could anyone help me with this topic? Thank you in advance for any suggestions.