Skip to content

Commit

Permalink
coherent use of circle symbol for densification methods
Browse files Browse the repository at this point in the history
  • Loading branch information
paulbzm committed Oct 2, 2024
1 parent 9568d6c commit 5940af5
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 23 deletions.
19 changes: 17 additions & 2 deletions data_extraction/build_html.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,20 @@ def combine_tables_to_html():
df["Shortname"] = df["Method"].apply(lambda x: shortnames[x])
df["NewMethod"] = df["Shortname"] + df["Submethod"]
# make Method column a link to the method summary + add color box
df["Method"] = '<a class="method-name" href="#' + df["Method"] + '"> <span class="legend-color-box-container"><span class="legend-color-box" style=background-color:'+df["Shortname"].map(groupcolors)+'></span><span class="legend-color-box-methods"></span>' + df["NewMethod"] + '</span></a>'
df["Method"] = (
'<a class="method-name" href="#'
+ df["Method"]
+ '"> <span class="legend-color-box-container">'
+ '<span class="'
+ df["Method"].apply(lambda x: "legend-color-box densification" if x in shortnames_d else "legend-color-box")
+ '" style="background-color:'
+ df["Shortname"].map(groupcolors)
+ '"></span>'
+ '<span class="legend-color-box-methods"></span>'
+ df["NewMethod"]
+ '</span></a>'
)


#change Size [Bytes] to Size [MB] and round
df.insert(5, "Size [MB]", df["Size [Bytes]"] / 1024 / 1024)
Expand Down Expand Up @@ -407,7 +420,9 @@ def load_methods_summaries(ranks, groupcolors):
color = groupcolors[shortnames[file.split(".")[0]]]
except KeyError:
color = "#ffffff"
title = f'<a href="{links[file.split(".")[0]]}" target="_blank" class="title-link" style="--title-box-color: {color}">{title}</a>'

class_str = "title-link" if category == "c" else "title-link densification" #for different symbols
title = f'<a href="{links[file.split(".")[0]]}" target="_blank" class="{class_str}" style="--title-box-color: {color}">{title}</a>'
summary = file_content.split('\n', 1)[1].strip()

#insert color if applicable
Expand Down
28 changes: 8 additions & 20 deletions project-page/static/css/style.css
Original file line number Diff line number Diff line change
@@ -1,25 +1,5 @@
.katex { line-height: 2 !important; }

.text-item {
display: inline-block;
font-size: 1em;
line-height: 1;
vertical-align: baseline;
position: relative;
margin-right: 0.25em;
}

.text-color-box {
display: inline-block;
width: 0.8em;
height: 0.8em;
margin-right: 0.2em;
border-radius: 0.2em;
vertical-align: middle;
position: relative;
top: -0.1em;
}

.title-link {
position: relative;
}
Expand All @@ -36,6 +16,10 @@
margin-right: 10px;
}

.title-link.densification::before {
border-radius: 100px;
}

.rounded-bullet {
display: inline-flex;
align-items: center;
Expand Down Expand Up @@ -181,6 +165,10 @@ input[type="checkbox"] {
flex-shrink: 0;
}

.legend-color-box.densification {
border-radius: 100px;
}

.legend-color-box-container {
display: flex;
align-items: center;
Expand Down
6 changes: 5 additions & 1 deletion project-page/static/js/scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,11 @@ function drawLegend() {
checkbox.addEventListener('change', updatePlotVisibility);

var colorBox = document.createElement('div');
colorBox.className = 'legend-color-box';
if (group in densificationMethods){
colorBox.className = 'legend-color-box densification';
}else{
colorBox.className = 'legend-color-box';
}
colorBox.style.backgroundColor = groupColors[group];

var labelText = document.createElement('a');
Expand Down

0 comments on commit 5940af5

Please sign in to comment.