def get_dfg_visualization(self): if self.selected_model_type == "model1": model = mdfg_disc_factory.apply( self.exploded_dataframe, model_type_variant=self.selected_model_type, node_freq_variant="type1", edge_freq_variant="type11") elif self.selected_model_type == "model2": model = mdfg_disc_factory.apply( self.exploded_dataframe, model_type_variant=self.selected_model_type, node_freq_variant="type21", edge_freq_variant="type211") elif self.selected_model_type == "model3": model = mdfg_disc_factory.apply( self.exploded_dataframe, model_type_variant=self.selected_model_type, node_freq_variant="type31", edge_freq_variant="type11") gviz = mdfg_vis_factory.apply(model, parameters={ "min_node_freq": self.selected_min_acti_count, "min_edge_freq": self.selected_min_edge_freq_count, "format": "svg" }) tfilepath = tempfile.NamedTemporaryFile(suffix='.svg') tfilepath.close() mdfg_vis_factory.save(gviz, tfilepath.name) self.model_view = base64.b64encode(open(tfilepath.name, "rb").read()).decode('utf-8')
def get_multigraph_visualization(self): self.epsilon = float(self.epsilon) self.noise_threshold = float(self.noise_threshold) model = mdfg_disc_factory3.apply(self.succint_dataframe, parameters={ "min_act_freq": self.selected_min_acti_count, "min_edge_freq": self.selected_min_edge_freq_count, "epsilon": self.epsilon, "noise_obj_number": self.noise_threshold }) gviz = mdfg_vis_factory3.apply( model, measure=self.selected_decoration_measure, freq=self.selected_aggregation_measure, projection=self.selected_projection, parameters={ "format": "svg", "min_act_freq": self.selected_min_acti_count, "min_edge_freq": self.selected_min_edge_freq_count }) tfilepath = tempfile.NamedTemporaryFile(suffix='.svg') tfilepath.close() mdfg_vis_factory.save(gviz, tfilepath.name) self.model_view = base64.b64encode(open(tfilepath.name, "rb").read()).decode('utf-8')
def get_new_visualization(self): classifier_function = None if self.selected_classifier == "activity": classifier_function = lambda x: x["event_activity"] elif self.selected_classifier == "combined": classifier_function = lambda x: x["event_activity"] + "+" + x[ "event_objtype"] model = mdfg_disc_factory2.apply( self.exploded_dataframe, classifier_function=classifier_function, variant=self.selected_model_type, parameters={ "min_acti_freq": self.selected_min_acti_count, "min_edge_freq": self.selected_min_edge_freq_count }) gviz = mdfg_vis_factory2.apply( model, measure=self.selected_decoration_measure, freq=self.selected_aggregation_measure, classifier=self.selected_classifier, projection=self.selected_projection, parameters={ "format": "svg", "min_acti_freq": self.selected_min_acti_count, "min_edge_freq": self.selected_min_edge_freq_count }) tfilepath = tempfile.NamedTemporaryFile(suffix='.svg') tfilepath.close() mdfg_vis_factory.save(gviz, tfilepath.name) self.model_view = base64.b64encode(open(tfilepath.name, "rb").read()).decode('utf-8')
def get_petri_visualization(self): model = petri_disc_factory.apply(self.exploded_dataframe, parameters={"min_node_freq": self.selected_min_acti_count, "min_edge_freq": self.selected_min_edge_freq_count}) gviz = pn_vis_factory.apply(model, parameters={"format": "svg"}) tfilepath = tempfile.NamedTemporaryFile(suffix='.svg') tfilepath.close() mdfg_vis_factory.save(gviz, tfilepath.name) self.model_view = base64.b64encode(open(tfilepath.name, "rb").read()).decode('utf-8')