From: Javier Sagredo Date: Wed, 6 May 2026 22:27:28 +0000 (+0200) Subject: Don't draw the predicate-class node alongside fam-resolves matches X-Git-Url: https://git.sagredo.dev/?a=commitdiff_plain;h=9aafb085d7e6974e93383ad7bf77bf04933c7502;p=classgraph.git Don't draw the predicate-class node alongside fam-resolves matches The "fam-resolves" chain pulled the predicate class into the instance view as a separate node and connected it to the matched instance with a green "defines" edge — duplicating information already on the matched-instance label. Drop the class anchor + defines edge here, the same way commit 3a8e0ac handled the matched-superclass case. Co-Authored-By: Claude Opus 4.7 (1M context) --- diff --git a/data/viewer.js b/data/viewer.js index d35899c..5611f57 100644 --- a/data/viewer.js +++ b/data/viewer.js @@ -652,7 +652,11 @@ } // Resolution chain: with the substituted RHS in hand, look for - // a matching class instance of @predClassQn@. + // a matching class instance of @predClassQn@. The matched + // instance's own label already names its class, so we don't + // also pull a class node into the graph alongside it — it + // would just be a redundant box with a green arrow that says + // the same thing. if (predClassQn && resolvedArgs) { const reduced = resolvedArgs.map(reduceTypeArg); const matched = findMatchingInstances(predClassQn, reduced); @@ -661,16 +665,6 @@ m, predClassQn, 'inst:' + m._idx ); - // Make sure the matched instance hangs under its class node - // so the user has a stable place to find it. - const predClsId = ensureClassNode(predClassQn); - const defId = predClsId + '=>' + mId; - if (!seenNodes.has(defId)) { - seenNodes.add(defId); - els.push({ group: 'edges', data: { - id: defId, source: predClsId, target: mId, kind: 'defines', - }}); - } const resId = fiNodeId + '=>resolves=>' + mId; if (!seenNodes.has(resId)) { seenNodes.add(resId);