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

visualization in json format for customization #369

Closed aditya11ad closed 1 year ago

aditya11ad commented 1 year ago

Hi, I have applied miner and created visualization by following code:

heu_net = heuristics_miner.apply_heu(log)

gviz = hn_visualizer.apply(heu_net)
hn_visualizer.view(gviz)

now I want the json representation of generated graph to be passed for customization at frontend.

Is there any method or technique for that?

thanks in advance.

fit-alessandro-berti commented 1 year ago

Dear @aditya11ad

We are not providing currently a default JSON serialization for our HeuristicsNet object nor plan to introduce it in near future.

However, if you look inside the class pm4py.objects.heuristics_net.obj.HeuristicsNet in particular inside the constructor, you see that the class is mainly based on Python dictionaries / set, which can be serialized quite easily

aditya11ad commented 1 year ago

thanks for the quick reply,

can u plz help me with that code of json serialization.

considering: heu_net = heuristics_miner.apply_heu(log)