Delete folder

This commit is contained in:
HajarZaiz 2023-02-19 22:27:13 +01:00
parent 54b0284abb
commit 2b7302de64
34 changed files with 152 additions and 51 deletions

2
.gitignore vendored
View File

@ -1,2 +1,4 @@
*.swp
*.pyc
results/*
!results/plots.py

BIN
Frontend/Imgs/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

BIN
Frontend/Plots/plot1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

BIN
Frontend/Plots/plt1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

85
Frontend/css/style.css Normal file
View File

@ -0,0 +1,85 @@
*{
text-decoration: none;
margin: 0;
padding: 0;
box-sizing: border-box;
list-style: none;
}
body{
display: flex;
}
.navbar{
width: 7vw;
height: 100vh;
padding-left: 5px;
display: flex;
flex-direction: column;
align-items: center;
background-color: #7f5a83;
background-image: linear-gradient(280deg, #3f305e 0%, #00060a 74%);
}
#logo{
margin-top: 25px;
width: 3vw;
opacity: 0.9;
}
.navbar-bar{
color: aliceblue;
margin-top: 15vh;
}
.navbar-bar li{
margin-top: 10px;
height: 10vh;
width: 7vw;
text-align: center;
line-height: 10vh;
}
.navbar li:hover, .navbar li:focus, .navbar li:active{
background: #eee5fdea;
border-top-left-radius: 50%;
border-bottom-left-radius: 50%;
cursor: pointer;
transition: all 0.5s ease-in-out;
}
.navbar li:hover .fa-solid{
color: #160f25;
}
.fa-solid{
color: #b9aecf;
opacity: 0.7;
cursor: pointer;
transition: all 0.5s ease-in-out;
}
.fa-solid:hover{
opacity: 1;
color: #160f25;
}
.content{
width: 93vw;
height: 100vh;
background-color: #eee5fdea;
}
.p1, .p2, .p3, .p4{
width: 93vw;
height: 100vh;
}
.p2, .p3, .p4{
display: none;
}
.plot1{
margin: auto;
display: block;
}

32
Frontend/index.html Normal file
View File

@ -0,0 +1,32 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="css/style.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.2.0/css/all.min.css" integrity="sha512-xh6O/CkQoPOWDdYTDqeRdPCVd1SpvCA9XXcUnZS2FmJNp1coAFzvtCN9BmamE+4aHK8yyUHUSCcJHgXloTyT2A==" crossorigin="anonymous" referrerpolicy="no-referrer" /> <title>DAS Dashboard</title>
</head>
<body>
<nav class="navbar">
<div class="company-logo">
<img src="Imgs/logo.png" id="logo">
</div>
<ul class="navbar-bar">
<li class = "sec1"><i class="fa-solid fa-chart-line fa-xl"></i></li>
<li class = sec2><i class="fa-solid fa-layer-group fa-xl"></i></li>
<li class = "sec3"><i class="fa-solid fa-chart-simple fa-xl"></i></li>
<li class = "sec4"><i class="fa-solid fa-table-list fa-xl"></i></li>
</ul>
</nav>
<div class="content">
<div class="p1">
<img class = "plot1" src="Plots/plot1.png">
</div>
<div class="p2">Text2</div>
<div class="p3">Text3</div>
<div class="p4">Text4</div>
</div>
<script src="script.js"></script>
</body>
</html>

33
Frontend/script.js Normal file
View File

@ -0,0 +1,33 @@
let section1 = document.querySelector('.sec1');
let section2 = document.querySelector('.sec2');
let section3 = document.querySelector('.sec3');
let section4 = document.querySelector('.sec4');
let sections = [section1, section2, section3, section4];
let icon1 = document.querySelector(".sec1 i");
let icon2 = document.querySelector(".sec2 i");
let icon3 = document.querySelector(".sec3 i");
let icon4 = document.querySelector(".sec4 i");
let icons = [icon1, icon2, icon3, icon4];
let par1 = document.querySelector(".p1");
let par2 = document.querySelector(".p2");
let par3 = document.querySelector(".p3");
let par4 = document.querySelector(".p4");
let paragraphs = [par1, par2, par3, par4];
section1.style.cssText = "background: #eee5fdea; border-top-left-radius: 50%; border-bottom-left-radius: 50%; cursor: pointer; transition: all 0.5s ease-in-out;"
icon1.style.cssText = "opacity: 1; color: #160f25;"
sections.forEach(section =>{
section.addEventListener("click", function(){
sections.forEach(s =>{
s.style.cssText = "background: none; border-top-left-radius: 0%; border-bottom-left-radius: 0%;"
icons[sections.indexOf(s)].style.cssText = "color: #b9aecf; opacity: 0.7;"
paragraphs[sections.indexOf(s)].style.display = "none";
});
section.style.cssText = "background: #eee5fdea; border-top-left-radius: 50%; border-bottom-left-radius: 50%; cursor: pointer; transition: all 0.5s ease-in-out;"
icons[sections.indexOf(section)].style.cssText = "opacity: 1; color: #160f25;"
paragraphs[sections.indexOf(section)].style.display = "block";
});
});

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

View File

@ -1,51 +0,0 @@
import os
import xml.etree.ElementTree as ET
import matplotlib.pyplot as plt
import numpy as np
#Yet to update with the execID format
folder_path = 'results/2023-01-26_10-41-29_912'
#Store data with a unique key for each (run, numberValidators, netDegree, chi) combination
data = {}
for filename in os.listdir(folder_path):
#Loop over the xmls and store the data in variables
if filename.endswith('.xml'):
tree = ET.parse(os.path.join(folder_path, filename))
root = tree.getroot()
run = int(root.find('run').text)
numberValidators = int(root.find('numberValidators').text)
netDegree = int(root.find('netDegree').text)
chi = int(root.find('chi').text)
blockSize = int(root.find('blockSize').text)
failureRate = int(root.find('failureRate').text)
tta = int(root.find('tta').text)
#Create a key for this combination of run, numberValidators, netDegree, and chi if it does not exist yet
key = (run, numberValidators, netDegree, chi)
if key not in data:
data[key] = {'blockSizes': [], 'failureRates': [], 'ttas': []}
#Append the data used for the plot
data[key]['blockSizes'].append(blockSize)
data[key]['failureRates'].append(failureRate)
data[key]['ttas'].append(tta)
#Store the 2D heatmaps in a folder
heatmaps_folder = 'heatmaps'
if not os.path.exists(heatmaps_folder):
os.makedirs(heatmaps_folder)
#Plot the heatmaps
for key, values in data.items():
hist, xedges, yedges = np.histogram2d(values['blockSizes'], values['failureRates'], bins=(10, 10), weights=values['ttas'])
plt.imshow(hist, extent=[xedges[0], xedges[-1], yedges[0], yedges[-1]])
plt.xlabel('blockSize')
plt.ylabel('failureRate')
plt.colorbar().set_label('tta')
title = f"run={key[0]}, numberValidators={key[1]}, netDegree={key[2]}, chi={key[3]}"
plt.title(title)
filename = f"run={key[0]}_numberValidators={key[1]}_netDegree={key[2]}_chi={key[3]}.png"
plt.savefig(os.path.join(heatmaps_folder, filename))
plt.clf()