SBGN-AF layout
pd2af.building.sbgn.layout
Build the SBGN-AF layout, in either plain or dot mode.
For each AF activity we build a fresh BiologicalActivityLayout /
PhenotypeLayout with a typed unit-of-information sublayout and a label.
Influence arcs are drawn afresh between the activity positions (PD arcs ran
entity->process, so they cannot be copied). The layout_model_mapping is
built per the catalogue in momapy/sbgn/af/__init__.py (singleton keys for
activities and units of information; a frozenset key {arc, source,
target} anchored on the arc for each influence).
Two layout modes:
plain-- reuse the curated SBGN-PD geometry: each activity is placed at its input element's layout position. An input element drawn with several layouts (a cloned entity pool) yields one activity layout per input layout, and influence arcs fan out across the source/target layouts per--influence-pairing(cross-- one arc per pair -- ornearest-- a single arc between the closest pair). Activities/compartments whose input has no layout are skipped.dot-- build every element at a placeholder position with the default size, then hand the whole layout topd2af.building.layout.make_auto_layout(graphviz) inbuild.pyfor repositioning. Required by the merged reading (keep_speciesoff), where a merged activity has no single input layout.
overlay for SBGN-AF is unsupported (see pd2af.core).
Functions:
| Name | Description |
|---|---|
make_and_add_layout |
Build |
resolve_operator_arc_segments |
Per-arc hook for :func: |
make_and_add_layout
make_and_add_layout(context: BuilderContext)
Build context.layout and context.layout_model_mapping (pass 2).
Source code in src/pd2af/building/sbgn/layout.py
resolve_operator_arc_segments
Per-arc hook for :func:pd2af.building.layout.make_auto_layout's arc-geometry step.
When arc is sourced by an operator glyph, return its connector-attached
segments recomputed from the graphviz-repositioned geometry; otherwise
return None so the caller keeps its normal border geometry. This reuses
the same connector helper as plain-mode arc creation, so the auto snap is
folded into the recompute that already iterates every arc.