metricFrame=ttk.Frame(rankedFrame,style='Test.TFrame',height=200,width=frameWidth)# Frame for each metric, should cover 80% of the window and stack vertically
metricFrame=ttk.Frame(frame,style='Test.TFrame',height=200,width=canvasWidth,padding=5)# Frame for each metric, should cover 80% of the window and stack vertically
metricFrame.grid(padx=10,pady=10,sticky="nsew")
metricFrame.grid_rowconfigure(0,weight=1)
metricFrame.grid_columnconfigure(0,weight=1)
rowIndex+=1# Increment the row index for the next frame
ttk.Label(metricFrame,text=f"Metric Name: {metricName}",style="Test.TLabel").grid(row=1,column=0,sticky="nw")# First label = Metric id and description
ttk.Label(metricFrame,text=f"Metric value: {metricValue}",style="Test.TLabel",wraplength=0.5*frameWidth).grid(row=2,column=0,sticky="nw")# First label = Metric id and description
ttk.Label(metricFrame,text=f"Metric value: {metricValue}",style="Test.TLabel",wraplength=0.5*canvasWidth).grid(row=2,column=0,sticky="nw")# First label = Metric id and description
ttk.Label(metricFrame,text=f"Number of associated components: {amountOFComponents}",style="Test.TLabel").grid(row=1,column=2,sticky="n")# Second label = Number of associated components in both diagrams
ttk.Label (metricFrame,text=f"Last update: {metricDate}",style="Test.TLabel").grid(row=2,column=2,sticky="e")# Third label = Last update of the metric
forchildinmetricFrame.winfo_children():
child.grid_configure(padx=3,pady=3,)
child.grid_columnconfigure(0,weight=3)
child.grid_configure(padx=3,pady=3)
returnrankedFrame
returnframe
guiRoot=Tk()
deffindMetrics(diagram,id:int,typeOfObject:str):
relevantMetrics=[]
relatedComponents=[]
formetricindiagram.metrics.values():
iftypeOfObject=="bowtie":
ifidinmetric.bowtieID:
relevantMetrics.append(metric.name)
relatedComponents.append(metric.erID)
eliftypeOfObject=="er":
ifidinmetric.erID:
relevantMetrics.append(metric.name)
relatedComponents.append(metric.bowtieID)
returnrelevantMetrics,relatedComponents
defcreateDynamic(diagram:Diagram,top):
fordynamicindiagram.dynamics.values():
ifdynamic.type=="ER":# If the dynamic is of type ER