diff --git a/dashBoard.py b/dashBoard.py index 3bbaf88fe4ef10ac8cc5ba71b1b5ab3a6e27ee2a..d00674e0fd3188690ee8d1a5dee471fe498fa644 100644 --- a/dashBoard.py +++ b/dashBoard.py @@ -93,7 +93,7 @@ def tempTestFunction(): top.geometry("1250x1200") top.minsize(windowWidth, windowHeight) - mainFrame = customtkinter.CTkScrollableFrame(top, width=windowWidth, height=windowHeight) + mainFrame = customtkinter.CTkScrollableFrame(top, width=windowWidth, height=windowHeight, bg_color="#155E53") mainFrame.grid() mainFrame.grid_rowconfigure(0, weight=1) @@ -103,13 +103,27 @@ def tempTestFunction(): def createMetrics(diagram: Diagram, frame, canvasWidth): s = ttk.Style() s.theme_use('classic') - s.configure('RankFrame.TFrame', background='red', relief='raised') + s.configure('Test.TFrame', background='#51D88F',foreground="#1A323B", relief='raised') + s.configure('Head.TLabel', background='#51D88F', foreground="#1A323B" ,font=('Helvetica', 20, 'bold')) + s.configure('Test.TLabel', background='#51D88F', foreground="#1A323B" ,font=('Helvetica', 20)) + metrics = diagram.metrics.values() rowIndex = 0 - topLabel = ttk.Label(frame, text="Ranked metrics", font=("Helvetica", 20, "bold")) - topLabel.grid(row=0, column=0, sticky="nw") + scoreFrame = ttk.Frame(frame, height=100, width=canvasWidth, padding=10, style='Test.TFrame') + scoreFrame.grid(padx=10, pady=25, sticky="nsew") + scoreFrame.grid_columnconfigure(0, weight=1) + + headerLabel = ttk.Label(scoreFrame, text="Diagram scorecard", font=("Helvetica", 25, "bold"), style="Head.TLabel") + label1 = ttk.Label(scoreFrame, text=f"Diagrams parsed! Below is the list of found metrics along with the amount of relationships. Further down you will find the list of metrics with usage and associated components", wraplength=0.5*canvasWidth ,font=("Helvetica", 20), style="Test.TLabel") + label2 = ttk.Label(scoreFrame, text=f"Number of metrics: {len(diagram.metrics)}", font=("Helvetica", 20), style="Test.TLabel") + label3 = ttk.Label(scoreFrame, text=f"Number of annotated relationships: {len(diagram.dynamics)}", font=("Helvetica", 20), style="Test.TLabel") + + headerLabel.grid(row=0, column=0, sticky="nw") + label1.grid(row=1, column=0, sticky="nw", pady=10) + label2.grid(row=2, column=0, sticky="nw") + label3.grid(row=3, column=0, sticky="nw") associatedList = {} # Needed to keep track of the number of associated components per metric @@ -125,16 +139,13 @@ def createMetrics(diagram: Diagram, frame, canvasWidth): metricName = diagram.metrics[metricID].name metricValue = diagram.metrics[metricID].value metricDate = diagram.metrics[metricID].date - - s.configure('Test.TFrame', background='white', relief='raised') - s.configure('Head.TLabel', background='white', font=('Helvetica', 20, 'bold')) - s.configure('Test.TLabel', background='white', font=('Helvetica', 20)) - + 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 number: {rowIndex}", style="Head.TLabel").grid(row=0, column=0, sticky="nw")