v9.12: remove all edges from graph (frontend + backend)

This commit is contained in:
Naeel
2026-04-16 15:39:01 +03:00
parent 2ec13f85f2
commit 2813d52d3b
3 changed files with 16 additions and 140 deletions
+8 -43
View File
@@ -81,12 +81,12 @@
.tab { padding: 7px 14px; font-size: 13px; cursor: pointer; border-bottom: 2px solid transparent; color: #8b949e; }
.tab.active { color: #58a6ff; border-bottom-color: #58a6ff; }
.panel { display: none; }
.panel-params { background: #0d1117; }
.panel-history { background: #0b0f1a; }
.panel-deps { background: #0f1107; }
body.light .panel-params { background: #f8fafc; }
body.light .panel-history { background: #f0f4ff; }
body.light .panel-deps { background: #f0fff4; }
.panel-params { background: #111827; border-top: 2px solid #1e3a5f; }
.panel-history { background: #0f1a0f; border-top: 2px solid #1a4a2e; }
.panel-deps { background: #1a1209; border-top: 2px solid #3d2a00; }
body.light .panel-params { background: #eff6ff; border-top: 2px solid #bfdbfe; }
body.light .panel-history { background: #f0fdf4; border-top: 2px solid #bbf7d0; }
body.light .panel-deps { background: #fffbeb; border-top: 2px solid #fde68a; }
.panel.active { display: block; }
.inst-graph { height: 420px; border: 1px solid #30363d; border-radius: 8px; background: #0b0f14; }
.graph-hint { color: #8b949e; font-size: 12px; margin-bottom: 8px; }
@@ -412,14 +412,6 @@ function buildRowLayout(data, containerWidth, forceShowAux){
return { positions: positions, laneById: laneById };
}
function edgeColorForRows(sourceRow, targetRow, edgeIndex){
var palette = ["#e11d48", "#0ea5e9", "#22c55e", "#f59e0b", "#a855f7", "#14b8a6", "#f97316"];
var s = Number.isFinite(sourceRow) ? sourceRow : 0;
var t = Number.isFinite(targetRow) ? targetRow : 0;
var idx = Math.abs((s * 11) + (t * 17) + edgeIndex) % palette.length;
return palette[idx];
}
// Service-based background colors for graph nodes
var SVC_COLORS = {
"cloud director": "#1e3a5f",
@@ -503,20 +495,6 @@ function graphElements(data, focusUid, laneById){
classes: (focusUid && n.id === focusUid) ? "focus" : ""
});
});
(data.edges || []).forEach(function(e, i){
var sourceRow = Number.isFinite(laneById[e.source]) ? laneById[e.source] : 0;
var targetRow = Number.isFinite(laneById[e.target]) ? laneById[e.target] : 0;
elems.push({
data: {
id: "e" + i + "-" + e.source + "-" + e.target,
source: e.source,
target: e.target,
sourceRow: sourceRow,
targetRow: targetRow,
color: edgeColorForRows(sourceRow, targetRow, i)
}
});
});
return elems;
}
@@ -538,7 +516,7 @@ function drawGraph(containerId, data, focusUid, forceShowAux){
var visibleIds = new Set(visibleNodes.map(function(n){ return n.id; }));
var filteredData = {
nodes: visibleNodes,
edges: (data.edges || []).filter(function(e){ return visibleIds.has(e.source) && visibleIds.has(e.target); })
edges: []
};
var layoutCfg = {
name: "preset",
@@ -563,20 +541,7 @@ function drawGraph(containerId, data, focusUid, forceShowAux){
"border-color": "data(color)",
"border-width": 2.4
}},
{ selector: "node.focus", style: { "border-color": "#facc15", "border-width": 3 }},
{ selector: "edge", style: {
"line-color": "data(color)",
"target-arrow-shape": "none",
"source-arrow-shape": "none",
"mid-target-arrow-shape": "none",
"mid-source-arrow-shape": "none",
"curve-style": "taxi",
"taxi-direction": "auto",
"taxi-turn": "50px",
"taxi-turn-min-distance": "10px",
"width": 2,
"opacity": 0.7
}}
{ selector: "node.focus", style: { "border-color": "#facc15", "border-width": 3 }}
],
layout: layoutCfg
});