Skip to content

docs(diagram): renamed FKs as orange edges [blocked on v2.3.2 / dj-python#1508]#215

Draft
dimitri-yatsenko wants to merge 4 commits into
mainfrom
docs/1492-diagram-notation
Draft

docs(diagram): renamed FKs as orange edges [blocked on v2.3.2 / dj-python#1508]#215
dimitri-yatsenko wants to merge 4 commits into
mainfrom
docs/1492-diagram-notation

Conversation

@dimitri-yatsenko

Copy link
Copy Markdown
Member

🚫 Do not merge until the v2.3.2 release. This documents the renamed-FK
diagram rendering introduced in datajoint/datajoint-python#1508, whose notebooks
here were re-executed against that (unreleased) branch. Merge only once #1508
has shipped in v2.3.2 — and re-run the authoritative full notebook
re-execution against the released package at that time (the #210 pattern).

Paired with datajoint/datajoint-python#1508 (nx.MultiDiGraph migration, milestone v2.3.2).

What changed

The diagram notation for a renamed / aliased foreign key changed: it used to
render as a small orange dot (an integer "alias node" between two tables); it
now renders as a distinctly-colored orange edge with a hover tooltip listing
the renamed columns (e.g. spouse1 ← person_id). The alias node is gone from the
underlying graph entirely (it is now an nx.MultiDiGraph with parallel edges).

Prose / notation

  • how-to/read-diagrams.ipynb, how-to/model-relationships.ipynb,
    tutorials/basics/02-schema-design.ipynb — "orange dots" → "orange edges";
    hover-tooltip wording updated.
  • reference/specs/diagram.md — new Edge Styles row for the renamed-FK orange edge.
  • reference/specs/cascade.md, reference/specs/trace.md — internal-model prose
    updated from the "alias node" mechanism to the MultiDiGraph parallel-edge model.

New example (shows the semantics are retained)

read-diagrams.ipynb gains a "Renamed primary vs. secondary foreign keys"
subsection. Orange is layered on top of the usual line styles — it never overrides
them:

Example Renamed FK kind Renders as
Person → Marriage (spouse1/spouse2) secondary, multi dashed orange, thin
Neuron → Synapse (presynaptic/postsynaptic) primary, multi solid orange, thin
Neuron → NeuronProfile (subject) 1:1 primary solid orange, thick

Verification

  • read-diagrams and model-relationships notebooks were re-executed against the
    #1508 build (MySQL via the repo's docker compose EXECUTE flow). The committed
    SVGs now show stroke="#ff8800" on the renamed-FK edges (with
    xlink:title="spouse1 ← person_id" tooltips) and no alias-node dots; solid/dashed
    and thick/thin encodings are preserved.

Follow-up (at release)

  • tutorials/domain/allen-ccf/allen-ccf.ipynb also renders renamed-FK diagrams and
    still shows the old dots; it will be picked up by the standard release-time full
    notebook re-execution against the released v2.3.2 package
    , so it is intentionally
    not re-run in this PR.

…s (#1492)

Aligns the diagram-notation docs with the nx.MultiDiGraph migration
(datajoint/datajoint-python#1508):
- read-diagrams / model-relationships / schema-design: 'orange dots' -> 'orange
  edges'; hover tooltip lists the renamed columns. read-diagrams gains a
  'Renamed primary vs. secondary foreign keys' example (Synapse/NeuronProfile)
  showing renamed FKs keep the line-style semantics: solid=primary,
  dashed=secondary, thick=1:1, thin=multi, in orange.
- diagram.md: new Edge Styles row for the renamed-FK orange edge.
- cascade.md / trace.md: internal-model prose updated from 'alias node' to the
  MultiDiGraph parallel-edge model (alias nodes no longer exist).

read-diagrams and model-relationships notebooks re-executed against the #1508
build; SVGs now show orange edges with rename tooltips.
…build

Regenerates read-diagrams and model-relationships against datajoint-python
#1508 at its final keyed-edge implementation (edges keyed by the FK-attribute
tuple). Renamed FKs render as orange edges with rename tooltips; genuine
parallel FKs (Person/Marriage, Neuron/Synapse, Session/Comparison) each show
their two distinct edges — no duplication.
'subject' read like an animal identifier; 'profile_id' is clearer for a 1:1
profile extension of Neuron. Re-executed against the #1508 build.
mkdocs-jupyter does not run the admonition extension on notebook markdown
cells, so the four '!!! version-added "New in 2.1"' blocks in read-diagrams
rendered as literal text. Convert them to blockquote callouts that render in
the notebook markdown pipeline. Markdown-only; no re-execution needed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant