// Direct-match path uses the reduced args as before.
const reqArgs = subbedArgs.map(reduceTypeArg);
const matched = findMatchingInstances(sc.seSuperclass, reqArgs);
- const scClsId = ensureClassNode(sc.seSuperclass);
const reqLabel = 'superclass needed ' + sc.seSuperclass.qnName + ' ' +
renderArgsCompact(reqArgs, inst.iiTyVars);
if (matched.length === 0) {
- // No instance found in our data; link to the class node and mark
- // it as external/unresolved.
+ // No instance found in our data; link to the superclass class
+ // node (which we have to draw in this branch) and mark it
+ // external/unresolved.
+ const scClsId = ensureClassNode(sc.seSuperclass);
els.push({ group: 'edges', data: {
id: instId + '#sc#' + si + '#none',
source: instId,
label: reqLabel + ' (no local match)',
}});
} else {
+ // Local match(es) exist. Connect the focused instance directly
+ // to each matched instance — we deliberately *don't* also pull
+ // the superclass class node into the graph, because the same
+ // information ("instance of class Foo") is already implied by
+ // the matched instance's own label and is plainly noisy.
for (const m of matched) {
const mId = ensureInstanceNode(
m, sc.seSuperclass,
'inst:' + m._idx
);
- // Also draw the matched instance under its class.
- ensureClassNode(sc.seSuperclass);
- const linkId = scClsId + '=>' + mId;
- if (!seenNodes.has(linkId)) {
- seenNodes.add(linkId);
- els.push({ group: 'edges', data: {
- id: linkId, source: scClsId, target: mId, kind: 'defines',
- }});
- }
els.push({ group: 'edges', data: {
id: instId + '#sc#' + si + '#' + m._idx,
source: instId,