Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions web/src/graph.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ export function buildNeighborhood(m: Model, o: NeighborhoodOptions): GraphSpec {
return true;
};
const addType = (id: Id, focus = false) =>
take(`c${id}`, () => typeNode(m, id, { focus, attrs: focus || o.expanded.has(id), inherited: focus && o.inherited, open: o.openAttrs.has(id), cap: focus ? o.maxAttrs * 2 : o.maxAttrs }), focus);
take(`c${id}`, () => typeNode(m, id, { focus, attrs: focus || o.expanded.has(id), inherited: o.inherited && (focus || o.expanded.has(id)), open: o.openAttrs.has(id), cap: focus ? o.maxAttrs * 2 : o.maxAttrs }), focus);
const edge = (e: EdgeSpec) => {
if (!edges.has(e.key)) edges.set(e.key, e);
};
Expand All @@ -185,7 +185,8 @@ export function buildNeighborhood(m: Model, o: NeighborhoodOptions): GraphSpec {
const c = m.comp(tid);
const ct = c.complexType;
if (!ct) return;
const inh = isFocus && o.inherited;
// Inherited rows follow the toggle for every box that lists its rows: the focus and expanded boxes.
const inh = o.inherited && (isFocus || o.expanded.has(tid));
// Base type.
const base = ct.derivation?.base;
if (m.isComplex(base) && addType(base)) edge({ key: `g${base}-${tid}`, from: `c${base}`, to: `c${tid}`, kind: ct.derivation!.method === "restriction" ? "restr" : "gen", label: ct.derivation!.method === "restriction" ? "«restriction»" : undefined });
Expand Down
2 changes: 1 addition & 1 deletion web/src/views/diagramPanel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ export function diagramPanel(ctx: AppCtx, focus: Id, opts: { tall?: boolean } =
depthBtn,
toggle("Inherited", () => o.inherited, (v) => {
o.inherited = v;
}, "List inherited attributes and child elements in this type's box"),
}, "List inherited attributes and child elements in the boxes of this type and of expanded types"),
toggle("Used by", () => o.incoming, (v) => {
o.incoming = v;
ctx.setPrefs({ incoming: v });
Expand Down
Loading