// Focus class at the top.
const focusedId = ensureClassNode(cls.ciName, { focused: true });
+ // Associated type families of the focused class. Surface them up
+ // front (regardless of whether any current instance contributes a
+ // fam-instance) so the user can see at a glance which families
+ // the class declares — same `assoc` link the classes view shows.
+ cls.ciAssocTypes.forEach(famQn => {
+ const famNodeId = ensureFamilyNode(famQn);
+ const linkId = focusedId + '~~' + famNodeId;
+ if (!seenNodes.has(linkId)) {
+ seenNodes.add(linkId);
+ els.push({ group: 'edges', data: {
+ id: linkId,
+ source: focusedId,
+ target: famNodeId,
+ kind: 'assoc',
+ label: 'assoc',
+ }});
+ }
+ });
+
// One row of instance nodes, anchored to the focused class.
insts.forEach((inst, idx) => {
const instId = ensureInstanceNode(inst, cls.ciName,