diff --git a/requirements.txt b/requirements.txt
index 7f04f0ea..6e8916ef 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -7,4 +7,5 @@ Levenshtein>=0.26.1
cxxfilt>=0.3.0
mapfile-parser>=2.7.5
PyYAML>=6.0.2
-colour>=0.1.5
\ No newline at end of file
+colour>=0.1.5
+plotly>=6.1.0
\ No newline at end of file
diff --git a/tools/python/score.py b/tools/python/score.py
index 25408e40..1933e016 100644
--- a/tools/python/score.py
+++ b/tools/python/score.py
@@ -1,10 +1,10 @@
import re
import sys
import argparse
-import time
import os
from file_util import FileUtil
from score_display import ScoreDisplay
+import plotly.graph_objects as go
ASM_FOLDERS = [
'./asm',
@@ -62,7 +62,7 @@ FUNCTION_REGEX = r'^(? 0:
+ matchPercents.append(f"Size: {value} bytes
Total: {value / CODE_SIZE * 100:.2f}%")
+ else:
+ matchPercents.append(None)
+
+ fig = go.Figure(go.Treemap(
+ labels = labels,
+ parents = parents,
+ values = values,
+ text=matchPercents,
+ hovertemplate='%{label}
Size: %{value} bytes',
+ marker = dict(colors = colours),
+ root_color="lightgrey"
+ ))
+
+ # Add custom legend using annotations
+ legend_items = [
+ ("green", "documented"),
+ ("#92ac68", "matched"),
+ ("orange", "non matching"),
+ ("red", "non equivalent"),
+ ("grey", "N/A")
+ ]
+
+ annotations = []
+ for i, (color, label) in enumerate(legend_items):
+ annotations.append(dict(
+ x=1.05,
+ y=1 - (i * 0.05),
+ xref="paper",
+ yref="paper",
+ showarrow=False,
+ text=f"■ {label}",
+ font=dict(size=12)
+ ))
+
+
+ fig.update_layout(
+ margin=dict(t=50, l=25, r=150, b=25), # Extra right margin for legend
+ title="Decomp Progress",
+ annotations=annotations
+ )
+ output_path = "treemap.html"
+ # This will raise an error if writing fails
+ fig.write_html(output_path)
+ sys.exit(0)
+
scoreDisplay = ScoreDisplay()
print(scoreDisplay.getDisplay(adventureOnePercentage, adventureOnePercentageWithNonMatching, adventureTwoPercentage, adventureSelect, totalNumberOfDecompiledFunctions, totalNumberOfGlobalAsms, totalNumberOfNonMatching, totalNumberOfNonEquivalent, totalNumberOfDocumentedFunctions, (totalNumberOfFunctions - ignoreNumberDocumentedFunctions) - totalNumberOfDocumentedFunctions))