pm4py / pm4py-core

Public repository for the PM4Py (Process Mining for Python) project.
https://pm4py.fit.fraunhofer.de
GNU General Public License v3.0
722 stars 286 forks source link

Provide possibility to represent the Petri net in Graph Viz with an horizontal layout instead of vertical #37

Closed Javert899 closed 5 years ago

Javert899 commented 5 years ago

As in title, expecially in publishing, it would be nice to have the option to output the Petri net in an horizontal way instead of vertical way.

Javert899 commented 5 years ago

The possibility to set the horizontal layout on Petri net representations has been provided using the pn_vis_factory.RANKDIR_LR parameter, in the 'develop' branch.

The following example code could be used:

from pm4py.objects.log.importer.xes import factory as xes_importer from pm4py.algo.discovery.inductive import factory as inductive_miner from pm4py.visualization.petrinet import factory as pn_vis_factory

log = xes_importer.apply("C:\running-example.xes") net, im, fm = inductive_miner.apply(log) gviz = pn_vis_factory.apply(net, im, fm, parameters={pn_vis_factory.RANKDIR_LR: True}) pn_vis_factory.view(gviz)