Skip to content
This repository was archived by the owner on Apr 2, 2026. It is now read-only.

Commit 54e9785

Browse files
Hide entity profile when all metrics are zero
Only hides when every metric value is 0 AND no edges AND no file position — meaning the API returned nothing useful. Shows the panel when any metric has a real value, even if others are zero.
1 parent 02f198b commit 54e9785

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

templates/_main.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,8 +225,13 @@ window.addEventListener("load", function() {
225225
imports: "#D0A27D", extends: "#E589C6", contains: "#808080", partOf: "#71B9BC"
226226
};
227227

228+
var hasAnyValue = metrics.some(function(d) { return d.value > 0; });
228229
var hasMetrics = metrics.length > 0;
229230
var hasEdges = edgeTypes.length > 0;
231+
if (!hasAnyValue && !hasEdges && !(ep.sl > 0 && ep.el > 0)) {
232+
var epPanel = epChartEl.closest(".chart-panel, .entity-profile-panel");
233+
if (epPanel) epPanel.style.display = "none";
234+
}
230235
var metricsH = hasMetrics ? metrics.length * 32 + 8 : 0;
231236
var edgesH = hasEdges ? Math.max(edgeTypes.length * 22 + 40, 56) : 0;
232237
var fileBarH = (ep.sl > 0 && ep.el > 0) ? 44 : 0;

0 commit comments

Comments
 (0)