PD - momapy

Skip to content

# PD

## `` momapy.sbgn.pd

Classes for SBGN PD maps

Classes:

Name | Description
--- | ---
`AndOperator` | Class for and operators
`AndOperatorLayout` | Class for and operator layouts
`Association` | Class for associations
`AssociationLayout` | Class for association layouts
`CardinalityLayout` | Class for cardinality layouts
`Catalysis` | Class for catalyses
`CatalysisLayout` | Class for catalysis layouts
`Compartment` | Class for compartments
`CompartmentLayout` | Class for compartment layouts
`Complex` | Class for complexes
`ComplexLayout` | Class for complex layouts
`ComplexMultimer` | Class for complex multimers
`ComplexMultimerLayout` | Class for complex multimer layouts
`ComplexMultimerSubunit` | Class for complex subunits
`ComplexMultimerSubunitLayout` | Class for complex multimer subunit layouts
`ComplexSubunit` | Class for complex subunits
`ComplexSubunitLayout` | Class for complex subunit layouts
`ConsumptionLayout` | Class for consumption layouts
`Dissociation` | Class for dissociations
`DissociationLayout` | Class for dissociation layouts
`EmptySet` | Class for empty sets
`EmptySetLayout` | Class for empty set layouts
`EntityPool` | Base class for entity pools
`EquivalenceArcLayout` | Class for equivalence arc layouts
`EquivalenceOperator` | Class for equivalence operators
`EquivalenceOperatorInput` | Class for inputs of equivalence operators
`EquivalenceOperatorLayout` | Class for equivalence operator layouts
`EquivalenceOperatorOutput` | Class for outputs of equivalence operators
`FluxRole` | Base class for flux roles
`GenericProcess` | Class for generic processes
`GenericProcessLayout` | Class for generic process layouts
`Inhibition` | Class for inhibitions
`InhibitionLayout` | Class for inhibition layouts
`LogicArcLayout` | Class for logic arc layouts
`LogicalOperator` | Class for logical operators
`LogicalOperatorInput` | Class for inputs of logical operators
`Macromolecule` | Class for macromolecules
`MacromoleculeLayout` | Class for macromolecule layouts
`MacromoleculeMultimer` | Class for macromolecule multimers
`MacromoleculeMultimerLayout` | Class for macromolecule multimer layouts
`MacromoleculeMultimerSubunit` | Class for macromolecule multimer subunits
`MacromoleculeMultimerSubunitLayout` | Class for macromolecule multimer subunit layouts
`MacromoleculeSubunit` | Class for macromolecule subunits
`MacromoleculeSubunitLayout` | Class for macromolecule subunit layouts
`Modulation` | Class for modulations
`ModulationLayout` | Class for modulation layouts
`Multimer` | Base class for multimers
`MultimerSubunit` | Base class for multimer subunits
`NecessaryStimulation` | Class for necessary stimulations
`NecessaryStimulationLayout` | Class for necessary stimulation layouts
`NotOperator` | Class for not operators
`NotOperatorLayout` | Class for not operator layouts
`NucleicAcidFeature` | Class for nucleic acid features
`NucleicAcidFeatureLayout` | Class for nucleic acid feature layouts
`NucleicAcidFeatureMultimer` | Class for nucleic acid feature multimers
`NucleicAcidFeatureMultimerLayout` | Class for nucleic acid feature multimer layouts
`NucleicAcidFeatureMultimerSubunit` | Class for nucleic acid feature multimer subunits
`NucleicAcidFeatureMultimerSubunitLayout` | Class for nucleic acid feature multimer subunit layouts
`NucleicAcidFeatureSubunit` | Class for nucleic acid feature subunits
`NucleicAcidFeatureSubunitLayout` | Class for nucleic acid feature subunit layouts
`OmittedProcess` | Class for omitted processes
`OmittedProcessLayout` | Class for omitted process layouts
`OrOperator` | Class for or operators
`OrOperatorLayout` | Class for or operator layouts
`PerturbingAgent` | Class for perturbing agents
`PerturbingAgentLayout` | Class for perturbing agent layouts
`Phenotype` | Class for phenotypes
`PhenotypeLayout` | Class for phenotype layouts
`Process` | Base class for processes
`Product` | Class for products
`ProductionLayout` | Class for production layouts
`Reactant` | Class for reactants
`SBGNPDLayout` | Class for SBGN-PD layouts
`SBGNPDMap` | Class for SBGN-PD maps
`SBGNPDModel` | Class for SBGN-PD models
`SimpleChemical` | Class for simple chemical
`SimpleChemicalLayout` | Class for simple chemical layouts
`SimpleChemicalMultimer` | Class for simple chemical multimers
`SimpleChemicalMultimerLayout` | Class for simple chemical multimer layouts
`SimpleChemicalMultimerSubunit` | Class for simple chemical multimer subunits
`SimpleChemicalMultimerSubunitLayout` | Class for simple chemical multimer subunit layouts
`SimpleChemicalSubunit` | Class for simple chemical subunits
`SimpleChemicalSubunitLayout` | Class for simple chemical subunit layouts
`StateVariable` | Class for state variables
`StateVariableLayout` | Class for state variable layouts
`Stimulation` | Class for stimulations
`StimulationLayout` | Class for stimulation layouts
`StoichiometricProcess` | Base class for stoichiometric processes
`Submap` | Class for submaps
`SubmapLayout` | Class for submap layouts
`Subunit` | Base class for subunits
`Tag` | Class for tags
`TagLayout` | Class for tag layouts
`TagReference` | Class for tag references
`Terminal` | Class for terminals
`TerminalLayout` | Class for terminal layouts
`TerminalReference` | Class for terminal references
`UncertainProcess` | Class for uncertain processes
`UncertainProcessLayout` | Class for uncertain process layouts
`UnitOfInformation` | Class for units of information
`UnitOfInformationLayout` | Class for unit of information layouts
`UnspecifiedEntity` | Class for unspecified entities
`UnspecifiedEntityLayout` | Class for unspecified entity layouts
`UnspecifiedEntitySubunit` | Class for unspecified entity subunits
`UnspecifiedEntitySubunitLayout` | Class for unspecified entity subunit layouts

Attributes:

Name | Type | Description
--- | --- | ---
`SBGNPDLayoutBuilder` |  | Class for SBGN-PD layout builders
`SBGNPDMapBuilder` |  | Class for SBGN-PD map builders
`SBGNPDModelBuilder` |  | Class for SBGN-PD model builders

### `` AndOperator `dataclass`

    AndOperator(
        *,
        id_: str = make_uuid4_as_str(),
        inputs: frozenset[LogicalOperatorInput] = frozenset(),
    )

Bases: `LogicalOperator`

Class for and operators

Parameters:

Name | Type | Description | Default
--- | --- | --- | ---
`id_` | `str` | The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element | `'99b1b1a5-c0e1-4c23-b895-0e071196bc88'`
`inputs` | `frozenset[LogicalOperatorInput]` | The inputs of the logical operator | `<class 'frozenset'>`

### `` AndOperatorLayout `dataclass`

    AndOperatorLayout(
        fill: NoneValueType | Color | None = white,
        stroke: NoneValueType | Color | None = black,
        stroke_width: float | None = 1.25,
        *,
        id_: str = make_uuid4_as_str(),
        layout_elements: tuple[LayoutElement] = tuple(),
        group_fill: NoneValueType | Color | None = None,
        group_fill_rule: FillRule | None = None,
        group_filter: NoneValueType | Filter | None = None,
        group_font_family: str | None = None,
        group_font_size: float | None = None,
        group_font_style: FontStyle | None = None,
        group_font_weight: FontWeight | float | None = None,
        group_stroke: NoneValueType | Color | None = None,
        group_stroke_dasharray: tuple[float, ...] | None = None,
        group_stroke_dashoffset: float | None = None,
        group_stroke_width: float | None = None,
        group_text_anchor: TextAnchor | None = None,
        group_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        filter: NoneValueType | Filter | None = None,
        height: float = 30.0,
        label: TextLayout | None = None,
        position: Point,
        stroke_dasharray: tuple[float, ...] | None = None,
        stroke_dashoffset: float | None = None,
        transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        width: float = 30.0,
        direction: Direction = HORIZONTAL,
        left_to_right: bool = True,
        left_connector_length: float = 10.0,
        right_connector_length: float = 10.0,
        left_connector_stroke: NoneValueType
        | Color
        | None = None,
        left_connector_stroke_width: float | None = None,
        left_connector_stroke_dasharray: NoneValueType
        | tuple[float]
        | None = None,
        left_connector_stroke_dashoffset: float | None = None,
        left_connector_fill: NoneValueType
        | Color
        | None = None,
        left_connector_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        left_connector_filter: NoneValueType
        | Filter
        | None = None,
        right_connector_stroke: NoneValueType
        | Color
        | None = None,
        right_connector_stroke_width: float | None = None,
        right_connector_stroke_dasharray: NoneValueType
        | tuple[float]
        | None = None,
        right_connector_stroke_dashoffset: float | None = None,
        right_connector_fill: NoneValueType
        | Color
        | None = None,
        right_connector_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        right_connector_filter: NoneValueType
        | Filter
        | None = None,
    )

Bases: `_ConnectorsMixin`, `_SimpleMixin`, `_TextMixin`, `SBGNNode`

Class for and operator layouts

Parameters:

Name | Type | Description | Default
--- | --- | --- | ---
`id_` | `str` | The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element | `'e99b0335-4781-4a4f-8658-b2827aff4f7c'`
`layout_elements` | `tuple[LayoutElement]` | The sub-layout elements of the group layout. These are part of the children of the group layout | `<dynamic>`
`group_fill` | `NoneValueType | Color | None` | The fill color of the group layout | `None`
`group_fill_rule` | `FillRule | None` | The fill rule of the group layout | `None`
`group_filter` | `NoneValueType | Filter | None` | The filter of the group layout | `None`
`group_font_family` | `str | None` | The font family of the group layout | `None`
`group_font_size` | `float | None` | The font size of the group layout | `None`
`group_font_style` | `FontStyle | None` | The font style of the group layout | `None`
`group_font_weight` | `FontWeight | float | None` | The font weight of the group layout | `None`
`group_stroke` | `NoneValueType | Color | None` | The stroke color of the group layout | `None`
`group_stroke_dasharray` | `tuple[float, ...] | None` | The stroke dasharray of the group layout | `None`
`group_stroke_dashoffset` | `float | None` | The stroke dashoffset of the group layout | `None`
`group_stroke_width` | `float | None` | The stroke width of the group layout | `None`
`group_text_anchor` | `TextAnchor | None` | The text anchor of the group layout | `None`
`group_transform` | `NoneValueType | tuple[Transformation] | None` | The transform of the group layout | `None`
`fill` | `NoneValueType | Color | None` |  | `Color(red=255, green=255, blue=255, alpha=1.0)`
`filter` | `NoneValueType | Filter | None` | The filter of the node | `None`
`height` | `float` |  | `30.0`
`label` | `TextLayout | None` | The label of the node | `None`
`position` | `Point` | The position of the node | required
`stroke` | `NoneValueType | Color | None` |  | `Color(red=0, green=0, blue=0, alpha=1.0)`
`stroke_dasharray` | `tuple[float, ...] | None` | The stroke dasharray of the node | `None`
`stroke_dashoffset` | `float | None` | The stroke dashoffset of the node | `None`
`stroke_width` | `float | None` |  | `1.25`
`transform` | `NoneValueType | tuple[Transformation] | None` | The transform of the node | `None`
`width` | `float` |  | `30.0`
`direction` | `Direction` |  | `<Direction.HORIZONTAL: 1>`
`left_to_right` | `bool` |  | `True`
`left_connector_length` | `float` |  | `10.0`
`right_connector_length` | `float` |  | `10.0`
`left_connector_stroke` | `NoneValueType | Color | None` |  | `None`
`left_connector_stroke_width` | `float | None` |  | `None`
`left_connector_stroke_dasharray` | `NoneValueType | tuple[float] | None` |  | `None`
`left_connector_stroke_dashoffset` | `float | None` |  | `None`
`left_connector_fill` | `NoneValueType | Color | None` |  | `None`
`left_connector_transform` | `NoneValueType | tuple[Transformation] | None` |  | `None`
`left_connector_filter` | `NoneValueType | Filter | None` |  | `None`
`right_connector_stroke` | `NoneValueType | Color | None` |  | `None`
`right_connector_stroke_width` | `float | None` |  | `None`
`right_connector_stroke_dasharray` | `NoneValueType | tuple[float] | None` |  | `None`
`right_connector_stroke_dashoffset` | `float | None` |  | `None`
`right_connector_fill` | `NoneValueType | Color | None` |  | `None`
`right_connector_transform` | `NoneValueType | tuple[Transformation] | None` |  | `None`
`right_connector_filter` | `NoneValueType | Filter | None` |  | `None`

Methods:

Name | Description
--- | ---
`anchor_point` | Return an anchor point of the layout element
`angle` | Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.
`bbox` | Compute and return the bounding box of the group layout element
`border` | Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point.
`center` | Return the center anchor of the node
`childless` | Return a copy of the node with no children
`children` | Return the children of the group layout.
`contains` | Return `true` if another layout element is a descendant of the layout element, `false` otherwise
`descendants` | Return the descendants of the layout element
`drawing_elements` | Return the drawing elements of the group layout.
`east_north_east` | Return the east north east anchor of the node
`east_south_east` | Return the east south east west anchor of the node
`equals` | Return `true` if the layout element is equal to another layout element, `false` otherwise
`flattened` | Return a list containing copy of the layout element with no children and all its descendants with no children
`label_center` | Return the label center anchor of the node
`north_east` | Return the north east anchor of the node
`north_north_east` | Return the north north east anchor of the node
`north_north_west` | Return the north north west anchor of the node
`north_west` | Return the north west anchor of the node
`self_angle` | Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.
`self_bbox` | Compute and return the bounding box of the self drawing element of the group layout
`self_border` | Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point.
`self_children` | Return the self children of the node. A node has unique child that is its label
`self_drawing_elements` | Return the node's own drawing elements
`self_to_shapely` | Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout
`size` | Return the size of the node
`south_east` | Return the south east anchor of the node
`south_south_east` | Return the south south east anchor of the node
`south_south_west` | Return the south south west anchor of the node
`south_west` | Return the south west anchor of the node
`to_shapely` | Return a shapely collection of geometries reproducing the drawing elements of the layout element
`west_north_west` | Return the west north west anchor of the node
`west_south_west` | Return the west south west anchor of the node

Attributes:

Name | Type | Description
--- | --- | ---
`x` | `float` | Return the x coordinate of the node
`y` | `float` | Return the y coordinate of the node

#### `` anchor_point

    anchor_point(anchor_name: str) -> Point

Return an anchor point of the layout element

Source code in `src/momapy/core.py`

    130
    131
    132
    def anchor_point(self, anchor_name: str) -> momapy.geometry.Point:
        """Return an anchor point of the layout element"""
        return getattr(self, anchor_name)()

#### `` angle

    angle(
        angle: float,
        unit: Literal["degrees", "radians"] = "degrees",
    ) -> Point

Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.

Source code in `src/momapy/core.py`

    817
    818
    819
    820
    821
    822
    823
    824
    825
    826
    827
    828
    def angle(
        self,
        angle: float,
        unit: typing.Literal["degrees", "radians"] = "degrees",
    ) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal."""
        return momapy.drawing.get_drawing_elements_angle(
            drawing_elements=self.drawing_elements(),
            angle=angle,
            unit=unit,
            center=self.center(),
        )

#### `` bbox

    bbox() -> Bbox

Compute and return the bounding box of the group layout element

Source code in `src/momapy/core.py`

    504
    505
    506
    507
    508
    509
    510
    511
    512
    513
    514
    515
    516
    517
    518
    519
    520
    521
    522
    523
    524
    525
    526
    def bbox(self) -> momapy.geometry.Bbox:
        """Compute and return the bounding box of the group layout element"""
        self_bbox = self.self_bbox()
        bboxes = [child.bbox() for child in self.children()]
        min_x = self_bbox.north_west().x
        min_y = self_bbox.north_west().y
        max_x = self_bbox.south_east().x
        max_y = self_bbox.south_east().y
        for bbox in bboxes:
            if bbox.north_west().x < min_x:
                min_x = bbox.north_west().x
            if bbox.north_west().y < min_y:
                min_y = bbox.north_west().y
            if bbox.south_east().x > max_x:
                max_x = bbox.south_east().x
            if bbox.south_east().y > max_y:
                max_y = bbox.south_east().y
        bbox = momapy.geometry.Bbox(
            momapy.geometry.Point(min_x / 2 + max_x / 2, min_y / 2 + max_y / 2),
            max_x - min_x,
            max_y - min_y,
        )
        return bbox

#### `` border

    border(point: Point) -> Point

Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point. When there are multiple intersection points, the one closest to the given point is returned

Source code in `src/momapy/core.py`

    794
    795
    796
    797
    798
    799
    800
    801
    802
    def border(self, point: momapy.geometry.Point) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point.
        When there are multiple intersection points, the one closest to the given point is returned
        """
        return momapy.drawing.get_drawing_elements_border(
            drawing_elements=self.drawing_elements(),
            point=point,
            center=self.center(),
        )

#### `` center

    center() -> Point

Return the center anchor of the node

Source code in `src/momapy/core.py`

    776
    777
    778
    def center(self) -> momapy.geometry.Point:
        """Return the center anchor of the node"""
        return self.position

#### `` childless

    childless() -> Self

Return a copy of the node with no children

Source code in `src/momapy/core.py`

    830
    831
    832
    def childless(self) -> typing.Self:
        """Return a copy of the node with no children"""
        return dataclasses.replace(self, label=None, layout_elements=tuple([]))

#### `` children

    children() -> list[LayoutElement]

Return the children of the group layout. These are the self children of the group layout (returned by the `self_children` method) and the other children of the group layout (given by the `layout_elements` attribute)

Source code in `src/momapy/core.py`

    566
    567
    568
    569
    570
    def children(self) -> list[LayoutElement]:
        """Return the children of the group layout.
        These are the self children of the group layout (returned by the `self_children` method) and the other children of the group layout (given by the `layout_elements` attribute)
        """
        return self.self_children() + list(self.layout_elements)

#### `` contains

    contains(other: LayoutElement) -> bool

Return `true` if another layout element is a descendant of the layout element, `false` otherwise

Source code in `src/momapy/core.py`

    119
    120
    121
    def contains(self, other: "LayoutElement") -> bool:
        """Return `true` if another layout element is a descendant of the layout element, `false` otherwise"""
        return other in self.descendants()

#### `` descendants

    descendants() -> list[LayoutElement]

Return the descendants of the layout element

Source code in `src/momapy/core.py`

    90
    91
    92
    93
    94
    95
    96
    def descendants(self) -> list["LayoutElement"]:
        """Return the descendants of the layout element"""
        descendants = []
        for child in self.children():
            descendants.append(child)
            descendants += child.descendants()
        return descendants

#### `` drawing_elements

    drawing_elements() -> list[DrawingElement]

Return the drawing elements of the group layout. The returned drawing elements are a group drawing element formed of the self drawing elements of the group layout and the drawing elements of its children

Source code in `src/momapy/core.py`

    538
    539
    540
    541
    542
    543
    544
    545
    546
    547
    548
    549
    550
    551
    552
    553
    554
    555
    556
    557
    558
    559
    560
    561
    562
    563
    564
    def drawing_elements(self) -> list[momapy.drawing.DrawingElement]:
        """Return the drawing elements of the group layout.
        The returned drawing elements are a group drawing element formed of the self drawing elements of the group layout and the drawing elements of its children
        """
        drawing_elements = self.self_drawing_elements()
        for child in self.children():
            if child is not None:
                drawing_elements += child.drawing_elements()
        group = momapy.drawing.Group(
            class_=f"{type(self).__name__}_group",
            elements=tuple(drawing_elements),
            id_=f"{self.id_}_group",
            fill=self.group_fill,
            fill_rule=self.group_fill_rule,
            filter=self.group_filter,
            font_family=self.group_font_family,
            font_size=self.group_font_size,
            font_style=self.group_font_style,
            font_weight=self.group_font_weight,
            stroke=self.group_stroke,
            stroke_dasharray=self.group_stroke_dasharray,
            stroke_dashoffset=self.group_stroke_dashoffset,
            stroke_width=self.group_stroke_width,
            text_anchor=self.group_text_anchor,
            transform=self.group_transform,
        )
        return [group]

#### `` east_north_east

    east_north_east() -> Point

Return the east north east anchor of the node

Source code in `src/momapy/core.py`

    700
    701
    702
    703
    704
    705
    706
    def east_north_east(self) -> momapy.geometry.Point:
        """Return the east north east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, -self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` east_south_east

    east_south_east() -> Point

Return the east south east west anchor of the node

Source code in `src/momapy/core.py`

    712
    713
    714
    715
    716
    717
    718
    def east_south_east(self) -> momapy.geometry.Point:
        """Return the east south east west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` equals

    equals(
        other: LayoutElement,
        flattened: bool = False,
        unordered: bool = False,
    ) -> bool

Return `true` if the layout element is equal to another layout element, `false` otherwise

Source code in `src/momapy/core.py`

    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    def equals(
        self, other: "LayoutElement", flattened: bool = False, unordered: bool = False
    ) -> bool:
        """Return `true` if the layout element is equal to another layout element, `false` otherwise"""
        if type(self) is type(other):
            if not flattened:
                return self == other
            else:
                if not unordered:
                    return self.flattened() == other.flattened()
                else:
                    return set(self.flattened()) == set(other.flattened())
        return False

#### `` flattened

    flattened() -> list[LayoutElement]

Return a list containing copy of the layout element with no children and all its descendants with no children

Source code in `src/momapy/core.py`

     98
     99
    100
    101
    102
    103
    def flattened(self) -> list["LayoutElement"]:
        """Return a list containing copy of the layout element with no children and all its descendants with no children"""
        flattened = [self.childless()]
        for child in self.children():
            flattened += child.flattened()
        return flattened

#### `` label_center

    label_center() -> Point

Return the label center anchor of the node

Source code in `src/momapy/core.py`

    780
    781
    782
    def label_center(self) -> momapy.geometry.Point:
        """Return the label center anchor of the node"""
        return self.position

#### `` north_east

    north_east() -> Point

Return the north east anchor of the node

Source code in `src/momapy/core.py`

    692
    693
    694
    695
    696
    697
    698
    def north_east(self) -> momapy.geometry.Point:
        """Return the north east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, -self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` north_north_east

    north_north_east() -> Point

Return the north north east anchor of the node

Source code in `src/momapy/core.py`

    684
    685
    686
    687
    688
    689
    690
    def north_north_east(self) -> momapy.geometry.Point:
        """Return the north north east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 4, -self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` north_north_west

    north_north_west() -> Point

Return the north north west anchor of the node

Source code in `src/momapy/core.py`

    672
    673
    674
    675
    676
    677
    678
    def north_north_west(self) -> momapy.geometry.Point:
        """Return the north north west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() - (self.width / 4, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` north_west

    north_west() -> Point

Return the north west anchor of the node

Source code in `src/momapy/core.py`

    664
    665
    666
    667
    668
    669
    670
    def north_west(self) -> momapy.geometry.Point:
        """Return the north west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() - (self.width / 2, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` self_angle

    self_angle(
        angle: float,
        unit: Literal["degrees", "radians"] = "degrees",
    ) -> Point

Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.

Source code in `src/momapy/core.py`

    804
    805
    806
    807
    808
    809
    810
    811
    812
    813
    814
    815
    def self_angle(
        self,
        angle: float,
        unit: typing.Literal["degrees", "radians"] = "degrees",
    ) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal."""
        return momapy.drawing.get_drawing_elements_angle(
            drawing_elements=self.self_drawing_elements(),
            angle=angle,
            unit=unit,
            center=self.center(),
        )

#### `` self_bbox

    self_bbox() -> Bbox

Compute and return the bounding box of the self drawing element of the group layout

Source code in `src/momapy/core.py`

    499
    500
    501
    502
    def self_bbox(self) -> momapy.geometry.Bbox:
        """Compute and return the bounding box of the self drawing element of the group layout"""
        bounds = self.self_to_shapely().bounds
        return momapy.geometry.Bbox.from_bounds(bounds)

#### `` self_border

    self_border(point: Point) -> Point

Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point. When there are multiple intersection points, the one closest to the given point is returned

Source code in `src/momapy/core.py`

    784
    785
    786
    787
    788
    789
    790
    791
    792
    def self_border(self, point: momapy.geometry.Point) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point.
        When there are multiple intersection points, the one closest to the given point is returned
        """
        return momapy.drawing.get_drawing_elements_border(
            drawing_elements=self.self_drawing_elements(),
            point=point,
            center=self.center(),
        )

#### `` self_children

    self_children() -> list[LayoutElement]

Return the self children of the node. A node has unique child that is its label

Source code in `src/momapy/core.py`

    654
    655
    656
    657
    658
    def self_children(self) -> list[LayoutElement]:
        """Return the self children of the node. A node has unique child that is its label"""
        if self.label is not None:
            return [self.label]
        return []

#### `` self_drawing_elements

    self_drawing_elements() -> list[DrawingElement]

Return the node's own drawing elements

Source code in `src/momapy/core.py`

    637
    638
    639
    640
    641
    642
    643
    644
    645
    646
    647
    648
    649
    650
    651
    652
    def self_drawing_elements(self) -> list[momapy.drawing.DrawingElement]:
        """Return the node's own drawing elements"""
        drawing_elements = self._border_drawing_elements()
        group = momapy.drawing.Group(
            class_=type(self).__name__,
            elements=tuple(drawing_elements),
            fill=self.fill,
            filter=self.filter,
            id_=self.id_,
            stroke=self.stroke,
            stroke_dasharray=self.stroke_dasharray,
            stroke_dashoffset=self.stroke_dashoffset,
            stroke_width=self.stroke_width,
            transform=self.transform,
        )
        return [group]

#### `` self_to_shapely

    self_to_shapely() -> GeometryCollection

Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout

Source code in `src/momapy/core.py`

    495
    496
    497
    def self_to_shapely(self) -> shapely.GeometryCollection:
        """Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout"""
        return momapy.drawing.drawing_elements_to_shapely(self.drawing_elements())

#### `` size

    size() -> tuple[float, float]

Return the size of the node

Source code in `src/momapy/core.py`

    660
    661
    662
    def size(self) -> tuple[float, float]:
        """Return the size of the node"""
        return (self.width, self.height)

#### `` south_east

    south_east() -> Point

Return the south east anchor of the node

Source code in `src/momapy/core.py`

    720
    721
    722
    723
    724
    725
    726
    def south_east(self) -> momapy.geometry.Point:
        """Return the south east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` south_south_east

    south_south_east() -> Point

Return the south south east anchor of the node

Source code in `src/momapy/core.py`

    728
    729
    730
    731
    732
    733
    734
    def south_south_east(self) -> momapy.geometry.Point:
        """Return the south south east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 4, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` south_south_west

    south_south_west() -> Point

Return the south south west anchor of the node

Source code in `src/momapy/core.py`

    740
    741
    742
    743
    744
    745
    746
    def south_south_west(self) -> momapy.geometry.Point:
        """Return the south south west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (-self.width / 4, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` south_west

    south_west() -> Point

Return the south west anchor of the node

Source code in `src/momapy/core.py`

    748
    749
    750
    751
    752
    753
    754
    def south_west(self) -> momapy.geometry.Point:
        """Return the south west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (-self.width / 2, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` to_shapely

    to_shapely(to_polygons: bool = False) -> GeometryCollection

Return a shapely collection of geometries reproducing the drawing elements of the layout element

Source code in `src/momapy/core.py`

    123
    124
    125
    126
    127
    128
    def to_shapely(self, to_polygons: bool = False) -> shapely.GeometryCollection:
        """Return a shapely collection of geometries reproducing the drawing elements of the layout element"""
        geom_collection = []
        for drawing_element in self.drawing_elements():
            geom_collection += drawing_element.to_shapely(to_polygons=to_polygons).geoms
        return shapely.GeometryCollection(geom_collection)

#### `` west_north_west

    west_north_west() -> Point

Return the west north west anchor of the node

Source code in `src/momapy/core.py`

    768
    769
    770
    771
    772
    773
    774
    def west_north_west(self) -> momapy.geometry.Point:
        """Return the west north west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() - (self.width / 2, self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` west_south_west

    west_south_west() -> Point

Return the west south west anchor of the node

Source code in `src/momapy/core.py`

    756
    757
    758
    759
    760
    761
    762
    def west_south_west(self) -> momapy.geometry.Point:
        """Return the west south west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (-self.width / 2, self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` x `property`

    x: float

Return the x coordinate of the node

#### `` y `property`

    y: float

Return the y coordinate of the node

### `` Association `dataclass`

    Association(
        *,
        id_: str = make_uuid4_as_str(),
        reactants: frozenset[Reactant] = frozenset(),
        products: frozenset[Product] = frozenset(),
        reversible: bool = False,
    )

Bases: `GenericProcess`

Class for associations

Parameters:

Name | Type | Description | Default
--- | --- | --- | ---
`id_` | `str` | The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element | `'1e464648-b284-4563-94e9-653b65a07c6a'`
`reactants` | `frozenset[Reactant]` | The reactants of the stoichiometric process | `<class 'frozenset'>`
`products` | `frozenset[Product]` | The products of the stoichiometric process | `<class 'frozenset'>`
`reversible` | `bool` | Whether the stoichiometric process is reversible or not | `False`

### `` AssociationLayout `dataclass`

    AssociationLayout(
        stroke: NoneValueType | Color | None = black,
        stroke_width: float | None = 1.25,
        *,
        id_: str = make_uuid4_as_str(),
        layout_elements: tuple[LayoutElement] = tuple(),
        group_fill: NoneValueType | Color | None = None,
        group_fill_rule: FillRule | None = None,
        group_filter: NoneValueType | Filter | None = None,
        group_font_family: str | None = None,
        group_font_size: float | None = None,
        group_font_style: FontStyle | None = None,
        group_font_weight: FontWeight | float | None = None,
        group_stroke: NoneValueType | Color | None = None,
        group_stroke_dasharray: tuple[float, ...] | None = None,
        group_stroke_dashoffset: float | None = None,
        group_stroke_width: float | None = None,
        group_text_anchor: TextAnchor | None = None,
        group_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        fill: NoneValueType | Color | None = black,
        filter: NoneValueType | Filter | None = None,
        height: float = 20.0,
        label: TextLayout | None = None,
        position: Point,
        stroke_dasharray: tuple[float, ...] | None = None,
        stroke_dashoffset: float | None = None,
        transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        width: float = 20.0,
        direction: Direction = HORIZONTAL,
        left_to_right: bool = True,
        left_connector_length: float = 10.0,
        right_connector_length: float = 10.0,
        left_connector_stroke: NoneValueType
        | Color
        | None = None,
        left_connector_stroke_width: float | None = None,
        left_connector_stroke_dasharray: NoneValueType
        | tuple[float]
        | None = None,
        left_connector_stroke_dashoffset: float | None = None,
        left_connector_fill: NoneValueType
        | Color
        | None = None,
        left_connector_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        left_connector_filter: NoneValueType
        | Filter
        | None = None,
        right_connector_stroke: NoneValueType
        | Color
        | None = None,
        right_connector_stroke_width: float | None = None,
        right_connector_stroke_dasharray: NoneValueType
        | tuple[float]
        | None = None,
        right_connector_stroke_dashoffset: float | None = None,
        right_connector_fill: NoneValueType
        | Color
        | None = None,
        right_connector_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        right_connector_filter: NoneValueType
        | Filter
        | None = None,
    )

Bases: `_ConnectorsMixin`, `_SimpleMixin`, `SBGNNode`

Class for association layouts

Parameters:

Name | Type | Description | Default
--- | --- | --- | ---
`id_` | `str` | The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element | `'7927cac6-780a-437a-9409-d6aaf990b710'`
`layout_elements` | `tuple[LayoutElement]` | The sub-layout elements of the group layout. These are part of the children of the group layout | `<dynamic>`
`group_fill` | `NoneValueType | Color | None` | The fill color of the group layout | `None`
`group_fill_rule` | `FillRule | None` | The fill rule of the group layout | `None`
`group_filter` | `NoneValueType | Filter | None` | The filter of the group layout | `None`
`group_font_family` | `str | None` | The font family of the group layout | `None`
`group_font_size` | `float | None` | The font size of the group layout | `None`
`group_font_style` | `FontStyle | None` | The font style of the group layout | `None`
`group_font_weight` | `FontWeight | float | None` | The font weight of the group layout | `None`
`group_stroke` | `NoneValueType | Color | None` | The stroke color of the group layout | `None`
`group_stroke_dasharray` | `tuple[float, ...] | None` | The stroke dasharray of the group layout | `None`
`group_stroke_dashoffset` | `float | None` | The stroke dashoffset of the group layout | `None`
`group_stroke_width` | `float | None` | The stroke width of the group layout | `None`
`group_text_anchor` | `TextAnchor | None` | The text anchor of the group layout | `None`
`group_transform` | `NoneValueType | tuple[Transformation] | None` | The transform of the group layout | `None`
`fill` | `NoneValueType | Color | None` |  | `Color(red=0, green=0, blue=0, alpha=1.0)`
`filter` | `NoneValueType | Filter | None` | The filter of the node | `None`
`height` | `float` |  | `20.0`
`label` | `TextLayout | None` | The label of the node | `None`
`position` | `Point` | The position of the node | required
`stroke` | `NoneValueType | Color | None` |  | `Color(red=0, green=0, blue=0, alpha=1.0)`
`stroke_dasharray` | `tuple[float, ...] | None` | The stroke dasharray of the node | `None`
`stroke_dashoffset` | `float | None` | The stroke dashoffset of the node | `None`
`stroke_width` | `float | None` |  | `1.25`
`transform` | `NoneValueType | tuple[Transformation] | None` | The transform of the node | `None`
`width` | `float` |  | `20.0`
`direction` | `Direction` |  | `<Direction.HORIZONTAL: 1>`
`left_to_right` | `bool` |  | `True`
`left_connector_length` | `float` |  | `10.0`
`right_connector_length` | `float` |  | `10.0`
`left_connector_stroke` | `NoneValueType | Color | None` |  | `None`
`left_connector_stroke_width` | `float | None` |  | `None`
`left_connector_stroke_dasharray` | `NoneValueType | tuple[float] | None` |  | `None`
`left_connector_stroke_dashoffset` | `float | None` |  | `None`
`left_connector_fill` | `NoneValueType | Color | None` |  | `None`
`left_connector_transform` | `NoneValueType | tuple[Transformation] | None` |  | `None`
`left_connector_filter` | `NoneValueType | Filter | None` |  | `None`
`right_connector_stroke` | `NoneValueType | Color | None` |  | `None`
`right_connector_stroke_width` | `float | None` |  | `None`
`right_connector_stroke_dasharray` | `NoneValueType | tuple[float] | None` |  | `None`
`right_connector_stroke_dashoffset` | `float | None` |  | `None`
`right_connector_fill` | `NoneValueType | Color | None` |  | `None`
`right_connector_transform` | `NoneValueType | tuple[Transformation] | None` |  | `None`
`right_connector_filter` | `NoneValueType | Filter | None` |  | `None`

Methods:

Name | Description
--- | ---
`anchor_point` | Return an anchor point of the layout element
`angle` | Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.
`bbox` | Compute and return the bounding box of the group layout element
`border` | Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point.
`center` | Return the center anchor of the node
`childless` | Return a copy of the node with no children
`children` | Return the children of the group layout.
`contains` | Return `true` if another layout element is a descendant of the layout element, `false` otherwise
`descendants` | Return the descendants of the layout element
`drawing_elements` | Return the drawing elements of the group layout.
`east_north_east` | Return the east north east anchor of the node
`east_south_east` | Return the east south east west anchor of the node
`equals` | Return `true` if the layout element is equal to another layout element, `false` otherwise
`flattened` | Return a list containing copy of the layout element with no children and all its descendants with no children
`label_center` | Return the label center anchor of the node
`north_east` | Return the north east anchor of the node
`north_north_east` | Return the north north east anchor of the node
`north_north_west` | Return the north north west anchor of the node
`north_west` | Return the north west anchor of the node
`self_angle` | Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.
`self_bbox` | Compute and return the bounding box of the self drawing element of the group layout
`self_border` | Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point.
`self_children` | Return the self children of the node. A node has unique child that is its label
`self_drawing_elements` | Return the node's own drawing elements
`self_to_shapely` | Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout
`size` | Return the size of the node
`south_east` | Return the south east anchor of the node
`south_south_east` | Return the south south east anchor of the node
`south_south_west` | Return the south south west anchor of the node
`south_west` | Return the south west anchor of the node
`to_shapely` | Return a shapely collection of geometries reproducing the drawing elements of the layout element
`west_north_west` | Return the west north west anchor of the node
`west_south_west` | Return the west south west anchor of the node

Attributes:

Name | Type | Description
--- | --- | ---
`x` | `float` | Return the x coordinate of the node
`y` | `float` | Return the y coordinate of the node

#### `` anchor_point

    anchor_point(anchor_name: str) -> Point

Return an anchor point of the layout element

Source code in `src/momapy/core.py`

    130
    131
    132
    def anchor_point(self, anchor_name: str) -> momapy.geometry.Point:
        """Return an anchor point of the layout element"""
        return getattr(self, anchor_name)()

#### `` angle

    angle(
        angle: float,
        unit: Literal["degrees", "radians"] = "degrees",
    ) -> Point

Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.

Source code in `src/momapy/core.py`

    817
    818
    819
    820
    821
    822
    823
    824
    825
    826
    827
    828
    def angle(
        self,
        angle: float,
        unit: typing.Literal["degrees", "radians"] = "degrees",
    ) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal."""
        return momapy.drawing.get_drawing_elements_angle(
            drawing_elements=self.drawing_elements(),
            angle=angle,
            unit=unit,
            center=self.center(),
        )

#### `` bbox

    bbox() -> Bbox

Compute and return the bounding box of the group layout element

Source code in `src/momapy/core.py`

    504
    505
    506
    507
    508
    509
    510
    511
    512
    513
    514
    515
    516
    517
    518
    519
    520
    521
    522
    523
    524
    525
    526
    def bbox(self) -> momapy.geometry.Bbox:
        """Compute and return the bounding box of the group layout element"""
        self_bbox = self.self_bbox()
        bboxes = [child.bbox() for child in self.children()]
        min_x = self_bbox.north_west().x
        min_y = self_bbox.north_west().y
        max_x = self_bbox.south_east().x
        max_y = self_bbox.south_east().y
        for bbox in bboxes:
            if bbox.north_west().x < min_x:
                min_x = bbox.north_west().x
            if bbox.north_west().y < min_y:
                min_y = bbox.north_west().y
            if bbox.south_east().x > max_x:
                max_x = bbox.south_east().x
            if bbox.south_east().y > max_y:
                max_y = bbox.south_east().y
        bbox = momapy.geometry.Bbox(
            momapy.geometry.Point(min_x / 2 + max_x / 2, min_y / 2 + max_y / 2),
            max_x - min_x,
            max_y - min_y,
        )
        return bbox

#### `` border

    border(point: Point) -> Point

Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point. When there are multiple intersection points, the one closest to the given point is returned

Source code in `src/momapy/core.py`

    794
    795
    796
    797
    798
    799
    800
    801
    802
    def border(self, point: momapy.geometry.Point) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point.
        When there are multiple intersection points, the one closest to the given point is returned
        """
        return momapy.drawing.get_drawing_elements_border(
            drawing_elements=self.drawing_elements(),
            point=point,
            center=self.center(),
        )

#### `` center

    center() -> Point

Return the center anchor of the node

Source code in `src/momapy/core.py`

    776
    777
    778
    def center(self) -> momapy.geometry.Point:
        """Return the center anchor of the node"""
        return self.position

#### `` childless

    childless() -> Self

Return a copy of the node with no children

Source code in `src/momapy/core.py`

    830
    831
    832
    def childless(self) -> typing.Self:
        """Return a copy of the node with no children"""
        return dataclasses.replace(self, label=None, layout_elements=tuple([]))

#### `` children

    children() -> list[LayoutElement]

Return the children of the group layout. These are the self children of the group layout (returned by the `self_children` method) and the other children of the group layout (given by the `layout_elements` attribute)

Source code in `src/momapy/core.py`

    566
    567
    568
    569
    570
    def children(self) -> list[LayoutElement]:
        """Return the children of the group layout.
        These are the self children of the group layout (returned by the `self_children` method) and the other children of the group layout (given by the `layout_elements` attribute)
        """
        return self.self_children() + list(self.layout_elements)

#### `` contains

    contains(other: LayoutElement) -> bool

Return `true` if another layout element is a descendant of the layout element, `false` otherwise

Source code in `src/momapy/core.py`

    119
    120
    121
    def contains(self, other: "LayoutElement") -> bool:
        """Return `true` if another layout element is a descendant of the layout element, `false` otherwise"""
        return other in self.descendants()

#### `` descendants

    descendants() -> list[LayoutElement]

Return the descendants of the layout element

Source code in `src/momapy/core.py`

    90
    91
    92
    93
    94
    95
    96
    def descendants(self) -> list["LayoutElement"]:
        """Return the descendants of the layout element"""
        descendants = []
        for child in self.children():
            descendants.append(child)
            descendants += child.descendants()
        return descendants

#### `` drawing_elements

    drawing_elements() -> list[DrawingElement]

Return the drawing elements of the group layout. The returned drawing elements are a group drawing element formed of the self drawing elements of the group layout and the drawing elements of its children

Source code in `src/momapy/core.py`

    538
    539
    540
    541
    542
    543
    544
    545
    546
    547
    548
    549
    550
    551
    552
    553
    554
    555
    556
    557
    558
    559
    560
    561
    562
    563
    564
    def drawing_elements(self) -> list[momapy.drawing.DrawingElement]:
        """Return the drawing elements of the group layout.
        The returned drawing elements are a group drawing element formed of the self drawing elements of the group layout and the drawing elements of its children
        """
        drawing_elements = self.self_drawing_elements()
        for child in self.children():
            if child is not None:
                drawing_elements += child.drawing_elements()
        group = momapy.drawing.Group(
            class_=f"{type(self).__name__}_group",
            elements=tuple(drawing_elements),
            id_=f"{self.id_}_group",
            fill=self.group_fill,
            fill_rule=self.group_fill_rule,
            filter=self.group_filter,
            font_family=self.group_font_family,
            font_size=self.group_font_size,
            font_style=self.group_font_style,
            font_weight=self.group_font_weight,
            stroke=self.group_stroke,
            stroke_dasharray=self.group_stroke_dasharray,
            stroke_dashoffset=self.group_stroke_dashoffset,
            stroke_width=self.group_stroke_width,
            text_anchor=self.group_text_anchor,
            transform=self.group_transform,
        )
        return [group]

#### `` east_north_east

    east_north_east() -> Point

Return the east north east anchor of the node

Source code in `src/momapy/core.py`

    700
    701
    702
    703
    704
    705
    706
    def east_north_east(self) -> momapy.geometry.Point:
        """Return the east north east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, -self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` east_south_east

    east_south_east() -> Point

Return the east south east west anchor of the node

Source code in `src/momapy/core.py`

    712
    713
    714
    715
    716
    717
    718
    def east_south_east(self) -> momapy.geometry.Point:
        """Return the east south east west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` equals

    equals(
        other: LayoutElement,
        flattened: bool = False,
        unordered: bool = False,
    ) -> bool

Return `true` if the layout element is equal to another layout element, `false` otherwise

Source code in `src/momapy/core.py`

    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    def equals(
        self, other: "LayoutElement", flattened: bool = False, unordered: bool = False
    ) -> bool:
        """Return `true` if the layout element is equal to another layout element, `false` otherwise"""
        if type(self) is type(other):
            if not flattened:
                return self == other
            else:
                if not unordered:
                    return self.flattened() == other.flattened()
                else:
                    return set(self.flattened()) == set(other.flattened())
        return False

#### `` flattened

    flattened() -> list[LayoutElement]

Return a list containing copy of the layout element with no children and all its descendants with no children

Source code in `src/momapy/core.py`

     98
     99
    100
    101
    102
    103
    def flattened(self) -> list["LayoutElement"]:
        """Return a list containing copy of the layout element with no children and all its descendants with no children"""
        flattened = [self.childless()]
        for child in self.children():
            flattened += child.flattened()
        return flattened

#### `` label_center

    label_center() -> Point

Return the label center anchor of the node

Source code in `src/momapy/core.py`

    780
    781
    782
    def label_center(self) -> momapy.geometry.Point:
        """Return the label center anchor of the node"""
        return self.position

#### `` north_east

    north_east() -> Point

Return the north east anchor of the node

Source code in `src/momapy/core.py`

    692
    693
    694
    695
    696
    697
    698
    def north_east(self) -> momapy.geometry.Point:
        """Return the north east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, -self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` north_north_east

    north_north_east() -> Point

Return the north north east anchor of the node

Source code in `src/momapy/core.py`

    684
    685
    686
    687
    688
    689
    690
    def north_north_east(self) -> momapy.geometry.Point:
        """Return the north north east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 4, -self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` north_north_west

    north_north_west() -> Point

Return the north north west anchor of the node

Source code in `src/momapy/core.py`

    672
    673
    674
    675
    676
    677
    678
    def north_north_west(self) -> momapy.geometry.Point:
        """Return the north north west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() - (self.width / 4, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` north_west

    north_west() -> Point

Return the north west anchor of the node

Source code in `src/momapy/core.py`

    664
    665
    666
    667
    668
    669
    670
    def north_west(self) -> momapy.geometry.Point:
        """Return the north west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() - (self.width / 2, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` self_angle

    self_angle(
        angle: float,
        unit: Literal["degrees", "radians"] = "degrees",
    ) -> Point

Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.

Source code in `src/momapy/core.py`

    804
    805
    806
    807
    808
    809
    810
    811
    812
    813
    814
    815
    def self_angle(
        self,
        angle: float,
        unit: typing.Literal["degrees", "radians"] = "degrees",
    ) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal."""
        return momapy.drawing.get_drawing_elements_angle(
            drawing_elements=self.self_drawing_elements(),
            angle=angle,
            unit=unit,
            center=self.center(),
        )

#### `` self_bbox

    self_bbox() -> Bbox

Compute and return the bounding box of the self drawing element of the group layout

Source code in `src/momapy/core.py`

    499
    500
    501
    502
    def self_bbox(self) -> momapy.geometry.Bbox:
        """Compute and return the bounding box of the self drawing element of the group layout"""
        bounds = self.self_to_shapely().bounds
        return momapy.geometry.Bbox.from_bounds(bounds)

#### `` self_border

    self_border(point: Point) -> Point

Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point. When there are multiple intersection points, the one closest to the given point is returned

Source code in `src/momapy/core.py`

    784
    785
    786
    787
    788
    789
    790
    791
    792
    def self_border(self, point: momapy.geometry.Point) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point.
        When there are multiple intersection points, the one closest to the given point is returned
        """
        return momapy.drawing.get_drawing_elements_border(
            drawing_elements=self.self_drawing_elements(),
            point=point,
            center=self.center(),
        )

#### `` self_children

    self_children() -> list[LayoutElement]

Return the self children of the node. A node has unique child that is its label

Source code in `src/momapy/core.py`

    654
    655
    656
    657
    658
    def self_children(self) -> list[LayoutElement]:
        """Return the self children of the node. A node has unique child that is its label"""
        if self.label is not None:
            return [self.label]
        return []

#### `` self_drawing_elements

    self_drawing_elements() -> list[DrawingElement]

Return the node's own drawing elements

Source code in `src/momapy/core.py`

    637
    638
    639
    640
    641
    642
    643
    644
    645
    646
    647
    648
    649
    650
    651
    652
    def self_drawing_elements(self) -> list[momapy.drawing.DrawingElement]:
        """Return the node's own drawing elements"""
        drawing_elements = self._border_drawing_elements()
        group = momapy.drawing.Group(
            class_=type(self).__name__,
            elements=tuple(drawing_elements),
            fill=self.fill,
            filter=self.filter,
            id_=self.id_,
            stroke=self.stroke,
            stroke_dasharray=self.stroke_dasharray,
            stroke_dashoffset=self.stroke_dashoffset,
            stroke_width=self.stroke_width,
            transform=self.transform,
        )
        return [group]

#### `` self_to_shapely

    self_to_shapely() -> GeometryCollection

Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout

Source code in `src/momapy/core.py`

    495
    496
    497
    def self_to_shapely(self) -> shapely.GeometryCollection:
        """Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout"""
        return momapy.drawing.drawing_elements_to_shapely(self.drawing_elements())

#### `` size

    size() -> tuple[float, float]

Return the size of the node

Source code in `src/momapy/core.py`

    660
    661
    662
    def size(self) -> tuple[float, float]:
        """Return the size of the node"""
        return (self.width, self.height)

#### `` south_east

    south_east() -> Point

Return the south east anchor of the node

Source code in `src/momapy/core.py`

    720
    721
    722
    723
    724
    725
    726
    def south_east(self) -> momapy.geometry.Point:
        """Return the south east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` south_south_east

    south_south_east() -> Point

Return the south south east anchor of the node

Source code in `src/momapy/core.py`

    728
    729
    730
    731
    732
    733
    734
    def south_south_east(self) -> momapy.geometry.Point:
        """Return the south south east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 4, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` south_south_west

    south_south_west() -> Point

Return the south south west anchor of the node

Source code in `src/momapy/core.py`

    740
    741
    742
    743
    744
    745
    746
    def south_south_west(self) -> momapy.geometry.Point:
        """Return the south south west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (-self.width / 4, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` south_west

    south_west() -> Point

Return the south west anchor of the node

Source code in `src/momapy/core.py`

    748
    749
    750
    751
    752
    753
    754
    def south_west(self) -> momapy.geometry.Point:
        """Return the south west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (-self.width / 2, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` to_shapely

    to_shapely(to_polygons: bool = False) -> GeometryCollection

Return a shapely collection of geometries reproducing the drawing elements of the layout element

Source code in `src/momapy/core.py`

    123
    124
    125
    126
    127
    128
    def to_shapely(self, to_polygons: bool = False) -> shapely.GeometryCollection:
        """Return a shapely collection of geometries reproducing the drawing elements of the layout element"""
        geom_collection = []
        for drawing_element in self.drawing_elements():
            geom_collection += drawing_element.to_shapely(to_polygons=to_polygons).geoms
        return shapely.GeometryCollection(geom_collection)

#### `` west_north_west

    west_north_west() -> Point

Return the west north west anchor of the node

Source code in `src/momapy/core.py`

    768
    769
    770
    771
    772
    773
    774
    def west_north_west(self) -> momapy.geometry.Point:
        """Return the west north west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() - (self.width / 2, self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` west_south_west

    west_south_west() -> Point

Return the west south west anchor of the node

Source code in `src/momapy/core.py`

    756
    757
    758
    759
    760
    761
    762
    def west_south_west(self) -> momapy.geometry.Point:
        """Return the west south west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (-self.width / 2, self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` x `property`

    x: float

Return the x coordinate of the node

#### `` y `property`

    y: float

Return the y coordinate of the node

### `` CardinalityLayout `dataclass`

    CardinalityLayout(
        fill: NoneValueType | Color | None = white,
        stroke: NoneValueType | Color | None = black,
        stroke_width: float | None = 1.25,
        *,
        id_: str = make_uuid4_as_str(),
        layout_elements: tuple[LayoutElement] = tuple(),
        group_fill: NoneValueType | Color | None = None,
        group_fill_rule: FillRule | None = None,
        group_filter: NoneValueType | Filter | None = None,
        group_font_family: str | None = None,
        group_font_size: float | None = None,
        group_font_style: FontStyle | None = None,
        group_font_weight: FontWeight | float | None = None,
        group_stroke: NoneValueType | Color | None = None,
        group_stroke_dasharray: tuple[float, ...] | None = None,
        group_stroke_dashoffset: float | None = None,
        group_stroke_width: float | None = None,
        group_text_anchor: TextAnchor | None = None,
        group_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        filter: NoneValueType | Filter | None = None,
        height: float = 19.0,
        label: TextLayout | None = None,
        position: Point,
        stroke_dasharray: tuple[float, ...] | None = None,
        stroke_dashoffset: float | None = None,
        transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        width: float = 12.0,
    )

Bases: `_SimpleMixin`, `SBGNNode`

Class for cardinality layouts

Parameters:

Name | Type | Description | Default
--- | --- | --- | ---
`id_` | `str` | The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element | `'0c0df93e-dc2b-4645-a963-6051db96780b'`
`layout_elements` | `tuple[LayoutElement]` | The sub-layout elements of the group layout. These are part of the children of the group layout | `<dynamic>`
`group_fill` | `NoneValueType | Color | None` | The fill color of the group layout | `None`
`group_fill_rule` | `FillRule | None` | The fill rule of the group layout | `None`
`group_filter` | `NoneValueType | Filter | None` | The filter of the group layout | `None`
`group_font_family` | `str | None` | The font family of the group layout | `None`
`group_font_size` | `float | None` | The font size of the group layout | `None`
`group_font_style` | `FontStyle | None` | The font style of the group layout | `None`
`group_font_weight` | `FontWeight | float | None` | The font weight of the group layout | `None`
`group_stroke` | `NoneValueType | Color | None` | The stroke color of the group layout | `None`
`group_stroke_dasharray` | `tuple[float, ...] | None` | The stroke dasharray of the group layout | `None`
`group_stroke_dashoffset` | `float | None` | The stroke dashoffset of the group layout | `None`
`group_stroke_width` | `float | None` | The stroke width of the group layout | `None`
`group_text_anchor` | `TextAnchor | None` | The text anchor of the group layout | `None`
`group_transform` | `NoneValueType | tuple[Transformation] | None` | The transform of the group layout | `None`
`fill` | `NoneValueType | Color | None` |  | `Color(red=255, green=255, blue=255, alpha=1.0)`
`filter` | `NoneValueType | Filter | None` | The filter of the node | `None`
`height` | `float` |  | `19.0`
`label` | `TextLayout | None` | The label of the node | `None`
`position` | `Point` | The position of the node | required
`stroke` | `NoneValueType | Color | None` |  | `Color(red=0, green=0, blue=0, alpha=1.0)`
`stroke_dasharray` | `tuple[float, ...] | None` | The stroke dasharray of the node | `None`
`stroke_dashoffset` | `float | None` | The stroke dashoffset of the node | `None`
`stroke_width` | `float | None` |  | `1.25`
`transform` | `NoneValueType | tuple[Transformation] | None` | The transform of the node | `None`
`width` | `float` |  | `12.0`

Methods:

Name | Description
--- | ---
`anchor_point` | Return an anchor point of the layout element
`angle` | Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.
`bbox` | Compute and return the bounding box of the group layout element
`border` | Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point.
`center` | Return the center anchor of the node
`childless` | Return a copy of the node with no children
`children` | Return the children of the group layout.
`contains` | Return `true` if another layout element is a descendant of the layout element, `false` otherwise
`descendants` | Return the descendants of the layout element
`drawing_elements` | Return the drawing elements of the group layout.
`east` | Return the east anchor of the node
`east_north_east` | Return the east north east anchor of the node
`east_south_east` | Return the east south east west anchor of the node
`equals` | Return `true` if the layout element is equal to another layout element, `false` otherwise
`flattened` | Return a list containing copy of the layout element with no children and all its descendants with no children
`label_center` | Return the label center anchor of the node
`north` | Return the north anchor of the node
`north_east` | Return the north east anchor of the node
`north_north_east` | Return the north north east anchor of the node
`north_north_west` | Return the north north west anchor of the node
`north_west` | Return the north west anchor of the node
`self_angle` | Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.
`self_bbox` | Compute and return the bounding box of the self drawing element of the group layout
`self_border` | Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point.
`self_children` | Return the self children of the node. A node has unique child that is its label
`self_drawing_elements` | Return the node's own drawing elements
`self_to_shapely` | Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout
`size` | Return the size of the node
`south` | Return the south anchor of the node
`south_east` | Return the south east anchor of the node
`south_south_east` | Return the south south east anchor of the node
`south_south_west` | Return the south south west anchor of the node
`south_west` | Return the south west anchor of the node
`to_shapely` | Return a shapely collection of geometries reproducing the drawing elements of the layout element
`west` | Return the west anchor of the node
`west_north_west` | Return the west north west anchor of the node
`west_south_west` | Return the west south west anchor of the node

Attributes:

Name | Type | Description
--- | --- | ---
`x` | `float` | Return the x coordinate of the node
`y` | `float` | Return the y coordinate of the node

#### `` anchor_point

    anchor_point(anchor_name: str) -> Point

Return an anchor point of the layout element

Source code in `src/momapy/core.py`

    130
    131
    132
    def anchor_point(self, anchor_name: str) -> momapy.geometry.Point:
        """Return an anchor point of the layout element"""
        return getattr(self, anchor_name)()

#### `` angle

    angle(
        angle: float,
        unit: Literal["degrees", "radians"] = "degrees",
    ) -> Point

Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.

Source code in `src/momapy/core.py`

    817
    818
    819
    820
    821
    822
    823
    824
    825
    826
    827
    828
    def angle(
        self,
        angle: float,
        unit: typing.Literal["degrees", "radians"] = "degrees",
    ) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal."""
        return momapy.drawing.get_drawing_elements_angle(
            drawing_elements=self.drawing_elements(),
            angle=angle,
            unit=unit,
            center=self.center(),
        )

#### `` bbox

    bbox() -> Bbox

Compute and return the bounding box of the group layout element

Source code in `src/momapy/core.py`

    504
    505
    506
    507
    508
    509
    510
    511
    512
    513
    514
    515
    516
    517
    518
    519
    520
    521
    522
    523
    524
    525
    526
    def bbox(self) -> momapy.geometry.Bbox:
        """Compute and return the bounding box of the group layout element"""
        self_bbox = self.self_bbox()
        bboxes = [child.bbox() for child in self.children()]
        min_x = self_bbox.north_west().x
        min_y = self_bbox.north_west().y
        max_x = self_bbox.south_east().x
        max_y = self_bbox.south_east().y
        for bbox in bboxes:
            if bbox.north_west().x < min_x:
                min_x = bbox.north_west().x
            if bbox.north_west().y < min_y:
                min_y = bbox.north_west().y
            if bbox.south_east().x > max_x:
                max_x = bbox.south_east().x
            if bbox.south_east().y > max_y:
                max_y = bbox.south_east().y
        bbox = momapy.geometry.Bbox(
            momapy.geometry.Point(min_x / 2 + max_x / 2, min_y / 2 + max_y / 2),
            max_x - min_x,
            max_y - min_y,
        )
        return bbox

#### `` border

    border(point: Point) -> Point

Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point. When there are multiple intersection points, the one closest to the given point is returned

Source code in `src/momapy/core.py`

    794
    795
    796
    797
    798
    799
    800
    801
    802
    def border(self, point: momapy.geometry.Point) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point.
        When there are multiple intersection points, the one closest to the given point is returned
        """
        return momapy.drawing.get_drawing_elements_border(
            drawing_elements=self.drawing_elements(),
            point=point,
            center=self.center(),
        )

#### `` center

    center() -> Point

Return the center anchor of the node

Source code in `src/momapy/core.py`

    776
    777
    778
    def center(self) -> momapy.geometry.Point:
        """Return the center anchor of the node"""
        return self.position

#### `` childless

    childless() -> Self

Return a copy of the node with no children

Source code in `src/momapy/core.py`

    830
    831
    832
    def childless(self) -> typing.Self:
        """Return a copy of the node with no children"""
        return dataclasses.replace(self, label=None, layout_elements=tuple([]))

#### `` children

    children() -> list[LayoutElement]

Return the children of the group layout. These are the self children of the group layout (returned by the `self_children` method) and the other children of the group layout (given by the `layout_elements` attribute)

Source code in `src/momapy/core.py`

    566
    567
    568
    569
    570
    def children(self) -> list[LayoutElement]:
        """Return the children of the group layout.
        These are the self children of the group layout (returned by the `self_children` method) and the other children of the group layout (given by the `layout_elements` attribute)
        """
        return self.self_children() + list(self.layout_elements)

#### `` contains

    contains(other: LayoutElement) -> bool

Return `true` if another layout element is a descendant of the layout element, `false` otherwise

Source code in `src/momapy/core.py`

    119
    120
    121
    def contains(self, other: "LayoutElement") -> bool:
        """Return `true` if another layout element is a descendant of the layout element, `false` otherwise"""
        return other in self.descendants()

#### `` descendants

    descendants() -> list[LayoutElement]

Return the descendants of the layout element

Source code in `src/momapy/core.py`

    90
    91
    92
    93
    94
    95
    96
    def descendants(self) -> list["LayoutElement"]:
        """Return the descendants of the layout element"""
        descendants = []
        for child in self.children():
            descendants.append(child)
            descendants += child.descendants()
        return descendants

#### `` drawing_elements

    drawing_elements() -> list[DrawingElement]

Return the drawing elements of the group layout. The returned drawing elements are a group drawing element formed of the self drawing elements of the group layout and the drawing elements of its children

Source code in `src/momapy/core.py`

    538
    539
    540
    541
    542
    543
    544
    545
    546
    547
    548
    549
    550
    551
    552
    553
    554
    555
    556
    557
    558
    559
    560
    561
    562
    563
    564
    def drawing_elements(self) -> list[momapy.drawing.DrawingElement]:
        """Return the drawing elements of the group layout.
        The returned drawing elements are a group drawing element formed of the self drawing elements of the group layout and the drawing elements of its children
        """
        drawing_elements = self.self_drawing_elements()
        for child in self.children():
            if child is not None:
                drawing_elements += child.drawing_elements()
        group = momapy.drawing.Group(
            class_=f"{type(self).__name__}_group",
            elements=tuple(drawing_elements),
            id_=f"{self.id_}_group",
            fill=self.group_fill,
            fill_rule=self.group_fill_rule,
            filter=self.group_filter,
            font_family=self.group_font_family,
            font_size=self.group_font_size,
            font_style=self.group_font_style,
            font_weight=self.group_font_weight,
            stroke=self.group_stroke,
            stroke_dasharray=self.group_stroke_dasharray,
            stroke_dashoffset=self.group_stroke_dashoffset,
            stroke_width=self.group_stroke_width,
            text_anchor=self.group_text_anchor,
            transform=self.group_transform,
        )
        return [group]

#### `` east

    east() -> Point

Return the east anchor of the node

Source code in `src/momapy/core.py`

    708
    709
    710
    def east(self) -> momapy.geometry.Point:
        """Return the east anchor of the node"""
        return self.self_angle(0)

#### `` east_north_east

    east_north_east() -> Point

Return the east north east anchor of the node

Source code in `src/momapy/core.py`

    700
    701
    702
    703
    704
    705
    706
    def east_north_east(self) -> momapy.geometry.Point:
        """Return the east north east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, -self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` east_south_east

    east_south_east() -> Point

Return the east south east west anchor of the node

Source code in `src/momapy/core.py`

    712
    713
    714
    715
    716
    717
    718
    def east_south_east(self) -> momapy.geometry.Point:
        """Return the east south east west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` equals

    equals(
        other: LayoutElement,
        flattened: bool = False,
        unordered: bool = False,
    ) -> bool

Return `true` if the layout element is equal to another layout element, `false` otherwise

Source code in `src/momapy/core.py`

    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    def equals(
        self, other: "LayoutElement", flattened: bool = False, unordered: bool = False
    ) -> bool:
        """Return `true` if the layout element is equal to another layout element, `false` otherwise"""
        if type(self) is type(other):
            if not flattened:
                return self == other
            else:
                if not unordered:
                    return self.flattened() == other.flattened()
                else:
                    return set(self.flattened()) == set(other.flattened())
        return False

#### `` flattened

    flattened() -> list[LayoutElement]

Return a list containing copy of the layout element with no children and all its descendants with no children

Source code in `src/momapy/core.py`

     98
     99
    100
    101
    102
    103
    def flattened(self) -> list["LayoutElement"]:
        """Return a list containing copy of the layout element with no children and all its descendants with no children"""
        flattened = [self.childless()]
        for child in self.children():
            flattened += child.flattened()
        return flattened

#### `` label_center

    label_center() -> Point

Return the label center anchor of the node

Source code in `src/momapy/core.py`

    780
    781
    782
    def label_center(self) -> momapy.geometry.Point:
        """Return the label center anchor of the node"""
        return self.position

#### `` north

    north() -> Point

Return the north anchor of the node

Source code in `src/momapy/core.py`

    680
    681
    682
    def north(self) -> momapy.geometry.Point:
        """Return the north anchor of the node"""
        return self.self_angle(90)

#### `` north_east

    north_east() -> Point

Return the north east anchor of the node

Source code in `src/momapy/core.py`

    692
    693
    694
    695
    696
    697
    698
    def north_east(self) -> momapy.geometry.Point:
        """Return the north east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, -self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` north_north_east

    north_north_east() -> Point

Return the north north east anchor of the node

Source code in `src/momapy/core.py`

    684
    685
    686
    687
    688
    689
    690
    def north_north_east(self) -> momapy.geometry.Point:
        """Return the north north east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 4, -self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` north_north_west

    north_north_west() -> Point

Return the north north west anchor of the node

Source code in `src/momapy/core.py`

    672
    673
    674
    675
    676
    677
    678
    def north_north_west(self) -> momapy.geometry.Point:
        """Return the north north west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() - (self.width / 4, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` north_west

    north_west() -> Point

Return the north west anchor of the node

Source code in `src/momapy/core.py`

    664
    665
    666
    667
    668
    669
    670
    def north_west(self) -> momapy.geometry.Point:
        """Return the north west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() - (self.width / 2, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` self_angle

    self_angle(
        angle: float,
        unit: Literal["degrees", "radians"] = "degrees",
    ) -> Point

Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.

Source code in `src/momapy/core.py`

    804
    805
    806
    807
    808
    809
    810
    811
    812
    813
    814
    815
    def self_angle(
        self,
        angle: float,
        unit: typing.Literal["degrees", "radians"] = "degrees",
    ) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal."""
        return momapy.drawing.get_drawing_elements_angle(
            drawing_elements=self.self_drawing_elements(),
            angle=angle,
            unit=unit,
            center=self.center(),
        )

#### `` self_bbox

    self_bbox() -> Bbox

Compute and return the bounding box of the self drawing element of the group layout

Source code in `src/momapy/core.py`

    499
    500
    501
    502
    def self_bbox(self) -> momapy.geometry.Bbox:
        """Compute and return the bounding box of the self drawing element of the group layout"""
        bounds = self.self_to_shapely().bounds
        return momapy.geometry.Bbox.from_bounds(bounds)

#### `` self_border

    self_border(point: Point) -> Point

Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point. When there are multiple intersection points, the one closest to the given point is returned

Source code in `src/momapy/core.py`

    784
    785
    786
    787
    788
    789
    790
    791
    792
    def self_border(self, point: momapy.geometry.Point) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point.
        When there are multiple intersection points, the one closest to the given point is returned
        """
        return momapy.drawing.get_drawing_elements_border(
            drawing_elements=self.self_drawing_elements(),
            point=point,
            center=self.center(),
        )

#### `` self_children

    self_children() -> list[LayoutElement]

Return the self children of the node. A node has unique child that is its label

Source code in `src/momapy/core.py`

    654
    655
    656
    657
    658
    def self_children(self) -> list[LayoutElement]:
        """Return the self children of the node. A node has unique child that is its label"""
        if self.label is not None:
            return [self.label]
        return []

#### `` self_drawing_elements

    self_drawing_elements() -> list[DrawingElement]

Return the node's own drawing elements

Source code in `src/momapy/core.py`

    637
    638
    639
    640
    641
    642
    643
    644
    645
    646
    647
    648
    649
    650
    651
    652
    def self_drawing_elements(self) -> list[momapy.drawing.DrawingElement]:
        """Return the node's own drawing elements"""
        drawing_elements = self._border_drawing_elements()
        group = momapy.drawing.Group(
            class_=type(self).__name__,
            elements=tuple(drawing_elements),
            fill=self.fill,
            filter=self.filter,
            id_=self.id_,
            stroke=self.stroke,
            stroke_dasharray=self.stroke_dasharray,
            stroke_dashoffset=self.stroke_dashoffset,
            stroke_width=self.stroke_width,
            transform=self.transform,
        )
        return [group]

#### `` self_to_shapely

    self_to_shapely() -> GeometryCollection

Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout

Source code in `src/momapy/core.py`

    495
    496
    497
    def self_to_shapely(self) -> shapely.GeometryCollection:
        """Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout"""
        return momapy.drawing.drawing_elements_to_shapely(self.drawing_elements())

#### `` size

    size() -> tuple[float, float]

Return the size of the node

Source code in `src/momapy/core.py`

    660
    661
    662
    def size(self) -> tuple[float, float]:
        """Return the size of the node"""
        return (self.width, self.height)

#### `` south

    south() -> Point

Return the south anchor of the node

Source code in `src/momapy/core.py`

    736
    737
    738
    def south(self) -> momapy.geometry.Point:
        """Return the south anchor of the node"""
        return self.self_angle(270)

#### `` south_east

    south_east() -> Point

Return the south east anchor of the node

Source code in `src/momapy/core.py`

    720
    721
    722
    723
    724
    725
    726
    def south_east(self) -> momapy.geometry.Point:
        """Return the south east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` south_south_east

    south_south_east() -> Point

Return the south south east anchor of the node

Source code in `src/momapy/core.py`

    728
    729
    730
    731
    732
    733
    734
    def south_south_east(self) -> momapy.geometry.Point:
        """Return the south south east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 4, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` south_south_west

    south_south_west() -> Point

Return the south south west anchor of the node

Source code in `src/momapy/core.py`

    740
    741
    742
    743
    744
    745
    746
    def south_south_west(self) -> momapy.geometry.Point:
        """Return the south south west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (-self.width / 4, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` south_west

    south_west() -> Point

Return the south west anchor of the node

Source code in `src/momapy/core.py`

    748
    749
    750
    751
    752
    753
    754
    def south_west(self) -> momapy.geometry.Point:
        """Return the south west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (-self.width / 2, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` to_shapely

    to_shapely(to_polygons: bool = False) -> GeometryCollection

Return a shapely collection of geometries reproducing the drawing elements of the layout element

Source code in `src/momapy/core.py`

    123
    124
    125
    126
    127
    128
    def to_shapely(self, to_polygons: bool = False) -> shapely.GeometryCollection:
        """Return a shapely collection of geometries reproducing the drawing elements of the layout element"""
        geom_collection = []
        for drawing_element in self.drawing_elements():
            geom_collection += drawing_element.to_shapely(to_polygons=to_polygons).geoms
        return shapely.GeometryCollection(geom_collection)

#### `` west

    west() -> Point

Return the west anchor of the node

Source code in `src/momapy/core.py`

    764
    765
    766
    def west(self) -> momapy.geometry.Point:
        """Return the west anchor of the node"""
        return self.self_angle(180)

#### `` west_north_west

    west_north_west() -> Point

Return the west north west anchor of the node

Source code in `src/momapy/core.py`

    768
    769
    770
    771
    772
    773
    774
    def west_north_west(self) -> momapy.geometry.Point:
        """Return the west north west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() - (self.width / 2, self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` west_south_west

    west_south_west() -> Point

Return the west south west anchor of the node

Source code in `src/momapy/core.py`

    756
    757
    758
    759
    760
    761
    762
    def west_south_west(self) -> momapy.geometry.Point:
        """Return the west south west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (-self.width / 2, self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` x `property`

    x: float

Return the x coordinate of the node

#### `` y `property`

    y: float

Return the y coordinate of the node

### `` Catalysis `dataclass`

    Catalysis(
        *,
        id_: str = make_uuid4_as_str(),
        source: EntityPool | LogicalOperator,
        target: Process,
    )

Bases: `Stimulation`

Class for catalyses

Parameters:

Name | Type | Description | Default
--- | --- | --- | ---
`id_` | `str` | The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element | `'b1424134-9f82-4ddb-a268-7ba5fc8fe6e2'`
`source` | `EntityPool | LogicalOperator` | The source of the modulation | required
`target` | `Process` | The target of the modulation | required

### `` CatalysisLayout `dataclass`

    CatalysisLayout(
        path_fill: NoneValueType | Color | None = NoneValue,
        path_stroke: NoneValueType | Color | None = black,
        path_stroke_width: float | None = 1.25,
        arrowhead_fill: NoneValueType | Color | None = white,
        arrowhead_stroke: NoneValueType | Color | None = black,
        arrowhead_stroke_width: float | None = 1.25,
        *,
        id_: str = make_uuid4_as_str(),
        layout_elements: tuple[LayoutElement] = tuple(),
        group_fill: NoneValueType | Color | None = None,
        group_fill_rule: FillRule | None = None,
        group_filter: NoneValueType | Filter | None = None,
        group_font_family: str | None = None,
        group_font_size: float | None = None,
        group_font_style: FontStyle | None = None,
        group_font_weight: FontWeight | float | None = None,
        group_stroke: NoneValueType | Color | None = None,
        group_stroke_dasharray: tuple[float, ...] | None = None,
        group_stroke_dashoffset: float | None = None,
        group_stroke_width: float | None = None,
        group_text_anchor: TextAnchor | None = None,
        group_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        end_shorten: float = 0.0,
        fill: NoneValueType | Color | None = None,
        filter: NoneValueType | Filter | None = None,
        path_filter: NoneValueType | Filter | None = None,
        path_stroke_dasharray: tuple[float, ...] | None = None,
        path_stroke_dashoffset: float | None = None,
        path_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        stroke: NoneValueType | Color | None = None,
        stroke_dasharray: NoneValueType
        | tuple[float]
        | None = None,
        stroke_dashoffset: float | None = None,
        stroke_width: float | None = None,
        segments: tuple[
            Segment | BezierCurve | EllipticalArc
        ] = tuple(),
        source: LayoutElement | None = None,
        start_shorten: float = 0.0,
        target: LayoutElement | None = None,
        transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        arrowhead_filter: NoneValueType | Filter | None = None,
        arrowhead_stroke_dasharray: tuple[float, ...]
        | None = None,
        arrowhead_stroke_dashoffset: float | None = None,
        arrowhead_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        arrowhead_height: float = 10.0,
        arrowhead_width: float = 10.0,
    )

Bases: `SBGNSingleHeadedArc`

Class for catalysis layouts

Parameters:

Name | Type | Description | Default
--- | --- | --- | ---
`id_` | `str` | The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element | `'a78977e4-0661-42b3-9a60-d6ce5d063394'`
`layout_elements` | `tuple[LayoutElement]` | The sub-layout elements of the group layout. These are part of the children of the group layout | `<dynamic>`
`group_fill` | `NoneValueType | Color | None` | The fill color of the group layout | `None`
`group_fill_rule` | `FillRule | None` | The fill rule of the group layout | `None`
`group_filter` | `NoneValueType | Filter | None` | The filter of the group layout | `None`
`group_font_family` | `str | None` | The font family of the group layout | `None`
`group_font_size` | `float | None` | The font size of the group layout | `None`
`group_font_style` | `FontStyle | None` | The font style of the group layout | `None`
`group_font_weight` | `FontWeight | float | None` | The font weight of the group layout | `None`
`group_stroke` | `NoneValueType | Color | None` | The stroke color of the group layout | `None`
`group_stroke_dasharray` | `tuple[float, ...] | None` | The stroke dasharray of the group layout | `None`
`group_stroke_dashoffset` | `float | None` | The stroke dashoffset of the group layout | `None`
`group_stroke_width` | `float | None` | The stroke width of the group layout | `None`
`group_text_anchor` | `TextAnchor | None` | The text anchor of the group layout | `None`
`group_transform` | `NoneValueType | tuple[Transformation] | None` | The transform of the group layout | `None`
`end_shorten` | `float` | The length the end of the arc will be shorten by | `0.0`
`fill` | `NoneValueType | Color | None` | The fill color of the arc | `None`
`filter` | `NoneValueType | Filter | None` | The fill filter of the arc | `None`
`path_fill` | `NoneValueType | Color | None` |  | `<momapy.drawing.NoneValueType object at 0x7fb32ae9f1d0>`
`path_filter` | `NoneValueType | Filter | None` | The path filter of the arc | `None`
`path_stroke` | `NoneValueType | Color | None` |  | `Color(red=0, green=0, blue=0, alpha=1.0)`
`path_stroke_dasharray` | `tuple[float, ...] | None` | The path stroke dasharray of the arc | `None`
`path_stroke_dashoffset` | `float | None` | The path stroke dashoffset of the arc | `None`
`path_stroke_width` | `float | None` |  | `1.25`
`path_transform` | `NoneValueType | tuple[Transformation] | None` | The path transform of the arc | `None`
`stroke` | `NoneValueType | Color | None` | The stroke color of the arc | `None`
`stroke_dasharray` | `NoneValueType | tuple[float] | None` | The stroke dasharray of the arc | `None`
`stroke_dashoffset` | `float | None` | The stroke dashoffset of the arc | `None`
`stroke_width` | `float | None` | The stroke width of the arc | `None`
`segments` | `tuple[Union[Segment, BezierCurve, EllipticalArc]]` | The path segments of the arc | `<dynamic>`
`source` | `LayoutElement | None` | The source of the arc | `None`
`start_shorten` | `float` | The length the start of the arc will be shorten by | `0.0`
`target` | `LayoutElement | None` | The target of the arc | `None`
`transform` | `NoneValueType | tuple[Transformation] | None` | The transform of the arc | `None`
`arrowhead_fill` | `NoneValueType | Color | None` |  | `Color(red=255, green=255, blue=255, alpha=1.0)`
`arrowhead_filter` | `NoneValueType | Filter | None` | The arrowhead filter of the arc | `None`
`arrowhead_stroke` | `NoneValueType | Color | None` |  | `Color(red=0, green=0, blue=0, alpha=1.0)`
`arrowhead_stroke_dasharray` | `tuple[float, ...] | None` | The arrowhead stroke dasharray of the arc | `None`
`arrowhead_stroke_dashoffset` | `float | None` | The arrowhead stroke dashoffset of the arc | `None`
`arrowhead_stroke_width` | `float | None` |  | `1.25`
`arrowhead_transform` | `NoneValueType | tuple[Transformation] | None` | The arrowhead transform of the arc | `None`
`arrowhead_height` | `float` |  | `10.0`
`arrowhead_width` | `float` |  | `10.0`

Methods:

Name | Description
--- | ---
`anchor_point` | Return an anchor point of the layout element
`arrowhead_base` | Return the arrowhead base anchor point of the single-headed arc
`arrowhead_bbox` | Return the bounding box of the single-headed arc arrowhead
`arrowhead_border` | Return the point at the intersection of the drawing elements of the single-headed arc arrowhead and the line going through the center of these drawing elements and the given point.
`arrowhead_drawing_elements` | Return the drawing elements of the single-headed arc arrowhead
`arrowhead_length` | Return the length of the single-headed arc arrowhead
`arrowhead_tip` | Return the arrowhead tip anchor point of the single-headed arc
`bbox` | Compute and return the bounding box of the group layout element
`childless` | Return a copy of the arc with no children
`children` | Return the children of the group layout.
`contains` | Return `true` if another layout element is a descendant of the layout element, `false` otherwise
`descendants` | Return the descendants of the layout element
`drawing_elements` | Return the drawing elements of the group layout.
`end_point` | Return the ending point of the arc
`equals` | Return `true` if the layout element is equal to another layout element, `false` otherwise
`flattened` | Return a list containing copy of the layout element with no children and all its descendants with no children
`fraction` | Return the position and angle on the arc at a given fraction (of the total arc length)
`length` | Return the total length of the arc path
`path_drawing_elements` | Return the drawing elements of the single-headed arc path
`points` | Return the points of the arc path
`self_bbox` | Compute and return the bounding box of the self drawing element of the group layout
`self_children` | Return the self children of the arc
`self_drawing_elements` | Return the self drawing elements of the single-headed arc
`self_to_shapely` | Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout
`start_point` | Return the starting point of the arc
`to_shapely` | Return a shapely collection of geometries reproducing the drawing elements of the layout element

#### `` anchor_point

    anchor_point(anchor_name: str) -> Point

Return an anchor point of the layout element

Source code in `src/momapy/core.py`

    130
    131
    132
    def anchor_point(self, anchor_name: str) -> momapy.geometry.Point:
        """Return an anchor point of the layout element"""
        return getattr(self, anchor_name)()

#### `` arrowhead_base

    arrowhead_base() -> Point

Return the arrowhead base anchor point of the single-headed arc

Source code in `src/momapy/core.py`

    1058
    1059
    1060
    1061
    1062
    1063
    1064
    1065
    1066
    def arrowhead_base(self) -> momapy.geometry.Point:
        """Return the arrowhead base anchor point of the single-headed arc"""
        arrowhead_length = self.arrowhead_length()
        segment = self.segments[-1]
        segment_length = segment.length()
        if segment_length == 0:
            return self.arrowhead_tip() - (arrowhead_length, 0)
        fraction = 1 - (arrowhead_length + self.end_shorten) / segment_length
        return segment.get_position_at_fraction(fraction)

#### `` arrowhead_bbox

    arrowhead_bbox() -> Bbox

Return the bounding box of the single-headed arc arrowhead

Source code in `src/momapy/core.py`

    1068
    1069
    1070
    1071
    1072
    def arrowhead_bbox(self) -> momapy.geometry.Bbox:
        """Return the bounding box of the single-headed arc arrowhead"""
        return momapy.drawing.get_drawing_elements_bbox(
            self.arrowhead_drawing_elements()
        )

#### `` arrowhead_border

    arrowhead_border(point) -> Point

Return the point at the intersection of the drawing elements of the single-headed arc arrowhead and the line going through the center of these drawing elements and the given point. When there are multiple intersection points, the one closest to the given point is returned

Source code in `src/momapy/core.py`

    1074
    1075
    1076
    1077
    1078
    1079
    1080
    1081
    1082
    1083
    1084
    def arrowhead_border(self, point) -> momapy.geometry.Point:
        """Return the point at the intersection of the drawing elements of the single-headed arc arrowhead and the line going through the center of these drawing elements and the given point.
        When there are multiple intersection points, the one closest to the given point is returned
        """

        point = momapy.drawing.get_drawing_elements_border(
            self.arrowhead_drawing_elements(), point
        )
        if point is None:
            return self.arrowhead_tip()
        return point

#### `` arrowhead_drawing_elements

    arrowhead_drawing_elements() -> list[DrawingElement]

Return the drawing elements of the single-headed arc arrowhead

Source code in `src/momapy/core.py`

    1108
    1109
    1110
    1111
    1112
    1113
    1114
    1115
    1116
    1117
    1118
    1119
    1120
    1121
    1122
    1123
    1124
    1125
    1126
    1127
    def arrowhead_drawing_elements(
        self,
    ) -> list[momapy.drawing.DrawingElement]:
        """Return the drawing elements of the single-headed arc arrowhead"""
        drawing_elements = self._arrowhead_border_drawing_elements()
        group = momapy.drawing.Group(
            class_=f"{type(self).__name__}_arrowhead",
            elements=tuple(drawing_elements),
            fill=self.arrowhead_fill,
            filter=self.arrowhead_filter,
            id_=f"{self.id_}_arrowhead",
            stroke=self.arrowhead_stroke,
            stroke_dasharray=self.arrowhead_stroke_dasharray,
            stroke_dashoffset=self.arrowhead_stroke_dashoffset,
            stroke_width=self.arrowhead_stroke_width,
            transform=self.arrowhead_transform,
        )
        transformation = self._get_arrowhead_transformation()
        group = group.transformed(transformation)
        return [group]

#### `` arrowhead_length

    arrowhead_length() -> float

Return the length of the single-headed arc arrowhead

Source code in `src/momapy/core.py`

    1040
    1041
    1042
    1043
    1044
    1045
    1046
    1047
    def arrowhead_length(self) -> float:
        """Return the length of the single-headed arc arrowhead"""
        bbox = momapy.drawing.get_drawing_elements_bbox(
            self._arrowhead_border_drawing_elements()
        )
        if math.isnan(bbox.width):
            return 0.0
        return bbox.east().x

#### `` arrowhead_tip

    arrowhead_tip() -> Point

Return the arrowhead tip anchor point of the single-headed arc

Source code in `src/momapy/core.py`

    1049
    1050
    1051
    1052
    1053
    1054
    1055
    1056
    def arrowhead_tip(self) -> momapy.geometry.Point:
        """Return the arrowhead tip anchor point of the single-headed arc"""
        segment = self.segments[-1]
        segment_length = segment.length()
        if segment_length == 0:
            return segment.p2
        fraction = 1 - self.end_shorten / segment_length
        return segment.get_position_at_fraction(fraction)

#### `` bbox

    bbox() -> Bbox

Compute and return the bounding box of the group layout element

Source code in `src/momapy/core.py`

    504
    505
    506
    507
    508
    509
    510
    511
    512
    513
    514
    515
    516
    517
    518
    519
    520
    521
    522
    523
    524
    525
    526
    def bbox(self) -> momapy.geometry.Bbox:
        """Compute and return the bounding box of the group layout element"""
        self_bbox = self.self_bbox()
        bboxes = [child.bbox() for child in self.children()]
        min_x = self_bbox.north_west().x
        min_y = self_bbox.north_west().y
        max_x = self_bbox.south_east().x
        max_y = self_bbox.south_east().y
        for bbox in bboxes:
            if bbox.north_west().x < min_x:
                min_x = bbox.north_west().x
            if bbox.north_west().y < min_y:
                min_y = bbox.north_west().y
            if bbox.south_east().x > max_x:
                max_x = bbox.south_east().x
            if bbox.south_east().y > max_y:
                max_y = bbox.south_east().y
        bbox = momapy.geometry.Bbox(
            momapy.geometry.Point(min_x / 2 + max_x / 2, min_y / 2 + max_y / 2),
            max_x - min_x,
            max_y - min_y,
        )
        return bbox

#### `` childless

    childless() -> Self

Return a copy of the arc with no children

Source code in `src/momapy/core.py`

    955
    956
    957
    def childless(self) -> typing.Self:
        """Return a copy of the arc with no children"""
        return dataclasses.replace(self, layout_elements=tuple([]))

#### `` children

    children() -> list[LayoutElement]

Return the children of the group layout. These are the self children of the group layout (returned by the `self_children` method) and the other children of the group layout (given by the `layout_elements` attribute)

Source code in `src/momapy/core.py`

    566
    567
    568
    569
    570
    def children(self) -> list[LayoutElement]:
        """Return the children of the group layout.
        These are the self children of the group layout (returned by the `self_children` method) and the other children of the group layout (given by the `layout_elements` attribute)
        """
        return self.self_children() + list(self.layout_elements)

#### `` contains

    contains(other: LayoutElement) -> bool

Return `true` if another layout element is a descendant of the layout element, `false` otherwise

Source code in `src/momapy/core.py`

    119
    120
    121
    def contains(self, other: "LayoutElement") -> bool:
        """Return `true` if another layout element is a descendant of the layout element, `false` otherwise"""
        return other in self.descendants()

#### `` descendants

    descendants() -> list[LayoutElement]

Return the descendants of the layout element

Source code in `src/momapy/core.py`

    90
    91
    92
    93
    94
    95
    96
    def descendants(self) -> list["LayoutElement"]:
        """Return the descendants of the layout element"""
        descendants = []
        for child in self.children():
            descendants.append(child)
            descendants += child.descendants()
        return descendants

#### `` drawing_elements

    drawing_elements() -> list[DrawingElement]

Return the drawing elements of the group layout. The returned drawing elements are a group drawing element formed of the self drawing elements of the group layout and the drawing elements of its children

Source code in `src/momapy/core.py`

    538
    539
    540
    541
    542
    543
    544
    545
    546
    547
    548
    549
    550
    551
    552
    553
    554
    555
    556
    557
    558
    559
    560
    561
    562
    563
    564
    def drawing_elements(self) -> list[momapy.drawing.DrawingElement]:
        """Return the drawing elements of the group layout.
        The returned drawing elements are a group drawing element formed of the self drawing elements of the group layout and the drawing elements of its children
        """
        drawing_elements = self.self_drawing_elements()
        for child in self.children():
            if child is not None:
                drawing_elements += child.drawing_elements()
        group = momapy.drawing.Group(
            class_=f"{type(self).__name__}_group",
            elements=tuple(drawing_elements),
            id_=f"{self.id_}_group",
            fill=self.group_fill,
            fill_rule=self.group_fill_rule,
            filter=self.group_filter,
            font_family=self.group_font_family,
            font_size=self.group_font_size,
            font_style=self.group_font_style,
            font_weight=self.group_font_weight,
            stroke=self.group_stroke,
            stroke_dasharray=self.group_stroke_dasharray,
            stroke_dashoffset=self.group_stroke_dashoffset,
            stroke_width=self.group_stroke_width,
            text_anchor=self.group_text_anchor,
            transform=self.group_transform,
        )
        return [group]

#### `` end_point

    end_point() -> Point

Return the ending point of the arc

Source code in `src/momapy/core.py`

    951
    952
    953
    def end_point(self) -> momapy.geometry.Point:
        """Return the ending point of the arc"""
        return self.points()[-1]

#### `` equals

    equals(
        other: LayoutElement,
        flattened: bool = False,
        unordered: bool = False,
    ) -> bool

Return `true` if the layout element is equal to another layout element, `false` otherwise

Source code in `src/momapy/core.py`

    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    def equals(
        self, other: "LayoutElement", flattened: bool = False, unordered: bool = False
    ) -> bool:
        """Return `true` if the layout element is equal to another layout element, `false` otherwise"""
        if type(self) is type(other):
            if not flattened:
                return self == other
            else:
                if not unordered:
                    return self.flattened() == other.flattened()
                else:
                    return set(self.flattened()) == set(other.flattened())
        return False

#### `` flattened

    flattened() -> list[LayoutElement]

Return a list containing copy of the layout element with no children and all its descendants with no children

Source code in `src/momapy/core.py`

     98
     99
    100
    101
    102
    103
    def flattened(self) -> list["LayoutElement"]:
        """Return a list containing copy of the layout element with no children and all its descendants with no children"""
        flattened = [self.childless()]
        for child in self.children():
            flattened += child.flattened()
        return flattened

#### `` fraction

    fraction(fraction: float) -> tuple[Point, float]

Return the position and angle on the arc at a given fraction (of the total arc length)

Source code in `src/momapy/core.py`

    959
    960
    961
    962
    963
    964
    965
    966
    967
    968
    def fraction(self, fraction: float) -> tuple[momapy.geometry.Point, float]:
        """Return the position and angle on the arc at a given fraction (of the total arc length)"""
        current_length = 0
        length_to_reach = fraction * self.length()
        for segment in self.segments:
            current_length += segment.length()
            if current_length >= length_to_reach:
                break
        position, angle = segment.get_position_and_angle_at_fraction(fraction)
        return position, angle

#### `` length

    length()

Return the total length of the arc path

Source code in `src/momapy/core.py`

    943
    944
    945
    def length(self):
        """Return the total length of the arc path"""
        return sum([segment.length() for segment in self.segments])

#### `` path_drawing_elements

    path_drawing_elements() -> list[Path]

Return the drawing elements of the single-headed arc path

Source code in `src/momapy/core.py`

    1129
    1130
    1131
    1132
    1133
    1134
    1135
    1136
    1137
    1138
    1139
    1140
    1141
    1142
    1143
    1144
    1145
    1146
    1147
    1148
    1149
    1150
    1151
    1152
    1153
    1154
    1155
    1156
    1157
    1158
    1159
    1160
    1161
    1162
    1163
    1164
    1165
    1166
    1167
    def path_drawing_elements(self) -> list[momapy.drawing.Path]:
        """Return the drawing elements of the single-headed arc path"""
        arrowhead_length = self.arrowhead_length()
        if len(self.segments) == 1:
            segment = (
                self.segments[0]
                .shortened(self.start_shorten, "start")
                .shortened(self.end_shorten + arrowhead_length, "end")
            )
            actions = [
                momapy.drawing.MoveTo(segment.p1),
                self._make_path_action_from_segment(segment),
            ]
        else:
            first_segment = self.segments[0].shortened(self.start_shorten, "start")
            last_segment = self.segments[-1].shortened(
                self.end_shorten + arrowhead_length, "end"
            )
            actions = [
                momapy.drawing.MoveTo(first_segment.p1),
                self._make_path_action_from_segment(first_segment),
            ]
            for segment in self.segments[1:-1]:
                action = self._make_path_action_from_segment(segment)
                actions.append(action)
            actions.append(self._make_path_action_from_segment(last_segment))
        path = momapy.drawing.Path(
            actions=tuple(actions),
            class_=f"{type(self).__name__}_path",
            fill=self.path_fill,
            filter=self.path_filter,
            id_=f"{self.id_}_path",
            stroke=self.path_stroke,
            stroke_dasharray=self.path_stroke_dasharray,
            stroke_dashoffset=self.path_stroke_dashoffset,
            stroke_width=self.path_stroke_width,
            transform=self.path_transform,
        )
        return [path]

#### `` points

    points() -> list[Point]

Return the points of the arc path

Source code in `src/momapy/core.py`

    935
    936
    937
    938
    939
    940
    941
    def points(self) -> list[momapy.geometry.Point]:
        """Return the points of the arc path"""
        points = []
        for segment in self.segments:
            points.append(segment.p1)
        points.append(segment.p2)
        return points

#### `` self_bbox

    self_bbox() -> Bbox

Compute and return the bounding box of the self drawing element of the group layout

Source code in `src/momapy/core.py`

    499
    500
    501
    502
    def self_bbox(self) -> momapy.geometry.Bbox:
        """Compute and return the bounding box of the self drawing element of the group layout"""
        bounds = self.self_to_shapely().bounds
        return momapy.geometry.Bbox.from_bounds(bounds)

#### `` self_children

    self_children() -> list[LayoutElement]

Return the self children of the arc

Source code in `src/momapy/core.py`

    931
    932
    933
    def self_children(self) -> list[LayoutElement]:
        """Return the self children of the arc"""
        return []

#### `` self_drawing_elements

    self_drawing_elements() -> list[DrawingElement]

Return the self drawing elements of the single-headed arc

Source code in `src/momapy/core.py`

    1169
    1170
    1171
    1172
    1173
    1174
    1175
    1176
    1177
    1178
    1179
    1180
    1181
    1182
    1183
    1184
    1185
    1186
    def self_drawing_elements(self) -> list[momapy.drawing.DrawingElement]:
        """Return the self drawing elements of the single-headed arc"""
        drawing_elements = (
            self.path_drawing_elements() + self.arrowhead_drawing_elements()
        )
        group = momapy.drawing.Group(
            class_=type(self).__name__,
            elements=tuple(drawing_elements),
            fill=self.fill,
            filter=self.filter,
            id_=self.id_,
            stroke=self.stroke,
            stroke_dasharray=self.stroke_dasharray,
            stroke_dashoffset=self.stroke_dashoffset,
            stroke_width=self.stroke_width,
            transform=self.transform,
        )
        return [group]

#### `` self_to_shapely

    self_to_shapely() -> GeometryCollection

Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout

Source code in `src/momapy/core.py`

    495
    496
    497
    def self_to_shapely(self) -> shapely.GeometryCollection:
        """Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout"""
        return momapy.drawing.drawing_elements_to_shapely(self.drawing_elements())

#### `` start_point

    start_point() -> Point

Return the starting point of the arc

Source code in `src/momapy/core.py`

    947
    948
    949
    def start_point(self) -> momapy.geometry.Point:
        """Return the starting point of the arc"""
        return self.points()[0]

#### `` to_shapely

    to_shapely(to_polygons: bool = False) -> GeometryCollection

Return a shapely collection of geometries reproducing the drawing elements of the layout element

Source code in `src/momapy/core.py`

    123
    124
    125
    126
    127
    128
    def to_shapely(self, to_polygons: bool = False) -> shapely.GeometryCollection:
        """Return a shapely collection of geometries reproducing the drawing elements of the layout element"""
        geom_collection = []
        for drawing_element in self.drawing_elements():
            geom_collection += drawing_element.to_shapely(to_polygons=to_polygons).geoms
        return shapely.GeometryCollection(geom_collection)

### `` Compartment `dataclass`

    Compartment(
        *,
        id_: str = make_uuid4_as_str(),
        label: str | None = None,
        state_variables: frozenset[StateVariable] = frozenset(),
        units_of_information: frozenset[
            UnitOfInformation
        ] = frozenset(),
    )

Bases: `SBGNModelElement`

Class for compartments

Parameters:

Name | Type | Description | Default
--- | --- | --- | ---
`id_` | `str` | The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element | `'b4d669c3-3c21-492a-99ac-b1229be5b154'`
`label` | `str | None` | The label of the compartment | `None`
`state_variables` | `frozenset[StateVariable]` | The state variables of the compartment | `<class 'frozenset'>`
`units_of_information` | `frozenset[UnitOfInformation]` | The units of information of the compartment | `<class 'frozenset'>`

### `` CompartmentLayout `dataclass`

    CompartmentLayout(
        fill: NoneValueType | Color | None = white,
        stroke: NoneValueType | Color | None = black,
        *,
        id_: str = make_uuid4_as_str(),
        layout_elements: tuple[LayoutElement] = tuple(),
        group_fill: NoneValueType | Color | None = None,
        group_fill_rule: FillRule | None = None,
        group_filter: NoneValueType | Filter | None = None,
        group_font_family: str | None = None,
        group_font_size: float | None = None,
        group_font_style: FontStyle | None = None,
        group_font_weight: FontWeight | float | None = None,
        group_stroke: NoneValueType | Color | None = None,
        group_stroke_dasharray: tuple[float, ...] | None = None,
        group_stroke_dashoffset: float | None = None,
        group_stroke_width: float | None = None,
        group_text_anchor: TextAnchor | None = None,
        group_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        filter: NoneValueType | Filter | None = None,
        height: float = 80.0,
        label: TextLayout | None = None,
        position: Point,
        stroke_dasharray: tuple[float, ...] | None = None,
        stroke_dashoffset: float | None = None,
        stroke_width: float = 3.25,
        transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        width: float = 80.0,
        rounded_corners: float = 5.0,
    )

Bases: `_SimpleMixin`, `SBGNNode`

Class for compartment layouts

Parameters:

Name | Type | Description | Default
--- | --- | --- | ---
`id_` | `str` | The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element | `'ea2fa682-b8a6-4556-b01e-b314ae91b76f'`
`layout_elements` | `tuple[LayoutElement]` | The sub-layout elements of the group layout. These are part of the children of the group layout | `<dynamic>`
`group_fill` | `NoneValueType | Color | None` | The fill color of the group layout | `None`
`group_fill_rule` | `FillRule | None` | The fill rule of the group layout | `None`
`group_filter` | `NoneValueType | Filter | None` | The filter of the group layout | `None`
`group_font_family` | `str | None` | The font family of the group layout | `None`
`group_font_size` | `float | None` | The font size of the group layout | `None`
`group_font_style` | `FontStyle | None` | The font style of the group layout | `None`
`group_font_weight` | `FontWeight | float | None` | The font weight of the group layout | `None`
`group_stroke` | `NoneValueType | Color | None` | The stroke color of the group layout | `None`
`group_stroke_dasharray` | `tuple[float, ...] | None` | The stroke dasharray of the group layout | `None`
`group_stroke_dashoffset` | `float | None` | The stroke dashoffset of the group layout | `None`
`group_stroke_width` | `float | None` | The stroke width of the group layout | `None`
`group_text_anchor` | `TextAnchor | None` | The text anchor of the group layout | `None`
`group_transform` | `NoneValueType | tuple[Transformation] | None` | The transform of the group layout | `None`
`fill` | `NoneValueType | Color | None` |  | `Color(red=255, green=255, blue=255, alpha=1.0)`
`filter` | `NoneValueType | Filter | None` | The filter of the node | `None`
`height` | `float` |  | `80.0`
`label` | `TextLayout | None` | The label of the node | `None`
`position` | `Point` | The position of the node | required
`stroke` | `NoneValueType | Color | None` |  | `Color(red=0, green=0, blue=0, alpha=1.0)`
`stroke_dasharray` | `tuple[float, ...] | None` | The stroke dasharray of the node | `None`
`stroke_dashoffset` | `float | None` | The stroke dashoffset of the node | `None`
`stroke_width` | `float` |  | `3.25`
`transform` | `NoneValueType | tuple[Transformation] | None` | The transform of the node | `None`
`width` | `float` |  | `80.0`
`rounded_corners` | `float` |  | `5.0`

Methods:

Name | Description
--- | ---
`anchor_point` | Return an anchor point of the layout element
`angle` | Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.
`bbox` | Compute and return the bounding box of the group layout element
`border` | Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point.
`center` | Return the center anchor of the node
`childless` | Return a copy of the node with no children
`children` | Return the children of the group layout.
`contains` | Return `true` if another layout element is a descendant of the layout element, `false` otherwise
`descendants` | Return the descendants of the layout element
`drawing_elements` | Return the drawing elements of the group layout.
`east` | Return the east anchor of the node
`east_north_east` | Return the east north east anchor of the node
`east_south_east` | Return the east south east west anchor of the node
`equals` | Return `true` if the layout element is equal to another layout element, `false` otherwise
`flattened` | Return a list containing copy of the layout element with no children and all its descendants with no children
`label_center` | Return the label center anchor of the node
`north` | Return the north anchor of the node
`north_east` | Return the north east anchor of the node
`north_north_east` | Return the north north east anchor of the node
`north_north_west` | Return the north north west anchor of the node
`north_west` | Return the north west anchor of the node
`self_angle` | Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.
`self_bbox` | Compute and return the bounding box of the self drawing element of the group layout
`self_border` | Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point.
`self_children` | Return the self children of the node. A node has unique child that is its label
`self_drawing_elements` | Return the node's own drawing elements
`self_to_shapely` | Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout
`size` | Return the size of the node
`south` | Return the south anchor of the node
`south_east` | Return the south east anchor of the node
`south_south_east` | Return the south south east anchor of the node
`south_south_west` | Return the south south west anchor of the node
`south_west` | Return the south west anchor of the node
`to_shapely` | Return a shapely collection of geometries reproducing the drawing elements of the layout element
`west` | Return the west anchor of the node
`west_north_west` | Return the west north west anchor of the node
`west_south_west` | Return the west south west anchor of the node

Attributes:

Name | Type | Description
--- | --- | ---
`x` | `float` | Return the x coordinate of the node
`y` | `float` | Return the y coordinate of the node

#### `` anchor_point

    anchor_point(anchor_name: str) -> Point

Return an anchor point of the layout element

Source code in `src/momapy/core.py`

    130
    131
    132
    def anchor_point(self, anchor_name: str) -> momapy.geometry.Point:
        """Return an anchor point of the layout element"""
        return getattr(self, anchor_name)()

#### `` angle

    angle(
        angle: float,
        unit: Literal["degrees", "radians"] = "degrees",
    ) -> Point

Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.

Source code in `src/momapy/core.py`

    817
    818
    819
    820
    821
    822
    823
    824
    825
    826
    827
    828
    def angle(
        self,
        angle: float,
        unit: typing.Literal["degrees", "radians"] = "degrees",
    ) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal."""
        return momapy.drawing.get_drawing_elements_angle(
            drawing_elements=self.drawing_elements(),
            angle=angle,
            unit=unit,
            center=self.center(),
        )

#### `` bbox

    bbox() -> Bbox

Compute and return the bounding box of the group layout element

Source code in `src/momapy/core.py`

    504
    505
    506
    507
    508
    509
    510
    511
    512
    513
    514
    515
    516
    517
    518
    519
    520
    521
    522
    523
    524
    525
    526
    def bbox(self) -> momapy.geometry.Bbox:
        """Compute and return the bounding box of the group layout element"""
        self_bbox = self.self_bbox()
        bboxes = [child.bbox() for child in self.children()]
        min_x = self_bbox.north_west().x
        min_y = self_bbox.north_west().y
        max_x = self_bbox.south_east().x
        max_y = self_bbox.south_east().y
        for bbox in bboxes:
            if bbox.north_west().x < min_x:
                min_x = bbox.north_west().x
            if bbox.north_west().y < min_y:
                min_y = bbox.north_west().y
            if bbox.south_east().x > max_x:
                max_x = bbox.south_east().x
            if bbox.south_east().y > max_y:
                max_y = bbox.south_east().y
        bbox = momapy.geometry.Bbox(
            momapy.geometry.Point(min_x / 2 + max_x / 2, min_y / 2 + max_y / 2),
            max_x - min_x,
            max_y - min_y,
        )
        return bbox

#### `` border

    border(point: Point) -> Point

Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point. When there are multiple intersection points, the one closest to the given point is returned

Source code in `src/momapy/core.py`

    794
    795
    796
    797
    798
    799
    800
    801
    802
    def border(self, point: momapy.geometry.Point) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point.
        When there are multiple intersection points, the one closest to the given point is returned
        """
        return momapy.drawing.get_drawing_elements_border(
            drawing_elements=self.drawing_elements(),
            point=point,
            center=self.center(),
        )

#### `` center

    center() -> Point

Return the center anchor of the node

Source code in `src/momapy/core.py`

    776
    777
    778
    def center(self) -> momapy.geometry.Point:
        """Return the center anchor of the node"""
        return self.position

#### `` childless

    childless() -> Self

Return a copy of the node with no children

Source code in `src/momapy/core.py`

    830
    831
    832
    def childless(self) -> typing.Self:
        """Return a copy of the node with no children"""
        return dataclasses.replace(self, label=None, layout_elements=tuple([]))

#### `` children

    children() -> list[LayoutElement]

Return the children of the group layout. These are the self children of the group layout (returned by the `self_children` method) and the other children of the group layout (given by the `layout_elements` attribute)

Source code in `src/momapy/core.py`

    566
    567
    568
    569
    570
    def children(self) -> list[LayoutElement]:
        """Return the children of the group layout.
        These are the self children of the group layout (returned by the `self_children` method) and the other children of the group layout (given by the `layout_elements` attribute)
        """
        return self.self_children() + list(self.layout_elements)

#### `` contains

    contains(other: LayoutElement) -> bool

Return `true` if another layout element is a descendant of the layout element, `false` otherwise

Source code in `src/momapy/core.py`

    119
    120
    121
    def contains(self, other: "LayoutElement") -> bool:
        """Return `true` if another layout element is a descendant of the layout element, `false` otherwise"""
        return other in self.descendants()

#### `` descendants

    descendants() -> list[LayoutElement]

Return the descendants of the layout element

Source code in `src/momapy/core.py`

    90
    91
    92
    93
    94
    95
    96
    def descendants(self) -> list["LayoutElement"]:
        """Return the descendants of the layout element"""
        descendants = []
        for child in self.children():
            descendants.append(child)
            descendants += child.descendants()
        return descendants

#### `` drawing_elements

    drawing_elements() -> list[DrawingElement]

Return the drawing elements of the group layout. The returned drawing elements are a group drawing element formed of the self drawing elements of the group layout and the drawing elements of its children

Source code in `src/momapy/core.py`

    538
    539
    540
    541
    542
    543
    544
    545
    546
    547
    548
    549
    550
    551
    552
    553
    554
    555
    556
    557
    558
    559
    560
    561
    562
    563
    564
    def drawing_elements(self) -> list[momapy.drawing.DrawingElement]:
        """Return the drawing elements of the group layout.
        The returned drawing elements are a group drawing element formed of the self drawing elements of the group layout and the drawing elements of its children
        """
        drawing_elements = self.self_drawing_elements()
        for child in self.children():
            if child is not None:
                drawing_elements += child.drawing_elements()
        group = momapy.drawing.Group(
            class_=f"{type(self).__name__}_group",
            elements=tuple(drawing_elements),
            id_=f"{self.id_}_group",
            fill=self.group_fill,
            fill_rule=self.group_fill_rule,
            filter=self.group_filter,
            font_family=self.group_font_family,
            font_size=self.group_font_size,
            font_style=self.group_font_style,
            font_weight=self.group_font_weight,
            stroke=self.group_stroke,
            stroke_dasharray=self.group_stroke_dasharray,
            stroke_dashoffset=self.group_stroke_dashoffset,
            stroke_width=self.group_stroke_width,
            text_anchor=self.group_text_anchor,
            transform=self.group_transform,
        )
        return [group]

#### `` east

    east() -> Point

Return the east anchor of the node

Source code in `src/momapy/core.py`

    708
    709
    710
    def east(self) -> momapy.geometry.Point:
        """Return the east anchor of the node"""
        return self.self_angle(0)

#### `` east_north_east

    east_north_east() -> Point

Return the east north east anchor of the node

Source code in `src/momapy/core.py`

    700
    701
    702
    703
    704
    705
    706
    def east_north_east(self) -> momapy.geometry.Point:
        """Return the east north east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, -self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` east_south_east

    east_south_east() -> Point

Return the east south east west anchor of the node

Source code in `src/momapy/core.py`

    712
    713
    714
    715
    716
    717
    718
    def east_south_east(self) -> momapy.geometry.Point:
        """Return the east south east west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` equals

    equals(
        other: LayoutElement,
        flattened: bool = False,
        unordered: bool = False,
    ) -> bool

Return `true` if the layout element is equal to another layout element, `false` otherwise

Source code in `src/momapy/core.py`

    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    def equals(
        self, other: "LayoutElement", flattened: bool = False, unordered: bool = False
    ) -> bool:
        """Return `true` if the layout element is equal to another layout element, `false` otherwise"""
        if type(self) is type(other):
            if not flattened:
                return self == other
            else:
                if not unordered:
                    return self.flattened() == other.flattened()
                else:
                    return set(self.flattened()) == set(other.flattened())
        return False

#### `` flattened

    flattened() -> list[LayoutElement]

Return a list containing copy of the layout element with no children and all its descendants with no children

Source code in `src/momapy/core.py`

     98
     99
    100
    101
    102
    103
    def flattened(self) -> list["LayoutElement"]:
        """Return a list containing copy of the layout element with no children and all its descendants with no children"""
        flattened = [self.childless()]
        for child in self.children():
            flattened += child.flattened()
        return flattened

#### `` label_center

    label_center() -> Point

Return the label center anchor of the node

Source code in `src/momapy/core.py`

    780
    781
    782
    def label_center(self) -> momapy.geometry.Point:
        """Return the label center anchor of the node"""
        return self.position

#### `` north

    north() -> Point

Return the north anchor of the node

Source code in `src/momapy/core.py`

    680
    681
    682
    def north(self) -> momapy.geometry.Point:
        """Return the north anchor of the node"""
        return self.self_angle(90)

#### `` north_east

    north_east() -> Point

Return the north east anchor of the node

Source code in `src/momapy/core.py`

    692
    693
    694
    695
    696
    697
    698
    def north_east(self) -> momapy.geometry.Point:
        """Return the north east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, -self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` north_north_east

    north_north_east() -> Point

Return the north north east anchor of the node

Source code in `src/momapy/core.py`

    684
    685
    686
    687
    688
    689
    690
    def north_north_east(self) -> momapy.geometry.Point:
        """Return the north north east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 4, -self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` north_north_west

    north_north_west() -> Point

Return the north north west anchor of the node

Source code in `src/momapy/core.py`

    672
    673
    674
    675
    676
    677
    678
    def north_north_west(self) -> momapy.geometry.Point:
        """Return the north north west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() - (self.width / 4, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` north_west

    north_west() -> Point

Return the north west anchor of the node

Source code in `src/momapy/core.py`

    664
    665
    666
    667
    668
    669
    670
    def north_west(self) -> momapy.geometry.Point:
        """Return the north west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() - (self.width / 2, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` self_angle

    self_angle(
        angle: float,
        unit: Literal["degrees", "radians"] = "degrees",
    ) -> Point

Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.

Source code in `src/momapy/core.py`

    804
    805
    806
    807
    808
    809
    810
    811
    812
    813
    814
    815
    def self_angle(
        self,
        angle: float,
        unit: typing.Literal["degrees", "radians"] = "degrees",
    ) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal."""
        return momapy.drawing.get_drawing_elements_angle(
            drawing_elements=self.self_drawing_elements(),
            angle=angle,
            unit=unit,
            center=self.center(),
        )

#### `` self_bbox

    self_bbox() -> Bbox

Compute and return the bounding box of the self drawing element of the group layout

Source code in `src/momapy/core.py`

    499
    500
    501
    502
    def self_bbox(self) -> momapy.geometry.Bbox:
        """Compute and return the bounding box of the self drawing element of the group layout"""
        bounds = self.self_to_shapely().bounds
        return momapy.geometry.Bbox.from_bounds(bounds)

#### `` self_border

    self_border(point: Point) -> Point

Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point. When there are multiple intersection points, the one closest to the given point is returned

Source code in `src/momapy/core.py`

    784
    785
    786
    787
    788
    789
    790
    791
    792
    def self_border(self, point: momapy.geometry.Point) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point.
        When there are multiple intersection points, the one closest to the given point is returned
        """
        return momapy.drawing.get_drawing_elements_border(
            drawing_elements=self.self_drawing_elements(),
            point=point,
            center=self.center(),
        )

#### `` self_children

    self_children() -> list[LayoutElement]

Return the self children of the node. A node has unique child that is its label

Source code in `src/momapy/core.py`

    654
    655
    656
    657
    658
    def self_children(self) -> list[LayoutElement]:
        """Return the self children of the node. A node has unique child that is its label"""
        if self.label is not None:
            return [self.label]
        return []

#### `` self_drawing_elements

    self_drawing_elements() -> list[DrawingElement]

Return the node's own drawing elements

Source code in `src/momapy/core.py`

    637
    638
    639
    640
    641
    642
    643
    644
    645
    646
    647
    648
    649
    650
    651
    652
    def self_drawing_elements(self) -> list[momapy.drawing.DrawingElement]:
        """Return the node's own drawing elements"""
        drawing_elements = self._border_drawing_elements()
        group = momapy.drawing.Group(
            class_=type(self).__name__,
            elements=tuple(drawing_elements),
            fill=self.fill,
            filter=self.filter,
            id_=self.id_,
            stroke=self.stroke,
            stroke_dasharray=self.stroke_dasharray,
            stroke_dashoffset=self.stroke_dashoffset,
            stroke_width=self.stroke_width,
            transform=self.transform,
        )
        return [group]

#### `` self_to_shapely

    self_to_shapely() -> GeometryCollection

Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout

Source code in `src/momapy/core.py`

    495
    496
    497
    def self_to_shapely(self) -> shapely.GeometryCollection:
        """Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout"""
        return momapy.drawing.drawing_elements_to_shapely(self.drawing_elements())

#### `` size

    size() -> tuple[float, float]

Return the size of the node

Source code in `src/momapy/core.py`

    660
    661
    662
    def size(self) -> tuple[float, float]:
        """Return the size of the node"""
        return (self.width, self.height)

#### `` south

    south() -> Point

Return the south anchor of the node

Source code in `src/momapy/core.py`

    736
    737
    738
    def south(self) -> momapy.geometry.Point:
        """Return the south anchor of the node"""
        return self.self_angle(270)

#### `` south_east

    south_east() -> Point

Return the south east anchor of the node

Source code in `src/momapy/core.py`

    720
    721
    722
    723
    724
    725
    726
    def south_east(self) -> momapy.geometry.Point:
        """Return the south east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` south_south_east

    south_south_east() -> Point

Return the south south east anchor of the node

Source code in `src/momapy/core.py`

    728
    729
    730
    731
    732
    733
    734
    def south_south_east(self) -> momapy.geometry.Point:
        """Return the south south east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 4, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` south_south_west

    south_south_west() -> Point

Return the south south west anchor of the node

Source code in `src/momapy/core.py`

    740
    741
    742
    743
    744
    745
    746
    def south_south_west(self) -> momapy.geometry.Point:
        """Return the south south west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (-self.width / 4, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` south_west

    south_west() -> Point

Return the south west anchor of the node

Source code in `src/momapy/core.py`

    748
    749
    750
    751
    752
    753
    754
    def south_west(self) -> momapy.geometry.Point:
        """Return the south west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (-self.width / 2, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` to_shapely

    to_shapely(to_polygons: bool = False) -> GeometryCollection

Return a shapely collection of geometries reproducing the drawing elements of the layout element

Source code in `src/momapy/core.py`

    123
    124
    125
    126
    127
    128
    def to_shapely(self, to_polygons: bool = False) -> shapely.GeometryCollection:
        """Return a shapely collection of geometries reproducing the drawing elements of the layout element"""
        geom_collection = []
        for drawing_element in self.drawing_elements():
            geom_collection += drawing_element.to_shapely(to_polygons=to_polygons).geoms
        return shapely.GeometryCollection(geom_collection)

#### `` west

    west() -> Point

Return the west anchor of the node

Source code in `src/momapy/core.py`

    764
    765
    766
    def west(self) -> momapy.geometry.Point:
        """Return the west anchor of the node"""
        return self.self_angle(180)

#### `` west_north_west

    west_north_west() -> Point

Return the west north west anchor of the node

Source code in `src/momapy/core.py`

    768
    769
    770
    771
    772
    773
    774
    def west_north_west(self) -> momapy.geometry.Point:
        """Return the west north west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() - (self.width / 2, self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` west_south_west

    west_south_west() -> Point

Return the west south west anchor of the node

Source code in `src/momapy/core.py`

    756
    757
    758
    759
    760
    761
    762
    def west_south_west(self) -> momapy.geometry.Point:
        """Return the west south west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (-self.width / 2, self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` x `property`

    x: float

Return the x coordinate of the node

#### `` y `property`

    y: float

Return the y coordinate of the node

### `` Complex `dataclass`

    Complex(
        *,
        id_: str = make_uuid4_as_str(),
        compartment: Compartment | None = None,
        label: str | None = None,
        state_variables: frozenset[StateVariable] = frozenset(),
        units_of_information: frozenset[
            UnitOfInformation
        ] = frozenset(),
        subunits: frozenset[Subunit] = frozenset(),
    )

Bases: `EntityPool`

Class for complexes

Parameters:

Name | Type | Description | Default
--- | --- | --- | ---
`id_` | `str` | The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element | `'647736e2-efd9-43d3-a67c-6f6ae5961c74'`
`compartment` | `Compartment | None` | The compartment of the entity pool | `None`
`label` | `str | None` | The label of the complex | `None`
`state_variables` | `frozenset[StateVariable]` | The state variables of the complex | `<class 'frozenset'>`
`units_of_information` | `frozenset[UnitOfInformation]` | The units of information of the complex | `<class 'frozenset'>`
`subunits` | `frozenset[Subunit]` | The subunits of the complex | `<class 'frozenset'>`

### `` ComplexLayout `dataclass`

    ComplexLayout(
        fill: NoneValueType | Color | None = white,
        stroke: NoneValueType | Color | None = black,
        stroke_width: float | None = 1.25,
        *,
        id_: str = make_uuid4_as_str(),
        layout_elements: tuple[LayoutElement] = tuple(),
        group_fill: NoneValueType | Color | None = None,
        group_fill_rule: FillRule | None = None,
        group_filter: NoneValueType | Filter | None = None,
        group_font_family: str | None = None,
        group_font_size: float | None = None,
        group_font_style: FontStyle | None = None,
        group_font_weight: FontWeight | float | None = None,
        group_stroke: NoneValueType | Color | None = None,
        group_stroke_dasharray: tuple[float, ...] | None = None,
        group_stroke_dashoffset: float | None = None,
        group_stroke_width: float | None = None,
        group_text_anchor: TextAnchor | None = None,
        group_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        filter: NoneValueType | Filter | None = None,
        height: float = 44.0,
        label: TextLayout | None = None,
        position: Point,
        stroke_dasharray: tuple[float, ...] | None = None,
        stroke_dashoffset: float | None = None,
        transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        width: float = 44.0,
        cut_corners: float = 5.0,
    )

Bases: `_SimpleMixin`, `SBGNNode`

Class for complex layouts

Parameters:

Name | Type | Description | Default
--- | --- | --- | ---
`id_` | `str` | The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element | `'8a6d98e6-8560-4fdc-88bd-c3e29be59c43'`
`layout_elements` | `tuple[LayoutElement]` | The sub-layout elements of the group layout. These are part of the children of the group layout | `<dynamic>`
`group_fill` | `NoneValueType | Color | None` | The fill color of the group layout | `None`
`group_fill_rule` | `FillRule | None` | The fill rule of the group layout | `None`
`group_filter` | `NoneValueType | Filter | None` | The filter of the group layout | `None`
`group_font_family` | `str | None` | The font family of the group layout | `None`
`group_font_size` | `float | None` | The font size of the group layout | `None`
`group_font_style` | `FontStyle | None` | The font style of the group layout | `None`
`group_font_weight` | `FontWeight | float | None` | The font weight of the group layout | `None`
`group_stroke` | `NoneValueType | Color | None` | The stroke color of the group layout | `None`
`group_stroke_dasharray` | `tuple[float, ...] | None` | The stroke dasharray of the group layout | `None`
`group_stroke_dashoffset` | `float | None` | The stroke dashoffset of the group layout | `None`
`group_stroke_width` | `float | None` | The stroke width of the group layout | `None`
`group_text_anchor` | `TextAnchor | None` | The text anchor of the group layout | `None`
`group_transform` | `NoneValueType | tuple[Transformation] | None` | The transform of the group layout | `None`
`fill` | `NoneValueType | Color | None` |  | `Color(red=255, green=255, blue=255, alpha=1.0)`
`filter` | `NoneValueType | Filter | None` | The filter of the node | `None`
`height` | `float` |  | `44.0`
`label` | `TextLayout | None` | The label of the node | `None`
`position` | `Point` | The position of the node | required
`stroke` | `NoneValueType | Color | None` |  | `Color(red=0, green=0, blue=0, alpha=1.0)`
`stroke_dasharray` | `tuple[float, ...] | None` | The stroke dasharray of the node | `None`
`stroke_dashoffset` | `float | None` | The stroke dashoffset of the node | `None`
`stroke_width` | `float | None` |  | `1.25`
`transform` | `NoneValueType | tuple[Transformation] | None` | The transform of the node | `None`
`width` | `float` |  | `44.0`
`cut_corners` | `float` |  | `5.0`

Methods:

Name | Description
--- | ---
`anchor_point` | Return an anchor point of the layout element
`angle` | Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.
`bbox` | Compute and return the bounding box of the group layout element
`border` | Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point.
`center` | Return the center anchor of the node
`childless` | Return a copy of the node with no children
`children` | Return the children of the group layout.
`contains` | Return `true` if another layout element is a descendant of the layout element, `false` otherwise
`descendants` | Return the descendants of the layout element
`drawing_elements` | Return the drawing elements of the group layout.
`east` | Return the east anchor of the node
`east_north_east` | Return the east north east anchor of the node
`east_south_east` | Return the east south east west anchor of the node
`equals` | Return `true` if the layout element is equal to another layout element, `false` otherwise
`flattened` | Return a list containing copy of the layout element with no children and all its descendants with no children
`label_center` | Return the label center anchor of the node
`north` | Return the north anchor of the node
`north_east` | Return the north east anchor of the node
`north_north_east` | Return the north north east anchor of the node
`north_north_west` | Return the north north west anchor of the node
`north_west` | Return the north west anchor of the node
`self_angle` | Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.
`self_bbox` | Compute and return the bounding box of the self drawing element of the group layout
`self_border` | Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point.
`self_children` | Return the self children of the node. A node has unique child that is its label
`self_drawing_elements` | Return the node's own drawing elements
`self_to_shapely` | Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout
`size` | Return the size of the node
`south` | Return the south anchor of the node
`south_east` | Return the south east anchor of the node
`south_south_east` | Return the south south east anchor of the node
`south_south_west` | Return the south south west anchor of the node
`south_west` | Return the south west anchor of the node
`to_shapely` | Return a shapely collection of geometries reproducing the drawing elements of the layout element
`west` | Return the west anchor of the node
`west_north_west` | Return the west north west anchor of the node
`west_south_west` | Return the west south west anchor of the node

Attributes:

Name | Type | Description
--- | --- | ---
`x` | `float` | Return the x coordinate of the node
`y` | `float` | Return the y coordinate of the node

#### `` anchor_point

    anchor_point(anchor_name: str) -> Point

Return an anchor point of the layout element

Source code in `src/momapy/core.py`

    130
    131
    132
    def anchor_point(self, anchor_name: str) -> momapy.geometry.Point:
        """Return an anchor point of the layout element"""
        return getattr(self, anchor_name)()

#### `` angle

    angle(
        angle: float,
        unit: Literal["degrees", "radians"] = "degrees",
    ) -> Point

Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.

Source code in `src/momapy/core.py`

    817
    818
    819
    820
    821
    822
    823
    824
    825
    826
    827
    828
    def angle(
        self,
        angle: float,
        unit: typing.Literal["degrees", "radians"] = "degrees",
    ) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal."""
        return momapy.drawing.get_drawing_elements_angle(
            drawing_elements=self.drawing_elements(),
            angle=angle,
            unit=unit,
            center=self.center(),
        )

#### `` bbox

    bbox() -> Bbox

Compute and return the bounding box of the group layout element

Source code in `src/momapy/core.py`

    504
    505
    506
    507
    508
    509
    510
    511
    512
    513
    514
    515
    516
    517
    518
    519
    520
    521
    522
    523
    524
    525
    526
    def bbox(self) -> momapy.geometry.Bbox:
        """Compute and return the bounding box of the group layout element"""
        self_bbox = self.self_bbox()
        bboxes = [child.bbox() for child in self.children()]
        min_x = self_bbox.north_west().x
        min_y = self_bbox.north_west().y
        max_x = self_bbox.south_east().x
        max_y = self_bbox.south_east().y
        for bbox in bboxes:
            if bbox.north_west().x < min_x:
                min_x = bbox.north_west().x
            if bbox.north_west().y < min_y:
                min_y = bbox.north_west().y
            if bbox.south_east().x > max_x:
                max_x = bbox.south_east().x
            if bbox.south_east().y > max_y:
                max_y = bbox.south_east().y
        bbox = momapy.geometry.Bbox(
            momapy.geometry.Point(min_x / 2 + max_x / 2, min_y / 2 + max_y / 2),
            max_x - min_x,
            max_y - min_y,
        )
        return bbox

#### `` border

    border(point: Point) -> Point

Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point. When there are multiple intersection points, the one closest to the given point is returned

Source code in `src/momapy/core.py`

    794
    795
    796
    797
    798
    799
    800
    801
    802
    def border(self, point: momapy.geometry.Point) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point.
        When there are multiple intersection points, the one closest to the given point is returned
        """
        return momapy.drawing.get_drawing_elements_border(
            drawing_elements=self.drawing_elements(),
            point=point,
            center=self.center(),
        )

#### `` center

    center() -> Point

Return the center anchor of the node

Source code in `src/momapy/core.py`

    776
    777
    778
    def center(self) -> momapy.geometry.Point:
        """Return the center anchor of the node"""
        return self.position

#### `` childless

    childless() -> Self

Return a copy of the node with no children

Source code in `src/momapy/core.py`

    830
    831
    832
    def childless(self) -> typing.Self:
        """Return a copy of the node with no children"""
        return dataclasses.replace(self, label=None, layout_elements=tuple([]))

#### `` children

    children() -> list[LayoutElement]

Return the children of the group layout. These are the self children of the group layout (returned by the `self_children` method) and the other children of the group layout (given by the `layout_elements` attribute)

Source code in `src/momapy/core.py`

    566
    567
    568
    569
    570
    def children(self) -> list[LayoutElement]:
        """Return the children of the group layout.
        These are the self children of the group layout (returned by the `self_children` method) and the other children of the group layout (given by the `layout_elements` attribute)
        """
        return self.self_children() + list(self.layout_elements)

#### `` contains

    contains(other: LayoutElement) -> bool

Return `true` if another layout element is a descendant of the layout element, `false` otherwise

Source code in `src/momapy/core.py`

    119
    120
    121
    def contains(self, other: "LayoutElement") -> bool:
        """Return `true` if another layout element is a descendant of the layout element, `false` otherwise"""
        return other in self.descendants()

#### `` descendants

    descendants() -> list[LayoutElement]

Return the descendants of the layout element

Source code in `src/momapy/core.py`

    90
    91
    92
    93
    94
    95
    96
    def descendants(self) -> list["LayoutElement"]:
        """Return the descendants of the layout element"""
        descendants = []
        for child in self.children():
            descendants.append(child)
            descendants += child.descendants()
        return descendants

#### `` drawing_elements

    drawing_elements() -> list[DrawingElement]

Return the drawing elements of the group layout. The returned drawing elements are a group drawing element formed of the self drawing elements of the group layout and the drawing elements of its children

Source code in `src/momapy/core.py`

    538
    539
    540
    541
    542
    543
    544
    545
    546
    547
    548
    549
    550
    551
    552
    553
    554
    555
    556
    557
    558
    559
    560
    561
    562
    563
    564
    def drawing_elements(self) -> list[momapy.drawing.DrawingElement]:
        """Return the drawing elements of the group layout.
        The returned drawing elements are a group drawing element formed of the self drawing elements of the group layout and the drawing elements of its children
        """
        drawing_elements = self.self_drawing_elements()
        for child in self.children():
            if child is not None:
                drawing_elements += child.drawing_elements()
        group = momapy.drawing.Group(
            class_=f"{type(self).__name__}_group",
            elements=tuple(drawing_elements),
            id_=f"{self.id_}_group",
            fill=self.group_fill,
            fill_rule=self.group_fill_rule,
            filter=self.group_filter,
            font_family=self.group_font_family,
            font_size=self.group_font_size,
            font_style=self.group_font_style,
            font_weight=self.group_font_weight,
            stroke=self.group_stroke,
            stroke_dasharray=self.group_stroke_dasharray,
            stroke_dashoffset=self.group_stroke_dashoffset,
            stroke_width=self.group_stroke_width,
            text_anchor=self.group_text_anchor,
            transform=self.group_transform,
        )
        return [group]

#### `` east

    east() -> Point

Return the east anchor of the node

Source code in `src/momapy/core.py`

    708
    709
    710
    def east(self) -> momapy.geometry.Point:
        """Return the east anchor of the node"""
        return self.self_angle(0)

#### `` east_north_east

    east_north_east() -> Point

Return the east north east anchor of the node

Source code in `src/momapy/core.py`

    700
    701
    702
    703
    704
    705
    706
    def east_north_east(self) -> momapy.geometry.Point:
        """Return the east north east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, -self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` east_south_east

    east_south_east() -> Point

Return the east south east west anchor of the node

Source code in `src/momapy/core.py`

    712
    713
    714
    715
    716
    717
    718
    def east_south_east(self) -> momapy.geometry.Point:
        """Return the east south east west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` equals

    equals(
        other: LayoutElement,
        flattened: bool = False,
        unordered: bool = False,
    ) -> bool

Return `true` if the layout element is equal to another layout element, `false` otherwise

Source code in `src/momapy/core.py`

    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    def equals(
        self, other: "LayoutElement", flattened: bool = False, unordered: bool = False
    ) -> bool:
        """Return `true` if the layout element is equal to another layout element, `false` otherwise"""
        if type(self) is type(other):
            if not flattened:
                return self == other
            else:
                if not unordered:
                    return self.flattened() == other.flattened()
                else:
                    return set(self.flattened()) == set(other.flattened())
        return False

#### `` flattened

    flattened() -> list[LayoutElement]

Return a list containing copy of the layout element with no children and all its descendants with no children

Source code in `src/momapy/core.py`

     98
     99
    100
    101
    102
    103
    def flattened(self) -> list["LayoutElement"]:
        """Return a list containing copy of the layout element with no children and all its descendants with no children"""
        flattened = [self.childless()]
        for child in self.children():
            flattened += child.flattened()
        return flattened

#### `` label_center

    label_center() -> Point

Return the label center anchor of the node

Source code in `src/momapy/core.py`

    780
    781
    782
    def label_center(self) -> momapy.geometry.Point:
        """Return the label center anchor of the node"""
        return self.position

#### `` north

    north() -> Point

Return the north anchor of the node

Source code in `src/momapy/core.py`

    680
    681
    682
    def north(self) -> momapy.geometry.Point:
        """Return the north anchor of the node"""
        return self.self_angle(90)

#### `` north_east

    north_east() -> Point

Return the north east anchor of the node

Source code in `src/momapy/core.py`

    692
    693
    694
    695
    696
    697
    698
    def north_east(self) -> momapy.geometry.Point:
        """Return the north east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, -self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` north_north_east

    north_north_east() -> Point

Return the north north east anchor of the node

Source code in `src/momapy/core.py`

    684
    685
    686
    687
    688
    689
    690
    def north_north_east(self) -> momapy.geometry.Point:
        """Return the north north east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 4, -self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` north_north_west

    north_north_west() -> Point

Return the north north west anchor of the node

Source code in `src/momapy/core.py`

    672
    673
    674
    675
    676
    677
    678
    def north_north_west(self) -> momapy.geometry.Point:
        """Return the north north west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() - (self.width / 4, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` north_west

    north_west() -> Point

Return the north west anchor of the node

Source code in `src/momapy/core.py`

    664
    665
    666
    667
    668
    669
    670
    def north_west(self) -> momapy.geometry.Point:
        """Return the north west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() - (self.width / 2, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` self_angle

    self_angle(
        angle: float,
        unit: Literal["degrees", "radians"] = "degrees",
    ) -> Point

Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.

Source code in `src/momapy/core.py`

    804
    805
    806
    807
    808
    809
    810
    811
    812
    813
    814
    815
    def self_angle(
        self,
        angle: float,
        unit: typing.Literal["degrees", "radians"] = "degrees",
    ) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal."""
        return momapy.drawing.get_drawing_elements_angle(
            drawing_elements=self.self_drawing_elements(),
            angle=angle,
            unit=unit,
            center=self.center(),
        )

#### `` self_bbox

    self_bbox() -> Bbox

Compute and return the bounding box of the self drawing element of the group layout

Source code in `src/momapy/core.py`

    499
    500
    501
    502
    def self_bbox(self) -> momapy.geometry.Bbox:
        """Compute and return the bounding box of the self drawing element of the group layout"""
        bounds = self.self_to_shapely().bounds
        return momapy.geometry.Bbox.from_bounds(bounds)

#### `` self_border

    self_border(point: Point) -> Point

Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point. When there are multiple intersection points, the one closest to the given point is returned

Source code in `src/momapy/core.py`

    784
    785
    786
    787
    788
    789
    790
    791
    792
    def self_border(self, point: momapy.geometry.Point) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point.
        When there are multiple intersection points, the one closest to the given point is returned
        """
        return momapy.drawing.get_drawing_elements_border(
            drawing_elements=self.self_drawing_elements(),
            point=point,
            center=self.center(),
        )

#### `` self_children

    self_children() -> list[LayoutElement]

Return the self children of the node. A node has unique child that is its label

Source code in `src/momapy/core.py`

    654
    655
    656
    657
    658
    def self_children(self) -> list[LayoutElement]:
        """Return the self children of the node. A node has unique child that is its label"""
        if self.label is not None:
            return [self.label]
        return []

#### `` self_drawing_elements

    self_drawing_elements() -> list[DrawingElement]

Return the node's own drawing elements

Source code in `src/momapy/core.py`

    637
    638
    639
    640
    641
    642
    643
    644
    645
    646
    647
    648
    649
    650
    651
    652
    def self_drawing_elements(self) -> list[momapy.drawing.DrawingElement]:
        """Return the node's own drawing elements"""
        drawing_elements = self._border_drawing_elements()
        group = momapy.drawing.Group(
            class_=type(self).__name__,
            elements=tuple(drawing_elements),
            fill=self.fill,
            filter=self.filter,
            id_=self.id_,
            stroke=self.stroke,
            stroke_dasharray=self.stroke_dasharray,
            stroke_dashoffset=self.stroke_dashoffset,
            stroke_width=self.stroke_width,
            transform=self.transform,
        )
        return [group]

#### `` self_to_shapely

    self_to_shapely() -> GeometryCollection

Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout

Source code in `src/momapy/core.py`

    495
    496
    497
    def self_to_shapely(self) -> shapely.GeometryCollection:
        """Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout"""
        return momapy.drawing.drawing_elements_to_shapely(self.drawing_elements())

#### `` size

    size() -> tuple[float, float]

Return the size of the node

Source code in `src/momapy/core.py`

    660
    661
    662
    def size(self) -> tuple[float, float]:
        """Return the size of the node"""
        return (self.width, self.height)

#### `` south

    south() -> Point

Return the south anchor of the node

Source code in `src/momapy/core.py`

    736
    737
    738
    def south(self) -> momapy.geometry.Point:
        """Return the south anchor of the node"""
        return self.self_angle(270)

#### `` south_east

    south_east() -> Point

Return the south east anchor of the node

Source code in `src/momapy/core.py`

    720
    721
    722
    723
    724
    725
    726
    def south_east(self) -> momapy.geometry.Point:
        """Return the south east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` south_south_east

    south_south_east() -> Point

Return the south south east anchor of the node

Source code in `src/momapy/core.py`

    728
    729
    730
    731
    732
    733
    734
    def south_south_east(self) -> momapy.geometry.Point:
        """Return the south south east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 4, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` south_south_west

    south_south_west() -> Point

Return the south south west anchor of the node

Source code in `src/momapy/core.py`

    740
    741
    742
    743
    744
    745
    746
    def south_south_west(self) -> momapy.geometry.Point:
        """Return the south south west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (-self.width / 4, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` south_west

    south_west() -> Point

Return the south west anchor of the node

Source code in `src/momapy/core.py`

    748
    749
    750
    751
    752
    753
    754
    def south_west(self) -> momapy.geometry.Point:
        """Return the south west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (-self.width / 2, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` to_shapely

    to_shapely(to_polygons: bool = False) -> GeometryCollection

Return a shapely collection of geometries reproducing the drawing elements of the layout element

Source code in `src/momapy/core.py`

    123
    124
    125
    126
    127
    128
    def to_shapely(self, to_polygons: bool = False) -> shapely.GeometryCollection:
        """Return a shapely collection of geometries reproducing the drawing elements of the layout element"""
        geom_collection = []
        for drawing_element in self.drawing_elements():
            geom_collection += drawing_element.to_shapely(to_polygons=to_polygons).geoms
        return shapely.GeometryCollection(geom_collection)

#### `` west

    west() -> Point

Return the west anchor of the node

Source code in `src/momapy/core.py`

    764
    765
    766
    def west(self) -> momapy.geometry.Point:
        """Return the west anchor of the node"""
        return self.self_angle(180)

#### `` west_north_west

    west_north_west() -> Point

Return the west north west anchor of the node

Source code in `src/momapy/core.py`

    768
    769
    770
    771
    772
    773
    774
    def west_north_west(self) -> momapy.geometry.Point:
        """Return the west north west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() - (self.width / 2, self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` west_south_west

    west_south_west() -> Point

Return the west south west anchor of the node

Source code in `src/momapy/core.py`

    756
    757
    758
    759
    760
    761
    762
    def west_south_west(self) -> momapy.geometry.Point:
        """Return the west south west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (-self.width / 2, self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` x `property`

    x: float

Return the x coordinate of the node

#### `` y `property`

    y: float

Return the y coordinate of the node

### `` ComplexMultimer `dataclass`

    ComplexMultimer(
        *,
        id_: str = make_uuid4_as_str(),
        compartment: Compartment | None = None,
        label: str | None = None,
        state_variables: frozenset[StateVariable] = frozenset(),
        units_of_information: frozenset[
            UnitOfInformation
        ] = frozenset(),
        subunits: frozenset[Subunit] = frozenset(),
        cardinality: int | None = None,
    )

Bases: `Multimer`

Class for complex multimers

Parameters:

Name | Type | Description | Default
--- | --- | --- | ---
`id_` | `str` | The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element | `'a6f5b968-3d9d-4ef7-9a05-d95a492a9eac'`
`compartment` | `Compartment | None` | The compartment of the entity pool | `None`
`label` | `str | None` | The label of the complex | `None`
`state_variables` | `frozenset[StateVariable]` | The state variables of the complex | `<class 'frozenset'>`
`units_of_information` | `frozenset[UnitOfInformation]` | The units of information of the complex | `<class 'frozenset'>`
`subunits` | `frozenset[Subunit]` | The subunits of the complex | `<class 'frozenset'>`
`cardinality` | `int | None` | The cardinality of the multimer | `None`

### `` ComplexMultimerLayout `dataclass`

    ComplexMultimerLayout(
        fill: NoneValueType | Color | None = white,
        stroke: NoneValueType | Color | None = black,
        stroke_width: float | None = 1.25,
        offset: float = 3.0,
        subunits_stroke: tuple[NoneValueType | Color]
        | None = None,
        subunits_stroke_width: tuple[NoneValueType | float]
        | None = None,
        subunits_stroke_dasharray: tuple[
            NoneValueType | tuple[float]
        ]
        | None = None,
        subunits_stroke_dashoffset: tuple[float] | None = None,
        subunits_fill: tuple[NoneValueType | Color]
        | None = None,
        subunits_transform: tuple[
            NoneValueType | tuple[Transformation]
        ]
        | None = None,
        subunits_filter: tuple[NoneValueType | Filter]
        | None = None,
        *,
        id_: str = make_uuid4_as_str(),
        layout_elements: tuple[LayoutElement] = tuple(),
        group_fill: NoneValueType | Color | None = None,
        group_fill_rule: FillRule | None = None,
        group_filter: NoneValueType | Filter | None = None,
        group_font_family: str | None = None,
        group_font_size: float | None = None,
        group_font_style: FontStyle | None = None,
        group_font_weight: FontWeight | float | None = None,
        group_stroke: NoneValueType | Color | None = None,
        group_stroke_dasharray: tuple[float, ...] | None = None,
        group_stroke_dashoffset: float | None = None,
        group_stroke_width: float | None = None,
        group_text_anchor: TextAnchor | None = None,
        group_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        filter: NoneValueType | Filter | None = None,
        height: float = 44.0,
        label: TextLayout | None = None,
        position: Point,
        stroke_dasharray: tuple[float, ...] | None = None,
        stroke_dashoffset: float | None = None,
        transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        width: float = 44.0,
        cut_corners: float = 5.0,
    )

Bases: `_MultiMixin`, `SBGNNode`

Class for complex multimer layouts

Parameters:

Name | Type | Description | Default
--- | --- | --- | ---
`id_` | `str` | The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element | `'089143df-afc3-490e-933e-1794a425d83b'`
`layout_elements` | `tuple[LayoutElement]` | The sub-layout elements of the group layout. These are part of the children of the group layout | `<dynamic>`
`group_fill` | `NoneValueType | Color | None` | The fill color of the group layout | `None`
`group_fill_rule` | `FillRule | None` | The fill rule of the group layout | `None`
`group_filter` | `NoneValueType | Filter | None` | The filter of the group layout | `None`
`group_font_family` | `str | None` | The font family of the group layout | `None`
`group_font_size` | `float | None` | The font size of the group layout | `None`
`group_font_style` | `FontStyle | None` | The font style of the group layout | `None`
`group_font_weight` | `FontWeight | float | None` | The font weight of the group layout | `None`
`group_stroke` | `NoneValueType | Color | None` | The stroke color of the group layout | `None`
`group_stroke_dasharray` | `tuple[float, ...] | None` | The stroke dasharray of the group layout | `None`
`group_stroke_dashoffset` | `float | None` | The stroke dashoffset of the group layout | `None`
`group_stroke_width` | `float | None` | The stroke width of the group layout | `None`
`group_text_anchor` | `TextAnchor | None` | The text anchor of the group layout | `None`
`group_transform` | `NoneValueType | tuple[Transformation] | None` | The transform of the group layout | `None`
`fill` | `NoneValueType | Color | None` |  | `Color(red=255, green=255, blue=255, alpha=1.0)`
`filter` | `NoneValueType | Filter | None` | The filter of the node | `None`
`height` | `float` |  | `44.0`
`label` | `TextLayout | None` | The label of the node | `None`
`position` | `Point` | The position of the node | required
`stroke` | `NoneValueType | Color | None` |  | `Color(red=0, green=0, blue=0, alpha=1.0)`
`stroke_dasharray` | `tuple[float, ...] | None` | The stroke dasharray of the node | `None`
`stroke_dashoffset` | `float | None` | The stroke dashoffset of the node | `None`
`stroke_width` | `float | None` |  | `1.25`
`transform` | `NoneValueType | tuple[Transformation] | None` | The transform of the node | `None`
`width` | `float` |  | `44.0`
`offset` | `float` |  | `3.0`
`subunits_stroke` | `tuple[Union[NoneValueType, Color]] | None` |  | `None`
`subunits_stroke_width` | `tuple[Union[NoneValueType, float]] | None` |  | `None`
`subunits_stroke_dasharray` | `tuple[Union[NoneValueType, tuple[float]]] | None` |  | `None`
`subunits_stroke_dashoffset` | `tuple[float] | None` |  | `None`
`subunits_fill` | `tuple[Union[NoneValueType, Color]] | None` |  | `None`
`subunits_transform` | `tuple[Union[NoneValueType, tuple[Transformation]]] | None` |  | `None`
`subunits_filter` | `tuple[Union[NoneValueType, Filter]] | None` |  | `None`
`cut_corners` | `float` |  | `5.0`

Methods:

Name | Description
--- | ---
`anchor_point` | Return an anchor point of the layout element
`angle` | Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.
`bbox` | Compute and return the bounding box of the group layout element
`border` | Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point.
`center` | Return the center anchor of the node
`childless` | Return a copy of the node with no children
`children` | Return the children of the group layout.
`contains` | Return `true` if another layout element is a descendant of the layout element, `false` otherwise
`descendants` | Return the descendants of the layout element
`drawing_elements` | Return the drawing elements of the group layout.
`east` | Return the east anchor of the node
`east_north_east` | Return the east north east anchor of the node
`east_south_east` | Return the east south east west anchor of the node
`equals` | Return `true` if the layout element is equal to another layout element, `false` otherwise
`flattened` | Return a list containing copy of the layout element with no children and all its descendants with no children
`north` | Return the north anchor of the node
`north_east` | Return the north east anchor of the node
`north_north_east` | Return the north north east anchor of the node
`north_north_west` | Return the north north west anchor of the node
`north_west` | Return the north west anchor of the node
`self_angle` | Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.
`self_bbox` | Compute and return the bounding box of the self drawing element of the group layout
`self_border` | Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point.
`self_children` | Return the self children of the node. A node has unique child that is its label
`self_drawing_elements` | Return the node's own drawing elements
`self_to_shapely` | Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout
`size` | Return the size of the node
`south` | Return the south anchor of the node
`south_east` | Return the south east anchor of the node
`south_south_east` | Return the south south east anchor of the node
`south_south_west` | Return the south south west anchor of the node
`south_west` | Return the south west anchor of the node
`to_shapely` | Return a shapely collection of geometries reproducing the drawing elements of the layout element
`west` | Return the west anchor of the node
`west_north_west` | Return the west north west anchor of the node
`west_south_west` | Return the west south west anchor of the node

Attributes:

Name | Type | Description
--- | --- | ---
`x` | `float` | Return the x coordinate of the node
`y` | `float` | Return the y coordinate of the node

#### `` anchor_point

    anchor_point(anchor_name: str) -> Point

Return an anchor point of the layout element

Source code in `src/momapy/core.py`

    130
    131
    132
    def anchor_point(self, anchor_name: str) -> momapy.geometry.Point:
        """Return an anchor point of the layout element"""
        return getattr(self, anchor_name)()

#### `` angle

    angle(
        angle: float,
        unit: Literal["degrees", "radians"] = "degrees",
    ) -> Point

Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.

Source code in `src/momapy/core.py`

    817
    818
    819
    820
    821
    822
    823
    824
    825
    826
    827
    828
    def angle(
        self,
        angle: float,
        unit: typing.Literal["degrees", "radians"] = "degrees",
    ) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal."""
        return momapy.drawing.get_drawing_elements_angle(
            drawing_elements=self.drawing_elements(),
            angle=angle,
            unit=unit,
            center=self.center(),
        )

#### `` bbox

    bbox() -> Bbox

Compute and return the bounding box of the group layout element

Source code in `src/momapy/core.py`

    504
    505
    506
    507
    508
    509
    510
    511
    512
    513
    514
    515
    516
    517
    518
    519
    520
    521
    522
    523
    524
    525
    526
    def bbox(self) -> momapy.geometry.Bbox:
        """Compute and return the bounding box of the group layout element"""
        self_bbox = self.self_bbox()
        bboxes = [child.bbox() for child in self.children()]
        min_x = self_bbox.north_west().x
        min_y = self_bbox.north_west().y
        max_x = self_bbox.south_east().x
        max_y = self_bbox.south_east().y
        for bbox in bboxes:
            if bbox.north_west().x < min_x:
                min_x = bbox.north_west().x
            if bbox.north_west().y < min_y:
                min_y = bbox.north_west().y
            if bbox.south_east().x > max_x:
                max_x = bbox.south_east().x
            if bbox.south_east().y > max_y:
                max_y = bbox.south_east().y
        bbox = momapy.geometry.Bbox(
            momapy.geometry.Point(min_x / 2 + max_x / 2, min_y / 2 + max_y / 2),
            max_x - min_x,
            max_y - min_y,
        )
        return bbox

#### `` border

    border(point: Point) -> Point

Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point. When there are multiple intersection points, the one closest to the given point is returned

Source code in `src/momapy/core.py`

    794
    795
    796
    797
    798
    799
    800
    801
    802
    def border(self, point: momapy.geometry.Point) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point.
        When there are multiple intersection points, the one closest to the given point is returned
        """
        return momapy.drawing.get_drawing_elements_border(
            drawing_elements=self.drawing_elements(),
            point=point,
            center=self.center(),
        )

#### `` center

    center() -> Point

Return the center anchor of the node

Source code in `src/momapy/core.py`

    776
    777
    778
    def center(self) -> momapy.geometry.Point:
        """Return the center anchor of the node"""
        return self.position

#### `` childless

    childless() -> Self

Return a copy of the node with no children

Source code in `src/momapy/core.py`

    830
    831
    832
    def childless(self) -> typing.Self:
        """Return a copy of the node with no children"""
        return dataclasses.replace(self, label=None, layout_elements=tuple([]))

#### `` children

    children() -> list[LayoutElement]

Return the children of the group layout. These are the self children of the group layout (returned by the `self_children` method) and the other children of the group layout (given by the `layout_elements` attribute)

Source code in `src/momapy/core.py`

    566
    567
    568
    569
    570
    def children(self) -> list[LayoutElement]:
        """Return the children of the group layout.
        These are the self children of the group layout (returned by the `self_children` method) and the other children of the group layout (given by the `layout_elements` attribute)
        """
        return self.self_children() + list(self.layout_elements)

#### `` contains

    contains(other: LayoutElement) -> bool

Return `true` if another layout element is a descendant of the layout element, `false` otherwise

Source code in `src/momapy/core.py`

    119
    120
    121
    def contains(self, other: "LayoutElement") -> bool:
        """Return `true` if another layout element is a descendant of the layout element, `false` otherwise"""
        return other in self.descendants()

#### `` descendants

    descendants() -> list[LayoutElement]

Return the descendants of the layout element

Source code in `src/momapy/core.py`

    90
    91
    92
    93
    94
    95
    96
    def descendants(self) -> list["LayoutElement"]:
        """Return the descendants of the layout element"""
        descendants = []
        for child in self.children():
            descendants.append(child)
            descendants += child.descendants()
        return descendants

#### `` drawing_elements

    drawing_elements() -> list[DrawingElement]

Return the drawing elements of the group layout. The returned drawing elements are a group drawing element formed of the self drawing elements of the group layout and the drawing elements of its children

Source code in `src/momapy/core.py`

    538
    539
    540
    541
    542
    543
    544
    545
    546
    547
    548
    549
    550
    551
    552
    553
    554
    555
    556
    557
    558
    559
    560
    561
    562
    563
    564
    def drawing_elements(self) -> list[momapy.drawing.DrawingElement]:
        """Return the drawing elements of the group layout.
        The returned drawing elements are a group drawing element formed of the self drawing elements of the group layout and the drawing elements of its children
        """
        drawing_elements = self.self_drawing_elements()
        for child in self.children():
            if child is not None:
                drawing_elements += child.drawing_elements()
        group = momapy.drawing.Group(
            class_=f"{type(self).__name__}_group",
            elements=tuple(drawing_elements),
            id_=f"{self.id_}_group",
            fill=self.group_fill,
            fill_rule=self.group_fill_rule,
            filter=self.group_filter,
            font_family=self.group_font_family,
            font_size=self.group_font_size,
            font_style=self.group_font_style,
            font_weight=self.group_font_weight,
            stroke=self.group_stroke,
            stroke_dasharray=self.group_stroke_dasharray,
            stroke_dashoffset=self.group_stroke_dashoffset,
            stroke_width=self.group_stroke_width,
            text_anchor=self.group_text_anchor,
            transform=self.group_transform,
        )
        return [group]

#### `` east

    east() -> Point

Return the east anchor of the node

Source code in `src/momapy/core.py`

    708
    709
    710
    def east(self) -> momapy.geometry.Point:
        """Return the east anchor of the node"""
        return self.self_angle(0)

#### `` east_north_east

    east_north_east() -> Point

Return the east north east anchor of the node

Source code in `src/momapy/core.py`

    700
    701
    702
    703
    704
    705
    706
    def east_north_east(self) -> momapy.geometry.Point:
        """Return the east north east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, -self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` east_south_east

    east_south_east() -> Point

Return the east south east west anchor of the node

Source code in `src/momapy/core.py`

    712
    713
    714
    715
    716
    717
    718
    def east_south_east(self) -> momapy.geometry.Point:
        """Return the east south east west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` equals

    equals(
        other: LayoutElement,
        flattened: bool = False,
        unordered: bool = False,
    ) -> bool

Return `true` if the layout element is equal to another layout element, `false` otherwise

Source code in `src/momapy/core.py`

    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    def equals(
        self, other: "LayoutElement", flattened: bool = False, unordered: bool = False
    ) -> bool:
        """Return `true` if the layout element is equal to another layout element, `false` otherwise"""
        if type(self) is type(other):
            if not flattened:
                return self == other
            else:
                if not unordered:
                    return self.flattened() == other.flattened()
                else:
                    return set(self.flattened()) == set(other.flattened())
        return False

#### `` flattened

    flattened() -> list[LayoutElement]

Return a list containing copy of the layout element with no children and all its descendants with no children

Source code in `src/momapy/core.py`

     98
     99
    100
    101
    102
    103
    def flattened(self) -> list["LayoutElement"]:
        """Return a list containing copy of the layout element with no children and all its descendants with no children"""
        flattened = [self.childless()]
        for child in self.children():
            flattened += child.flattened()
        return flattened

#### `` north

    north() -> Point

Return the north anchor of the node

Source code in `src/momapy/core.py`

    680
    681
    682
    def north(self) -> momapy.geometry.Point:
        """Return the north anchor of the node"""
        return self.self_angle(90)

#### `` north_east

    north_east() -> Point

Return the north east anchor of the node

Source code in `src/momapy/core.py`

    692
    693
    694
    695
    696
    697
    698
    def north_east(self) -> momapy.geometry.Point:
        """Return the north east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, -self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` north_north_east

    north_north_east() -> Point

Return the north north east anchor of the node

Source code in `src/momapy/core.py`

    684
    685
    686
    687
    688
    689
    690
    def north_north_east(self) -> momapy.geometry.Point:
        """Return the north north east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 4, -self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` north_north_west

    north_north_west() -> Point

Return the north north west anchor of the node

Source code in `src/momapy/core.py`

    672
    673
    674
    675
    676
    677
    678
    def north_north_west(self) -> momapy.geometry.Point:
        """Return the north north west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() - (self.width / 4, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` north_west

    north_west() -> Point

Return the north west anchor of the node

Source code in `src/momapy/core.py`

    664
    665
    666
    667
    668
    669
    670
    def north_west(self) -> momapy.geometry.Point:
        """Return the north west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() - (self.width / 2, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` self_angle

    self_angle(
        angle: float,
        unit: Literal["degrees", "radians"] = "degrees",
    ) -> Point

Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.

Source code in `src/momapy/core.py`

    804
    805
    806
    807
    808
    809
    810
    811
    812
    813
    814
    815
    def self_angle(
        self,
        angle: float,
        unit: typing.Literal["degrees", "radians"] = "degrees",
    ) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal."""
        return momapy.drawing.get_drawing_elements_angle(
            drawing_elements=self.self_drawing_elements(),
            angle=angle,
            unit=unit,
            center=self.center(),
        )

#### `` self_bbox

    self_bbox() -> Bbox

Compute and return the bounding box of the self drawing element of the group layout

Source code in `src/momapy/core.py`

    499
    500
    501
    502
    def self_bbox(self) -> momapy.geometry.Bbox:
        """Compute and return the bounding box of the self drawing element of the group layout"""
        bounds = self.self_to_shapely().bounds
        return momapy.geometry.Bbox.from_bounds(bounds)

#### `` self_border

    self_border(point: Point) -> Point

Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point. When there are multiple intersection points, the one closest to the given point is returned

Source code in `src/momapy/core.py`

    784
    785
    786
    787
    788
    789
    790
    791
    792
    def self_border(self, point: momapy.geometry.Point) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point.
        When there are multiple intersection points, the one closest to the given point is returned
        """
        return momapy.drawing.get_drawing_elements_border(
            drawing_elements=self.self_drawing_elements(),
            point=point,
            center=self.center(),
        )

#### `` self_children

    self_children() -> list[LayoutElement]

Return the self children of the node. A node has unique child that is its label

Source code in `src/momapy/core.py`

    654
    655
    656
    657
    658
    def self_children(self) -> list[LayoutElement]:
        """Return the self children of the node. A node has unique child that is its label"""
        if self.label is not None:
            return [self.label]
        return []

#### `` self_drawing_elements

    self_drawing_elements() -> list[DrawingElement]

Return the node's own drawing elements

Source code in `src/momapy/core.py`

    637
    638
    639
    640
    641
    642
    643
    644
    645
    646
    647
    648
    649
    650
    651
    652
    def self_drawing_elements(self) -> list[momapy.drawing.DrawingElement]:
        """Return the node's own drawing elements"""
        drawing_elements = self._border_drawing_elements()
        group = momapy.drawing.Group(
            class_=type(self).__name__,
            elements=tuple(drawing_elements),
            fill=self.fill,
            filter=self.filter,
            id_=self.id_,
            stroke=self.stroke,
            stroke_dasharray=self.stroke_dasharray,
            stroke_dashoffset=self.stroke_dashoffset,
            stroke_width=self.stroke_width,
            transform=self.transform,
        )
        return [group]

#### `` self_to_shapely

    self_to_shapely() -> GeometryCollection

Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout

Source code in `src/momapy/core.py`

    495
    496
    497
    def self_to_shapely(self) -> shapely.GeometryCollection:
        """Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout"""
        return momapy.drawing.drawing_elements_to_shapely(self.drawing_elements())

#### `` size

    size() -> tuple[float, float]

Return the size of the node

Source code in `src/momapy/core.py`

    660
    661
    662
    def size(self) -> tuple[float, float]:
        """Return the size of the node"""
        return (self.width, self.height)

#### `` south

    south() -> Point

Return the south anchor of the node

Source code in `src/momapy/core.py`

    736
    737
    738
    def south(self) -> momapy.geometry.Point:
        """Return the south anchor of the node"""
        return self.self_angle(270)

#### `` south_east

    south_east() -> Point

Return the south east anchor of the node

Source code in `src/momapy/core.py`

    720
    721
    722
    723
    724
    725
    726
    def south_east(self) -> momapy.geometry.Point:
        """Return the south east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` south_south_east

    south_south_east() -> Point

Return the south south east anchor of the node

Source code in `src/momapy/core.py`

    728
    729
    730
    731
    732
    733
    734
    def south_south_east(self) -> momapy.geometry.Point:
        """Return the south south east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 4, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` south_south_west

    south_south_west() -> Point

Return the south south west anchor of the node

Source code in `src/momapy/core.py`

    740
    741
    742
    743
    744
    745
    746
    def south_south_west(self) -> momapy.geometry.Point:
        """Return the south south west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (-self.width / 4, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` south_west

    south_west() -> Point

Return the south west anchor of the node

Source code in `src/momapy/core.py`

    748
    749
    750
    751
    752
    753
    754
    def south_west(self) -> momapy.geometry.Point:
        """Return the south west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (-self.width / 2, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` to_shapely

    to_shapely(to_polygons: bool = False) -> GeometryCollection

Return a shapely collection of geometries reproducing the drawing elements of the layout element

Source code in `src/momapy/core.py`

    123
    124
    125
    126
    127
    128
    def to_shapely(self, to_polygons: bool = False) -> shapely.GeometryCollection:
        """Return a shapely collection of geometries reproducing the drawing elements of the layout element"""
        geom_collection = []
        for drawing_element in self.drawing_elements():
            geom_collection += drawing_element.to_shapely(to_polygons=to_polygons).geoms
        return shapely.GeometryCollection(geom_collection)

#### `` west

    west() -> Point

Return the west anchor of the node

Source code in `src/momapy/core.py`

    764
    765
    766
    def west(self) -> momapy.geometry.Point:
        """Return the west anchor of the node"""
        return self.self_angle(180)

#### `` west_north_west

    west_north_west() -> Point

Return the west north west anchor of the node

Source code in `src/momapy/core.py`

    768
    769
    770
    771
    772
    773
    774
    def west_north_west(self) -> momapy.geometry.Point:
        """Return the west north west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() - (self.width / 2, self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` west_south_west

    west_south_west() -> Point

Return the west south west anchor of the node

Source code in `src/momapy/core.py`

    756
    757
    758
    759
    760
    761
    762
    def west_south_west(self) -> momapy.geometry.Point:
        """Return the west south west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (-self.width / 2, self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` x `property`

    x: float

Return the x coordinate of the node

#### `` y `property`

    y: float

Return the y coordinate of the node

### `` ComplexMultimerSubunit `dataclass`

    ComplexMultimerSubunit(
        *,
        id_: str = make_uuid4_as_str(),
        label: str | None = None,
        state_variables: frozenset[StateVariable] = frozenset(),
        units_of_information: frozenset[
            UnitOfInformation
        ] = frozenset(),
        subunits: frozenset[Subunit] = frozenset(),
        cardinality: int | None = None,
    )

Bases: `MultimerSubunit`

Class for complex subunits

Parameters:

Name | Type | Description | Default
--- | --- | --- | ---
`id_` | `str` | The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element | `'6d63f1ee-7c1b-465b-aa21-1061e5155971'`
`label` | `str | None` | The label of the subunit | `None`
`state_variables` | `frozenset[StateVariable]` | The state variables of the complex subunit | `<class 'frozenset'>`
`units_of_information` | `frozenset[UnitOfInformation]` | The units of information of the complex subunit | `<class 'frozenset'>`
`subunits` | `frozenset[Subunit]` | The subunits of the complex subunit | `<class 'frozenset'>`
`cardinality` | `int | None` | The cardinality of the multimer subunit | `None`

### `` ComplexMultimerSubunitLayout `dataclass`

    ComplexMultimerSubunitLayout(
        fill: NoneValueType | Color | None = white,
        stroke: NoneValueType | Color | None = black,
        stroke_width: float | None = 1.25,
        offset: float = 3.0,
        subunits_stroke: tuple[NoneValueType | Color]
        | None = None,
        subunits_stroke_width: tuple[NoneValueType | float]
        | None = None,
        subunits_stroke_dasharray: tuple[
            NoneValueType | tuple[float]
        ]
        | None = None,
        subunits_stroke_dashoffset: tuple[float] | None = None,
        subunits_fill: tuple[NoneValueType | Color]
        | None = None,
        subunits_transform: tuple[
            NoneValueType | tuple[Transformation]
        ]
        | None = None,
        subunits_filter: tuple[NoneValueType | Filter]
        | None = None,
        *,
        id_: str = make_uuid4_as_str(),
        layout_elements: tuple[LayoutElement] = tuple(),
        group_fill: NoneValueType | Color | None = None,
        group_fill_rule: FillRule | None = None,
        group_filter: NoneValueType | Filter | None = None,
        group_font_family: str | None = None,
        group_font_size: float | None = None,
        group_font_style: FontStyle | None = None,
        group_font_weight: FontWeight | float | None = None,
        group_stroke: NoneValueType | Color | None = None,
        group_stroke_dasharray: tuple[float, ...] | None = None,
        group_stroke_dashoffset: float | None = None,
        group_stroke_width: float | None = None,
        group_text_anchor: TextAnchor | None = None,
        group_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        filter: NoneValueType | Filter | None = None,
        height: float = 30.0,
        label: TextLayout | None = None,
        position: Point,
        stroke_dasharray: tuple[float, ...] | None = None,
        stroke_dashoffset: float | None = None,
        transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        width: float = 60.0,
        cut_corners: float = 5.0,
    )

Bases: `_MultiMixin`, `SBGNNode`

Class for complex multimer subunit layouts

Parameters:

Name | Type | Description | Default
--- | --- | --- | ---
`id_` | `str` | The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element | `'96f4b137-f68c-439c-954c-dd72141fa4cd'`
`layout_elements` | `tuple[LayoutElement]` | The sub-layout elements of the group layout. These are part of the children of the group layout | `<dynamic>`
`group_fill` | `NoneValueType | Color | None` | The fill color of the group layout | `None`
`group_fill_rule` | `FillRule | None` | The fill rule of the group layout | `None`
`group_filter` | `NoneValueType | Filter | None` | The filter of the group layout | `None`
`group_font_family` | `str | None` | The font family of the group layout | `None`
`group_font_size` | `float | None` | The font size of the group layout | `None`
`group_font_style` | `FontStyle | None` | The font style of the group layout | `None`
`group_font_weight` | `FontWeight | float | None` | The font weight of the group layout | `None`
`group_stroke` | `NoneValueType | Color | None` | The stroke color of the group layout | `None`
`group_stroke_dasharray` | `tuple[float, ...] | None` | The stroke dasharray of the group layout | `None`
`group_stroke_dashoffset` | `float | None` | The stroke dashoffset of the group layout | `None`
`group_stroke_width` | `float | None` | The stroke width of the group layout | `None`
`group_text_anchor` | `TextAnchor | None` | The text anchor of the group layout | `None`
`group_transform` | `NoneValueType | tuple[Transformation] | None` | The transform of the group layout | `None`
`fill` | `NoneValueType | Color | None` |  | `Color(red=255, green=255, blue=255, alpha=1.0)`
`filter` | `NoneValueType | Filter | None` | The filter of the node | `None`
`height` | `float` |  | `30.0`
`label` | `TextLayout | None` | The label of the node | `None`
`position` | `Point` | The position of the node | required
`stroke` | `NoneValueType | Color | None` |  | `Color(red=0, green=0, blue=0, alpha=1.0)`
`stroke_dasharray` | `tuple[float, ...] | None` | The stroke dasharray of the node | `None`
`stroke_dashoffset` | `float | None` | The stroke dashoffset of the node | `None`
`stroke_width` | `float | None` |  | `1.25`
`transform` | `NoneValueType | tuple[Transformation] | None` | The transform of the node | `None`
`width` | `float` |  | `60.0`
`offset` | `float` |  | `3.0`
`subunits_stroke` | `tuple[Union[NoneValueType, Color]] | None` |  | `None`
`subunits_stroke_width` | `tuple[Union[NoneValueType, float]] | None` |  | `None`
`subunits_stroke_dasharray` | `tuple[Union[NoneValueType, tuple[float]]] | None` |  | `None`
`subunits_stroke_dashoffset` | `tuple[float] | None` |  | `None`
`subunits_fill` | `tuple[Union[NoneValueType, Color]] | None` |  | `None`
`subunits_transform` | `tuple[Union[NoneValueType, tuple[Transformation]]] | None` |  | `None`
`subunits_filter` | `tuple[Union[NoneValueType, Filter]] | None` |  | `None`
`cut_corners` | `float` |  | `5.0`

Methods:

Name | Description
--- | ---
`anchor_point` | Return an anchor point of the layout element
`angle` | Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.
`bbox` | Compute and return the bounding box of the group layout element
`border` | Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point.
`center` | Return the center anchor of the node
`childless` | Return a copy of the node with no children
`children` | Return the children of the group layout.
`contains` | Return `true` if another layout element is a descendant of the layout element, `false` otherwise
`descendants` | Return the descendants of the layout element
`drawing_elements` | Return the drawing elements of the group layout.
`east` | Return the east anchor of the node
`east_north_east` | Return the east north east anchor of the node
`east_south_east` | Return the east south east west anchor of the node
`equals` | Return `true` if the layout element is equal to another layout element, `false` otherwise
`flattened` | Return a list containing copy of the layout element with no children and all its descendants with no children
`north` | Return the north anchor of the node
`north_east` | Return the north east anchor of the node
`north_north_east` | Return the north north east anchor of the node
`north_north_west` | Return the north north west anchor of the node
`north_west` | Return the north west anchor of the node
`self_angle` | Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.
`self_bbox` | Compute and return the bounding box of the self drawing element of the group layout
`self_border` | Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point.
`self_children` | Return the self children of the node. A node has unique child that is its label
`self_drawing_elements` | Return the node's own drawing elements
`self_to_shapely` | Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout
`size` | Return the size of the node
`south` | Return the south anchor of the node
`south_east` | Return the south east anchor of the node
`south_south_east` | Return the south south east anchor of the node
`south_south_west` | Return the south south west anchor of the node
`south_west` | Return the south west anchor of the node
`to_shapely` | Return a shapely collection of geometries reproducing the drawing elements of the layout element
`west` | Return the west anchor of the node
`west_north_west` | Return the west north west anchor of the node
`west_south_west` | Return the west south west anchor of the node

Attributes:

Name | Type | Description
--- | --- | ---
`x` | `float` | Return the x coordinate of the node
`y` | `float` | Return the y coordinate of the node

#### `` anchor_point

    anchor_point(anchor_name: str) -> Point

Return an anchor point of the layout element

Source code in `src/momapy/core.py`

    130
    131
    132
    def anchor_point(self, anchor_name: str) -> momapy.geometry.Point:
        """Return an anchor point of the layout element"""
        return getattr(self, anchor_name)()

#### `` angle

    angle(
        angle: float,
        unit: Literal["degrees", "radians"] = "degrees",
    ) -> Point

Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.

Source code in `src/momapy/core.py`

    817
    818
    819
    820
    821
    822
    823
    824
    825
    826
    827
    828
    def angle(
        self,
        angle: float,
        unit: typing.Literal["degrees", "radians"] = "degrees",
    ) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal."""
        return momapy.drawing.get_drawing_elements_angle(
            drawing_elements=self.drawing_elements(),
            angle=angle,
            unit=unit,
            center=self.center(),
        )

#### `` bbox

    bbox() -> Bbox

Compute and return the bounding box of the group layout element

Source code in `src/momapy/core.py`

    504
    505
    506
    507
    508
    509
    510
    511
    512
    513
    514
    515
    516
    517
    518
    519
    520
    521
    522
    523
    524
    525
    526
    def bbox(self) -> momapy.geometry.Bbox:
        """Compute and return the bounding box of the group layout element"""
        self_bbox = self.self_bbox()
        bboxes = [child.bbox() for child in self.children()]
        min_x = self_bbox.north_west().x
        min_y = self_bbox.north_west().y
        max_x = self_bbox.south_east().x
        max_y = self_bbox.south_east().y
        for bbox in bboxes:
            if bbox.north_west().x < min_x:
                min_x = bbox.north_west().x
            if bbox.north_west().y < min_y:
                min_y = bbox.north_west().y
            if bbox.south_east().x > max_x:
                max_x = bbox.south_east().x
            if bbox.south_east().y > max_y:
                max_y = bbox.south_east().y
        bbox = momapy.geometry.Bbox(
            momapy.geometry.Point(min_x / 2 + max_x / 2, min_y / 2 + max_y / 2),
            max_x - min_x,
            max_y - min_y,
        )
        return bbox

#### `` border

    border(point: Point) -> Point

Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point. When there are multiple intersection points, the one closest to the given point is returned

Source code in `src/momapy/core.py`

    794
    795
    796
    797
    798
    799
    800
    801
    802
    def border(self, point: momapy.geometry.Point) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point.
        When there are multiple intersection points, the one closest to the given point is returned
        """
        return momapy.drawing.get_drawing_elements_border(
            drawing_elements=self.drawing_elements(),
            point=point,
            center=self.center(),
        )

#### `` center

    center() -> Point

Return the center anchor of the node

Source code in `src/momapy/core.py`

    776
    777
    778
    def center(self) -> momapy.geometry.Point:
        """Return the center anchor of the node"""
        return self.position

#### `` childless

    childless() -> Self

Return a copy of the node with no children

Source code in `src/momapy/core.py`

    830
    831
    832
    def childless(self) -> typing.Self:
        """Return a copy of the node with no children"""
        return dataclasses.replace(self, label=None, layout_elements=tuple([]))

#### `` children

    children() -> list[LayoutElement]

Return the children of the group layout. These are the self children of the group layout (returned by the `self_children` method) and the other children of the group layout (given by the `layout_elements` attribute)

Source code in `src/momapy/core.py`

    566
    567
    568
    569
    570
    def children(self) -> list[LayoutElement]:
        """Return the children of the group layout.
        These are the self children of the group layout (returned by the `self_children` method) and the other children of the group layout (given by the `layout_elements` attribute)
        """
        return self.self_children() + list(self.layout_elements)

#### `` contains

    contains(other: LayoutElement) -> bool

Return `true` if another layout element is a descendant of the layout element, `false` otherwise

Source code in `src/momapy/core.py`

    119
    120
    121
    def contains(self, other: "LayoutElement") -> bool:
        """Return `true` if another layout element is a descendant of the layout element, `false` otherwise"""
        return other in self.descendants()

#### `` descendants

    descendants() -> list[LayoutElement]

Return the descendants of the layout element

Source code in `src/momapy/core.py`

    90
    91
    92
    93
    94
    95
    96
    def descendants(self) -> list["LayoutElement"]:
        """Return the descendants of the layout element"""
        descendants = []
        for child in self.children():
            descendants.append(child)
            descendants += child.descendants()
        return descendants

#### `` drawing_elements

    drawing_elements() -> list[DrawingElement]

Return the drawing elements of the group layout. The returned drawing elements are a group drawing element formed of the self drawing elements of the group layout and the drawing elements of its children

Source code in `src/momapy/core.py`

    538
    539
    540
    541
    542
    543
    544
    545
    546
    547
    548
    549
    550
    551
    552
    553
    554
    555
    556
    557
    558
    559
    560
    561
    562
    563
    564
    def drawing_elements(self) -> list[momapy.drawing.DrawingElement]:
        """Return the drawing elements of the group layout.
        The returned drawing elements are a group drawing element formed of the self drawing elements of the group layout and the drawing elements of its children
        """
        drawing_elements = self.self_drawing_elements()
        for child in self.children():
            if child is not None:
                drawing_elements += child.drawing_elements()
        group = momapy.drawing.Group(
            class_=f"{type(self).__name__}_group",
            elements=tuple(drawing_elements),
            id_=f"{self.id_}_group",
            fill=self.group_fill,
            fill_rule=self.group_fill_rule,
            filter=self.group_filter,
            font_family=self.group_font_family,
            font_size=self.group_font_size,
            font_style=self.group_font_style,
            font_weight=self.group_font_weight,
            stroke=self.group_stroke,
            stroke_dasharray=self.group_stroke_dasharray,
            stroke_dashoffset=self.group_stroke_dashoffset,
            stroke_width=self.group_stroke_width,
            text_anchor=self.group_text_anchor,
            transform=self.group_transform,
        )
        return [group]

#### `` east

    east() -> Point

Return the east anchor of the node

Source code in `src/momapy/core.py`

    708
    709
    710
    def east(self) -> momapy.geometry.Point:
        """Return the east anchor of the node"""
        return self.self_angle(0)

#### `` east_north_east

    east_north_east() -> Point

Return the east north east anchor of the node

Source code in `src/momapy/core.py`

    700
    701
    702
    703
    704
    705
    706
    def east_north_east(self) -> momapy.geometry.Point:
        """Return the east north east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, -self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` east_south_east

    east_south_east() -> Point

Return the east south east west anchor of the node

Source code in `src/momapy/core.py`

    712
    713
    714
    715
    716
    717
    718
    def east_south_east(self) -> momapy.geometry.Point:
        """Return the east south east west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` equals

    equals(
        other: LayoutElement,
        flattened: bool = False,
        unordered: bool = False,
    ) -> bool

Return `true` if the layout element is equal to another layout element, `false` otherwise

Source code in `src/momapy/core.py`

    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    def equals(
        self, other: "LayoutElement", flattened: bool = False, unordered: bool = False
    ) -> bool:
        """Return `true` if the layout element is equal to another layout element, `false` otherwise"""
        if type(self) is type(other):
            if not flattened:
                return self == other
            else:
                if not unordered:
                    return self.flattened() == other.flattened()
                else:
                    return set(self.flattened()) == set(other.flattened())
        return False

#### `` flattened

    flattened() -> list[LayoutElement]

Return a list containing copy of the layout element with no children and all its descendants with no children

Source code in `src/momapy/core.py`

     98
     99
    100
    101
    102
    103
    def flattened(self) -> list["LayoutElement"]:
        """Return a list containing copy of the layout element with no children and all its descendants with no children"""
        flattened = [self.childless()]
        for child in self.children():
            flattened += child.flattened()
        return flattened

#### `` north

    north() -> Point

Return the north anchor of the node

Source code in `src/momapy/core.py`

    680
    681
    682
    def north(self) -> momapy.geometry.Point:
        """Return the north anchor of the node"""
        return self.self_angle(90)

#### `` north_east

    north_east() -> Point

Return the north east anchor of the node

Source code in `src/momapy/core.py`

    692
    693
    694
    695
    696
    697
    698
    def north_east(self) -> momapy.geometry.Point:
        """Return the north east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, -self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` north_north_east

    north_north_east() -> Point

Return the north north east anchor of the node

Source code in `src/momapy/core.py`

    684
    685
    686
    687
    688
    689
    690
    def north_north_east(self) -> momapy.geometry.Point:
        """Return the north north east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 4, -self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` north_north_west

    north_north_west() -> Point

Return the north north west anchor of the node

Source code in `src/momapy/core.py`

    672
    673
    674
    675
    676
    677
    678
    def north_north_west(self) -> momapy.geometry.Point:
        """Return the north north west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() - (self.width / 4, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` north_west

    north_west() -> Point

Return the north west anchor of the node

Source code in `src/momapy/core.py`

    664
    665
    666
    667
    668
    669
    670
    def north_west(self) -> momapy.geometry.Point:
        """Return the north west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() - (self.width / 2, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` self_angle

    self_angle(
        angle: float,
        unit: Literal["degrees", "radians"] = "degrees",
    ) -> Point

Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.

Source code in `src/momapy/core.py`

    804
    805
    806
    807
    808
    809
    810
    811
    812
    813
    814
    815
    def self_angle(
        self,
        angle: float,
        unit: typing.Literal["degrees", "radians"] = "degrees",
    ) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal."""
        return momapy.drawing.get_drawing_elements_angle(
            drawing_elements=self.self_drawing_elements(),
            angle=angle,
            unit=unit,
            center=self.center(),
        )

#### `` self_bbox

    self_bbox() -> Bbox

Compute and return the bounding box of the self drawing element of the group layout

Source code in `src/momapy/core.py`

    499
    500
    501
    502
    def self_bbox(self) -> momapy.geometry.Bbox:
        """Compute and return the bounding box of the self drawing element of the group layout"""
        bounds = self.self_to_shapely().bounds
        return momapy.geometry.Bbox.from_bounds(bounds)

#### `` self_border

    self_border(point: Point) -> Point

Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point. When there are multiple intersection points, the one closest to the given point is returned

Source code in `src/momapy/core.py`

    784
    785
    786
    787
    788
    789
    790
    791
    792
    def self_border(self, point: momapy.geometry.Point) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point.
        When there are multiple intersection points, the one closest to the given point is returned
        """
        return momapy.drawing.get_drawing_elements_border(
            drawing_elements=self.self_drawing_elements(),
            point=point,
            center=self.center(),
        )

#### `` self_children

    self_children() -> list[LayoutElement]

Return the self children of the node. A node has unique child that is its label

Source code in `src/momapy/core.py`

    654
    655
    656
    657
    658
    def self_children(self) -> list[LayoutElement]:
        """Return the self children of the node. A node has unique child that is its label"""
        if self.label is not None:
            return [self.label]
        return []

#### `` self_drawing_elements

    self_drawing_elements() -> list[DrawingElement]

Return the node's own drawing elements

Source code in `src/momapy/core.py`

    637
    638
    639
    640
    641
    642
    643
    644
    645
    646
    647
    648
    649
    650
    651
    652
    def self_drawing_elements(self) -> list[momapy.drawing.DrawingElement]:
        """Return the node's own drawing elements"""
        drawing_elements = self._border_drawing_elements()
        group = momapy.drawing.Group(
            class_=type(self).__name__,
            elements=tuple(drawing_elements),
            fill=self.fill,
            filter=self.filter,
            id_=self.id_,
            stroke=self.stroke,
            stroke_dasharray=self.stroke_dasharray,
            stroke_dashoffset=self.stroke_dashoffset,
            stroke_width=self.stroke_width,
            transform=self.transform,
        )
        return [group]

#### `` self_to_shapely

    self_to_shapely() -> GeometryCollection

Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout

Source code in `src/momapy/core.py`

    495
    496
    497
    def self_to_shapely(self) -> shapely.GeometryCollection:
        """Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout"""
        return momapy.drawing.drawing_elements_to_shapely(self.drawing_elements())

#### `` size

    size() -> tuple[float, float]

Return the size of the node

Source code in `src/momapy/core.py`

    660
    661
    662
    def size(self) -> tuple[float, float]:
        """Return the size of the node"""
        return (self.width, self.height)

#### `` south

    south() -> Point

Return the south anchor of the node

Source code in `src/momapy/core.py`

    736
    737
    738
    def south(self) -> momapy.geometry.Point:
        """Return the south anchor of the node"""
        return self.self_angle(270)

#### `` south_east

    south_east() -> Point

Return the south east anchor of the node

Source code in `src/momapy/core.py`

    720
    721
    722
    723
    724
    725
    726
    def south_east(self) -> momapy.geometry.Point:
        """Return the south east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` south_south_east

    south_south_east() -> Point

Return the south south east anchor of the node

Source code in `src/momapy/core.py`

    728
    729
    730
    731
    732
    733
    734
    def south_south_east(self) -> momapy.geometry.Point:
        """Return the south south east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 4, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` south_south_west

    south_south_west() -> Point

Return the south south west anchor of the node

Source code in `src/momapy/core.py`

    740
    741
    742
    743
    744
    745
    746
    def south_south_west(self) -> momapy.geometry.Point:
        """Return the south south west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (-self.width / 4, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` south_west

    south_west() -> Point

Return the south west anchor of the node

Source code in `src/momapy/core.py`

    748
    749
    750
    751
    752
    753
    754
    def south_west(self) -> momapy.geometry.Point:
        """Return the south west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (-self.width / 2, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` to_shapely

    to_shapely(to_polygons: bool = False) -> GeometryCollection

Return a shapely collection of geometries reproducing the drawing elements of the layout element

Source code in `src/momapy/core.py`

    123
    124
    125
    126
    127
    128
    def to_shapely(self, to_polygons: bool = False) -> shapely.GeometryCollection:
        """Return a shapely collection of geometries reproducing the drawing elements of the layout element"""
        geom_collection = []
        for drawing_element in self.drawing_elements():
            geom_collection += drawing_element.to_shapely(to_polygons=to_polygons).geoms
        return shapely.GeometryCollection(geom_collection)

#### `` west

    west() -> Point

Return the west anchor of the node

Source code in `src/momapy/core.py`

    764
    765
    766
    def west(self) -> momapy.geometry.Point:
        """Return the west anchor of the node"""
        return self.self_angle(180)

#### `` west_north_west

    west_north_west() -> Point

Return the west north west anchor of the node

Source code in `src/momapy/core.py`

    768
    769
    770
    771
    772
    773
    774
    def west_north_west(self) -> momapy.geometry.Point:
        """Return the west north west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() - (self.width / 2, self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` west_south_west

    west_south_west() -> Point

Return the west south west anchor of the node

Source code in `src/momapy/core.py`

    756
    757
    758
    759
    760
    761
    762
    def west_south_west(self) -> momapy.geometry.Point:
        """Return the west south west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (-self.width / 2, self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` x `property`

    x: float

Return the x coordinate of the node

#### `` y `property`

    y: float

Return the y coordinate of the node

### `` ComplexSubunit `dataclass`

    ComplexSubunit(
        *,
        id_: str = make_uuid4_as_str(),
        label: str | None = None,
        state_variables: frozenset[StateVariable] = frozenset(),
        units_of_information: frozenset[
            UnitOfInformation
        ] = frozenset(),
        subunits: frozenset[Subunit] = frozenset(),
    )

Bases: `Subunit`

Class for complex subunits

Parameters:

Name | Type | Description | Default
--- | --- | --- | ---
`id_` | `str` | The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element | `'f3dbc215-1626-4657-aafe-476471c8d0b0'`
`label` | `str | None` | The label of the subunit | `None`
`state_variables` | `frozenset[StateVariable]` | The state variables of the complex subunit | `<class 'frozenset'>`
`units_of_information` | `frozenset[UnitOfInformation]` | The units of information of the complex subunit | `<class 'frozenset'>`
`subunits` | `frozenset[Subunit]` | The subunits of the complex subunit | `<class 'frozenset'>`

### `` ComplexSubunitLayout `dataclass`

    ComplexSubunitLayout(
        fill: NoneValueType | Color | None = white,
        stroke: NoneValueType | Color | None = black,
        stroke_width: float | None = 1.25,
        *,
        id_: str = make_uuid4_as_str(),
        layout_elements: tuple[LayoutElement] = tuple(),
        group_fill: NoneValueType | Color | None = None,
        group_fill_rule: FillRule | None = None,
        group_filter: NoneValueType | Filter | None = None,
        group_font_family: str | None = None,
        group_font_size: float | None = None,
        group_font_style: FontStyle | None = None,
        group_font_weight: FontWeight | float | None = None,
        group_stroke: NoneValueType | Color | None = None,
        group_stroke_dasharray: tuple[float, ...] | None = None,
        group_stroke_dashoffset: float | None = None,
        group_stroke_width: float | None = None,
        group_text_anchor: TextAnchor | None = None,
        group_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        filter: NoneValueType | Filter | None = None,
        height: float = 30.0,
        label: TextLayout | None = None,
        position: Point,
        stroke_dasharray: tuple[float, ...] | None = None,
        stroke_dashoffset: float | None = None,
        transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        width: float = 60.0,
        cut_corners: float = 5.0,
    )

Bases: `_SimpleMixin`, `SBGNNode`

Class for complex subunit layouts

Parameters:

Name | Type | Description | Default
--- | --- | --- | ---
`id_` | `str` | The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element | `'ae52773a-e990-486f-8ef7-a7da2305293d'`
`layout_elements` | `tuple[LayoutElement]` | The sub-layout elements of the group layout. These are part of the children of the group layout | `<dynamic>`
`group_fill` | `NoneValueType | Color | None` | The fill color of the group layout | `None`
`group_fill_rule` | `FillRule | None` | The fill rule of the group layout | `None`
`group_filter` | `NoneValueType | Filter | None` | The filter of the group layout | `None`
`group_font_family` | `str | None` | The font family of the group layout | `None`
`group_font_size` | `float | None` | The font size of the group layout | `None`
`group_font_style` | `FontStyle | None` | The font style of the group layout | `None`
`group_font_weight` | `FontWeight | float | None` | The font weight of the group layout | `None`
`group_stroke` | `NoneValueType | Color | None` | The stroke color of the group layout | `None`
`group_stroke_dasharray` | `tuple[float, ...] | None` | The stroke dasharray of the group layout | `None`
`group_stroke_dashoffset` | `float | None` | The stroke dashoffset of the group layout | `None`
`group_stroke_width` | `float | None` | The stroke width of the group layout | `None`
`group_text_anchor` | `TextAnchor | None` | The text anchor of the group layout | `None`
`group_transform` | `NoneValueType | tuple[Transformation] | None` | The transform of the group layout | `None`
`fill` | `NoneValueType | Color | None` |  | `Color(red=255, green=255, blue=255, alpha=1.0)`
`filter` | `NoneValueType | Filter | None` | The filter of the node | `None`
`height` | `float` |  | `30.0`
`label` | `TextLayout | None` | The label of the node | `None`
`position` | `Point` | The position of the node | required
`stroke` | `NoneValueType | Color | None` |  | `Color(red=0, green=0, blue=0, alpha=1.0)`
`stroke_dasharray` | `tuple[float, ...] | None` | The stroke dasharray of the node | `None`
`stroke_dashoffset` | `float | None` | The stroke dashoffset of the node | `None`
`stroke_width` | `float | None` |  | `1.25`
`transform` | `NoneValueType | tuple[Transformation] | None` | The transform of the node | `None`
`width` | `float` |  | `60.0`
`cut_corners` | `float` |  | `5.0`

Methods:

Name | Description
--- | ---
`anchor_point` | Return an anchor point of the layout element
`angle` | Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.
`bbox` | Compute and return the bounding box of the group layout element
`border` | Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point.
`center` | Return the center anchor of the node
`childless` | Return a copy of the node with no children
`children` | Return the children of the group layout.
`contains` | Return `true` if another layout element is a descendant of the layout element, `false` otherwise
`descendants` | Return the descendants of the layout element
`drawing_elements` | Return the drawing elements of the group layout.
`east` | Return the east anchor of the node
`east_north_east` | Return the east north east anchor of the node
`east_south_east` | Return the east south east west anchor of the node
`equals` | Return `true` if the layout element is equal to another layout element, `false` otherwise
`flattened` | Return a list containing copy of the layout element with no children and all its descendants with no children
`label_center` | Return the label center anchor of the node
`north` | Return the north anchor of the node
`north_east` | Return the north east anchor of the node
`north_north_east` | Return the north north east anchor of the node
`north_north_west` | Return the north north west anchor of the node
`north_west` | Return the north west anchor of the node
`self_angle` | Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.
`self_bbox` | Compute and return the bounding box of the self drawing element of the group layout
`self_border` | Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point.
`self_children` | Return the self children of the node. A node has unique child that is its label
`self_drawing_elements` | Return the node's own drawing elements
`self_to_shapely` | Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout
`size` | Return the size of the node
`south` | Return the south anchor of the node
`south_east` | Return the south east anchor of the node
`south_south_east` | Return the south south east anchor of the node
`south_south_west` | Return the south south west anchor of the node
`south_west` | Return the south west anchor of the node
`to_shapely` | Return a shapely collection of geometries reproducing the drawing elements of the layout element
`west` | Return the west anchor of the node
`west_north_west` | Return the west north west anchor of the node
`west_south_west` | Return the west south west anchor of the node

Attributes:

Name | Type | Description
--- | --- | ---
`x` | `float` | Return the x coordinate of the node
`y` | `float` | Return the y coordinate of the node

#### `` anchor_point

    anchor_point(anchor_name: str) -> Point

Return an anchor point of the layout element

Source code in `src/momapy/core.py`

    130
    131
    132
    def anchor_point(self, anchor_name: str) -> momapy.geometry.Point:
        """Return an anchor point of the layout element"""
        return getattr(self, anchor_name)()

#### `` angle

    angle(
        angle: float,
        unit: Literal["degrees", "radians"] = "degrees",
    ) -> Point

Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.

Source code in `src/momapy/core.py`

    817
    818
    819
    820
    821
    822
    823
    824
    825
    826
    827
    828
    def angle(
        self,
        angle: float,
        unit: typing.Literal["degrees", "radians"] = "degrees",
    ) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal."""
        return momapy.drawing.get_drawing_elements_angle(
            drawing_elements=self.drawing_elements(),
            angle=angle,
            unit=unit,
            center=self.center(),
        )

#### `` bbox

    bbox() -> Bbox

Compute and return the bounding box of the group layout element

Source code in `src/momapy/core.py`

    504
    505
    506
    507
    508
    509
    510
    511
    512
    513
    514
    515
    516
    517
    518
    519
    520
    521
    522
    523
    524
    525
    526
    def bbox(self) -> momapy.geometry.Bbox:
        """Compute and return the bounding box of the group layout element"""
        self_bbox = self.self_bbox()
        bboxes = [child.bbox() for child in self.children()]
        min_x = self_bbox.north_west().x
        min_y = self_bbox.north_west().y
        max_x = self_bbox.south_east().x
        max_y = self_bbox.south_east().y
        for bbox in bboxes:
            if bbox.north_west().x < min_x:
                min_x = bbox.north_west().x
            if bbox.north_west().y < min_y:
                min_y = bbox.north_west().y
            if bbox.south_east().x > max_x:
                max_x = bbox.south_east().x
            if bbox.south_east().y > max_y:
                max_y = bbox.south_east().y
        bbox = momapy.geometry.Bbox(
            momapy.geometry.Point(min_x / 2 + max_x / 2, min_y / 2 + max_y / 2),
            max_x - min_x,
            max_y - min_y,
        )
        return bbox

#### `` border

    border(point: Point) -> Point

Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point. When there are multiple intersection points, the one closest to the given point is returned

Source code in `src/momapy/core.py`

    794
    795
    796
    797
    798
    799
    800
    801
    802
    def border(self, point: momapy.geometry.Point) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point.
        When there are multiple intersection points, the one closest to the given point is returned
        """
        return momapy.drawing.get_drawing_elements_border(
            drawing_elements=self.drawing_elements(),
            point=point,
            center=self.center(),
        )

#### `` center

    center() -> Point

Return the center anchor of the node

Source code in `src/momapy/core.py`

    776
    777
    778
    def center(self) -> momapy.geometry.Point:
        """Return the center anchor of the node"""
        return self.position

#### `` childless

    childless() -> Self

Return a copy of the node with no children

Source code in `src/momapy/core.py`

    830
    831
    832
    def childless(self) -> typing.Self:
        """Return a copy of the node with no children"""
        return dataclasses.replace(self, label=None, layout_elements=tuple([]))

#### `` children

    children() -> list[LayoutElement]

Return the children of the group layout. These are the self children of the group layout (returned by the `self_children` method) and the other children of the group layout (given by the `layout_elements` attribute)

Source code in `src/momapy/core.py`

    566
    567
    568
    569
    570
    def children(self) -> list[LayoutElement]:
        """Return the children of the group layout.
        These are the self children of the group layout (returned by the `self_children` method) and the other children of the group layout (given by the `layout_elements` attribute)
        """
        return self.self_children() + list(self.layout_elements)

#### `` contains

    contains(other: LayoutElement) -> bool

Return `true` if another layout element is a descendant of the layout element, `false` otherwise

Source code in `src/momapy/core.py`

    119
    120
    121
    def contains(self, other: "LayoutElement") -> bool:
        """Return `true` if another layout element is a descendant of the layout element, `false` otherwise"""
        return other in self.descendants()

#### `` descendants

    descendants() -> list[LayoutElement]

Return the descendants of the layout element

Source code in `src/momapy/core.py`

    90
    91
    92
    93
    94
    95
    96
    def descendants(self) -> list["LayoutElement"]:
        """Return the descendants of the layout element"""
        descendants = []
        for child in self.children():
            descendants.append(child)
            descendants += child.descendants()
        return descendants

#### `` drawing_elements

    drawing_elements() -> list[DrawingElement]

Return the drawing elements of the group layout. The returned drawing elements are a group drawing element formed of the self drawing elements of the group layout and the drawing elements of its children

Source code in `src/momapy/core.py`

    538
    539
    540
    541
    542
    543
    544
    545
    546
    547
    548
    549
    550
    551
    552
    553
    554
    555
    556
    557
    558
    559
    560
    561
    562
    563
    564
    def drawing_elements(self) -> list[momapy.drawing.DrawingElement]:
        """Return the drawing elements of the group layout.
        The returned drawing elements are a group drawing element formed of the self drawing elements of the group layout and the drawing elements of its children
        """
        drawing_elements = self.self_drawing_elements()
        for child in self.children():
            if child is not None:
                drawing_elements += child.drawing_elements()
        group = momapy.drawing.Group(
            class_=f"{type(self).__name__}_group",
            elements=tuple(drawing_elements),
            id_=f"{self.id_}_group",
            fill=self.group_fill,
            fill_rule=self.group_fill_rule,
            filter=self.group_filter,
            font_family=self.group_font_family,
            font_size=self.group_font_size,
            font_style=self.group_font_style,
            font_weight=self.group_font_weight,
            stroke=self.group_stroke,
            stroke_dasharray=self.group_stroke_dasharray,
            stroke_dashoffset=self.group_stroke_dashoffset,
            stroke_width=self.group_stroke_width,
            text_anchor=self.group_text_anchor,
            transform=self.group_transform,
        )
        return [group]

#### `` east

    east() -> Point

Return the east anchor of the node

Source code in `src/momapy/core.py`

    708
    709
    710
    def east(self) -> momapy.geometry.Point:
        """Return the east anchor of the node"""
        return self.self_angle(0)

#### `` east_north_east

    east_north_east() -> Point

Return the east north east anchor of the node

Source code in `src/momapy/core.py`

    700
    701
    702
    703
    704
    705
    706
    def east_north_east(self) -> momapy.geometry.Point:
        """Return the east north east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, -self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` east_south_east

    east_south_east() -> Point

Return the east south east west anchor of the node

Source code in `src/momapy/core.py`

    712
    713
    714
    715
    716
    717
    718
    def east_south_east(self) -> momapy.geometry.Point:
        """Return the east south east west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` equals

    equals(
        other: LayoutElement,
        flattened: bool = False,
        unordered: bool = False,
    ) -> bool

Return `true` if the layout element is equal to another layout element, `false` otherwise

Source code in `src/momapy/core.py`

    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    def equals(
        self, other: "LayoutElement", flattened: bool = False, unordered: bool = False
    ) -> bool:
        """Return `true` if the layout element is equal to another layout element, `false` otherwise"""
        if type(self) is type(other):
            if not flattened:
                return self == other
            else:
                if not unordered:
                    return self.flattened() == other.flattened()
                else:
                    return set(self.flattened()) == set(other.flattened())
        return False

#### `` flattened

    flattened() -> list[LayoutElement]

Return a list containing copy of the layout element with no children and all its descendants with no children

Source code in `src/momapy/core.py`

     98
     99
    100
    101
    102
    103
    def flattened(self) -> list["LayoutElement"]:
        """Return a list containing copy of the layout element with no children and all its descendants with no children"""
        flattened = [self.childless()]
        for child in self.children():
            flattened += child.flattened()
        return flattened

#### `` label_center

    label_center() -> Point

Return the label center anchor of the node

Source code in `src/momapy/core.py`

    780
    781
    782
    def label_center(self) -> momapy.geometry.Point:
        """Return the label center anchor of the node"""
        return self.position

#### `` north

    north() -> Point

Return the north anchor of the node

Source code in `src/momapy/core.py`

    680
    681
    682
    def north(self) -> momapy.geometry.Point:
        """Return the north anchor of the node"""
        return self.self_angle(90)

#### `` north_east

    north_east() -> Point

Return the north east anchor of the node

Source code in `src/momapy/core.py`

    692
    693
    694
    695
    696
    697
    698
    def north_east(self) -> momapy.geometry.Point:
        """Return the north east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, -self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` north_north_east

    north_north_east() -> Point

Return the north north east anchor of the node

Source code in `src/momapy/core.py`

    684
    685
    686
    687
    688
    689
    690
    def north_north_east(self) -> momapy.geometry.Point:
        """Return the north north east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 4, -self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` north_north_west

    north_north_west() -> Point

Return the north north west anchor of the node

Source code in `src/momapy/core.py`

    672
    673
    674
    675
    676
    677
    678
    def north_north_west(self) -> momapy.geometry.Point:
        """Return the north north west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() - (self.width / 4, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` north_west

    north_west() -> Point

Return the north west anchor of the node

Source code in `src/momapy/core.py`

    664
    665
    666
    667
    668
    669
    670
    def north_west(self) -> momapy.geometry.Point:
        """Return the north west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() - (self.width / 2, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` self_angle

    self_angle(
        angle: float,
        unit: Literal["degrees", "radians"] = "degrees",
    ) -> Point

Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.

Source code in `src/momapy/core.py`

    804
    805
    806
    807
    808
    809
    810
    811
    812
    813
    814
    815
    def self_angle(
        self,
        angle: float,
        unit: typing.Literal["degrees", "radians"] = "degrees",
    ) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal."""
        return momapy.drawing.get_drawing_elements_angle(
            drawing_elements=self.self_drawing_elements(),
            angle=angle,
            unit=unit,
            center=self.center(),
        )

#### `` self_bbox

    self_bbox() -> Bbox

Compute and return the bounding box of the self drawing element of the group layout

Source code in `src/momapy/core.py`

    499
    500
    501
    502
    def self_bbox(self) -> momapy.geometry.Bbox:
        """Compute and return the bounding box of the self drawing element of the group layout"""
        bounds = self.self_to_shapely().bounds
        return momapy.geometry.Bbox.from_bounds(bounds)

#### `` self_border

    self_border(point: Point) -> Point

Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point. When there are multiple intersection points, the one closest to the given point is returned

Source code in `src/momapy/core.py`

    784
    785
    786
    787
    788
    789
    790
    791
    792
    def self_border(self, point: momapy.geometry.Point) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point.
        When there are multiple intersection points, the one closest to the given point is returned
        """
        return momapy.drawing.get_drawing_elements_border(
            drawing_elements=self.self_drawing_elements(),
            point=point,
            center=self.center(),
        )

#### `` self_children

    self_children() -> list[LayoutElement]

Return the self children of the node. A node has unique child that is its label

Source code in `src/momapy/core.py`

    654
    655
    656
    657
    658
    def self_children(self) -> list[LayoutElement]:
        """Return the self children of the node. A node has unique child that is its label"""
        if self.label is not None:
            return [self.label]
        return []

#### `` self_drawing_elements

    self_drawing_elements() -> list[DrawingElement]

Return the node's own drawing elements

Source code in `src/momapy/core.py`

    637
    638
    639
    640
    641
    642
    643
    644
    645
    646
    647
    648
    649
    650
    651
    652
    def self_drawing_elements(self) -> list[momapy.drawing.DrawingElement]:
        """Return the node's own drawing elements"""
        drawing_elements = self._border_drawing_elements()
        group = momapy.drawing.Group(
            class_=type(self).__name__,
            elements=tuple(drawing_elements),
            fill=self.fill,
            filter=self.filter,
            id_=self.id_,
            stroke=self.stroke,
            stroke_dasharray=self.stroke_dasharray,
            stroke_dashoffset=self.stroke_dashoffset,
            stroke_width=self.stroke_width,
            transform=self.transform,
        )
        return [group]

#### `` self_to_shapely

    self_to_shapely() -> GeometryCollection

Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout

Source code in `src/momapy/core.py`

    495
    496
    497
    def self_to_shapely(self) -> shapely.GeometryCollection:
        """Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout"""
        return momapy.drawing.drawing_elements_to_shapely(self.drawing_elements())

#### `` size

    size() -> tuple[float, float]

Return the size of the node

Source code in `src/momapy/core.py`

    660
    661
    662
    def size(self) -> tuple[float, float]:
        """Return the size of the node"""
        return (self.width, self.height)

#### `` south

    south() -> Point

Return the south anchor of the node

Source code in `src/momapy/core.py`

    736
    737
    738
    def south(self) -> momapy.geometry.Point:
        """Return the south anchor of the node"""
        return self.self_angle(270)

#### `` south_east

    south_east() -> Point

Return the south east anchor of the node

Source code in `src/momapy/core.py`

    720
    721
    722
    723
    724
    725
    726
    def south_east(self) -> momapy.geometry.Point:
        """Return the south east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` south_south_east

    south_south_east() -> Point

Return the south south east anchor of the node

Source code in `src/momapy/core.py`

    728
    729
    730
    731
    732
    733
    734
    def south_south_east(self) -> momapy.geometry.Point:
        """Return the south south east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 4, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` south_south_west

    south_south_west() -> Point

Return the south south west anchor of the node

Source code in `src/momapy/core.py`

    740
    741
    742
    743
    744
    745
    746
    def south_south_west(self) -> momapy.geometry.Point:
        """Return the south south west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (-self.width / 4, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` south_west

    south_west() -> Point

Return the south west anchor of the node

Source code in `src/momapy/core.py`

    748
    749
    750
    751
    752
    753
    754
    def south_west(self) -> momapy.geometry.Point:
        """Return the south west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (-self.width / 2, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` to_shapely

    to_shapely(to_polygons: bool = False) -> GeometryCollection

Return a shapely collection of geometries reproducing the drawing elements of the layout element

Source code in `src/momapy/core.py`

    123
    124
    125
    126
    127
    128
    def to_shapely(self, to_polygons: bool = False) -> shapely.GeometryCollection:
        """Return a shapely collection of geometries reproducing the drawing elements of the layout element"""
        geom_collection = []
        for drawing_element in self.drawing_elements():
            geom_collection += drawing_element.to_shapely(to_polygons=to_polygons).geoms
        return shapely.GeometryCollection(geom_collection)

#### `` west

    west() -> Point

Return the west anchor of the node

Source code in `src/momapy/core.py`

    764
    765
    766
    def west(self) -> momapy.geometry.Point:
        """Return the west anchor of the node"""
        return self.self_angle(180)

#### `` west_north_west

    west_north_west() -> Point

Return the west north west anchor of the node

Source code in `src/momapy/core.py`

    768
    769
    770
    771
    772
    773
    774
    def west_north_west(self) -> momapy.geometry.Point:
        """Return the west north west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() - (self.width / 2, self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` west_south_west

    west_south_west() -> Point

Return the west south west anchor of the node

Source code in `src/momapy/core.py`

    756
    757
    758
    759
    760
    761
    762
    def west_south_west(self) -> momapy.geometry.Point:
        """Return the west south west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (-self.width / 2, self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` x `property`

    x: float

Return the x coordinate of the node

#### `` y `property`

    y: float

Return the y coordinate of the node

### `` ConsumptionLayout `dataclass`

    ConsumptionLayout(
        path_fill: NoneValueType | Color | None = NoneValue,
        path_stroke: NoneValueType | Color | None = black,
        path_stroke_width: float | None = 1.25,
        arrowhead_fill: NoneValueType | Color | None = white,
        arrowhead_stroke: NoneValueType | Color | None = black,
        arrowhead_stroke_width: float | None = 1.25,
        *,
        id_: str = make_uuid4_as_str(),
        layout_elements: tuple[LayoutElement] = tuple(),
        group_fill: NoneValueType | Color | None = None,
        group_fill_rule: FillRule | None = None,
        group_filter: NoneValueType | Filter | None = None,
        group_font_family: str | None = None,
        group_font_size: float | None = None,
        group_font_style: FontStyle | None = None,
        group_font_weight: FontWeight | float | None = None,
        group_stroke: NoneValueType | Color | None = None,
        group_stroke_dasharray: tuple[float, ...] | None = None,
        group_stroke_dashoffset: float | None = None,
        group_stroke_width: float | None = None,
        group_text_anchor: TextAnchor | None = None,
        group_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        end_shorten: float = 0.0,
        fill: NoneValueType | Color | None = None,
        filter: NoneValueType | Filter | None = None,
        path_filter: NoneValueType | Filter | None = None,
        path_stroke_dasharray: tuple[float, ...] | None = None,
        path_stroke_dashoffset: float | None = None,
        path_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        stroke: NoneValueType | Color | None = None,
        stroke_dasharray: NoneValueType
        | tuple[float]
        | None = None,
        stroke_dashoffset: float | None = None,
        stroke_width: float | None = None,
        segments: tuple[
            Segment | BezierCurve | EllipticalArc
        ] = tuple(),
        source: LayoutElement | None = None,
        start_shorten: float = 0.0,
        target: LayoutElement | None = None,
        transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        arrowhead_filter: NoneValueType | Filter | None = None,
        arrowhead_stroke_dasharray: tuple[float, ...]
        | None = None,
        arrowhead_stroke_dashoffset: float | None = None,
        arrowhead_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
    )

Bases: `SBGNSingleHeadedArc`

Class for consumption layouts

Parameters:

Name | Type | Description | Default
--- | --- | --- | ---
`id_` | `str` | The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element | `'a78ece63-e8fd-49f5-b737-3a3d8c1c9c87'`
`layout_elements` | `tuple[LayoutElement]` | The sub-layout elements of the group layout. These are part of the children of the group layout | `<dynamic>`
`group_fill` | `NoneValueType | Color | None` | The fill color of the group layout | `None`
`group_fill_rule` | `FillRule | None` | The fill rule of the group layout | `None`
`group_filter` | `NoneValueType | Filter | None` | The filter of the group layout | `None`
`group_font_family` | `str | None` | The font family of the group layout | `None`
`group_font_size` | `float | None` | The font size of the group layout | `None`
`group_font_style` | `FontStyle | None` | The font style of the group layout | `None`
`group_font_weight` | `FontWeight | float | None` | The font weight of the group layout | `None`
`group_stroke` | `NoneValueType | Color | None` | The stroke color of the group layout | `None`
`group_stroke_dasharray` | `tuple[float, ...] | None` | The stroke dasharray of the group layout | `None`
`group_stroke_dashoffset` | `float | None` | The stroke dashoffset of the group layout | `None`
`group_stroke_width` | `float | None` | The stroke width of the group layout | `None`
`group_text_anchor` | `TextAnchor | None` | The text anchor of the group layout | `None`
`group_transform` | `NoneValueType | tuple[Transformation] | None` | The transform of the group layout | `None`
`end_shorten` | `float` | The length the end of the arc will be shorten by | `0.0`
`fill` | `NoneValueType | Color | None` | The fill color of the arc | `None`
`filter` | `NoneValueType | Filter | None` | The fill filter of the arc | `None`
`path_fill` | `NoneValueType | Color | None` |  | `<momapy.drawing.NoneValueType object at 0x7fb32ae9f1d0>`
`path_filter` | `NoneValueType | Filter | None` | The path filter of the arc | `None`
`path_stroke` | `NoneValueType | Color | None` |  | `Color(red=0, green=0, blue=0, alpha=1.0)`
`path_stroke_dasharray` | `tuple[float, ...] | None` | The path stroke dasharray of the arc | `None`
`path_stroke_dashoffset` | `float | None` | The path stroke dashoffset of the arc | `None`
`path_stroke_width` | `float | None` |  | `1.25`
`path_transform` | `NoneValueType | tuple[Transformation] | None` | The path transform of the arc | `None`
`stroke` | `NoneValueType | Color | None` | The stroke color of the arc | `None`
`stroke_dasharray` | `NoneValueType | tuple[float] | None` | The stroke dasharray of the arc | `None`
`stroke_dashoffset` | `float | None` | The stroke dashoffset of the arc | `None`
`stroke_width` | `float | None` | The stroke width of the arc | `None`
`segments` | `tuple[Union[Segment, BezierCurve, EllipticalArc]]` | The path segments of the arc | `<dynamic>`
`source` | `LayoutElement | None` | The source of the arc | `None`
`start_shorten` | `float` | The length the start of the arc will be shorten by | `0.0`
`target` | `LayoutElement | None` | The target of the arc | `None`
`transform` | `NoneValueType | tuple[Transformation] | None` | The transform of the arc | `None`
`arrowhead_fill` | `NoneValueType | Color | None` |  | `Color(red=255, green=255, blue=255, alpha=1.0)`
`arrowhead_filter` | `NoneValueType | Filter | None` | The arrowhead filter of the arc | `None`
`arrowhead_stroke` | `NoneValueType | Color | None` |  | `Color(red=0, green=0, blue=0, alpha=1.0)`
`arrowhead_stroke_dasharray` | `tuple[float, ...] | None` | The arrowhead stroke dasharray of the arc | `None`
`arrowhead_stroke_dashoffset` | `float | None` | The arrowhead stroke dashoffset of the arc | `None`
`arrowhead_stroke_width` | `float | None` |  | `1.25`
`arrowhead_transform` | `NoneValueType | tuple[Transformation] | None` | The arrowhead transform of the arc | `None`

Methods:

Name | Description
--- | ---
`anchor_point` | Return an anchor point of the layout element
`arrowhead_base` | Return the arrowhead base anchor point of the single-headed arc
`arrowhead_bbox` | Return the bounding box of the single-headed arc arrowhead
`arrowhead_border` | Return the point at the intersection of the drawing elements of the single-headed arc arrowhead and the line going through the center of these drawing elements and the given point.
`arrowhead_drawing_elements` | Return the drawing elements of the single-headed arc arrowhead
`arrowhead_length` | Return the length of the single-headed arc arrowhead
`arrowhead_tip` | Return the arrowhead tip anchor point of the single-headed arc
`bbox` | Compute and return the bounding box of the group layout element
`childless` | Return a copy of the arc with no children
`children` | Return the children of the group layout.
`contains` | Return `true` if another layout element is a descendant of the layout element, `false` otherwise
`descendants` | Return the descendants of the layout element
`drawing_elements` | Return the drawing elements of the group layout.
`end_point` | Return the ending point of the arc
`equals` | Return `true` if the layout element is equal to another layout element, `false` otherwise
`flattened` | Return a list containing copy of the layout element with no children and all its descendants with no children
`fraction` | Return the position and angle on the arc at a given fraction (of the total arc length)
`length` | Return the total length of the arc path
`path_drawing_elements` | Return the drawing elements of the single-headed arc path
`points` | Return the points of the arc path
`self_bbox` | Compute and return the bounding box of the self drawing element of the group layout
`self_children` | Return the self children of the arc
`self_drawing_elements` | Return the self drawing elements of the single-headed arc
`self_to_shapely` | Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout
`start_point` | Return the starting point of the arc
`to_shapely` | Return a shapely collection of geometries reproducing the drawing elements of the layout element

#### `` anchor_point

    anchor_point(anchor_name: str) -> Point

Return an anchor point of the layout element

Source code in `src/momapy/core.py`

    130
    131
    132
    def anchor_point(self, anchor_name: str) -> momapy.geometry.Point:
        """Return an anchor point of the layout element"""
        return getattr(self, anchor_name)()

#### `` arrowhead_base

    arrowhead_base() -> Point

Return the arrowhead base anchor point of the single-headed arc

Source code in `src/momapy/core.py`

    1058
    1059
    1060
    1061
    1062
    1063
    1064
    1065
    1066
    def arrowhead_base(self) -> momapy.geometry.Point:
        """Return the arrowhead base anchor point of the single-headed arc"""
        arrowhead_length = self.arrowhead_length()
        segment = self.segments[-1]
        segment_length = segment.length()
        if segment_length == 0:
            return self.arrowhead_tip() - (arrowhead_length, 0)
        fraction = 1 - (arrowhead_length + self.end_shorten) / segment_length
        return segment.get_position_at_fraction(fraction)

#### `` arrowhead_bbox

    arrowhead_bbox() -> Bbox

Return the bounding box of the single-headed arc arrowhead

Source code in `src/momapy/core.py`

    1068
    1069
    1070
    1071
    1072
    def arrowhead_bbox(self) -> momapy.geometry.Bbox:
        """Return the bounding box of the single-headed arc arrowhead"""
        return momapy.drawing.get_drawing_elements_bbox(
            self.arrowhead_drawing_elements()
        )

#### `` arrowhead_border

    arrowhead_border(point) -> Point

Return the point at the intersection of the drawing elements of the single-headed arc arrowhead and the line going through the center of these drawing elements and the given point. When there are multiple intersection points, the one closest to the given point is returned

Source code in `src/momapy/core.py`

    1074
    1075
    1076
    1077
    1078
    1079
    1080
    1081
    1082
    1083
    1084
    def arrowhead_border(self, point) -> momapy.geometry.Point:
        """Return the point at the intersection of the drawing elements of the single-headed arc arrowhead and the line going through the center of these drawing elements and the given point.
        When there are multiple intersection points, the one closest to the given point is returned
        """

        point = momapy.drawing.get_drawing_elements_border(
            self.arrowhead_drawing_elements(), point
        )
        if point is None:
            return self.arrowhead_tip()
        return point

#### `` arrowhead_drawing_elements

    arrowhead_drawing_elements() -> list[DrawingElement]

Return the drawing elements of the single-headed arc arrowhead

Source code in `src/momapy/core.py`

    1108
    1109
    1110
    1111
    1112
    1113
    1114
    1115
    1116
    1117
    1118
    1119
    1120
    1121
    1122
    1123
    1124
    1125
    1126
    1127
    def arrowhead_drawing_elements(
        self,
    ) -> list[momapy.drawing.DrawingElement]:
        """Return the drawing elements of the single-headed arc arrowhead"""
        drawing_elements = self._arrowhead_border_drawing_elements()
        group = momapy.drawing.Group(
            class_=f"{type(self).__name__}_arrowhead",
            elements=tuple(drawing_elements),
            fill=self.arrowhead_fill,
            filter=self.arrowhead_filter,
            id_=f"{self.id_}_arrowhead",
            stroke=self.arrowhead_stroke,
            stroke_dasharray=self.arrowhead_stroke_dasharray,
            stroke_dashoffset=self.arrowhead_stroke_dashoffset,
            stroke_width=self.arrowhead_stroke_width,
            transform=self.arrowhead_transform,
        )
        transformation = self._get_arrowhead_transformation()
        group = group.transformed(transformation)
        return [group]

#### `` arrowhead_length

    arrowhead_length() -> float

Return the length of the single-headed arc arrowhead

Source code in `src/momapy/core.py`

    1040
    1041
    1042
    1043
    1044
    1045
    1046
    1047
    def arrowhead_length(self) -> float:
        """Return the length of the single-headed arc arrowhead"""
        bbox = momapy.drawing.get_drawing_elements_bbox(
            self._arrowhead_border_drawing_elements()
        )
        if math.isnan(bbox.width):
            return 0.0
        return bbox.east().x

#### `` arrowhead_tip

    arrowhead_tip() -> Point

Return the arrowhead tip anchor point of the single-headed arc

Source code in `src/momapy/core.py`

    1049
    1050
    1051
    1052
    1053
    1054
    1055
    1056
    def arrowhead_tip(self) -> momapy.geometry.Point:
        """Return the arrowhead tip anchor point of the single-headed arc"""
        segment = self.segments[-1]
        segment_length = segment.length()
        if segment_length == 0:
            return segment.p2
        fraction = 1 - self.end_shorten / segment_length
        return segment.get_position_at_fraction(fraction)

#### `` bbox

    bbox() -> Bbox

Compute and return the bounding box of the group layout element

Source code in `src/momapy/core.py`

    504
    505
    506
    507
    508
    509
    510
    511
    512
    513
    514
    515
    516
    517
    518
    519
    520
    521
    522
    523
    524
    525
    526
    def bbox(self) -> momapy.geometry.Bbox:
        """Compute and return the bounding box of the group layout element"""
        self_bbox = self.self_bbox()
        bboxes = [child.bbox() for child in self.children()]
        min_x = self_bbox.north_west().x
        min_y = self_bbox.north_west().y
        max_x = self_bbox.south_east().x
        max_y = self_bbox.south_east().y
        for bbox in bboxes:
            if bbox.north_west().x < min_x:
                min_x = bbox.north_west().x
            if bbox.north_west().y < min_y:
                min_y = bbox.north_west().y
            if bbox.south_east().x > max_x:
                max_x = bbox.south_east().x
            if bbox.south_east().y > max_y:
                max_y = bbox.south_east().y
        bbox = momapy.geometry.Bbox(
            momapy.geometry.Point(min_x / 2 + max_x / 2, min_y / 2 + max_y / 2),
            max_x - min_x,
            max_y - min_y,
        )
        return bbox

#### `` childless

    childless() -> Self

Return a copy of the arc with no children

Source code in `src/momapy/core.py`

    955
    956
    957
    def childless(self) -> typing.Self:
        """Return a copy of the arc with no children"""
        return dataclasses.replace(self, layout_elements=tuple([]))

#### `` children

    children() -> list[LayoutElement]

Return the children of the group layout. These are the self children of the group layout (returned by the `self_children` method) and the other children of the group layout (given by the `layout_elements` attribute)

Source code in `src/momapy/core.py`

    566
    567
    568
    569
    570
    def children(self) -> list[LayoutElement]:
        """Return the children of the group layout.
        These are the self children of the group layout (returned by the `self_children` method) and the other children of the group layout (given by the `layout_elements` attribute)
        """
        return self.self_children() + list(self.layout_elements)

#### `` contains

    contains(other: LayoutElement) -> bool

Return `true` if another layout element is a descendant of the layout element, `false` otherwise

Source code in `src/momapy/core.py`

    119
    120
    121
    def contains(self, other: "LayoutElement") -> bool:
        """Return `true` if another layout element is a descendant of the layout element, `false` otherwise"""
        return other in self.descendants()

#### `` descendants

    descendants() -> list[LayoutElement]

Return the descendants of the layout element

Source code in `src/momapy/core.py`

    90
    91
    92
    93
    94
    95
    96
    def descendants(self) -> list["LayoutElement"]:
        """Return the descendants of the layout element"""
        descendants = []
        for child in self.children():
            descendants.append(child)
            descendants += child.descendants()
        return descendants

#### `` drawing_elements

    drawing_elements() -> list[DrawingElement]

Return the drawing elements of the group layout. The returned drawing elements are a group drawing element formed of the self drawing elements of the group layout and the drawing elements of its children

Source code in `src/momapy/core.py`

    538
    539
    540
    541
    542
    543
    544
    545
    546
    547
    548
    549
    550
    551
    552
    553
    554
    555
    556
    557
    558
    559
    560
    561
    562
    563
    564
    def drawing_elements(self) -> list[momapy.drawing.DrawingElement]:
        """Return the drawing elements of the group layout.
        The returned drawing elements are a group drawing element formed of the self drawing elements of the group layout and the drawing elements of its children
        """
        drawing_elements = self.self_drawing_elements()
        for child in self.children():
            if child is not None:
                drawing_elements += child.drawing_elements()
        group = momapy.drawing.Group(
            class_=f"{type(self).__name__}_group",
            elements=tuple(drawing_elements),
            id_=f"{self.id_}_group",
            fill=self.group_fill,
            fill_rule=self.group_fill_rule,
            filter=self.group_filter,
            font_family=self.group_font_family,
            font_size=self.group_font_size,
            font_style=self.group_font_style,
            font_weight=self.group_font_weight,
            stroke=self.group_stroke,
            stroke_dasharray=self.group_stroke_dasharray,
            stroke_dashoffset=self.group_stroke_dashoffset,
            stroke_width=self.group_stroke_width,
            text_anchor=self.group_text_anchor,
            transform=self.group_transform,
        )
        return [group]

#### `` end_point

    end_point() -> Point

Return the ending point of the arc

Source code in `src/momapy/core.py`

    951
    952
    953
    def end_point(self) -> momapy.geometry.Point:
        """Return the ending point of the arc"""
        return self.points()[-1]

#### `` equals

    equals(
        other: LayoutElement,
        flattened: bool = False,
        unordered: bool = False,
    ) -> bool

Return `true` if the layout element is equal to another layout element, `false` otherwise

Source code in `src/momapy/core.py`

    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    def equals(
        self, other: "LayoutElement", flattened: bool = False, unordered: bool = False
    ) -> bool:
        """Return `true` if the layout element is equal to another layout element, `false` otherwise"""
        if type(self) is type(other):
            if not flattened:
                return self == other
            else:
                if not unordered:
                    return self.flattened() == other.flattened()
                else:
                    return set(self.flattened()) == set(other.flattened())
        return False

#### `` flattened

    flattened() -> list[LayoutElement]

Return a list containing copy of the layout element with no children and all its descendants with no children

Source code in `src/momapy/core.py`

     98
     99
    100
    101
    102
    103
    def flattened(self) -> list["LayoutElement"]:
        """Return a list containing copy of the layout element with no children and all its descendants with no children"""
        flattened = [self.childless()]
        for child in self.children():
            flattened += child.flattened()
        return flattened

#### `` fraction

    fraction(fraction: float) -> tuple[Point, float]

Return the position and angle on the arc at a given fraction (of the total arc length)

Source code in `src/momapy/core.py`

    959
    960
    961
    962
    963
    964
    965
    966
    967
    968
    def fraction(self, fraction: float) -> tuple[momapy.geometry.Point, float]:
        """Return the position and angle on the arc at a given fraction (of the total arc length)"""
        current_length = 0
        length_to_reach = fraction * self.length()
        for segment in self.segments:
            current_length += segment.length()
            if current_length >= length_to_reach:
                break
        position, angle = segment.get_position_and_angle_at_fraction(fraction)
        return position, angle

#### `` length

    length()

Return the total length of the arc path

Source code in `src/momapy/core.py`

    943
    944
    945
    def length(self):
        """Return the total length of the arc path"""
        return sum([segment.length() for segment in self.segments])

#### `` path_drawing_elements

    path_drawing_elements() -> list[Path]

Return the drawing elements of the single-headed arc path

Source code in `src/momapy/core.py`

    1129
    1130
    1131
    1132
    1133
    1134
    1135
    1136
    1137
    1138
    1139
    1140
    1141
    1142
    1143
    1144
    1145
    1146
    1147
    1148
    1149
    1150
    1151
    1152
    1153
    1154
    1155
    1156
    1157
    1158
    1159
    1160
    1161
    1162
    1163
    1164
    1165
    1166
    1167
    def path_drawing_elements(self) -> list[momapy.drawing.Path]:
        """Return the drawing elements of the single-headed arc path"""
        arrowhead_length = self.arrowhead_length()
        if len(self.segments) == 1:
            segment = (
                self.segments[0]
                .shortened(self.start_shorten, "start")
                .shortened(self.end_shorten + arrowhead_length, "end")
            )
            actions = [
                momapy.drawing.MoveTo(segment.p1),
                self._make_path_action_from_segment(segment),
            ]
        else:
            first_segment = self.segments[0].shortened(self.start_shorten, "start")
            last_segment = self.segments[-1].shortened(
                self.end_shorten + arrowhead_length, "end"
            )
            actions = [
                momapy.drawing.MoveTo(first_segment.p1),
                self._make_path_action_from_segment(first_segment),
            ]
            for segment in self.segments[1:-1]:
                action = self._make_path_action_from_segment(segment)
                actions.append(action)
            actions.append(self._make_path_action_from_segment(last_segment))
        path = momapy.drawing.Path(
            actions=tuple(actions),
            class_=f"{type(self).__name__}_path",
            fill=self.path_fill,
            filter=self.path_filter,
            id_=f"{self.id_}_path",
            stroke=self.path_stroke,
            stroke_dasharray=self.path_stroke_dasharray,
            stroke_dashoffset=self.path_stroke_dashoffset,
            stroke_width=self.path_stroke_width,
            transform=self.path_transform,
        )
        return [path]

#### `` points

    points() -> list[Point]

Return the points of the arc path

Source code in `src/momapy/core.py`

    935
    936
    937
    938
    939
    940
    941
    def points(self) -> list[momapy.geometry.Point]:
        """Return the points of the arc path"""
        points = []
        for segment in self.segments:
            points.append(segment.p1)
        points.append(segment.p2)
        return points

#### `` self_bbox

    self_bbox() -> Bbox

Compute and return the bounding box of the self drawing element of the group layout

Source code in `src/momapy/core.py`

    499
    500
    501
    502
    def self_bbox(self) -> momapy.geometry.Bbox:
        """Compute and return the bounding box of the self drawing element of the group layout"""
        bounds = self.self_to_shapely().bounds
        return momapy.geometry.Bbox.from_bounds(bounds)

#### `` self_children

    self_children() -> list[LayoutElement]

Return the self children of the arc

Source code in `src/momapy/core.py`

    931
    932
    933
    def self_children(self) -> list[LayoutElement]:
        """Return the self children of the arc"""
        return []

#### `` self_drawing_elements

    self_drawing_elements() -> list[DrawingElement]

Return the self drawing elements of the single-headed arc

Source code in `src/momapy/core.py`

    1169
    1170
    1171
    1172
    1173
    1174
    1175
    1176
    1177
    1178
    1179
    1180
    1181
    1182
    1183
    1184
    1185
    1186
    def self_drawing_elements(self) -> list[momapy.drawing.DrawingElement]:
        """Return the self drawing elements of the single-headed arc"""
        drawing_elements = (
            self.path_drawing_elements() + self.arrowhead_drawing_elements()
        )
        group = momapy.drawing.Group(
            class_=type(self).__name__,
            elements=tuple(drawing_elements),
            fill=self.fill,
            filter=self.filter,
            id_=self.id_,
            stroke=self.stroke,
            stroke_dasharray=self.stroke_dasharray,
            stroke_dashoffset=self.stroke_dashoffset,
            stroke_width=self.stroke_width,
            transform=self.transform,
        )
        return [group]

#### `` self_to_shapely

    self_to_shapely() -> GeometryCollection

Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout

Source code in `src/momapy/core.py`

    495
    496
    497
    def self_to_shapely(self) -> shapely.GeometryCollection:
        """Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout"""
        return momapy.drawing.drawing_elements_to_shapely(self.drawing_elements())

#### `` start_point

    start_point() -> Point

Return the starting point of the arc

Source code in `src/momapy/core.py`

    947
    948
    949
    def start_point(self) -> momapy.geometry.Point:
        """Return the starting point of the arc"""
        return self.points()[0]

#### `` to_shapely

    to_shapely(to_polygons: bool = False) -> GeometryCollection

Return a shapely collection of geometries reproducing the drawing elements of the layout element

Source code in `src/momapy/core.py`

    123
    124
    125
    126
    127
    128
    def to_shapely(self, to_polygons: bool = False) -> shapely.GeometryCollection:
        """Return a shapely collection of geometries reproducing the drawing elements of the layout element"""
        geom_collection = []
        for drawing_element in self.drawing_elements():
            geom_collection += drawing_element.to_shapely(to_polygons=to_polygons).geoms
        return shapely.GeometryCollection(geom_collection)

### `` Dissociation `dataclass`

    Dissociation(
        *,
        id_: str = make_uuid4_as_str(),
        reactants: frozenset[Reactant] = frozenset(),
        products: frozenset[Product] = frozenset(),
        reversible: bool = False,
    )

Bases: `GenericProcess`

Class for dissociations

Parameters:

Name | Type | Description | Default
--- | --- | --- | ---
`id_` | `str` | The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element | `'ea5aa9b1-b55a-4e2d-a92a-29eefea1537c'`
`reactants` | `frozenset[Reactant]` | The reactants of the stoichiometric process | `<class 'frozenset'>`
`products` | `frozenset[Product]` | The products of the stoichiometric process | `<class 'frozenset'>`
`reversible` | `bool` | Whether the stoichiometric process is reversible or not | `False`

### `` DissociationLayout `dataclass`

    DissociationLayout(
        fill: NoneValueType | Color | None = white,
        stroke: NoneValueType | Color | None = black,
        stroke_width: float | None = 1.25,
        *,
        id_: str = make_uuid4_as_str(),
        layout_elements: tuple[LayoutElement] = tuple(),
        group_fill: NoneValueType | Color | None = None,
        group_fill_rule: FillRule | None = None,
        group_filter: NoneValueType | Filter | None = None,
        group_font_family: str | None = None,
        group_font_size: float | None = None,
        group_font_style: FontStyle | None = None,
        group_font_weight: FontWeight | float | None = None,
        group_stroke: NoneValueType | Color | None = None,
        group_stroke_dasharray: tuple[float, ...] | None = None,
        group_stroke_dashoffset: float | None = None,
        group_stroke_width: float | None = None,
        group_text_anchor: TextAnchor | None = None,
        group_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        filter: NoneValueType | Filter | None = None,
        height: float = 20.0,
        label: TextLayout | None = None,
        position: Point,
        stroke_dasharray: tuple[float, ...] | None = None,
        stroke_dashoffset: float | None = None,
        transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        width: float = 20.0,
        direction: Direction = HORIZONTAL,
        left_to_right: bool = True,
        left_connector_length: float = 10.0,
        right_connector_length: float = 10.0,
        left_connector_stroke: NoneValueType
        | Color
        | None = None,
        left_connector_stroke_width: float | None = None,
        left_connector_stroke_dasharray: NoneValueType
        | tuple[float]
        | None = None,
        left_connector_stroke_dashoffset: float | None = None,
        left_connector_fill: NoneValueType
        | Color
        | None = None,
        left_connector_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        left_connector_filter: NoneValueType
        | Filter
        | None = None,
        right_connector_stroke: NoneValueType
        | Color
        | None = None,
        right_connector_stroke_width: float | None = None,
        right_connector_stroke_dasharray: NoneValueType
        | tuple[float]
        | None = None,
        right_connector_stroke_dashoffset: float | None = None,
        right_connector_fill: NoneValueType
        | Color
        | None = None,
        right_connector_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        right_connector_filter: NoneValueType
        | Filter
        | None = None,
        sep: float = 3.0,
    )

Bases: `_ConnectorsMixin`, `_SimpleMixin`, `SBGNNode`

Class for dissociation layouts

Parameters:

Name | Type | Description | Default
--- | --- | --- | ---
`id_` | `str` | The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element | `'a8870b99-ae6d-48d1-a0f2-45efe367cfc9'`
`layout_elements` | `tuple[LayoutElement]` | The sub-layout elements of the group layout. These are part of the children of the group layout | `<dynamic>`
`group_fill` | `NoneValueType | Color | None` | The fill color of the group layout | `None`
`group_fill_rule` | `FillRule | None` | The fill rule of the group layout | `None`
`group_filter` | `NoneValueType | Filter | None` | The filter of the group layout | `None`
`group_font_family` | `str | None` | The font family of the group layout | `None`
`group_font_size` | `float | None` | The font size of the group layout | `None`
`group_font_style` | `FontStyle | None` | The font style of the group layout | `None`
`group_font_weight` | `FontWeight | float | None` | The font weight of the group layout | `None`
`group_stroke` | `NoneValueType | Color | None` | The stroke color of the group layout | `None`
`group_stroke_dasharray` | `tuple[float, ...] | None` | The stroke dasharray of the group layout | `None`
`group_stroke_dashoffset` | `float | None` | The stroke dashoffset of the group layout | `None`
`group_stroke_width` | `float | None` | The stroke width of the group layout | `None`
`group_text_anchor` | `TextAnchor | None` | The text anchor of the group layout | `None`
`group_transform` | `NoneValueType | tuple[Transformation] | None` | The transform of the group layout | `None`
`fill` | `NoneValueType | Color | None` |  | `Color(red=255, green=255, blue=255, alpha=1.0)`
`filter` | `NoneValueType | Filter | None` | The filter of the node | `None`
`height` | `float` |  | `20.0`
`label` | `TextLayout | None` | The label of the node | `None`
`position` | `Point` | The position of the node | required
`stroke` | `NoneValueType | Color | None` |  | `Color(red=0, green=0, blue=0, alpha=1.0)`
`stroke_dasharray` | `tuple[float, ...] | None` | The stroke dasharray of the node | `None`
`stroke_dashoffset` | `float | None` | The stroke dashoffset of the node | `None`
`stroke_width` | `float | None` |  | `1.25`
`transform` | `NoneValueType | tuple[Transformation] | None` | The transform of the node | `None`
`width` | `float` |  | `20.0`
`direction` | `Direction` |  | `<Direction.HORIZONTAL: 1>`
`left_to_right` | `bool` |  | `True`
`left_connector_length` | `float` |  | `10.0`
`right_connector_length` | `float` |  | `10.0`
`left_connector_stroke` | `NoneValueType | Color | None` |  | `None`
`left_connector_stroke_width` | `float | None` |  | `None`
`left_connector_stroke_dasharray` | `NoneValueType | tuple[float] | None` |  | `None`
`left_connector_stroke_dashoffset` | `float | None` |  | `None`
`left_connector_fill` | `NoneValueType | Color | None` |  | `None`
`left_connector_transform` | `NoneValueType | tuple[Transformation] | None` |  | `None`
`left_connector_filter` | `NoneValueType | Filter | None` |  | `None`
`right_connector_stroke` | `NoneValueType | Color | None` |  | `None`
`right_connector_stroke_width` | `float | None` |  | `None`
`right_connector_stroke_dasharray` | `NoneValueType | tuple[float] | None` |  | `None`
`right_connector_stroke_dashoffset` | `float | None` |  | `None`
`right_connector_fill` | `NoneValueType | Color | None` |  | `None`
`right_connector_transform` | `NoneValueType | tuple[Transformation] | None` |  | `None`
`right_connector_filter` | `NoneValueType | Filter | None` |  | `None`
`sep` | `float` |  | `3.0`

Methods:

Name | Description
--- | ---
`anchor_point` | Return an anchor point of the layout element
`angle` | Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.
`bbox` | Compute and return the bounding box of the group layout element
`border` | Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point.
`center` | Return the center anchor of the node
`childless` | Return a copy of the node with no children
`children` | Return the children of the group layout.
`contains` | Return `true` if another layout element is a descendant of the layout element, `false` otherwise
`descendants` | Return the descendants of the layout element
`drawing_elements` | Return the drawing elements of the group layout.
`east_north_east` | Return the east north east anchor of the node
`east_south_east` | Return the east south east west anchor of the node
`equals` | Return `true` if the layout element is equal to another layout element, `false` otherwise
`flattened` | Return a list containing copy of the layout element with no children and all its descendants with no children
`label_center` | Return the label center anchor of the node
`north_east` | Return the north east anchor of the node
`north_north_east` | Return the north north east anchor of the node
`north_north_west` | Return the north north west anchor of the node
`north_west` | Return the north west anchor of the node
`self_angle` | Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.
`self_bbox` | Compute and return the bounding box of the self drawing element of the group layout
`self_border` | Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point.
`self_children` | Return the self children of the node. A node has unique child that is its label
`self_drawing_elements` | Return the node's own drawing elements
`self_to_shapely` | Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout
`size` | Return the size of the node
`south_east` | Return the south east anchor of the node
`south_south_east` | Return the south south east anchor of the node
`south_south_west` | Return the south south west anchor of the node
`south_west` | Return the south west anchor of the node
`to_shapely` | Return a shapely collection of geometries reproducing the drawing elements of the layout element
`west_north_west` | Return the west north west anchor of the node
`west_south_west` | Return the west south west anchor of the node

Attributes:

Name | Type | Description
--- | --- | ---
`x` | `float` | Return the x coordinate of the node
`y` | `float` | Return the y coordinate of the node

#### `` anchor_point

    anchor_point(anchor_name: str) -> Point

Return an anchor point of the layout element

Source code in `src/momapy/core.py`

    130
    131
    132
    def anchor_point(self, anchor_name: str) -> momapy.geometry.Point:
        """Return an anchor point of the layout element"""
        return getattr(self, anchor_name)()

#### `` angle

    angle(
        angle: float,
        unit: Literal["degrees", "radians"] = "degrees",
    ) -> Point

Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.

Source code in `src/momapy/core.py`

    817
    818
    819
    820
    821
    822
    823
    824
    825
    826
    827
    828
    def angle(
        self,
        angle: float,
        unit: typing.Literal["degrees", "radians"] = "degrees",
    ) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal."""
        return momapy.drawing.get_drawing_elements_angle(
            drawing_elements=self.drawing_elements(),
            angle=angle,
            unit=unit,
            center=self.center(),
        )

#### `` bbox

    bbox() -> Bbox

Compute and return the bounding box of the group layout element

Source code in `src/momapy/core.py`

    504
    505
    506
    507
    508
    509
    510
    511
    512
    513
    514
    515
    516
    517
    518
    519
    520
    521
    522
    523
    524
    525
    526
    def bbox(self) -> momapy.geometry.Bbox:
        """Compute and return the bounding box of the group layout element"""
        self_bbox = self.self_bbox()
        bboxes = [child.bbox() for child in self.children()]
        min_x = self_bbox.north_west().x
        min_y = self_bbox.north_west().y
        max_x = self_bbox.south_east().x
        max_y = self_bbox.south_east().y
        for bbox in bboxes:
            if bbox.north_west().x < min_x:
                min_x = bbox.north_west().x
            if bbox.north_west().y < min_y:
                min_y = bbox.north_west().y
            if bbox.south_east().x > max_x:
                max_x = bbox.south_east().x
            if bbox.south_east().y > max_y:
                max_y = bbox.south_east().y
        bbox = momapy.geometry.Bbox(
            momapy.geometry.Point(min_x / 2 + max_x / 2, min_y / 2 + max_y / 2),
            max_x - min_x,
            max_y - min_y,
        )
        return bbox

#### `` border

    border(point: Point) -> Point

Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point. When there are multiple intersection points, the one closest to the given point is returned

Source code in `src/momapy/core.py`

    794
    795
    796
    797
    798
    799
    800
    801
    802
    def border(self, point: momapy.geometry.Point) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point.
        When there are multiple intersection points, the one closest to the given point is returned
        """
        return momapy.drawing.get_drawing_elements_border(
            drawing_elements=self.drawing_elements(),
            point=point,
            center=self.center(),
        )

#### `` center

    center() -> Point

Return the center anchor of the node

Source code in `src/momapy/core.py`

    776
    777
    778
    def center(self) -> momapy.geometry.Point:
        """Return the center anchor of the node"""
        return self.position

#### `` childless

    childless() -> Self

Return a copy of the node with no children

Source code in `src/momapy/core.py`

    830
    831
    832
    def childless(self) -> typing.Self:
        """Return a copy of the node with no children"""
        return dataclasses.replace(self, label=None, layout_elements=tuple([]))

#### `` children

    children() -> list[LayoutElement]

Return the children of the group layout. These are the self children of the group layout (returned by the `self_children` method) and the other children of the group layout (given by the `layout_elements` attribute)

Source code in `src/momapy/core.py`

    566
    567
    568
    569
    570
    def children(self) -> list[LayoutElement]:
        """Return the children of the group layout.
        These are the self children of the group layout (returned by the `self_children` method) and the other children of the group layout (given by the `layout_elements` attribute)
        """
        return self.self_children() + list(self.layout_elements)

#### `` contains

    contains(other: LayoutElement) -> bool

Return `true` if another layout element is a descendant of the layout element, `false` otherwise

Source code in `src/momapy/core.py`

    119
    120
    121
    def contains(self, other: "LayoutElement") -> bool:
        """Return `true` if another layout element is a descendant of the layout element, `false` otherwise"""
        return other in self.descendants()

#### `` descendants

    descendants() -> list[LayoutElement]

Return the descendants of the layout element

Source code in `src/momapy/core.py`

    90
    91
    92
    93
    94
    95
    96
    def descendants(self) -> list["LayoutElement"]:
        """Return the descendants of the layout element"""
        descendants = []
        for child in self.children():
            descendants.append(child)
            descendants += child.descendants()
        return descendants

#### `` drawing_elements

    drawing_elements() -> list[DrawingElement]

Return the drawing elements of the group layout. The returned drawing elements are a group drawing element formed of the self drawing elements of the group layout and the drawing elements of its children

Source code in `src/momapy/core.py`

    538
    539
    540
    541
    542
    543
    544
    545
    546
    547
    548
    549
    550
    551
    552
    553
    554
    555
    556
    557
    558
    559
    560
    561
    562
    563
    564
    def drawing_elements(self) -> list[momapy.drawing.DrawingElement]:
        """Return the drawing elements of the group layout.
        The returned drawing elements are a group drawing element formed of the self drawing elements of the group layout and the drawing elements of its children
        """
        drawing_elements = self.self_drawing_elements()
        for child in self.children():
            if child is not None:
                drawing_elements += child.drawing_elements()
        group = momapy.drawing.Group(
            class_=f"{type(self).__name__}_group",
            elements=tuple(drawing_elements),
            id_=f"{self.id_}_group",
            fill=self.group_fill,
            fill_rule=self.group_fill_rule,
            filter=self.group_filter,
            font_family=self.group_font_family,
            font_size=self.group_font_size,
            font_style=self.group_font_style,
            font_weight=self.group_font_weight,
            stroke=self.group_stroke,
            stroke_dasharray=self.group_stroke_dasharray,
            stroke_dashoffset=self.group_stroke_dashoffset,
            stroke_width=self.group_stroke_width,
            text_anchor=self.group_text_anchor,
            transform=self.group_transform,
        )
        return [group]

#### `` east_north_east

    east_north_east() -> Point

Return the east north east anchor of the node

Source code in `src/momapy/core.py`

    700
    701
    702
    703
    704
    705
    706
    def east_north_east(self) -> momapy.geometry.Point:
        """Return the east north east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, -self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` east_south_east

    east_south_east() -> Point

Return the east south east west anchor of the node

Source code in `src/momapy/core.py`

    712
    713
    714
    715
    716
    717
    718
    def east_south_east(self) -> momapy.geometry.Point:
        """Return the east south east west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` equals

    equals(
        other: LayoutElement,
        flattened: bool = False,
        unordered: bool = False,
    ) -> bool

Return `true` if the layout element is equal to another layout element, `false` otherwise

Source code in `src/momapy/core.py`

    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    def equals(
        self, other: "LayoutElement", flattened: bool = False, unordered: bool = False
    ) -> bool:
        """Return `true` if the layout element is equal to another layout element, `false` otherwise"""
        if type(self) is type(other):
            if not flattened:
                return self == other
            else:
                if not unordered:
                    return self.flattened() == other.flattened()
                else:
                    return set(self.flattened()) == set(other.flattened())
        return False

#### `` flattened

    flattened() -> list[LayoutElement]

Return a list containing copy of the layout element with no children and all its descendants with no children

Source code in `src/momapy/core.py`

     98
     99
    100
    101
    102
    103
    def flattened(self) -> list["LayoutElement"]:
        """Return a list containing copy of the layout element with no children and all its descendants with no children"""
        flattened = [self.childless()]
        for child in self.children():
            flattened += child.flattened()
        return flattened

#### `` label_center

    label_center() -> Point

Return the label center anchor of the node

Source code in `src/momapy/core.py`

    780
    781
    782
    def label_center(self) -> momapy.geometry.Point:
        """Return the label center anchor of the node"""
        return self.position

#### `` north_east

    north_east() -> Point

Return the north east anchor of the node

Source code in `src/momapy/core.py`

    692
    693
    694
    695
    696
    697
    698
    def north_east(self) -> momapy.geometry.Point:
        """Return the north east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, -self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` north_north_east

    north_north_east() -> Point

Return the north north east anchor of the node

Source code in `src/momapy/core.py`

    684
    685
    686
    687
    688
    689
    690
    def north_north_east(self) -> momapy.geometry.Point:
        """Return the north north east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 4, -self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` north_north_west

    north_north_west() -> Point

Return the north north west anchor of the node

Source code in `src/momapy/core.py`

    672
    673
    674
    675
    676
    677
    678
    def north_north_west(self) -> momapy.geometry.Point:
        """Return the north north west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() - (self.width / 4, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` north_west

    north_west() -> Point

Return the north west anchor of the node

Source code in `src/momapy/core.py`

    664
    665
    666
    667
    668
    669
    670
    def north_west(self) -> momapy.geometry.Point:
        """Return the north west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() - (self.width / 2, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` self_angle

    self_angle(
        angle: float,
        unit: Literal["degrees", "radians"] = "degrees",
    ) -> Point

Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.

Source code in `src/momapy/core.py`

    804
    805
    806
    807
    808
    809
    810
    811
    812
    813
    814
    815
    def self_angle(
        self,
        angle: float,
        unit: typing.Literal["degrees", "radians"] = "degrees",
    ) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal."""
        return momapy.drawing.get_drawing_elements_angle(
            drawing_elements=self.self_drawing_elements(),
            angle=angle,
            unit=unit,
            center=self.center(),
        )

#### `` self_bbox

    self_bbox() -> Bbox

Compute and return the bounding box of the self drawing element of the group layout

Source code in `src/momapy/core.py`

    499
    500
    501
    502
    def self_bbox(self) -> momapy.geometry.Bbox:
        """Compute and return the bounding box of the self drawing element of the group layout"""
        bounds = self.self_to_shapely().bounds
        return momapy.geometry.Bbox.from_bounds(bounds)

#### `` self_border

    self_border(point: Point) -> Point

Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point. When there are multiple intersection points, the one closest to the given point is returned

Source code in `src/momapy/core.py`

    784
    785
    786
    787
    788
    789
    790
    791
    792
    def self_border(self, point: momapy.geometry.Point) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point.
        When there are multiple intersection points, the one closest to the given point is returned
        """
        return momapy.drawing.get_drawing_elements_border(
            drawing_elements=self.self_drawing_elements(),
            point=point,
            center=self.center(),
        )

#### `` self_children

    self_children() -> list[LayoutElement]

Return the self children of the node. A node has unique child that is its label

Source code in `src/momapy/core.py`

    654
    655
    656
    657
    658
    def self_children(self) -> list[LayoutElement]:
        """Return the self children of the node. A node has unique child that is its label"""
        if self.label is not None:
            return [self.label]
        return []

#### `` self_drawing_elements

    self_drawing_elements() -> list[DrawingElement]

Return the node's own drawing elements

Source code in `src/momapy/core.py`

    637
    638
    639
    640
    641
    642
    643
    644
    645
    646
    647
    648
    649
    650
    651
    652
    def self_drawing_elements(self) -> list[momapy.drawing.DrawingElement]:
        """Return the node's own drawing elements"""
        drawing_elements = self._border_drawing_elements()
        group = momapy.drawing.Group(
            class_=type(self).__name__,
            elements=tuple(drawing_elements),
            fill=self.fill,
            filter=self.filter,
            id_=self.id_,
            stroke=self.stroke,
            stroke_dasharray=self.stroke_dasharray,
            stroke_dashoffset=self.stroke_dashoffset,
            stroke_width=self.stroke_width,
            transform=self.transform,
        )
        return [group]

#### `` self_to_shapely

    self_to_shapely() -> GeometryCollection

Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout

Source code in `src/momapy/core.py`

    495
    496
    497
    def self_to_shapely(self) -> shapely.GeometryCollection:
        """Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout"""
        return momapy.drawing.drawing_elements_to_shapely(self.drawing_elements())

#### `` size

    size() -> tuple[float, float]

Return the size of the node

Source code in `src/momapy/core.py`

    660
    661
    662
    def size(self) -> tuple[float, float]:
        """Return the size of the node"""
        return (self.width, self.height)

#### `` south_east

    south_east() -> Point

Return the south east anchor of the node

Source code in `src/momapy/core.py`

    720
    721
    722
    723
    724
    725
    726
    def south_east(self) -> momapy.geometry.Point:
        """Return the south east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` south_south_east

    south_south_east() -> Point

Return the south south east anchor of the node

Source code in `src/momapy/core.py`

    728
    729
    730
    731
    732
    733
    734
    def south_south_east(self) -> momapy.geometry.Point:
        """Return the south south east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 4, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` south_south_west

    south_south_west() -> Point

Return the south south west anchor of the node

Source code in `src/momapy/core.py`

    740
    741
    742
    743
    744
    745
    746
    def south_south_west(self) -> momapy.geometry.Point:
        """Return the south south west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (-self.width / 4, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` south_west

    south_west() -> Point

Return the south west anchor of the node

Source code in `src/momapy/core.py`

    748
    749
    750
    751
    752
    753
    754
    def south_west(self) -> momapy.geometry.Point:
        """Return the south west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (-self.width / 2, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` to_shapely

    to_shapely(to_polygons: bool = False) -> GeometryCollection

Return a shapely collection of geometries reproducing the drawing elements of the layout element

Source code in `src/momapy/core.py`

    123
    124
    125
    126
    127
    128
    def to_shapely(self, to_polygons: bool = False) -> shapely.GeometryCollection:
        """Return a shapely collection of geometries reproducing the drawing elements of the layout element"""
        geom_collection = []
        for drawing_element in self.drawing_elements():
            geom_collection += drawing_element.to_shapely(to_polygons=to_polygons).geoms
        return shapely.GeometryCollection(geom_collection)

#### `` west_north_west

    west_north_west() -> Point

Return the west north west anchor of the node

Source code in `src/momapy/core.py`

    768
    769
    770
    771
    772
    773
    774
    def west_north_west(self) -> momapy.geometry.Point:
        """Return the west north west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() - (self.width / 2, self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` west_south_west

    west_south_west() -> Point

Return the west south west anchor of the node

Source code in `src/momapy/core.py`

    756
    757
    758
    759
    760
    761
    762
    def west_south_west(self) -> momapy.geometry.Point:
        """Return the west south west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (-self.width / 2, self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` x `property`

    x: float

Return the x coordinate of the node

#### `` y `property`

    y: float

Return the y coordinate of the node

### `` EmptySet `dataclass`

    EmptySet(
        *,
        id_: str = make_uuid4_as_str(),
        compartment: Compartment | None = None,
    )

Bases: `EntityPool`

Class for empty sets

Parameters:

Name | Type | Description | Default
--- | --- | --- | ---
`id_` | `str` | The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element | `'0fdc366a-7e0b-46c5-9368-b233d1330f11'`
`compartment` | `Compartment | None` | The compartment of the entity pool | `None`

### `` EmptySetLayout `dataclass`

    EmptySetLayout(
        fill: NoneValueType | Color | None = white,
        stroke: NoneValueType | Color | None = black,
        stroke_width: float | None = 1.25,
        *,
        id_: str = make_uuid4_as_str(),
        layout_elements: tuple[LayoutElement] = tuple(),
        group_fill: NoneValueType | Color | None = None,
        group_fill_rule: FillRule | None = None,
        group_filter: NoneValueType | Filter | None = None,
        group_font_family: str | None = None,
        group_font_size: float | None = None,
        group_font_style: FontStyle | None = None,
        group_font_weight: FontWeight | float | None = None,
        group_stroke: NoneValueType | Color | None = None,
        group_stroke_dasharray: tuple[float, ...] | None = None,
        group_stroke_dashoffset: float | None = None,
        group_stroke_width: float | None = None,
        group_text_anchor: TextAnchor | None = None,
        group_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        filter: NoneValueType | Filter | None = None,
        height: float = 22.0,
        label: TextLayout | None = None,
        position: Point,
        stroke_dasharray: tuple[float, ...] | None = None,
        stroke_dashoffset: float | None = None,
        transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        width: float = 22.0,
    )

Bases: `_SimpleMixin`, `SBGNNode`

Class for empty set layouts

Parameters:

Name | Type | Description | Default
--- | --- | --- | ---
`id_` | `str` | The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element | `'040d80a7-4f82-4580-bda9-ac207eb70fbd'`
`layout_elements` | `tuple[LayoutElement]` | The sub-layout elements of the group layout. These are part of the children of the group layout | `<dynamic>`
`group_fill` | `NoneValueType | Color | None` | The fill color of the group layout | `None`
`group_fill_rule` | `FillRule | None` | The fill rule of the group layout | `None`
`group_filter` | `NoneValueType | Filter | None` | The filter of the group layout | `None`
`group_font_family` | `str | None` | The font family of the group layout | `None`
`group_font_size` | `float | None` | The font size of the group layout | `None`
`group_font_style` | `FontStyle | None` | The font style of the group layout | `None`
`group_font_weight` | `FontWeight | float | None` | The font weight of the group layout | `None`
`group_stroke` | `NoneValueType | Color | None` | The stroke color of the group layout | `None`
`group_stroke_dasharray` | `tuple[float, ...] | None` | The stroke dasharray of the group layout | `None`
`group_stroke_dashoffset` | `float | None` | The stroke dashoffset of the group layout | `None`
`group_stroke_width` | `float | None` | The stroke width of the group layout | `None`
`group_text_anchor` | `TextAnchor | None` | The text anchor of the group layout | `None`
`group_transform` | `NoneValueType | tuple[Transformation] | None` | The transform of the group layout | `None`
`fill` | `NoneValueType | Color | None` |  | `Color(red=255, green=255, blue=255, alpha=1.0)`
`filter` | `NoneValueType | Filter | None` | The filter of the node | `None`
`height` | `float` |  | `22.0`
`label` | `TextLayout | None` | The label of the node | `None`
`position` | `Point` | The position of the node | required
`stroke` | `NoneValueType | Color | None` |  | `Color(red=0, green=0, blue=0, alpha=1.0)`
`stroke_dasharray` | `tuple[float, ...] | None` | The stroke dasharray of the node | `None`
`stroke_dashoffset` | `float | None` | The stroke dashoffset of the node | `None`
`stroke_width` | `float | None` |  | `1.25`
`transform` | `NoneValueType | tuple[Transformation] | None` | The transform of the node | `None`
`width` | `float` |  | `22.0`

Methods:

Name | Description
--- | ---
`anchor_point` | Return an anchor point of the layout element
`angle` | Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.
`bbox` | Compute and return the bounding box of the group layout element
`border` | Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point.
`center` | Return the center anchor of the node
`childless` | Return a copy of the node with no children
`children` | Return the children of the group layout.
`contains` | Return `true` if another layout element is a descendant of the layout element, `false` otherwise
`descendants` | Return the descendants of the layout element
`drawing_elements` | Return the drawing elements of the group layout.
`east` | Return the east anchor of the node
`east_north_east` | Return the east north east anchor of the node
`east_south_east` | Return the east south east west anchor of the node
`equals` | Return `true` if the layout element is equal to another layout element, `false` otherwise
`flattened` | Return a list containing copy of the layout element with no children and all its descendants with no children
`label_center` | Return the label center anchor of the node
`north` | Return the north anchor of the node
`north_east` | Return the north east anchor of the node
`north_north_east` | Return the north north east anchor of the node
`north_north_west` | Return the north north west anchor of the node
`north_west` | Return the north west anchor of the node
`self_angle` | Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.
`self_bbox` | Compute and return the bounding box of the self drawing element of the group layout
`self_border` | Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point.
`self_children` | Return the self children of the node. A node has unique child that is its label
`self_drawing_elements` | Return the node's own drawing elements
`self_to_shapely` | Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout
`size` | Return the size of the node
`south` | Return the south anchor of the node
`south_east` | Return the south east anchor of the node
`south_south_east` | Return the south south east anchor of the node
`south_south_west` | Return the south south west anchor of the node
`south_west` | Return the south west anchor of the node
`to_shapely` | Return a shapely collection of geometries reproducing the drawing elements of the layout element
`west` | Return the west anchor of the node
`west_north_west` | Return the west north west anchor of the node
`west_south_west` | Return the west south west anchor of the node

Attributes:

Name | Type | Description
--- | --- | ---
`x` | `float` | Return the x coordinate of the node
`y` | `float` | Return the y coordinate of the node

#### `` anchor_point

    anchor_point(anchor_name: str) -> Point

Return an anchor point of the layout element

Source code in `src/momapy/core.py`

    130
    131
    132
    def anchor_point(self, anchor_name: str) -> momapy.geometry.Point:
        """Return an anchor point of the layout element"""
        return getattr(self, anchor_name)()

#### `` angle

    angle(
        angle: float,
        unit: Literal["degrees", "radians"] = "degrees",
    ) -> Point

Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.

Source code in `src/momapy/core.py`

    817
    818
    819
    820
    821
    822
    823
    824
    825
    826
    827
    828
    def angle(
        self,
        angle: float,
        unit: typing.Literal["degrees", "radians"] = "degrees",
    ) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal."""
        return momapy.drawing.get_drawing_elements_angle(
            drawing_elements=self.drawing_elements(),
            angle=angle,
            unit=unit,
            center=self.center(),
        )

#### `` bbox

    bbox() -> Bbox

Compute and return the bounding box of the group layout element

Source code in `src/momapy/core.py`

    504
    505
    506
    507
    508
    509
    510
    511
    512
    513
    514
    515
    516
    517
    518
    519
    520
    521
    522
    523
    524
    525
    526
    def bbox(self) -> momapy.geometry.Bbox:
        """Compute and return the bounding box of the group layout element"""
        self_bbox = self.self_bbox()
        bboxes = [child.bbox() for child in self.children()]
        min_x = self_bbox.north_west().x
        min_y = self_bbox.north_west().y
        max_x = self_bbox.south_east().x
        max_y = self_bbox.south_east().y
        for bbox in bboxes:
            if bbox.north_west().x < min_x:
                min_x = bbox.north_west().x
            if bbox.north_west().y < min_y:
                min_y = bbox.north_west().y
            if bbox.south_east().x > max_x:
                max_x = bbox.south_east().x
            if bbox.south_east().y > max_y:
                max_y = bbox.south_east().y
        bbox = momapy.geometry.Bbox(
            momapy.geometry.Point(min_x / 2 + max_x / 2, min_y / 2 + max_y / 2),
            max_x - min_x,
            max_y - min_y,
        )
        return bbox

#### `` border

    border(point: Point) -> Point

Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point. When there are multiple intersection points, the one closest to the given point is returned

Source code in `src/momapy/core.py`

    794
    795
    796
    797
    798
    799
    800
    801
    802
    def border(self, point: momapy.geometry.Point) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point.
        When there are multiple intersection points, the one closest to the given point is returned
        """
        return momapy.drawing.get_drawing_elements_border(
            drawing_elements=self.drawing_elements(),
            point=point,
            center=self.center(),
        )

#### `` center

    center() -> Point

Return the center anchor of the node

Source code in `src/momapy/core.py`

    776
    777
    778
    def center(self) -> momapy.geometry.Point:
        """Return the center anchor of the node"""
        return self.position

#### `` childless

    childless() -> Self

Return a copy of the node with no children

Source code in `src/momapy/core.py`

    830
    831
    832
    def childless(self) -> typing.Self:
        """Return a copy of the node with no children"""
        return dataclasses.replace(self, label=None, layout_elements=tuple([]))

#### `` children

    children() -> list[LayoutElement]

Return the children of the group layout. These are the self children of the group layout (returned by the `self_children` method) and the other children of the group layout (given by the `layout_elements` attribute)

Source code in `src/momapy/core.py`

    566
    567
    568
    569
    570
    def children(self) -> list[LayoutElement]:
        """Return the children of the group layout.
        These are the self children of the group layout (returned by the `self_children` method) and the other children of the group layout (given by the `layout_elements` attribute)
        """
        return self.self_children() + list(self.layout_elements)

#### `` contains

    contains(other: LayoutElement) -> bool

Return `true` if another layout element is a descendant of the layout element, `false` otherwise

Source code in `src/momapy/core.py`

    119
    120
    121
    def contains(self, other: "LayoutElement") -> bool:
        """Return `true` if another layout element is a descendant of the layout element, `false` otherwise"""
        return other in self.descendants()

#### `` descendants

    descendants() -> list[LayoutElement]

Return the descendants of the layout element

Source code in `src/momapy/core.py`

    90
    91
    92
    93
    94
    95
    96
    def descendants(self) -> list["LayoutElement"]:
        """Return the descendants of the layout element"""
        descendants = []
        for child in self.children():
            descendants.append(child)
            descendants += child.descendants()
        return descendants

#### `` drawing_elements

    drawing_elements() -> list[DrawingElement]

Return the drawing elements of the group layout. The returned drawing elements are a group drawing element formed of the self drawing elements of the group layout and the drawing elements of its children

Source code in `src/momapy/core.py`

    538
    539
    540
    541
    542
    543
    544
    545
    546
    547
    548
    549
    550
    551
    552
    553
    554
    555
    556
    557
    558
    559
    560
    561
    562
    563
    564
    def drawing_elements(self) -> list[momapy.drawing.DrawingElement]:
        """Return the drawing elements of the group layout.
        The returned drawing elements are a group drawing element formed of the self drawing elements of the group layout and the drawing elements of its children
        """
        drawing_elements = self.self_drawing_elements()
        for child in self.children():
            if child is not None:
                drawing_elements += child.drawing_elements()
        group = momapy.drawing.Group(
            class_=f"{type(self).__name__}_group",
            elements=tuple(drawing_elements),
            id_=f"{self.id_}_group",
            fill=self.group_fill,
            fill_rule=self.group_fill_rule,
            filter=self.group_filter,
            font_family=self.group_font_family,
            font_size=self.group_font_size,
            font_style=self.group_font_style,
            font_weight=self.group_font_weight,
            stroke=self.group_stroke,
            stroke_dasharray=self.group_stroke_dasharray,
            stroke_dashoffset=self.group_stroke_dashoffset,
            stroke_width=self.group_stroke_width,
            text_anchor=self.group_text_anchor,
            transform=self.group_transform,
        )
        return [group]

#### `` east

    east() -> Point

Return the east anchor of the node

Source code in `src/momapy/core.py`

    708
    709
    710
    def east(self) -> momapy.geometry.Point:
        """Return the east anchor of the node"""
        return self.self_angle(0)

#### `` east_north_east

    east_north_east() -> Point

Return the east north east anchor of the node

Source code in `src/momapy/core.py`

    700
    701
    702
    703
    704
    705
    706
    def east_north_east(self) -> momapy.geometry.Point:
        """Return the east north east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, -self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` east_south_east

    east_south_east() -> Point

Return the east south east west anchor of the node

Source code in `src/momapy/core.py`

    712
    713
    714
    715
    716
    717
    718
    def east_south_east(self) -> momapy.geometry.Point:
        """Return the east south east west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` equals

    equals(
        other: LayoutElement,
        flattened: bool = False,
        unordered: bool = False,
    ) -> bool

Return `true` if the layout element is equal to another layout element, `false` otherwise

Source code in `src/momapy/core.py`

    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    def equals(
        self, other: "LayoutElement", flattened: bool = False, unordered: bool = False
    ) -> bool:
        """Return `true` if the layout element is equal to another layout element, `false` otherwise"""
        if type(self) is type(other):
            if not flattened:
                return self == other
            else:
                if not unordered:
                    return self.flattened() == other.flattened()
                else:
                    return set(self.flattened()) == set(other.flattened())
        return False

#### `` flattened

    flattened() -> list[LayoutElement]

Return a list containing copy of the layout element with no children and all its descendants with no children

Source code in `src/momapy/core.py`

     98
     99
    100
    101
    102
    103
    def flattened(self) -> list["LayoutElement"]:
        """Return a list containing copy of the layout element with no children and all its descendants with no children"""
        flattened = [self.childless()]
        for child in self.children():
            flattened += child.flattened()
        return flattened

#### `` label_center

    label_center() -> Point

Return the label center anchor of the node

Source code in `src/momapy/core.py`

    780
    781
    782
    def label_center(self) -> momapy.geometry.Point:
        """Return the label center anchor of the node"""
        return self.position

#### `` north

    north() -> Point

Return the north anchor of the node

Source code in `src/momapy/core.py`

    680
    681
    682
    def north(self) -> momapy.geometry.Point:
        """Return the north anchor of the node"""
        return self.self_angle(90)

#### `` north_east

    north_east() -> Point

Return the north east anchor of the node

Source code in `src/momapy/core.py`

    692
    693
    694
    695
    696
    697
    698
    def north_east(self) -> momapy.geometry.Point:
        """Return the north east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, -self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` north_north_east

    north_north_east() -> Point

Return the north north east anchor of the node

Source code in `src/momapy/core.py`

    684
    685
    686
    687
    688
    689
    690
    def north_north_east(self) -> momapy.geometry.Point:
        """Return the north north east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 4, -self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` north_north_west

    north_north_west() -> Point

Return the north north west anchor of the node

Source code in `src/momapy/core.py`

    672
    673
    674
    675
    676
    677
    678
    def north_north_west(self) -> momapy.geometry.Point:
        """Return the north north west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() - (self.width / 4, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` north_west

    north_west() -> Point

Return the north west anchor of the node

Source code in `src/momapy/core.py`

    664
    665
    666
    667
    668
    669
    670
    def north_west(self) -> momapy.geometry.Point:
        """Return the north west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() - (self.width / 2, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` self_angle

    self_angle(
        angle: float,
        unit: Literal["degrees", "radians"] = "degrees",
    ) -> Point

Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.

Source code in `src/momapy/core.py`

    804
    805
    806
    807
    808
    809
    810
    811
    812
    813
    814
    815
    def self_angle(
        self,
        angle: float,
        unit: typing.Literal["degrees", "radians"] = "degrees",
    ) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal."""
        return momapy.drawing.get_drawing_elements_angle(
            drawing_elements=self.self_drawing_elements(),
            angle=angle,
            unit=unit,
            center=self.center(),
        )

#### `` self_bbox

    self_bbox() -> Bbox

Compute and return the bounding box of the self drawing element of the group layout

Source code in `src/momapy/core.py`

    499
    500
    501
    502
    def self_bbox(self) -> momapy.geometry.Bbox:
        """Compute and return the bounding box of the self drawing element of the group layout"""
        bounds = self.self_to_shapely().bounds
        return momapy.geometry.Bbox.from_bounds(bounds)

#### `` self_border

    self_border(point: Point) -> Point

Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point. When there are multiple intersection points, the one closest to the given point is returned

Source code in `src/momapy/core.py`

    784
    785
    786
    787
    788
    789
    790
    791
    792
    def self_border(self, point: momapy.geometry.Point) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point.
        When there are multiple intersection points, the one closest to the given point is returned
        """
        return momapy.drawing.get_drawing_elements_border(
            drawing_elements=self.self_drawing_elements(),
            point=point,
            center=self.center(),
        )

#### `` self_children

    self_children() -> list[LayoutElement]

Return the self children of the node. A node has unique child that is its label

Source code in `src/momapy/core.py`

    654
    655
    656
    657
    658
    def self_children(self) -> list[LayoutElement]:
        """Return the self children of the node. A node has unique child that is its label"""
        if self.label is not None:
            return [self.label]
        return []

#### `` self_drawing_elements

    self_drawing_elements() -> list[DrawingElement]

Return the node's own drawing elements

Source code in `src/momapy/core.py`

    637
    638
    639
    640
    641
    642
    643
    644
    645
    646
    647
    648
    649
    650
    651
    652
    def self_drawing_elements(self) -> list[momapy.drawing.DrawingElement]:
        """Return the node's own drawing elements"""
        drawing_elements = self._border_drawing_elements()
        group = momapy.drawing.Group(
            class_=type(self).__name__,
            elements=tuple(drawing_elements),
            fill=self.fill,
            filter=self.filter,
            id_=self.id_,
            stroke=self.stroke,
            stroke_dasharray=self.stroke_dasharray,
            stroke_dashoffset=self.stroke_dashoffset,
            stroke_width=self.stroke_width,
            transform=self.transform,
        )
        return [group]

#### `` self_to_shapely

    self_to_shapely() -> GeometryCollection

Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout

Source code in `src/momapy/core.py`

    495
    496
    497
    def self_to_shapely(self) -> shapely.GeometryCollection:
        """Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout"""
        return momapy.drawing.drawing_elements_to_shapely(self.drawing_elements())

#### `` size

    size() -> tuple[float, float]

Return the size of the node

Source code in `src/momapy/core.py`

    660
    661
    662
    def size(self) -> tuple[float, float]:
        """Return the size of the node"""
        return (self.width, self.height)

#### `` south

    south() -> Point

Return the south anchor of the node

Source code in `src/momapy/core.py`

    736
    737
    738
    def south(self) -> momapy.geometry.Point:
        """Return the south anchor of the node"""
        return self.self_angle(270)

#### `` south_east

    south_east() -> Point

Return the south east anchor of the node

Source code in `src/momapy/core.py`

    720
    721
    722
    723
    724
    725
    726
    def south_east(self) -> momapy.geometry.Point:
        """Return the south east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` south_south_east

    south_south_east() -> Point

Return the south south east anchor of the node

Source code in `src/momapy/core.py`

    728
    729
    730
    731
    732
    733
    734
    def south_south_east(self) -> momapy.geometry.Point:
        """Return the south south east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 4, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` south_south_west

    south_south_west() -> Point

Return the south south west anchor of the node

Source code in `src/momapy/core.py`

    740
    741
    742
    743
    744
    745
    746
    def south_south_west(self) -> momapy.geometry.Point:
        """Return the south south west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (-self.width / 4, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` south_west

    south_west() -> Point

Return the south west anchor of the node

Source code in `src/momapy/core.py`

    748
    749
    750
    751
    752
    753
    754
    def south_west(self) -> momapy.geometry.Point:
        """Return the south west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (-self.width / 2, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` to_shapely

    to_shapely(to_polygons: bool = False) -> GeometryCollection

Return a shapely collection of geometries reproducing the drawing elements of the layout element

Source code in `src/momapy/core.py`

    123
    124
    125
    126
    127
    128
    def to_shapely(self, to_polygons: bool = False) -> shapely.GeometryCollection:
        """Return a shapely collection of geometries reproducing the drawing elements of the layout element"""
        geom_collection = []
        for drawing_element in self.drawing_elements():
            geom_collection += drawing_element.to_shapely(to_polygons=to_polygons).geoms
        return shapely.GeometryCollection(geom_collection)

#### `` west

    west() -> Point

Return the west anchor of the node

Source code in `src/momapy/core.py`

    764
    765
    766
    def west(self) -> momapy.geometry.Point:
        """Return the west anchor of the node"""
        return self.self_angle(180)

#### `` west_north_west

    west_north_west() -> Point

Return the west north west anchor of the node

Source code in `src/momapy/core.py`

    768
    769
    770
    771
    772
    773
    774
    def west_north_west(self) -> momapy.geometry.Point:
        """Return the west north west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() - (self.width / 2, self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` west_south_west

    west_south_west() -> Point

Return the west south west anchor of the node

Source code in `src/momapy/core.py`

    756
    757
    758
    759
    760
    761
    762
    def west_south_west(self) -> momapy.geometry.Point:
        """Return the west south west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (-self.width / 2, self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` x `property`

    x: float

Return the x coordinate of the node

#### `` y `property`

    y: float

Return the y coordinate of the node

### `` EntityPool `dataclass`

    EntityPool(
        *,
        id_: str = make_uuid4_as_str(),
        compartment: Compartment | None = None,
    )

Bases: `SBGNModelElement`

Base class for entity pools

Parameters:

Name | Type | Description | Default
--- | --- | --- | ---
`id_` | `str` | The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element | `'3588570e-4389-465e-8218-9dd967d175ec'`
`compartment` | `Compartment | None` | The compartment of the entity pool | `None`

### `` EquivalenceArcLayout `dataclass`

    EquivalenceArcLayout(
        path_fill: NoneValueType | Color | None = NoneValue,
        path_stroke: NoneValueType | Color | None = black,
        path_stroke_width: float | None = 1.25,
        arrowhead_fill: NoneValueType | Color | None = white,
        arrowhead_stroke: NoneValueType | Color | None = black,
        arrowhead_stroke_width: float | None = 1.25,
        *,
        id_: str = make_uuid4_as_str(),
        layout_elements: tuple[LayoutElement] = tuple(),
        group_fill: NoneValueType | Color | None = None,
        group_fill_rule: FillRule | None = None,
        group_filter: NoneValueType | Filter | None = None,
        group_font_family: str | None = None,
        group_font_size: float | None = None,
        group_font_style: FontStyle | None = None,
        group_font_weight: FontWeight | float | None = None,
        group_stroke: NoneValueType | Color | None = None,
        group_stroke_dasharray: tuple[float, ...] | None = None,
        group_stroke_dashoffset: float | None = None,
        group_stroke_width: float | None = None,
        group_text_anchor: TextAnchor | None = None,
        group_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        end_shorten: float = 0.0,
        fill: NoneValueType | Color | None = None,
        filter: NoneValueType | Filter | None = None,
        path_filter: NoneValueType | Filter | None = None,
        path_stroke_dasharray: tuple[float, ...] | None = None,
        path_stroke_dashoffset: float | None = None,
        path_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        stroke: NoneValueType | Color | None = None,
        stroke_dasharray: NoneValueType
        | tuple[float]
        | None = None,
        stroke_dashoffset: float | None = None,
        stroke_width: float | None = None,
        segments: tuple[
            Segment | BezierCurve | EllipticalArc
        ] = tuple(),
        source: LayoutElement | None = None,
        start_shorten: float = 0.0,
        target: LayoutElement | None = None,
        transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        arrowhead_filter: NoneValueType | Filter | None = None,
        arrowhead_stroke_dasharray: tuple[float, ...]
        | None = None,
        arrowhead_stroke_dashoffset: float | None = None,
        arrowhead_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
    )

Bases: `SBGNSingleHeadedArc`

Class for equivalence arc layouts

Parameters:

Name | Type | Description | Default
--- | --- | --- | ---
`id_` | `str` | The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element | `'d71ecd6c-25a4-4c26-aa40-d5be08b3dd9b'`
`layout_elements` | `tuple[LayoutElement]` | The sub-layout elements of the group layout. These are part of the children of the group layout | `<dynamic>`
`group_fill` | `NoneValueType | Color | None` | The fill color of the group layout | `None`
`group_fill_rule` | `FillRule | None` | The fill rule of the group layout | `None`
`group_filter` | `NoneValueType | Filter | None` | The filter of the group layout | `None`
`group_font_family` | `str | None` | The font family of the group layout | `None`
`group_font_size` | `float | None` | The font size of the group layout | `None`
`group_font_style` | `FontStyle | None` | The font style of the group layout | `None`
`group_font_weight` | `FontWeight | float | None` | The font weight of the group layout | `None`
`group_stroke` | `NoneValueType | Color | None` | The stroke color of the group layout | `None`
`group_stroke_dasharray` | `tuple[float, ...] | None` | The stroke dasharray of the group layout | `None`
`group_stroke_dashoffset` | `float | None` | The stroke dashoffset of the group layout | `None`
`group_stroke_width` | `float | None` | The stroke width of the group layout | `None`
`group_text_anchor` | `TextAnchor | None` | The text anchor of the group layout | `None`
`group_transform` | `NoneValueType | tuple[Transformation] | None` | The transform of the group layout | `None`
`end_shorten` | `float` | The length the end of the arc will be shorten by | `0.0`
`fill` | `NoneValueType | Color | None` | The fill color of the arc | `None`
`filter` | `NoneValueType | Filter | None` | The fill filter of the arc | `None`
`path_fill` | `NoneValueType | Color | None` |  | `<momapy.drawing.NoneValueType object at 0x7fb32ae9f1d0>`
`path_filter` | `NoneValueType | Filter | None` | The path filter of the arc | `None`
`path_stroke` | `NoneValueType | Color | None` |  | `Color(red=0, green=0, blue=0, alpha=1.0)`
`path_stroke_dasharray` | `tuple[float, ...] | None` | The path stroke dasharray of the arc | `None`
`path_stroke_dashoffset` | `float | None` | The path stroke dashoffset of the arc | `None`
`path_stroke_width` | `float | None` |  | `1.25`
`path_transform` | `NoneValueType | tuple[Transformation] | None` | The path transform of the arc | `None`
`stroke` | `NoneValueType | Color | None` | The stroke color of the arc | `None`
`stroke_dasharray` | `NoneValueType | tuple[float] | None` | The stroke dasharray of the arc | `None`
`stroke_dashoffset` | `float | None` | The stroke dashoffset of the arc | `None`
`stroke_width` | `float | None` | The stroke width of the arc | `None`
`segments` | `tuple[Union[Segment, BezierCurve, EllipticalArc]]` | The path segments of the arc | `<dynamic>`
`source` | `LayoutElement | None` | The source of the arc | `None`
`start_shorten` | `float` | The length the start of the arc will be shorten by | `0.0`
`target` | `LayoutElement | None` | The target of the arc | `None`
`transform` | `NoneValueType | tuple[Transformation] | None` | The transform of the arc | `None`
`arrowhead_fill` | `NoneValueType | Color | None` |  | `Color(red=255, green=255, blue=255, alpha=1.0)`
`arrowhead_filter` | `NoneValueType | Filter | None` | The arrowhead filter of the arc | `None`
`arrowhead_stroke` | `NoneValueType | Color | None` |  | `Color(red=0, green=0, blue=0, alpha=1.0)`
`arrowhead_stroke_dasharray` | `tuple[float, ...] | None` | The arrowhead stroke dasharray of the arc | `None`
`arrowhead_stroke_dashoffset` | `float | None` | The arrowhead stroke dashoffset of the arc | `None`
`arrowhead_stroke_width` | `float | None` |  | `1.25`
`arrowhead_transform` | `NoneValueType | tuple[Transformation] | None` | The arrowhead transform of the arc | `None`

Methods:

Name | Description
--- | ---
`anchor_point` | Return an anchor point of the layout element
`arrowhead_base` | Return the arrowhead base anchor point of the single-headed arc
`arrowhead_bbox` | Return the bounding box of the single-headed arc arrowhead
`arrowhead_border` | Return the point at the intersection of the drawing elements of the single-headed arc arrowhead and the line going through the center of these drawing elements and the given point.
`arrowhead_drawing_elements` | Return the drawing elements of the single-headed arc arrowhead
`arrowhead_length` | Return the length of the single-headed arc arrowhead
`arrowhead_tip` | Return the arrowhead tip anchor point of the single-headed arc
`bbox` | Compute and return the bounding box of the group layout element
`childless` | Return a copy of the arc with no children
`children` | Return the children of the group layout.
`contains` | Return `true` if another layout element is a descendant of the layout element, `false` otherwise
`descendants` | Return the descendants of the layout element
`drawing_elements` | Return the drawing elements of the group layout.
`end_point` | Return the ending point of the arc
`equals` | Return `true` if the layout element is equal to another layout element, `false` otherwise
`flattened` | Return a list containing copy of the layout element with no children and all its descendants with no children
`fraction` | Return the position and angle on the arc at a given fraction (of the total arc length)
`length` | Return the total length of the arc path
`path_drawing_elements` | Return the drawing elements of the single-headed arc path
`points` | Return the points of the arc path
`self_bbox` | Compute and return the bounding box of the self drawing element of the group layout
`self_children` | Return the self children of the arc
`self_drawing_elements` | Return the self drawing elements of the single-headed arc
`self_to_shapely` | Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout
`start_point` | Return the starting point of the arc
`to_shapely` | Return a shapely collection of geometries reproducing the drawing elements of the layout element

#### `` anchor_point

    anchor_point(anchor_name: str) -> Point

Return an anchor point of the layout element

Source code in `src/momapy/core.py`

    130
    131
    132
    def anchor_point(self, anchor_name: str) -> momapy.geometry.Point:
        """Return an anchor point of the layout element"""
        return getattr(self, anchor_name)()

#### `` arrowhead_base

    arrowhead_base() -> Point

Return the arrowhead base anchor point of the single-headed arc

Source code in `src/momapy/core.py`

    1058
    1059
    1060
    1061
    1062
    1063
    1064
    1065
    1066
    def arrowhead_base(self) -> momapy.geometry.Point:
        """Return the arrowhead base anchor point of the single-headed arc"""
        arrowhead_length = self.arrowhead_length()
        segment = self.segments[-1]
        segment_length = segment.length()
        if segment_length == 0:
            return self.arrowhead_tip() - (arrowhead_length, 0)
        fraction = 1 - (arrowhead_length + self.end_shorten) / segment_length
        return segment.get_position_at_fraction(fraction)

#### `` arrowhead_bbox

    arrowhead_bbox() -> Bbox

Return the bounding box of the single-headed arc arrowhead

Source code in `src/momapy/core.py`

    1068
    1069
    1070
    1071
    1072
    def arrowhead_bbox(self) -> momapy.geometry.Bbox:
        """Return the bounding box of the single-headed arc arrowhead"""
        return momapy.drawing.get_drawing_elements_bbox(
            self.arrowhead_drawing_elements()
        )

#### `` arrowhead_border

    arrowhead_border(point) -> Point

Return the point at the intersection of the drawing elements of the single-headed arc arrowhead and the line going through the center of these drawing elements and the given point. When there are multiple intersection points, the one closest to the given point is returned

Source code in `src/momapy/core.py`

    1074
    1075
    1076
    1077
    1078
    1079
    1080
    1081
    1082
    1083
    1084
    def arrowhead_border(self, point) -> momapy.geometry.Point:
        """Return the point at the intersection of the drawing elements of the single-headed arc arrowhead and the line going through the center of these drawing elements and the given point.
        When there are multiple intersection points, the one closest to the given point is returned
        """

        point = momapy.drawing.get_drawing_elements_border(
            self.arrowhead_drawing_elements(), point
        )
        if point is None:
            return self.arrowhead_tip()
        return point

#### `` arrowhead_drawing_elements

    arrowhead_drawing_elements() -> list[DrawingElement]

Return the drawing elements of the single-headed arc arrowhead

Source code in `src/momapy/core.py`

    1108
    1109
    1110
    1111
    1112
    1113
    1114
    1115
    1116
    1117
    1118
    1119
    1120
    1121
    1122
    1123
    1124
    1125
    1126
    1127
    def arrowhead_drawing_elements(
        self,
    ) -> list[momapy.drawing.DrawingElement]:
        """Return the drawing elements of the single-headed arc arrowhead"""
        drawing_elements = self._arrowhead_border_drawing_elements()
        group = momapy.drawing.Group(
            class_=f"{type(self).__name__}_arrowhead",
            elements=tuple(drawing_elements),
            fill=self.arrowhead_fill,
            filter=self.arrowhead_filter,
            id_=f"{self.id_}_arrowhead",
            stroke=self.arrowhead_stroke,
            stroke_dasharray=self.arrowhead_stroke_dasharray,
            stroke_dashoffset=self.arrowhead_stroke_dashoffset,
            stroke_width=self.arrowhead_stroke_width,
            transform=self.arrowhead_transform,
        )
        transformation = self._get_arrowhead_transformation()
        group = group.transformed(transformation)
        return [group]

#### `` arrowhead_length

    arrowhead_length() -> float

Return the length of the single-headed arc arrowhead

Source code in `src/momapy/core.py`

    1040
    1041
    1042
    1043
    1044
    1045
    1046
    1047
    def arrowhead_length(self) -> float:
        """Return the length of the single-headed arc arrowhead"""
        bbox = momapy.drawing.get_drawing_elements_bbox(
            self._arrowhead_border_drawing_elements()
        )
        if math.isnan(bbox.width):
            return 0.0
        return bbox.east().x

#### `` arrowhead_tip

    arrowhead_tip() -> Point

Return the arrowhead tip anchor point of the single-headed arc

Source code in `src/momapy/core.py`

    1049
    1050
    1051
    1052
    1053
    1054
    1055
    1056
    def arrowhead_tip(self) -> momapy.geometry.Point:
        """Return the arrowhead tip anchor point of the single-headed arc"""
        segment = self.segments[-1]
        segment_length = segment.length()
        if segment_length == 0:
            return segment.p2
        fraction = 1 - self.end_shorten / segment_length
        return segment.get_position_at_fraction(fraction)

#### `` bbox

    bbox() -> Bbox

Compute and return the bounding box of the group layout element

Source code in `src/momapy/core.py`

    504
    505
    506
    507
    508
    509
    510
    511
    512
    513
    514
    515
    516
    517
    518
    519
    520
    521
    522
    523
    524
    525
    526
    def bbox(self) -> momapy.geometry.Bbox:
        """Compute and return the bounding box of the group layout element"""
        self_bbox = self.self_bbox()
        bboxes = [child.bbox() for child in self.children()]
        min_x = self_bbox.north_west().x
        min_y = self_bbox.north_west().y
        max_x = self_bbox.south_east().x
        max_y = self_bbox.south_east().y
        for bbox in bboxes:
            if bbox.north_west().x < min_x:
                min_x = bbox.north_west().x
            if bbox.north_west().y < min_y:
                min_y = bbox.north_west().y
            if bbox.south_east().x > max_x:
                max_x = bbox.south_east().x
            if bbox.south_east().y > max_y:
                max_y = bbox.south_east().y
        bbox = momapy.geometry.Bbox(
            momapy.geometry.Point(min_x / 2 + max_x / 2, min_y / 2 + max_y / 2),
            max_x - min_x,
            max_y - min_y,
        )
        return bbox

#### `` childless

    childless() -> Self

Return a copy of the arc with no children

Source code in `src/momapy/core.py`

    955
    956
    957
    def childless(self) -> typing.Self:
        """Return a copy of the arc with no children"""
        return dataclasses.replace(self, layout_elements=tuple([]))

#### `` children

    children() -> list[LayoutElement]

Return the children of the group layout. These are the self children of the group layout (returned by the `self_children` method) and the other children of the group layout (given by the `layout_elements` attribute)

Source code in `src/momapy/core.py`

    566
    567
    568
    569
    570
    def children(self) -> list[LayoutElement]:
        """Return the children of the group layout.
        These are the self children of the group layout (returned by the `self_children` method) and the other children of the group layout (given by the `layout_elements` attribute)
        """
        return self.self_children() + list(self.layout_elements)

#### `` contains

    contains(other: LayoutElement) -> bool

Return `true` if another layout element is a descendant of the layout element, `false` otherwise

Source code in `src/momapy/core.py`

    119
    120
    121
    def contains(self, other: "LayoutElement") -> bool:
        """Return `true` if another layout element is a descendant of the layout element, `false` otherwise"""
        return other in self.descendants()

#### `` descendants

    descendants() -> list[LayoutElement]

Return the descendants of the layout element

Source code in `src/momapy/core.py`

    90
    91
    92
    93
    94
    95
    96
    def descendants(self) -> list["LayoutElement"]:
        """Return the descendants of the layout element"""
        descendants = []
        for child in self.children():
            descendants.append(child)
            descendants += child.descendants()
        return descendants

#### `` drawing_elements

    drawing_elements() -> list[DrawingElement]

Return the drawing elements of the group layout. The returned drawing elements are a group drawing element formed of the self drawing elements of the group layout and the drawing elements of its children

Source code in `src/momapy/core.py`

    538
    539
    540
    541
    542
    543
    544
    545
    546
    547
    548
    549
    550
    551
    552
    553
    554
    555
    556
    557
    558
    559
    560
    561
    562
    563
    564
    def drawing_elements(self) -> list[momapy.drawing.DrawingElement]:
        """Return the drawing elements of the group layout.
        The returned drawing elements are a group drawing element formed of the self drawing elements of the group layout and the drawing elements of its children
        """
        drawing_elements = self.self_drawing_elements()
        for child in self.children():
            if child is not None:
                drawing_elements += child.drawing_elements()
        group = momapy.drawing.Group(
            class_=f"{type(self).__name__}_group",
            elements=tuple(drawing_elements),
            id_=f"{self.id_}_group",
            fill=self.group_fill,
            fill_rule=self.group_fill_rule,
            filter=self.group_filter,
            font_family=self.group_font_family,
            font_size=self.group_font_size,
            font_style=self.group_font_style,
            font_weight=self.group_font_weight,
            stroke=self.group_stroke,
            stroke_dasharray=self.group_stroke_dasharray,
            stroke_dashoffset=self.group_stroke_dashoffset,
            stroke_width=self.group_stroke_width,
            text_anchor=self.group_text_anchor,
            transform=self.group_transform,
        )
        return [group]

#### `` end_point

    end_point() -> Point

Return the ending point of the arc

Source code in `src/momapy/core.py`

    951
    952
    953
    def end_point(self) -> momapy.geometry.Point:
        """Return the ending point of the arc"""
        return self.points()[-1]

#### `` equals

    equals(
        other: LayoutElement,
        flattened: bool = False,
        unordered: bool = False,
    ) -> bool

Return `true` if the layout element is equal to another layout element, `false` otherwise

Source code in `src/momapy/core.py`

    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    def equals(
        self, other: "LayoutElement", flattened: bool = False, unordered: bool = False
    ) -> bool:
        """Return `true` if the layout element is equal to another layout element, `false` otherwise"""
        if type(self) is type(other):
            if not flattened:
                return self == other
            else:
                if not unordered:
                    return self.flattened() == other.flattened()
                else:
                    return set(self.flattened()) == set(other.flattened())
        return False

#### `` flattened

    flattened() -> list[LayoutElement]

Return a list containing copy of the layout element with no children and all its descendants with no children

Source code in `src/momapy/core.py`

     98
     99
    100
    101
    102
    103
    def flattened(self) -> list["LayoutElement"]:
        """Return a list containing copy of the layout element with no children and all its descendants with no children"""
        flattened = [self.childless()]
        for child in self.children():
            flattened += child.flattened()
        return flattened

#### `` fraction

    fraction(fraction: float) -> tuple[Point, float]

Return the position and angle on the arc at a given fraction (of the total arc length)

Source code in `src/momapy/core.py`

    959
    960
    961
    962
    963
    964
    965
    966
    967
    968
    def fraction(self, fraction: float) -> tuple[momapy.geometry.Point, float]:
        """Return the position and angle on the arc at a given fraction (of the total arc length)"""
        current_length = 0
        length_to_reach = fraction * self.length()
        for segment in self.segments:
            current_length += segment.length()
            if current_length >= length_to_reach:
                break
        position, angle = segment.get_position_and_angle_at_fraction(fraction)
        return position, angle

#### `` length

    length()

Return the total length of the arc path

Source code in `src/momapy/core.py`

    943
    944
    945
    def length(self):
        """Return the total length of the arc path"""
        return sum([segment.length() for segment in self.segments])

#### `` path_drawing_elements

    path_drawing_elements() -> list[Path]

Return the drawing elements of the single-headed arc path

Source code in `src/momapy/core.py`

    1129
    1130
    1131
    1132
    1133
    1134
    1135
    1136
    1137
    1138
    1139
    1140
    1141
    1142
    1143
    1144
    1145
    1146
    1147
    1148
    1149
    1150
    1151
    1152
    1153
    1154
    1155
    1156
    1157
    1158
    1159
    1160
    1161
    1162
    1163
    1164
    1165
    1166
    1167
    def path_drawing_elements(self) -> list[momapy.drawing.Path]:
        """Return the drawing elements of the single-headed arc path"""
        arrowhead_length = self.arrowhead_length()
        if len(self.segments) == 1:
            segment = (
                self.segments[0]
                .shortened(self.start_shorten, "start")
                .shortened(self.end_shorten + arrowhead_length, "end")
            )
            actions = [
                momapy.drawing.MoveTo(segment.p1),
                self._make_path_action_from_segment(segment),
            ]
        else:
            first_segment = self.segments[0].shortened(self.start_shorten, "start")
            last_segment = self.segments[-1].shortened(
                self.end_shorten + arrowhead_length, "end"
            )
            actions = [
                momapy.drawing.MoveTo(first_segment.p1),
                self._make_path_action_from_segment(first_segment),
            ]
            for segment in self.segments[1:-1]:
                action = self._make_path_action_from_segment(segment)
                actions.append(action)
            actions.append(self._make_path_action_from_segment(last_segment))
        path = momapy.drawing.Path(
            actions=tuple(actions),
            class_=f"{type(self).__name__}_path",
            fill=self.path_fill,
            filter=self.path_filter,
            id_=f"{self.id_}_path",
            stroke=self.path_stroke,
            stroke_dasharray=self.path_stroke_dasharray,
            stroke_dashoffset=self.path_stroke_dashoffset,
            stroke_width=self.path_stroke_width,
            transform=self.path_transform,
        )
        return [path]

#### `` points

    points() -> list[Point]

Return the points of the arc path

Source code in `src/momapy/core.py`

    935
    936
    937
    938
    939
    940
    941
    def points(self) -> list[momapy.geometry.Point]:
        """Return the points of the arc path"""
        points = []
        for segment in self.segments:
            points.append(segment.p1)
        points.append(segment.p2)
        return points

#### `` self_bbox

    self_bbox() -> Bbox

Compute and return the bounding box of the self drawing element of the group layout

Source code in `src/momapy/core.py`

    499
    500
    501
    502
    def self_bbox(self) -> momapy.geometry.Bbox:
        """Compute and return the bounding box of the self drawing element of the group layout"""
        bounds = self.self_to_shapely().bounds
        return momapy.geometry.Bbox.from_bounds(bounds)

#### `` self_children

    self_children() -> list[LayoutElement]

Return the self children of the arc

Source code in `src/momapy/core.py`

    931
    932
    933
    def self_children(self) -> list[LayoutElement]:
        """Return the self children of the arc"""
        return []

#### `` self_drawing_elements

    self_drawing_elements() -> list[DrawingElement]

Return the self drawing elements of the single-headed arc

Source code in `src/momapy/core.py`

    1169
    1170
    1171
    1172
    1173
    1174
    1175
    1176
    1177
    1178
    1179
    1180
    1181
    1182
    1183
    1184
    1185
    1186
    def self_drawing_elements(self) -> list[momapy.drawing.DrawingElement]:
        """Return the self drawing elements of the single-headed arc"""
        drawing_elements = (
            self.path_drawing_elements() + self.arrowhead_drawing_elements()
        )
        group = momapy.drawing.Group(
            class_=type(self).__name__,
            elements=tuple(drawing_elements),
            fill=self.fill,
            filter=self.filter,
            id_=self.id_,
            stroke=self.stroke,
            stroke_dasharray=self.stroke_dasharray,
            stroke_dashoffset=self.stroke_dashoffset,
            stroke_width=self.stroke_width,
            transform=self.transform,
        )
        return [group]

#### `` self_to_shapely

    self_to_shapely() -> GeometryCollection

Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout

Source code in `src/momapy/core.py`

    495
    496
    497
    def self_to_shapely(self) -> shapely.GeometryCollection:
        """Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout"""
        return momapy.drawing.drawing_elements_to_shapely(self.drawing_elements())

#### `` start_point

    start_point() -> Point

Return the starting point of the arc

Source code in `src/momapy/core.py`

    947
    948
    949
    def start_point(self) -> momapy.geometry.Point:
        """Return the starting point of the arc"""
        return self.points()[0]

#### `` to_shapely

    to_shapely(to_polygons: bool = False) -> GeometryCollection

Return a shapely collection of geometries reproducing the drawing elements of the layout element

Source code in `src/momapy/core.py`

    123
    124
    125
    126
    127
    128
    def to_shapely(self, to_polygons: bool = False) -> shapely.GeometryCollection:
        """Return a shapely collection of geometries reproducing the drawing elements of the layout element"""
        geom_collection = []
        for drawing_element in self.drawing_elements():
            geom_collection += drawing_element.to_shapely(to_polygons=to_polygons).geoms
        return shapely.GeometryCollection(geom_collection)

### `` EquivalenceOperator `dataclass`

    EquivalenceOperator(
        *,
        id_: str = make_uuid4_as_str(),
        inputs: frozenset[
            EquivalenceOperatorInput
        ] = frozenset(),
        output: EquivalenceOperatorOutput | None = None,
    )

Bases: `SBGNModelElement`

Class for equivalence operators

Parameters:

Name | Type | Description | Default
--- | --- | --- | ---
`id_` | `str` | The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element | `'cb0ddab8-f692-48ea-90bd-6c038b824850'`
`inputs` | `frozenset[EquivalenceOperatorInput]` | The inputs of the equivalence operator | `<class 'frozenset'>`
`output` | `EquivalenceOperatorOutput | None` | The output of the equivalence operator | `None`

### `` EquivalenceOperatorInput `dataclass`

    EquivalenceOperatorInput(
        *, id_: str = make_uuid4_as_str(), element: EntityPool
    )

Bases: `SBGNRole`

Class for inputs of equivalence operators

Parameters:

Name | Type | Description | Default
--- | --- | --- | ---
`id_` | `str` | The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element | `'40d277bd-0aa0-4793-a786-22a5564cfa72'`
`element` | `EntityPool` | The element of the equivalence operator input | required

### `` EquivalenceOperatorLayout `dataclass`

    EquivalenceOperatorLayout(
        fill: NoneValueType | Color | None = white,
        stroke: NoneValueType | Color | None = black,
        stroke_width: float | None = 1.25,
        *,
        id_: str = make_uuid4_as_str(),
        layout_elements: tuple[LayoutElement] = tuple(),
        group_fill: NoneValueType | Color | None = None,
        group_fill_rule: FillRule | None = None,
        group_filter: NoneValueType | Filter | None = None,
        group_font_family: str | None = None,
        group_font_size: float | None = None,
        group_font_style: FontStyle | None = None,
        group_font_weight: FontWeight | float | None = None,
        group_stroke: NoneValueType | Color | None = None,
        group_stroke_dasharray: tuple[float, ...] | None = None,
        group_stroke_dashoffset: float | None = None,
        group_stroke_width: float | None = None,
        group_text_anchor: TextAnchor | None = None,
        group_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        filter: NoneValueType | Filter | None = None,
        height: float = 30.0,
        label: TextLayout | None = None,
        position: Point,
        stroke_dasharray: tuple[float, ...] | None = None,
        stroke_dashoffset: float | None = None,
        transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        width: float = 30.0,
        direction: Direction = HORIZONTAL,
        left_to_right: bool = True,
        left_connector_length: float = 10.0,
        right_connector_length: float = 10.0,
        left_connector_stroke: NoneValueType
        | Color
        | None = None,
        left_connector_stroke_width: float | None = None,
        left_connector_stroke_dasharray: NoneValueType
        | tuple[float]
        | None = None,
        left_connector_stroke_dashoffset: float | None = None,
        left_connector_fill: NoneValueType
        | Color
        | None = None,
        left_connector_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        left_connector_filter: NoneValueType
        | Filter
        | None = None,
        right_connector_stroke: NoneValueType
        | Color
        | None = None,
        right_connector_stroke_width: float | None = None,
        right_connector_stroke_dasharray: NoneValueType
        | tuple[float]
        | None = None,
        right_connector_stroke_dashoffset: float | None = None,
        right_connector_fill: NoneValueType
        | Color
        | None = None,
        right_connector_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        right_connector_filter: NoneValueType
        | Filter
        | None = None,
    )

Bases: `_ConnectorsMixin`, `_SimpleMixin`, `_TextMixin`, `SBGNNode`

Class for equivalence operator layouts

Parameters:

Name | Type | Description | Default
--- | --- | --- | ---
`id_` | `str` | The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element | `'68a336ad-90f9-4a35-84e0-0a38ed9dce12'`
`layout_elements` | `tuple[LayoutElement]` | The sub-layout elements of the group layout. These are part of the children of the group layout | `<dynamic>`
`group_fill` | `NoneValueType | Color | None` | The fill color of the group layout | `None`
`group_fill_rule` | `FillRule | None` | The fill rule of the group layout | `None`
`group_filter` | `NoneValueType | Filter | None` | The filter of the group layout | `None`
`group_font_family` | `str | None` | The font family of the group layout | `None`
`group_font_size` | `float | None` | The font size of the group layout | `None`
`group_font_style` | `FontStyle | None` | The font style of the group layout | `None`
`group_font_weight` | `FontWeight | float | None` | The font weight of the group layout | `None`
`group_stroke` | `NoneValueType | Color | None` | The stroke color of the group layout | `None`
`group_stroke_dasharray` | `tuple[float, ...] | None` | The stroke dasharray of the group layout | `None`
`group_stroke_dashoffset` | `float | None` | The stroke dashoffset of the group layout | `None`
`group_stroke_width` | `float | None` | The stroke width of the group layout | `None`
`group_text_anchor` | `TextAnchor | None` | The text anchor of the group layout | `None`
`group_transform` | `NoneValueType | tuple[Transformation] | None` | The transform of the group layout | `None`
`fill` | `NoneValueType | Color | None` |  | `Color(red=255, green=255, blue=255, alpha=1.0)`
`filter` | `NoneValueType | Filter | None` | The filter of the node | `None`
`height` | `float` |  | `30.0`
`label` | `TextLayout | None` | The label of the node | `None`
`position` | `Point` | The position of the node | required
`stroke` | `NoneValueType | Color | None` |  | `Color(red=0, green=0, blue=0, alpha=1.0)`
`stroke_dasharray` | `tuple[float, ...] | None` | The stroke dasharray of the node | `None`
`stroke_dashoffset` | `float | None` | The stroke dashoffset of the node | `None`
`stroke_width` | `float | None` |  | `1.25`
`transform` | `NoneValueType | tuple[Transformation] | None` | The transform of the node | `None`
`width` | `float` |  | `30.0`
`direction` | `Direction` |  | `<Direction.HORIZONTAL: 1>`
`left_to_right` | `bool` |  | `True`
`left_connector_length` | `float` |  | `10.0`
`right_connector_length` | `float` |  | `10.0`
`left_connector_stroke` | `NoneValueType | Color | None` |  | `None`
`left_connector_stroke_width` | `float | None` |  | `None`
`left_connector_stroke_dasharray` | `NoneValueType | tuple[float] | None` |  | `None`
`left_connector_stroke_dashoffset` | `float | None` |  | `None`
`left_connector_fill` | `NoneValueType | Color | None` |  | `None`
`left_connector_transform` | `NoneValueType | tuple[Transformation] | None` |  | `None`
`left_connector_filter` | `NoneValueType | Filter | None` |  | `None`
`right_connector_stroke` | `NoneValueType | Color | None` |  | `None`
`right_connector_stroke_width` | `float | None` |  | `None`
`right_connector_stroke_dasharray` | `NoneValueType | tuple[float] | None` |  | `None`
`right_connector_stroke_dashoffset` | `float | None` |  | `None`
`right_connector_fill` | `NoneValueType | Color | None` |  | `None`
`right_connector_transform` | `NoneValueType | tuple[Transformation] | None` |  | `None`
`right_connector_filter` | `NoneValueType | Filter | None` |  | `None`

Methods:

Name | Description
--- | ---
`anchor_point` | Return an anchor point of the layout element
`angle` | Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.
`bbox` | Compute and return the bounding box of the group layout element
`border` | Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point.
`center` | Return the center anchor of the node
`childless` | Return a copy of the node with no children
`children` | Return the children of the group layout.
`contains` | Return `true` if another layout element is a descendant of the layout element, `false` otherwise
`descendants` | Return the descendants of the layout element
`drawing_elements` | Return the drawing elements of the group layout.
`east_north_east` | Return the east north east anchor of the node
`east_south_east` | Return the east south east west anchor of the node
`equals` | Return `true` if the layout element is equal to another layout element, `false` otherwise
`flattened` | Return a list containing copy of the layout element with no children and all its descendants with no children
`label_center` | Return the label center anchor of the node
`north_east` | Return the north east anchor of the node
`north_north_east` | Return the north north east anchor of the node
`north_north_west` | Return the north north west anchor of the node
`north_west` | Return the north west anchor of the node
`self_angle` | Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.
`self_bbox` | Compute and return the bounding box of the self drawing element of the group layout
`self_border` | Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point.
`self_children` | Return the self children of the node. A node has unique child that is its label
`self_drawing_elements` | Return the node's own drawing elements
`self_to_shapely` | Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout
`size` | Return the size of the node
`south_east` | Return the south east anchor of the node
`south_south_east` | Return the south south east anchor of the node
`south_south_west` | Return the south south west anchor of the node
`south_west` | Return the south west anchor of the node
`to_shapely` | Return a shapely collection of geometries reproducing the drawing elements of the layout element
`west_north_west` | Return the west north west anchor of the node
`west_south_west` | Return the west south west anchor of the node

Attributes:

Name | Type | Description
--- | --- | ---
`x` | `float` | Return the x coordinate of the node
`y` | `float` | Return the y coordinate of the node

#### `` anchor_point

    anchor_point(anchor_name: str) -> Point

Return an anchor point of the layout element

Source code in `src/momapy/core.py`

    130
    131
    132
    def anchor_point(self, anchor_name: str) -> momapy.geometry.Point:
        """Return an anchor point of the layout element"""
        return getattr(self, anchor_name)()

#### `` angle

    angle(
        angle: float,
        unit: Literal["degrees", "radians"] = "degrees",
    ) -> Point

Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.

Source code in `src/momapy/core.py`

    817
    818
    819
    820
    821
    822
    823
    824
    825
    826
    827
    828
    def angle(
        self,
        angle: float,
        unit: typing.Literal["degrees", "radians"] = "degrees",
    ) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal."""
        return momapy.drawing.get_drawing_elements_angle(
            drawing_elements=self.drawing_elements(),
            angle=angle,
            unit=unit,
            center=self.center(),
        )

#### `` bbox

    bbox() -> Bbox

Compute and return the bounding box of the group layout element

Source code in `src/momapy/core.py`

    504
    505
    506
    507
    508
    509
    510
    511
    512
    513
    514
    515
    516
    517
    518
    519
    520
    521
    522
    523
    524
    525
    526
    def bbox(self) -> momapy.geometry.Bbox:
        """Compute and return the bounding box of the group layout element"""
        self_bbox = self.self_bbox()
        bboxes = [child.bbox() for child in self.children()]
        min_x = self_bbox.north_west().x
        min_y = self_bbox.north_west().y
        max_x = self_bbox.south_east().x
        max_y = self_bbox.south_east().y
        for bbox in bboxes:
            if bbox.north_west().x < min_x:
                min_x = bbox.north_west().x
            if bbox.north_west().y < min_y:
                min_y = bbox.north_west().y
            if bbox.south_east().x > max_x:
                max_x = bbox.south_east().x
            if bbox.south_east().y > max_y:
                max_y = bbox.south_east().y
        bbox = momapy.geometry.Bbox(
            momapy.geometry.Point(min_x / 2 + max_x / 2, min_y / 2 + max_y / 2),
            max_x - min_x,
            max_y - min_y,
        )
        return bbox

#### `` border

    border(point: Point) -> Point

Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point. When there are multiple intersection points, the one closest to the given point is returned

Source code in `src/momapy/core.py`

    794
    795
    796
    797
    798
    799
    800
    801
    802
    def border(self, point: momapy.geometry.Point) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point.
        When there are multiple intersection points, the one closest to the given point is returned
        """
        return momapy.drawing.get_drawing_elements_border(
            drawing_elements=self.drawing_elements(),
            point=point,
            center=self.center(),
        )

#### `` center

    center() -> Point

Return the center anchor of the node

Source code in `src/momapy/core.py`

    776
    777
    778
    def center(self) -> momapy.geometry.Point:
        """Return the center anchor of the node"""
        return self.position

#### `` childless

    childless() -> Self

Return a copy of the node with no children

Source code in `src/momapy/core.py`

    830
    831
    832
    def childless(self) -> typing.Self:
        """Return a copy of the node with no children"""
        return dataclasses.replace(self, label=None, layout_elements=tuple([]))

#### `` children

    children() -> list[LayoutElement]

Return the children of the group layout. These are the self children of the group layout (returned by the `self_children` method) and the other children of the group layout (given by the `layout_elements` attribute)

Source code in `src/momapy/core.py`

    566
    567
    568
    569
    570
    def children(self) -> list[LayoutElement]:
        """Return the children of the group layout.
        These are the self children of the group layout (returned by the `self_children` method) and the other children of the group layout (given by the `layout_elements` attribute)
        """
        return self.self_children() + list(self.layout_elements)

#### `` contains

    contains(other: LayoutElement) -> bool

Return `true` if another layout element is a descendant of the layout element, `false` otherwise

Source code in `src/momapy/core.py`

    119
    120
    121
    def contains(self, other: "LayoutElement") -> bool:
        """Return `true` if another layout element is a descendant of the layout element, `false` otherwise"""
        return other in self.descendants()

#### `` descendants

    descendants() -> list[LayoutElement]

Return the descendants of the layout element

Source code in `src/momapy/core.py`

    90
    91
    92
    93
    94
    95
    96
    def descendants(self) -> list["LayoutElement"]:
        """Return the descendants of the layout element"""
        descendants = []
        for child in self.children():
            descendants.append(child)
            descendants += child.descendants()
        return descendants

#### `` drawing_elements

    drawing_elements() -> list[DrawingElement]

Return the drawing elements of the group layout. The returned drawing elements are a group drawing element formed of the self drawing elements of the group layout and the drawing elements of its children

Source code in `src/momapy/core.py`

    538
    539
    540
    541
    542
    543
    544
    545
    546
    547
    548
    549
    550
    551
    552
    553
    554
    555
    556
    557
    558
    559
    560
    561
    562
    563
    564
    def drawing_elements(self) -> list[momapy.drawing.DrawingElement]:
        """Return the drawing elements of the group layout.
        The returned drawing elements are a group drawing element formed of the self drawing elements of the group layout and the drawing elements of its children
        """
        drawing_elements = self.self_drawing_elements()
        for child in self.children():
            if child is not None:
                drawing_elements += child.drawing_elements()
        group = momapy.drawing.Group(
            class_=f"{type(self).__name__}_group",
            elements=tuple(drawing_elements),
            id_=f"{self.id_}_group",
            fill=self.group_fill,
            fill_rule=self.group_fill_rule,
            filter=self.group_filter,
            font_family=self.group_font_family,
            font_size=self.group_font_size,
            font_style=self.group_font_style,
            font_weight=self.group_font_weight,
            stroke=self.group_stroke,
            stroke_dasharray=self.group_stroke_dasharray,
            stroke_dashoffset=self.group_stroke_dashoffset,
            stroke_width=self.group_stroke_width,
            text_anchor=self.group_text_anchor,
            transform=self.group_transform,
        )
        return [group]

#### `` east_north_east

    east_north_east() -> Point

Return the east north east anchor of the node

Source code in `src/momapy/core.py`

    700
    701
    702
    703
    704
    705
    706
    def east_north_east(self) -> momapy.geometry.Point:
        """Return the east north east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, -self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` east_south_east

    east_south_east() -> Point

Return the east south east west anchor of the node

Source code in `src/momapy/core.py`

    712
    713
    714
    715
    716
    717
    718
    def east_south_east(self) -> momapy.geometry.Point:
        """Return the east south east west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` equals

    equals(
        other: LayoutElement,
        flattened: bool = False,
        unordered: bool = False,
    ) -> bool

Return `true` if the layout element is equal to another layout element, `false` otherwise

Source code in `src/momapy/core.py`

    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    def equals(
        self, other: "LayoutElement", flattened: bool = False, unordered: bool = False
    ) -> bool:
        """Return `true` if the layout element is equal to another layout element, `false` otherwise"""
        if type(self) is type(other):
            if not flattened:
                return self == other
            else:
                if not unordered:
                    return self.flattened() == other.flattened()
                else:
                    return set(self.flattened()) == set(other.flattened())
        return False

#### `` flattened

    flattened() -> list[LayoutElement]

Return a list containing copy of the layout element with no children and all its descendants with no children

Source code in `src/momapy/core.py`

     98
     99
    100
    101
    102
    103
    def flattened(self) -> list["LayoutElement"]:
        """Return a list containing copy of the layout element with no children and all its descendants with no children"""
        flattened = [self.childless()]
        for child in self.children():
            flattened += child.flattened()
        return flattened

#### `` label_center

    label_center() -> Point

Return the label center anchor of the node

Source code in `src/momapy/core.py`

    780
    781
    782
    def label_center(self) -> momapy.geometry.Point:
        """Return the label center anchor of the node"""
        return self.position

#### `` north_east

    north_east() -> Point

Return the north east anchor of the node

Source code in `src/momapy/core.py`

    692
    693
    694
    695
    696
    697
    698
    def north_east(self) -> momapy.geometry.Point:
        """Return the north east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, -self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` north_north_east

    north_north_east() -> Point

Return the north north east anchor of the node

Source code in `src/momapy/core.py`

    684
    685
    686
    687
    688
    689
    690
    def north_north_east(self) -> momapy.geometry.Point:
        """Return the north north east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 4, -self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` north_north_west

    north_north_west() -> Point

Return the north north west anchor of the node

Source code in `src/momapy/core.py`

    672
    673
    674
    675
    676
    677
    678
    def north_north_west(self) -> momapy.geometry.Point:
        """Return the north north west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() - (self.width / 4, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` north_west

    north_west() -> Point

Return the north west anchor of the node

Source code in `src/momapy/core.py`

    664
    665
    666
    667
    668
    669
    670
    def north_west(self) -> momapy.geometry.Point:
        """Return the north west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() - (self.width / 2, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` self_angle

    self_angle(
        angle: float,
        unit: Literal["degrees", "radians"] = "degrees",
    ) -> Point

Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.

Source code in `src/momapy/core.py`

    804
    805
    806
    807
    808
    809
    810
    811
    812
    813
    814
    815
    def self_angle(
        self,
        angle: float,
        unit: typing.Literal["degrees", "radians"] = "degrees",
    ) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal."""
        return momapy.drawing.get_drawing_elements_angle(
            drawing_elements=self.self_drawing_elements(),
            angle=angle,
            unit=unit,
            center=self.center(),
        )

#### `` self_bbox

    self_bbox() -> Bbox

Compute and return the bounding box of the self drawing element of the group layout

Source code in `src/momapy/core.py`

    499
    500
    501
    502
    def self_bbox(self) -> momapy.geometry.Bbox:
        """Compute and return the bounding box of the self drawing element of the group layout"""
        bounds = self.self_to_shapely().bounds
        return momapy.geometry.Bbox.from_bounds(bounds)

#### `` self_border

    self_border(point: Point) -> Point

Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point. When there are multiple intersection points, the one closest to the given point is returned

Source code in `src/momapy/core.py`

    784
    785
    786
    787
    788
    789
    790
    791
    792
    def self_border(self, point: momapy.geometry.Point) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point.
        When there are multiple intersection points, the one closest to the given point is returned
        """
        return momapy.drawing.get_drawing_elements_border(
            drawing_elements=self.self_drawing_elements(),
            point=point,
            center=self.center(),
        )

#### `` self_children

    self_children() -> list[LayoutElement]

Return the self children of the node. A node has unique child that is its label

Source code in `src/momapy/core.py`

    654
    655
    656
    657
    658
    def self_children(self) -> list[LayoutElement]:
        """Return the self children of the node. A node has unique child that is its label"""
        if self.label is not None:
            return [self.label]
        return []

#### `` self_drawing_elements

    self_drawing_elements() -> list[DrawingElement]

Return the node's own drawing elements

Source code in `src/momapy/core.py`

    637
    638
    639
    640
    641
    642
    643
    644
    645
    646
    647
    648
    649
    650
    651
    652
    def self_drawing_elements(self) -> list[momapy.drawing.DrawingElement]:
        """Return the node's own drawing elements"""
        drawing_elements = self._border_drawing_elements()
        group = momapy.drawing.Group(
            class_=type(self).__name__,
            elements=tuple(drawing_elements),
            fill=self.fill,
            filter=self.filter,
            id_=self.id_,
            stroke=self.stroke,
            stroke_dasharray=self.stroke_dasharray,
            stroke_dashoffset=self.stroke_dashoffset,
            stroke_width=self.stroke_width,
            transform=self.transform,
        )
        return [group]

#### `` self_to_shapely

    self_to_shapely() -> GeometryCollection

Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout

Source code in `src/momapy/core.py`

    495
    496
    497
    def self_to_shapely(self) -> shapely.GeometryCollection:
        """Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout"""
        return momapy.drawing.drawing_elements_to_shapely(self.drawing_elements())

#### `` size

    size() -> tuple[float, float]

Return the size of the node

Source code in `src/momapy/core.py`

    660
    661
    662
    def size(self) -> tuple[float, float]:
        """Return the size of the node"""
        return (self.width, self.height)

#### `` south_east

    south_east() -> Point

Return the south east anchor of the node

Source code in `src/momapy/core.py`

    720
    721
    722
    723
    724
    725
    726
    def south_east(self) -> momapy.geometry.Point:
        """Return the south east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` south_south_east

    south_south_east() -> Point

Return the south south east anchor of the node

Source code in `src/momapy/core.py`

    728
    729
    730
    731
    732
    733
    734
    def south_south_east(self) -> momapy.geometry.Point:
        """Return the south south east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 4, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` south_south_west

    south_south_west() -> Point

Return the south south west anchor of the node

Source code in `src/momapy/core.py`

    740
    741
    742
    743
    744
    745
    746
    def south_south_west(self) -> momapy.geometry.Point:
        """Return the south south west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (-self.width / 4, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` south_west

    south_west() -> Point

Return the south west anchor of the node

Source code in `src/momapy/core.py`

    748
    749
    750
    751
    752
    753
    754
    def south_west(self) -> momapy.geometry.Point:
        """Return the south west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (-self.width / 2, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` to_shapely

    to_shapely(to_polygons: bool = False) -> GeometryCollection

Return a shapely collection of geometries reproducing the drawing elements of the layout element

Source code in `src/momapy/core.py`

    123
    124
    125
    126
    127
    128
    def to_shapely(self, to_polygons: bool = False) -> shapely.GeometryCollection:
        """Return a shapely collection of geometries reproducing the drawing elements of the layout element"""
        geom_collection = []
        for drawing_element in self.drawing_elements():
            geom_collection += drawing_element.to_shapely(to_polygons=to_polygons).geoms
        return shapely.GeometryCollection(geom_collection)

#### `` west_north_west

    west_north_west() -> Point

Return the west north west anchor of the node

Source code in `src/momapy/core.py`

    768
    769
    770
    771
    772
    773
    774
    def west_north_west(self) -> momapy.geometry.Point:
        """Return the west north west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() - (self.width / 2, self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` west_south_west

    west_south_west() -> Point

Return the west south west anchor of the node

Source code in `src/momapy/core.py`

    756
    757
    758
    759
    760
    761
    762
    def west_south_west(self) -> momapy.geometry.Point:
        """Return the west south west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (-self.width / 2, self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` x `property`

    x: float

Return the x coordinate of the node

#### `` y `property`

    y: float

Return the y coordinate of the node

### `` EquivalenceOperatorOutput `dataclass`

    EquivalenceOperatorOutput(
        *, id_: str = make_uuid4_as_str(), element: EntityPool
    )

Bases: `SBGNRole`

Class for outputs of equivalence operators

Parameters:

Name | Type | Description | Default
--- | --- | --- | ---
`id_` | `str` | The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element | `'59c5f95d-73d8-4cd9-ad1e-a7c0200768bb'`
`element` | `EntityPool` | The element of the equivalence operator output | required

### `` FluxRole `dataclass`

    FluxRole(
        *,
        id_: str = make_uuid4_as_str(),
        element: EntityPool,
        stoichiometry: int | None = None,
    )

Bases: `SBGNRole`

Base class for flux roles

Parameters:

Name | Type | Description | Default
--- | --- | --- | ---
`id_` | `str` | The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element | `'a821f366-da7b-4dca-a1c6-0bb921a166c0'`
`element` | `EntityPool` | The entity pool of the flux role | required
`stoichiometry` | `int | None` | The stoichiometry of the flux role | `None`

### `` GenericProcess `dataclass`

    GenericProcess(
        *,
        id_: str = make_uuid4_as_str(),
        reactants: frozenset[Reactant] = frozenset(),
        products: frozenset[Product] = frozenset(),
        reversible: bool = False,
    )

Bases: `StoichiometricProcess`

Class for generic processes

Parameters:

Name | Type | Description | Default
--- | --- | --- | ---
`id_` | `str` | The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element | `'107dd684-b1ec-4c5c-afd1-824a48b15dde'`
`reactants` | `frozenset[Reactant]` | The reactants of the stoichiometric process | `<class 'frozenset'>`
`products` | `frozenset[Product]` | The products of the stoichiometric process | `<class 'frozenset'>`
`reversible` | `bool` | Whether the stoichiometric process is reversible or not | `False`

### `` GenericProcessLayout `dataclass`

    GenericProcessLayout(
        fill: NoneValueType | Color | None = white,
        stroke: NoneValueType | Color | None = black,
        stroke_width: float | None = 1.25,
        *,
        id_: str = make_uuid4_as_str(),
        layout_elements: tuple[LayoutElement] = tuple(),
        group_fill: NoneValueType | Color | None = None,
        group_fill_rule: FillRule | None = None,
        group_filter: NoneValueType | Filter | None = None,
        group_font_family: str | None = None,
        group_font_size: float | None = None,
        group_font_style: FontStyle | None = None,
        group_font_weight: FontWeight | float | None = None,
        group_stroke: NoneValueType | Color | None = None,
        group_stroke_dasharray: tuple[float, ...] | None = None,
        group_stroke_dashoffset: float | None = None,
        group_stroke_width: float | None = None,
        group_text_anchor: TextAnchor | None = None,
        group_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        filter: NoneValueType | Filter | None = None,
        height: float = 20.0,
        label: TextLayout | None = None,
        position: Point,
        stroke_dasharray: tuple[float, ...] | None = None,
        stroke_dashoffset: float | None = None,
        transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        width: float = 20.0,
        direction: Direction = HORIZONTAL,
        left_to_right: bool = True,
        left_connector_length: float = 10.0,
        right_connector_length: float = 10.0,
        left_connector_stroke: NoneValueType
        | Color
        | None = None,
        left_connector_stroke_width: float | None = None,
        left_connector_stroke_dasharray: NoneValueType
        | tuple[float]
        | None = None,
        left_connector_stroke_dashoffset: float | None = None,
        left_connector_fill: NoneValueType
        | Color
        | None = None,
        left_connector_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        left_connector_filter: NoneValueType
        | Filter
        | None = None,
        right_connector_stroke: NoneValueType
        | Color
        | None = None,
        right_connector_stroke_width: float | None = None,
        right_connector_stroke_dasharray: NoneValueType
        | tuple[float]
        | None = None,
        right_connector_stroke_dashoffset: float | None = None,
        right_connector_fill: NoneValueType
        | Color
        | None = None,
        right_connector_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        right_connector_filter: NoneValueType
        | Filter
        | None = None,
    )

Bases: `_ConnectorsMixin`, `_SimpleMixin`, `SBGNNode`

Class for generic process layouts

Parameters:

Name | Type | Description | Default
--- | --- | --- | ---
`id_` | `str` | The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element | `'846ebee0-0851-4f8c-9971-1f5c6a91ba99'`
`layout_elements` | `tuple[LayoutElement]` | The sub-layout elements of the group layout. These are part of the children of the group layout | `<dynamic>`
`group_fill` | `NoneValueType | Color | None` | The fill color of the group layout | `None`
`group_fill_rule` | `FillRule | None` | The fill rule of the group layout | `None`
`group_filter` | `NoneValueType | Filter | None` | The filter of the group layout | `None`
`group_font_family` | `str | None` | The font family of the group layout | `None`
`group_font_size` | `float | None` | The font size of the group layout | `None`
`group_font_style` | `FontStyle | None` | The font style of the group layout | `None`
`group_font_weight` | `FontWeight | float | None` | The font weight of the group layout | `None`
`group_stroke` | `NoneValueType | Color | None` | The stroke color of the group layout | `None`
`group_stroke_dasharray` | `tuple[float, ...] | None` | The stroke dasharray of the group layout | `None`
`group_stroke_dashoffset` | `float | None` | The stroke dashoffset of the group layout | `None`
`group_stroke_width` | `float | None` | The stroke width of the group layout | `None`
`group_text_anchor` | `TextAnchor | None` | The text anchor of the group layout | `None`
`group_transform` | `NoneValueType | tuple[Transformation] | None` | The transform of the group layout | `None`
`fill` | `NoneValueType | Color | None` |  | `Color(red=255, green=255, blue=255, alpha=1.0)`
`filter` | `NoneValueType | Filter | None` | The filter of the node | `None`
`height` | `float` |  | `20.0`
`label` | `TextLayout | None` | The label of the node | `None`
`position` | `Point` | The position of the node | required
`stroke` | `NoneValueType | Color | None` |  | `Color(red=0, green=0, blue=0, alpha=1.0)`
`stroke_dasharray` | `tuple[float, ...] | None` | The stroke dasharray of the node | `None`
`stroke_dashoffset` | `float | None` | The stroke dashoffset of the node | `None`
`stroke_width` | `float | None` |  | `1.25`
`transform` | `NoneValueType | tuple[Transformation] | None` | The transform of the node | `None`
`width` | `float` |  | `20.0`
`direction` | `Direction` |  | `<Direction.HORIZONTAL: 1>`
`left_to_right` | `bool` |  | `True`
`left_connector_length` | `float` |  | `10.0`
`right_connector_length` | `float` |  | `10.0`
`left_connector_stroke` | `NoneValueType | Color | None` |  | `None`
`left_connector_stroke_width` | `float | None` |  | `None`
`left_connector_stroke_dasharray` | `NoneValueType | tuple[float] | None` |  | `None`
`left_connector_stroke_dashoffset` | `float | None` |  | `None`
`left_connector_fill` | `NoneValueType | Color | None` |  | `None`
`left_connector_transform` | `NoneValueType | tuple[Transformation] | None` |  | `None`
`left_connector_filter` | `NoneValueType | Filter | None` |  | `None`
`right_connector_stroke` | `NoneValueType | Color | None` |  | `None`
`right_connector_stroke_width` | `float | None` |  | `None`
`right_connector_stroke_dasharray` | `NoneValueType | tuple[float] | None` |  | `None`
`right_connector_stroke_dashoffset` | `float | None` |  | `None`
`right_connector_fill` | `NoneValueType | Color | None` |  | `None`
`right_connector_transform` | `NoneValueType | tuple[Transformation] | None` |  | `None`
`right_connector_filter` | `NoneValueType | Filter | None` |  | `None`

Methods:

Name | Description
--- | ---
`anchor_point` | Return an anchor point of the layout element
`angle` | Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.
`bbox` | Compute and return the bounding box of the group layout element
`border` | Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point.
`center` | Return the center anchor of the node
`childless` | Return a copy of the node with no children
`children` | Return the children of the group layout.
`contains` | Return `true` if another layout element is a descendant of the layout element, `false` otherwise
`descendants` | Return the descendants of the layout element
`drawing_elements` | Return the drawing elements of the group layout.
`east_north_east` | Return the east north east anchor of the node
`east_south_east` | Return the east south east west anchor of the node
`equals` | Return `true` if the layout element is equal to another layout element, `false` otherwise
`flattened` | Return a list containing copy of the layout element with no children and all its descendants with no children
`label_center` | Return the label center anchor of the node
`north_east` | Return the north east anchor of the node
`north_north_east` | Return the north north east anchor of the node
`north_north_west` | Return the north north west anchor of the node
`north_west` | Return the north west anchor of the node
`self_angle` | Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.
`self_bbox` | Compute and return the bounding box of the self drawing element of the group layout
`self_border` | Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point.
`self_children` | Return the self children of the node. A node has unique child that is its label
`self_drawing_elements` | Return the node's own drawing elements
`self_to_shapely` | Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout
`size` | Return the size of the node
`south_east` | Return the south east anchor of the node
`south_south_east` | Return the south south east anchor of the node
`south_south_west` | Return the south south west anchor of the node
`south_west` | Return the south west anchor of the node
`to_shapely` | Return a shapely collection of geometries reproducing the drawing elements of the layout element
`west_north_west` | Return the west north west anchor of the node
`west_south_west` | Return the west south west anchor of the node

Attributes:

Name | Type | Description
--- | --- | ---
`x` | `float` | Return the x coordinate of the node
`y` | `float` | Return the y coordinate of the node

#### `` anchor_point

    anchor_point(anchor_name: str) -> Point

Return an anchor point of the layout element

Source code in `src/momapy/core.py`

    130
    131
    132
    def anchor_point(self, anchor_name: str) -> momapy.geometry.Point:
        """Return an anchor point of the layout element"""
        return getattr(self, anchor_name)()

#### `` angle

    angle(
        angle: float,
        unit: Literal["degrees", "radians"] = "degrees",
    ) -> Point

Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.

Source code in `src/momapy/core.py`

    817
    818
    819
    820
    821
    822
    823
    824
    825
    826
    827
    828
    def angle(
        self,
        angle: float,
        unit: typing.Literal["degrees", "radians"] = "degrees",
    ) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal."""
        return momapy.drawing.get_drawing_elements_angle(
            drawing_elements=self.drawing_elements(),
            angle=angle,
            unit=unit,
            center=self.center(),
        )

#### `` bbox

    bbox() -> Bbox

Compute and return the bounding box of the group layout element

Source code in `src/momapy/core.py`

    504
    505
    506
    507
    508
    509
    510
    511
    512
    513
    514
    515
    516
    517
    518
    519
    520
    521
    522
    523
    524
    525
    526
    def bbox(self) -> momapy.geometry.Bbox:
        """Compute and return the bounding box of the group layout element"""
        self_bbox = self.self_bbox()
        bboxes = [child.bbox() for child in self.children()]
        min_x = self_bbox.north_west().x
        min_y = self_bbox.north_west().y
        max_x = self_bbox.south_east().x
        max_y = self_bbox.south_east().y
        for bbox in bboxes:
            if bbox.north_west().x < min_x:
                min_x = bbox.north_west().x
            if bbox.north_west().y < min_y:
                min_y = bbox.north_west().y
            if bbox.south_east().x > max_x:
                max_x = bbox.south_east().x
            if bbox.south_east().y > max_y:
                max_y = bbox.south_east().y
        bbox = momapy.geometry.Bbox(
            momapy.geometry.Point(min_x / 2 + max_x / 2, min_y / 2 + max_y / 2),
            max_x - min_x,
            max_y - min_y,
        )
        return bbox

#### `` border

    border(point: Point) -> Point

Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point. When there are multiple intersection points, the one closest to the given point is returned

Source code in `src/momapy/core.py`

    794
    795
    796
    797
    798
    799
    800
    801
    802
    def border(self, point: momapy.geometry.Point) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point.
        When there are multiple intersection points, the one closest to the given point is returned
        """
        return momapy.drawing.get_drawing_elements_border(
            drawing_elements=self.drawing_elements(),
            point=point,
            center=self.center(),
        )

#### `` center

    center() -> Point

Return the center anchor of the node

Source code in `src/momapy/core.py`

    776
    777
    778
    def center(self) -> momapy.geometry.Point:
        """Return the center anchor of the node"""
        return self.position

#### `` childless

    childless() -> Self

Return a copy of the node with no children

Source code in `src/momapy/core.py`

    830
    831
    832
    def childless(self) -> typing.Self:
        """Return a copy of the node with no children"""
        return dataclasses.replace(self, label=None, layout_elements=tuple([]))

#### `` children

    children() -> list[LayoutElement]

Return the children of the group layout. These are the self children of the group layout (returned by the `self_children` method) and the other children of the group layout (given by the `layout_elements` attribute)

Source code in `src/momapy/core.py`

    566
    567
    568
    569
    570
    def children(self) -> list[LayoutElement]:
        """Return the children of the group layout.
        These are the self children of the group layout (returned by the `self_children` method) and the other children of the group layout (given by the `layout_elements` attribute)
        """
        return self.self_children() + list(self.layout_elements)

#### `` contains

    contains(other: LayoutElement) -> bool

Return `true` if another layout element is a descendant of the layout element, `false` otherwise

Source code in `src/momapy/core.py`

    119
    120
    121
    def contains(self, other: "LayoutElement") -> bool:
        """Return `true` if another layout element is a descendant of the layout element, `false` otherwise"""
        return other in self.descendants()

#### `` descendants

    descendants() -> list[LayoutElement]

Return the descendants of the layout element

Source code in `src/momapy/core.py`

    90
    91
    92
    93
    94
    95
    96
    def descendants(self) -> list["LayoutElement"]:
        """Return the descendants of the layout element"""
        descendants = []
        for child in self.children():
            descendants.append(child)
            descendants += child.descendants()
        return descendants

#### `` drawing_elements

    drawing_elements() -> list[DrawingElement]

Return the drawing elements of the group layout. The returned drawing elements are a group drawing element formed of the self drawing elements of the group layout and the drawing elements of its children

Source code in `src/momapy/core.py`

    538
    539
    540
    541
    542
    543
    544
    545
    546
    547
    548
    549
    550
    551
    552
    553
    554
    555
    556
    557
    558
    559
    560
    561
    562
    563
    564
    def drawing_elements(self) -> list[momapy.drawing.DrawingElement]:
        """Return the drawing elements of the group layout.
        The returned drawing elements are a group drawing element formed of the self drawing elements of the group layout and the drawing elements of its children
        """
        drawing_elements = self.self_drawing_elements()
        for child in self.children():
            if child is not None:
                drawing_elements += child.drawing_elements()
        group = momapy.drawing.Group(
            class_=f"{type(self).__name__}_group",
            elements=tuple(drawing_elements),
            id_=f"{self.id_}_group",
            fill=self.group_fill,
            fill_rule=self.group_fill_rule,
            filter=self.group_filter,
            font_family=self.group_font_family,
            font_size=self.group_font_size,
            font_style=self.group_font_style,
            font_weight=self.group_font_weight,
            stroke=self.group_stroke,
            stroke_dasharray=self.group_stroke_dasharray,
            stroke_dashoffset=self.group_stroke_dashoffset,
            stroke_width=self.group_stroke_width,
            text_anchor=self.group_text_anchor,
            transform=self.group_transform,
        )
        return [group]

#### `` east_north_east

    east_north_east() -> Point

Return the east north east anchor of the node

Source code in `src/momapy/core.py`

    700
    701
    702
    703
    704
    705
    706
    def east_north_east(self) -> momapy.geometry.Point:
        """Return the east north east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, -self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` east_south_east

    east_south_east() -> Point

Return the east south east west anchor of the node

Source code in `src/momapy/core.py`

    712
    713
    714
    715
    716
    717
    718
    def east_south_east(self) -> momapy.geometry.Point:
        """Return the east south east west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` equals

    equals(
        other: LayoutElement,
        flattened: bool = False,
        unordered: bool = False,
    ) -> bool

Return `true` if the layout element is equal to another layout element, `false` otherwise

Source code in `src/momapy/core.py`

    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    def equals(
        self, other: "LayoutElement", flattened: bool = False, unordered: bool = False
    ) -> bool:
        """Return `true` if the layout element is equal to another layout element, `false` otherwise"""
        if type(self) is type(other):
            if not flattened:
                return self == other
            else:
                if not unordered:
                    return self.flattened() == other.flattened()
                else:
                    return set(self.flattened()) == set(other.flattened())
        return False

#### `` flattened

    flattened() -> list[LayoutElement]

Return a list containing copy of the layout element with no children and all its descendants with no children

Source code in `src/momapy/core.py`

     98
     99
    100
    101
    102
    103
    def flattened(self) -> list["LayoutElement"]:
        """Return a list containing copy of the layout element with no children and all its descendants with no children"""
        flattened = [self.childless()]
        for child in self.children():
            flattened += child.flattened()
        return flattened

#### `` label_center

    label_center() -> Point

Return the label center anchor of the node

Source code in `src/momapy/core.py`

    780
    781
    782
    def label_center(self) -> momapy.geometry.Point:
        """Return the label center anchor of the node"""
        return self.position

#### `` north_east

    north_east() -> Point

Return the north east anchor of the node

Source code in `src/momapy/core.py`

    692
    693
    694
    695
    696
    697
    698
    def north_east(self) -> momapy.geometry.Point:
        """Return the north east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, -self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` north_north_east

    north_north_east() -> Point

Return the north north east anchor of the node

Source code in `src/momapy/core.py`

    684
    685
    686
    687
    688
    689
    690
    def north_north_east(self) -> momapy.geometry.Point:
        """Return the north north east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 4, -self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` north_north_west

    north_north_west() -> Point

Return the north north west anchor of the node

Source code in `src/momapy/core.py`

    672
    673
    674
    675
    676
    677
    678
    def north_north_west(self) -> momapy.geometry.Point:
        """Return the north north west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() - (self.width / 4, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` north_west

    north_west() -> Point

Return the north west anchor of the node

Source code in `src/momapy/core.py`

    664
    665
    666
    667
    668
    669
    670
    def north_west(self) -> momapy.geometry.Point:
        """Return the north west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() - (self.width / 2, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` self_angle

    self_angle(
        angle: float,
        unit: Literal["degrees", "radians"] = "degrees",
    ) -> Point

Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.

Source code in `src/momapy/core.py`

    804
    805
    806
    807
    808
    809
    810
    811
    812
    813
    814
    815
    def self_angle(
        self,
        angle: float,
        unit: typing.Literal["degrees", "radians"] = "degrees",
    ) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal."""
        return momapy.drawing.get_drawing_elements_angle(
            drawing_elements=self.self_drawing_elements(),
            angle=angle,
            unit=unit,
            center=self.center(),
        )

#### `` self_bbox

    self_bbox() -> Bbox

Compute and return the bounding box of the self drawing element of the group layout

Source code in `src/momapy/core.py`

    499
    500
    501
    502
    def self_bbox(self) -> momapy.geometry.Bbox:
        """Compute and return the bounding box of the self drawing element of the group layout"""
        bounds = self.self_to_shapely().bounds
        return momapy.geometry.Bbox.from_bounds(bounds)

#### `` self_border

    self_border(point: Point) -> Point

Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point. When there are multiple intersection points, the one closest to the given point is returned

Source code in `src/momapy/core.py`

    784
    785
    786
    787
    788
    789
    790
    791
    792
    def self_border(self, point: momapy.geometry.Point) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point.
        When there are multiple intersection points, the one closest to the given point is returned
        """
        return momapy.drawing.get_drawing_elements_border(
            drawing_elements=self.self_drawing_elements(),
            point=point,
            center=self.center(),
        )

#### `` self_children

    self_children() -> list[LayoutElement]

Return the self children of the node. A node has unique child that is its label

Source code in `src/momapy/core.py`

    654
    655
    656
    657
    658
    def self_children(self) -> list[LayoutElement]:
        """Return the self children of the node. A node has unique child that is its label"""
        if self.label is not None:
            return [self.label]
        return []

#### `` self_drawing_elements

    self_drawing_elements() -> list[DrawingElement]

Return the node's own drawing elements

Source code in `src/momapy/core.py`

    637
    638
    639
    640
    641
    642
    643
    644
    645
    646
    647
    648
    649
    650
    651
    652
    def self_drawing_elements(self) -> list[momapy.drawing.DrawingElement]:
        """Return the node's own drawing elements"""
        drawing_elements = self._border_drawing_elements()
        group = momapy.drawing.Group(
            class_=type(self).__name__,
            elements=tuple(drawing_elements),
            fill=self.fill,
            filter=self.filter,
            id_=self.id_,
            stroke=self.stroke,
            stroke_dasharray=self.stroke_dasharray,
            stroke_dashoffset=self.stroke_dashoffset,
            stroke_width=self.stroke_width,
            transform=self.transform,
        )
        return [group]

#### `` self_to_shapely

    self_to_shapely() -> GeometryCollection

Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout

Source code in `src/momapy/core.py`

    495
    496
    497
    def self_to_shapely(self) -> shapely.GeometryCollection:
        """Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout"""
        return momapy.drawing.drawing_elements_to_shapely(self.drawing_elements())

#### `` size

    size() -> tuple[float, float]

Return the size of the node

Source code in `src/momapy/core.py`

    660
    661
    662
    def size(self) -> tuple[float, float]:
        """Return the size of the node"""
        return (self.width, self.height)

#### `` south_east

    south_east() -> Point

Return the south east anchor of the node

Source code in `src/momapy/core.py`

    720
    721
    722
    723
    724
    725
    726
    def south_east(self) -> momapy.geometry.Point:
        """Return the south east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` south_south_east

    south_south_east() -> Point

Return the south south east anchor of the node

Source code in `src/momapy/core.py`

    728
    729
    730
    731
    732
    733
    734
    def south_south_east(self) -> momapy.geometry.Point:
        """Return the south south east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 4, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` south_south_west

    south_south_west() -> Point

Return the south south west anchor of the node

Source code in `src/momapy/core.py`

    740
    741
    742
    743
    744
    745
    746
    def south_south_west(self) -> momapy.geometry.Point:
        """Return the south south west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (-self.width / 4, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` south_west

    south_west() -> Point

Return the south west anchor of the node

Source code in `src/momapy/core.py`

    748
    749
    750
    751
    752
    753
    754
    def south_west(self) -> momapy.geometry.Point:
        """Return the south west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (-self.width / 2, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` to_shapely

    to_shapely(to_polygons: bool = False) -> GeometryCollection

Return a shapely collection of geometries reproducing the drawing elements of the layout element

Source code in `src/momapy/core.py`

    123
    124
    125
    126
    127
    128
    def to_shapely(self, to_polygons: bool = False) -> shapely.GeometryCollection:
        """Return a shapely collection of geometries reproducing the drawing elements of the layout element"""
        geom_collection = []
        for drawing_element in self.drawing_elements():
            geom_collection += drawing_element.to_shapely(to_polygons=to_polygons).geoms
        return shapely.GeometryCollection(geom_collection)

#### `` west_north_west

    west_north_west() -> Point

Return the west north west anchor of the node

Source code in `src/momapy/core.py`

    768
    769
    770
    771
    772
    773
    774
    def west_north_west(self) -> momapy.geometry.Point:
        """Return the west north west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() - (self.width / 2, self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` west_south_west

    west_south_west() -> Point

Return the west south west anchor of the node

Source code in `src/momapy/core.py`

    756
    757
    758
    759
    760
    761
    762
    def west_south_west(self) -> momapy.geometry.Point:
        """Return the west south west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (-self.width / 2, self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` x `property`

    x: float

Return the x coordinate of the node

#### `` y `property`

    y: float

Return the y coordinate of the node

### `` Inhibition `dataclass`

    Inhibition(
        *,
        id_: str = make_uuid4_as_str(),
        source: EntityPool | LogicalOperator,
        target: Process,
    )

Bases: `Modulation`

Class for inhibitions

Parameters:

Name | Type | Description | Default
--- | --- | --- | ---
`id_` | `str` | The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element | `'83e8dad3-112e-41fb-b9e6-7f18f048996c'`
`source` | `EntityPool | LogicalOperator` | The source of the modulation | required
`target` | `Process` | The target of the modulation | required

### `` InhibitionLayout `dataclass`

    InhibitionLayout(
        path_fill: NoneValueType | Color | None = NoneValue,
        path_stroke: NoneValueType | Color | None = black,
        path_stroke_width: float | None = 1.25,
        arrowhead_fill: NoneValueType | Color | None = white,
        arrowhead_stroke: NoneValueType | Color | None = black,
        arrowhead_stroke_width: float | None = 1.25,
        *,
        id_: str = make_uuid4_as_str(),
        layout_elements: tuple[LayoutElement] = tuple(),
        group_fill: NoneValueType | Color | None = None,
        group_fill_rule: FillRule | None = None,
        group_filter: NoneValueType | Filter | None = None,
        group_font_family: str | None = None,
        group_font_size: float | None = None,
        group_font_style: FontStyle | None = None,
        group_font_weight: FontWeight | float | None = None,
        group_stroke: NoneValueType | Color | None = None,
        group_stroke_dasharray: tuple[float, ...] | None = None,
        group_stroke_dashoffset: float | None = None,
        group_stroke_width: float | None = None,
        group_text_anchor: TextAnchor | None = None,
        group_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        end_shorten: float = 0.0,
        fill: NoneValueType | Color | None = None,
        filter: NoneValueType | Filter | None = None,
        path_filter: NoneValueType | Filter | None = None,
        path_stroke_dasharray: tuple[float, ...] | None = None,
        path_stroke_dashoffset: float | None = None,
        path_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        stroke: NoneValueType | Color | None = None,
        stroke_dasharray: NoneValueType
        | tuple[float]
        | None = None,
        stroke_dashoffset: float | None = None,
        stroke_width: float | None = None,
        segments: tuple[
            Segment | BezierCurve | EllipticalArc
        ] = tuple(),
        source: LayoutElement | None = None,
        start_shorten: float = 0.0,
        target: LayoutElement | None = None,
        transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        arrowhead_filter: NoneValueType | Filter | None = None,
        arrowhead_stroke_dasharray: tuple[float, ...]
        | None = None,
        arrowhead_stroke_dashoffset: float | None = None,
        arrowhead_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        arrowhead_height: float = 10.0,
    )

Bases: `SBGNSingleHeadedArc`

Class for inhibition layouts

Parameters:

Name | Type | Description | Default
--- | --- | --- | ---
`id_` | `str` | The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element | `'fa8dddae-4154-470e-9738-8c75ddec76fa'`
`layout_elements` | `tuple[LayoutElement]` | The sub-layout elements of the group layout. These are part of the children of the group layout | `<dynamic>`
`group_fill` | `NoneValueType | Color | None` | The fill color of the group layout | `None`
`group_fill_rule` | `FillRule | None` | The fill rule of the group layout | `None`
`group_filter` | `NoneValueType | Filter | None` | The filter of the group layout | `None`
`group_font_family` | `str | None` | The font family of the group layout | `None`
`group_font_size` | `float | None` | The font size of the group layout | `None`
`group_font_style` | `FontStyle | None` | The font style of the group layout | `None`
`group_font_weight` | `FontWeight | float | None` | The font weight of the group layout | `None`
`group_stroke` | `NoneValueType | Color | None` | The stroke color of the group layout | `None`
`group_stroke_dasharray` | `tuple[float, ...] | None` | The stroke dasharray of the group layout | `None`
`group_stroke_dashoffset` | `float | None` | The stroke dashoffset of the group layout | `None`
`group_stroke_width` | `float | None` | The stroke width of the group layout | `None`
`group_text_anchor` | `TextAnchor | None` | The text anchor of the group layout | `None`
`group_transform` | `NoneValueType | tuple[Transformation] | None` | The transform of the group layout | `None`
`end_shorten` | `float` | The length the end of the arc will be shorten by | `0.0`
`fill` | `NoneValueType | Color | None` | The fill color of the arc | `None`
`filter` | `NoneValueType | Filter | None` | The fill filter of the arc | `None`
`path_fill` | `NoneValueType | Color | None` |  | `<momapy.drawing.NoneValueType object at 0x7fb32ae9f1d0>`
`path_filter` | `NoneValueType | Filter | None` | The path filter of the arc | `None`
`path_stroke` | `NoneValueType | Color | None` |  | `Color(red=0, green=0, blue=0, alpha=1.0)`
`path_stroke_dasharray` | `tuple[float, ...] | None` | The path stroke dasharray of the arc | `None`
`path_stroke_dashoffset` | `float | None` | The path stroke dashoffset of the arc | `None`
`path_stroke_width` | `float | None` |  | `1.25`
`path_transform` | `NoneValueType | tuple[Transformation] | None` | The path transform of the arc | `None`
`stroke` | `NoneValueType | Color | None` | The stroke color of the arc | `None`
`stroke_dasharray` | `NoneValueType | tuple[float] | None` | The stroke dasharray of the arc | `None`
`stroke_dashoffset` | `float | None` | The stroke dashoffset of the arc | `None`
`stroke_width` | `float | None` | The stroke width of the arc | `None`
`segments` | `tuple[Union[Segment, BezierCurve, EllipticalArc]]` | The path segments of the arc | `<dynamic>`
`source` | `LayoutElement | None` | The source of the arc | `None`
`start_shorten` | `float` | The length the start of the arc will be shorten by | `0.0`
`target` | `LayoutElement | None` | The target of the arc | `None`
`transform` | `NoneValueType | tuple[Transformation] | None` | The transform of the arc | `None`
`arrowhead_fill` | `NoneValueType | Color | None` |  | `Color(red=255, green=255, blue=255, alpha=1.0)`
`arrowhead_filter` | `NoneValueType | Filter | None` | The arrowhead filter of the arc | `None`
`arrowhead_stroke` | `NoneValueType | Color | None` |  | `Color(red=0, green=0, blue=0, alpha=1.0)`
`arrowhead_stroke_dasharray` | `tuple[float, ...] | None` | The arrowhead stroke dasharray of the arc | `None`
`arrowhead_stroke_dashoffset` | `float | None` | The arrowhead stroke dashoffset of the arc | `None`
`arrowhead_stroke_width` | `float | None` |  | `1.25`
`arrowhead_transform` | `NoneValueType | tuple[Transformation] | None` | The arrowhead transform of the arc | `None`
`arrowhead_height` | `float` |  | `10.0`

Methods:

Name | Description
--- | ---
`anchor_point` | Return an anchor point of the layout element
`arrowhead_base` | Return the arrowhead base anchor point of the single-headed arc
`arrowhead_bbox` | Return the bounding box of the single-headed arc arrowhead
`arrowhead_border` | Return the point at the intersection of the drawing elements of the single-headed arc arrowhead and the line going through the center of these drawing elements and the given point.
`arrowhead_drawing_elements` | Return the drawing elements of the single-headed arc arrowhead
`arrowhead_length` | Return the length of the single-headed arc arrowhead
`arrowhead_tip` | Return the arrowhead tip anchor point of the single-headed arc
`bbox` | Compute and return the bounding box of the group layout element
`childless` | Return a copy of the arc with no children
`children` | Return the children of the group layout.
`contains` | Return `true` if another layout element is a descendant of the layout element, `false` otherwise
`descendants` | Return the descendants of the layout element
`drawing_elements` | Return the drawing elements of the group layout.
`end_point` | Return the ending point of the arc
`equals` | Return `true` if the layout element is equal to another layout element, `false` otherwise
`flattened` | Return a list containing copy of the layout element with no children and all its descendants with no children
`fraction` | Return the position and angle on the arc at a given fraction (of the total arc length)
`length` | Return the total length of the arc path
`path_drawing_elements` | Return the drawing elements of the single-headed arc path
`points` | Return the points of the arc path
`self_bbox` | Compute and return the bounding box of the self drawing element of the group layout
`self_children` | Return the self children of the arc
`self_drawing_elements` | Return the self drawing elements of the single-headed arc
`self_to_shapely` | Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout
`start_point` | Return the starting point of the arc
`to_shapely` | Return a shapely collection of geometries reproducing the drawing elements of the layout element

#### `` anchor_point

    anchor_point(anchor_name: str) -> Point

Return an anchor point of the layout element

Source code in `src/momapy/core.py`

    130
    131
    132
    def anchor_point(self, anchor_name: str) -> momapy.geometry.Point:
        """Return an anchor point of the layout element"""
        return getattr(self, anchor_name)()

#### `` arrowhead_base

    arrowhead_base() -> Point

Return the arrowhead base anchor point of the single-headed arc

Source code in `src/momapy/core.py`

    1058
    1059
    1060
    1061
    1062
    1063
    1064
    1065
    1066
    def arrowhead_base(self) -> momapy.geometry.Point:
        """Return the arrowhead base anchor point of the single-headed arc"""
        arrowhead_length = self.arrowhead_length()
        segment = self.segments[-1]
        segment_length = segment.length()
        if segment_length == 0:
            return self.arrowhead_tip() - (arrowhead_length, 0)
        fraction = 1 - (arrowhead_length + self.end_shorten) / segment_length
        return segment.get_position_at_fraction(fraction)

#### `` arrowhead_bbox

    arrowhead_bbox() -> Bbox

Return the bounding box of the single-headed arc arrowhead

Source code in `src/momapy/core.py`

    1068
    1069
    1070
    1071
    1072
    def arrowhead_bbox(self) -> momapy.geometry.Bbox:
        """Return the bounding box of the single-headed arc arrowhead"""
        return momapy.drawing.get_drawing_elements_bbox(
            self.arrowhead_drawing_elements()
        )

#### `` arrowhead_border

    arrowhead_border(point) -> Point

Return the point at the intersection of the drawing elements of the single-headed arc arrowhead and the line going through the center of these drawing elements and the given point. When there are multiple intersection points, the one closest to the given point is returned

Source code in `src/momapy/core.py`

    1074
    1075
    1076
    1077
    1078
    1079
    1080
    1081
    1082
    1083
    1084
    def arrowhead_border(self, point) -> momapy.geometry.Point:
        """Return the point at the intersection of the drawing elements of the single-headed arc arrowhead and the line going through the center of these drawing elements and the given point.
        When there are multiple intersection points, the one closest to the given point is returned
        """

        point = momapy.drawing.get_drawing_elements_border(
            self.arrowhead_drawing_elements(), point
        )
        if point is None:
            return self.arrowhead_tip()
        return point

#### `` arrowhead_drawing_elements

    arrowhead_drawing_elements() -> list[DrawingElement]

Return the drawing elements of the single-headed arc arrowhead

Source code in `src/momapy/core.py`

    1108
    1109
    1110
    1111
    1112
    1113
    1114
    1115
    1116
    1117
    1118
    1119
    1120
    1121
    1122
    1123
    1124
    1125
    1126
    1127
    def arrowhead_drawing_elements(
        self,
    ) -> list[momapy.drawing.DrawingElement]:
        """Return the drawing elements of the single-headed arc arrowhead"""
        drawing_elements = self._arrowhead_border_drawing_elements()
        group = momapy.drawing.Group(
            class_=f"{type(self).__name__}_arrowhead",
            elements=tuple(drawing_elements),
            fill=self.arrowhead_fill,
            filter=self.arrowhead_filter,
            id_=f"{self.id_}_arrowhead",
            stroke=self.arrowhead_stroke,
            stroke_dasharray=self.arrowhead_stroke_dasharray,
            stroke_dashoffset=self.arrowhead_stroke_dashoffset,
            stroke_width=self.arrowhead_stroke_width,
            transform=self.arrowhead_transform,
        )
        transformation = self._get_arrowhead_transformation()
        group = group.transformed(transformation)
        return [group]

#### `` arrowhead_length

    arrowhead_length() -> float

Return the length of the single-headed arc arrowhead

Source code in `src/momapy/core.py`

    1040
    1041
    1042
    1043
    1044
    1045
    1046
    1047
    def arrowhead_length(self) -> float:
        """Return the length of the single-headed arc arrowhead"""
        bbox = momapy.drawing.get_drawing_elements_bbox(
            self._arrowhead_border_drawing_elements()
        )
        if math.isnan(bbox.width):
            return 0.0
        return bbox.east().x

#### `` arrowhead_tip

    arrowhead_tip() -> Point

Return the arrowhead tip anchor point of the single-headed arc

Source code in `src/momapy/core.py`

    1049
    1050
    1051
    1052
    1053
    1054
    1055
    1056
    def arrowhead_tip(self) -> momapy.geometry.Point:
        """Return the arrowhead tip anchor point of the single-headed arc"""
        segment = self.segments[-1]
        segment_length = segment.length()
        if segment_length == 0:
            return segment.p2
        fraction = 1 - self.end_shorten / segment_length
        return segment.get_position_at_fraction(fraction)

#### `` bbox

    bbox() -> Bbox

Compute and return the bounding box of the group layout element

Source code in `src/momapy/core.py`

    504
    505
    506
    507
    508
    509
    510
    511
    512
    513
    514
    515
    516
    517
    518
    519
    520
    521
    522
    523
    524
    525
    526
    def bbox(self) -> momapy.geometry.Bbox:
        """Compute and return the bounding box of the group layout element"""
        self_bbox = self.self_bbox()
        bboxes = [child.bbox() for child in self.children()]
        min_x = self_bbox.north_west().x
        min_y = self_bbox.north_west().y
        max_x = self_bbox.south_east().x
        max_y = self_bbox.south_east().y
        for bbox in bboxes:
            if bbox.north_west().x < min_x:
                min_x = bbox.north_west().x
            if bbox.north_west().y < min_y:
                min_y = bbox.north_west().y
            if bbox.south_east().x > max_x:
                max_x = bbox.south_east().x
            if bbox.south_east().y > max_y:
                max_y = bbox.south_east().y
        bbox = momapy.geometry.Bbox(
            momapy.geometry.Point(min_x / 2 + max_x / 2, min_y / 2 + max_y / 2),
            max_x - min_x,
            max_y - min_y,
        )
        return bbox

#### `` childless

    childless() -> Self

Return a copy of the arc with no children

Source code in `src/momapy/core.py`

    955
    956
    957
    def childless(self) -> typing.Self:
        """Return a copy of the arc with no children"""
        return dataclasses.replace(self, layout_elements=tuple([]))

#### `` children

    children() -> list[LayoutElement]

Return the children of the group layout. These are the self children of the group layout (returned by the `self_children` method) and the other children of the group layout (given by the `layout_elements` attribute)

Source code in `src/momapy/core.py`

    566
    567
    568
    569
    570
    def children(self) -> list[LayoutElement]:
        """Return the children of the group layout.
        These are the self children of the group layout (returned by the `self_children` method) and the other children of the group layout (given by the `layout_elements` attribute)
        """
        return self.self_children() + list(self.layout_elements)

#### `` contains

    contains(other: LayoutElement) -> bool

Return `true` if another layout element is a descendant of the layout element, `false` otherwise

Source code in `src/momapy/core.py`

    119
    120
    121
    def contains(self, other: "LayoutElement") -> bool:
        """Return `true` if another layout element is a descendant of the layout element, `false` otherwise"""
        return other in self.descendants()

#### `` descendants

    descendants() -> list[LayoutElement]

Return the descendants of the layout element

Source code in `src/momapy/core.py`

    90
    91
    92
    93
    94
    95
    96
    def descendants(self) -> list["LayoutElement"]:
        """Return the descendants of the layout element"""
        descendants = []
        for child in self.children():
            descendants.append(child)
            descendants += child.descendants()
        return descendants

#### `` drawing_elements

    drawing_elements() -> list[DrawingElement]

Return the drawing elements of the group layout. The returned drawing elements are a group drawing element formed of the self drawing elements of the group layout and the drawing elements of its children

Source code in `src/momapy/core.py`

    538
    539
    540
    541
    542
    543
    544
    545
    546
    547
    548
    549
    550
    551
    552
    553
    554
    555
    556
    557
    558
    559
    560
    561
    562
    563
    564
    def drawing_elements(self) -> list[momapy.drawing.DrawingElement]:
        """Return the drawing elements of the group layout.
        The returned drawing elements are a group drawing element formed of the self drawing elements of the group layout and the drawing elements of its children
        """
        drawing_elements = self.self_drawing_elements()
        for child in self.children():
            if child is not None:
                drawing_elements += child.drawing_elements()
        group = momapy.drawing.Group(
            class_=f"{type(self).__name__}_group",
            elements=tuple(drawing_elements),
            id_=f"{self.id_}_group",
            fill=self.group_fill,
            fill_rule=self.group_fill_rule,
            filter=self.group_filter,
            font_family=self.group_font_family,
            font_size=self.group_font_size,
            font_style=self.group_font_style,
            font_weight=self.group_font_weight,
            stroke=self.group_stroke,
            stroke_dasharray=self.group_stroke_dasharray,
            stroke_dashoffset=self.group_stroke_dashoffset,
            stroke_width=self.group_stroke_width,
            text_anchor=self.group_text_anchor,
            transform=self.group_transform,
        )
        return [group]

#### `` end_point

    end_point() -> Point

Return the ending point of the arc

Source code in `src/momapy/core.py`

    951
    952
    953
    def end_point(self) -> momapy.geometry.Point:
        """Return the ending point of the arc"""
        return self.points()[-1]

#### `` equals

    equals(
        other: LayoutElement,
        flattened: bool = False,
        unordered: bool = False,
    ) -> bool

Return `true` if the layout element is equal to another layout element, `false` otherwise

Source code in `src/momapy/core.py`

    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    def equals(
        self, other: "LayoutElement", flattened: bool = False, unordered: bool = False
    ) -> bool:
        """Return `true` if the layout element is equal to another layout element, `false` otherwise"""
        if type(self) is type(other):
            if not flattened:
                return self == other
            else:
                if not unordered:
                    return self.flattened() == other.flattened()
                else:
                    return set(self.flattened()) == set(other.flattened())
        return False

#### `` flattened

    flattened() -> list[LayoutElement]

Return a list containing copy of the layout element with no children and all its descendants with no children

Source code in `src/momapy/core.py`

     98
     99
    100
    101
    102
    103
    def flattened(self) -> list["LayoutElement"]:
        """Return a list containing copy of the layout element with no children and all its descendants with no children"""
        flattened = [self.childless()]
        for child in self.children():
            flattened += child.flattened()
        return flattened

#### `` fraction

    fraction(fraction: float) -> tuple[Point, float]

Return the position and angle on the arc at a given fraction (of the total arc length)

Source code in `src/momapy/core.py`

    959
    960
    961
    962
    963
    964
    965
    966
    967
    968
    def fraction(self, fraction: float) -> tuple[momapy.geometry.Point, float]:
        """Return the position and angle on the arc at a given fraction (of the total arc length)"""
        current_length = 0
        length_to_reach = fraction * self.length()
        for segment in self.segments:
            current_length += segment.length()
            if current_length >= length_to_reach:
                break
        position, angle = segment.get_position_and_angle_at_fraction(fraction)
        return position, angle

#### `` length

    length()

Return the total length of the arc path

Source code in `src/momapy/core.py`

    943
    944
    945
    def length(self):
        """Return the total length of the arc path"""
        return sum([segment.length() for segment in self.segments])

#### `` path_drawing_elements

    path_drawing_elements() -> list[Path]

Return the drawing elements of the single-headed arc path

Source code in `src/momapy/core.py`

    1129
    1130
    1131
    1132
    1133
    1134
    1135
    1136
    1137
    1138
    1139
    1140
    1141
    1142
    1143
    1144
    1145
    1146
    1147
    1148
    1149
    1150
    1151
    1152
    1153
    1154
    1155
    1156
    1157
    1158
    1159
    1160
    1161
    1162
    1163
    1164
    1165
    1166
    1167
    def path_drawing_elements(self) -> list[momapy.drawing.Path]:
        """Return the drawing elements of the single-headed arc path"""
        arrowhead_length = self.arrowhead_length()
        if len(self.segments) == 1:
            segment = (
                self.segments[0]
                .shortened(self.start_shorten, "start")
                .shortened(self.end_shorten + arrowhead_length, "end")
            )
            actions = [
                momapy.drawing.MoveTo(segment.p1),
                self._make_path_action_from_segment(segment),
            ]
        else:
            first_segment = self.segments[0].shortened(self.start_shorten, "start")
            last_segment = self.segments[-1].shortened(
                self.end_shorten + arrowhead_length, "end"
            )
            actions = [
                momapy.drawing.MoveTo(first_segment.p1),
                self._make_path_action_from_segment(first_segment),
            ]
            for segment in self.segments[1:-1]:
                action = self._make_path_action_from_segment(segment)
                actions.append(action)
            actions.append(self._make_path_action_from_segment(last_segment))
        path = momapy.drawing.Path(
            actions=tuple(actions),
            class_=f"{type(self).__name__}_path",
            fill=self.path_fill,
            filter=self.path_filter,
            id_=f"{self.id_}_path",
            stroke=self.path_stroke,
            stroke_dasharray=self.path_stroke_dasharray,
            stroke_dashoffset=self.path_stroke_dashoffset,
            stroke_width=self.path_stroke_width,
            transform=self.path_transform,
        )
        return [path]

#### `` points

    points() -> list[Point]

Return the points of the arc path

Source code in `src/momapy/core.py`

    935
    936
    937
    938
    939
    940
    941
    def points(self) -> list[momapy.geometry.Point]:
        """Return the points of the arc path"""
        points = []
        for segment in self.segments:
            points.append(segment.p1)
        points.append(segment.p2)
        return points

#### `` self_bbox

    self_bbox() -> Bbox

Compute and return the bounding box of the self drawing element of the group layout

Source code in `src/momapy/core.py`

    499
    500
    501
    502
    def self_bbox(self) -> momapy.geometry.Bbox:
        """Compute and return the bounding box of the self drawing element of the group layout"""
        bounds = self.self_to_shapely().bounds
        return momapy.geometry.Bbox.from_bounds(bounds)

#### `` self_children

    self_children() -> list[LayoutElement]

Return the self children of the arc

Source code in `src/momapy/core.py`

    931
    932
    933
    def self_children(self) -> list[LayoutElement]:
        """Return the self children of the arc"""
        return []

#### `` self_drawing_elements

    self_drawing_elements() -> list[DrawingElement]

Return the self drawing elements of the single-headed arc

Source code in `src/momapy/core.py`

    1169
    1170
    1171
    1172
    1173
    1174
    1175
    1176
    1177
    1178
    1179
    1180
    1181
    1182
    1183
    1184
    1185
    1186
    def self_drawing_elements(self) -> list[momapy.drawing.DrawingElement]:
        """Return the self drawing elements of the single-headed arc"""
        drawing_elements = (
            self.path_drawing_elements() + self.arrowhead_drawing_elements()
        )
        group = momapy.drawing.Group(
            class_=type(self).__name__,
            elements=tuple(drawing_elements),
            fill=self.fill,
            filter=self.filter,
            id_=self.id_,
            stroke=self.stroke,
            stroke_dasharray=self.stroke_dasharray,
            stroke_dashoffset=self.stroke_dashoffset,
            stroke_width=self.stroke_width,
            transform=self.transform,
        )
        return [group]

#### `` self_to_shapely

    self_to_shapely() -> GeometryCollection

Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout

Source code in `src/momapy/core.py`

    495
    496
    497
    def self_to_shapely(self) -> shapely.GeometryCollection:
        """Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout"""
        return momapy.drawing.drawing_elements_to_shapely(self.drawing_elements())

#### `` start_point

    start_point() -> Point

Return the starting point of the arc

Source code in `src/momapy/core.py`

    947
    948
    949
    def start_point(self) -> momapy.geometry.Point:
        """Return the starting point of the arc"""
        return self.points()[0]

#### `` to_shapely

    to_shapely(to_polygons: bool = False) -> GeometryCollection

Return a shapely collection of geometries reproducing the drawing elements of the layout element

Source code in `src/momapy/core.py`

    123
    124
    125
    126
    127
    128
    def to_shapely(self, to_polygons: bool = False) -> shapely.GeometryCollection:
        """Return a shapely collection of geometries reproducing the drawing elements of the layout element"""
        geom_collection = []
        for drawing_element in self.drawing_elements():
            geom_collection += drawing_element.to_shapely(to_polygons=to_polygons).geoms
        return shapely.GeometryCollection(geom_collection)

### `` LogicArcLayout `dataclass`

    LogicArcLayout(
        path_fill: NoneValueType | Color | None = NoneValue,
        path_stroke: NoneValueType | Color | None = black,
        path_stroke_width: float | None = 1.25,
        arrowhead_fill: NoneValueType | Color | None = white,
        arrowhead_stroke: NoneValueType | Color | None = black,
        arrowhead_stroke_width: float | None = 1.25,
        *,
        id_: str = make_uuid4_as_str(),
        layout_elements: tuple[LayoutElement] = tuple(),
        group_fill: NoneValueType | Color | None = None,
        group_fill_rule: FillRule | None = None,
        group_filter: NoneValueType | Filter | None = None,
        group_font_family: str | None = None,
        group_font_size: float | None = None,
        group_font_style: FontStyle | None = None,
        group_font_weight: FontWeight | float | None = None,
        group_stroke: NoneValueType | Color | None = None,
        group_stroke_dasharray: tuple[float, ...] | None = None,
        group_stroke_dashoffset: float | None = None,
        group_stroke_width: float | None = None,
        group_text_anchor: TextAnchor | None = None,
        group_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        end_shorten: float = 0.0,
        fill: NoneValueType | Color | None = None,
        filter: NoneValueType | Filter | None = None,
        path_filter: NoneValueType | Filter | None = None,
        path_stroke_dasharray: tuple[float, ...] | None = None,
        path_stroke_dashoffset: float | None = None,
        path_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        stroke: NoneValueType | Color | None = None,
        stroke_dasharray: NoneValueType
        | tuple[float]
        | None = None,
        stroke_dashoffset: float | None = None,
        stroke_width: float | None = None,
        segments: tuple[
            Segment | BezierCurve | EllipticalArc
        ] = tuple(),
        source: LayoutElement | None = None,
        start_shorten: float = 0.0,
        target: LayoutElement | None = None,
        transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        arrowhead_filter: NoneValueType | Filter | None = None,
        arrowhead_stroke_dasharray: tuple[float, ...]
        | None = None,
        arrowhead_stroke_dashoffset: float | None = None,
        arrowhead_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
    )

Bases: `SBGNSingleHeadedArc`

Class for logic arc layouts

Parameters:

Name | Type | Description | Default
--- | --- | --- | ---
`id_` | `str` | The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element | `'a3da40b3-6742-4a28-906a-4c3aa5d9febb'`
`layout_elements` | `tuple[LayoutElement]` | The sub-layout elements of the group layout. These are part of the children of the group layout | `<dynamic>`
`group_fill` | `NoneValueType | Color | None` | The fill color of the group layout | `None`
`group_fill_rule` | `FillRule | None` | The fill rule of the group layout | `None`
`group_filter` | `NoneValueType | Filter | None` | The filter of the group layout | `None`
`group_font_family` | `str | None` | The font family of the group layout | `None`
`group_font_size` | `float | None` | The font size of the group layout | `None`
`group_font_style` | `FontStyle | None` | The font style of the group layout | `None`
`group_font_weight` | `FontWeight | float | None` | The font weight of the group layout | `None`
`group_stroke` | `NoneValueType | Color | None` | The stroke color of the group layout | `None`
`group_stroke_dasharray` | `tuple[float, ...] | None` | The stroke dasharray of the group layout | `None`
`group_stroke_dashoffset` | `float | None` | The stroke dashoffset of the group layout | `None`
`group_stroke_width` | `float | None` | The stroke width of the group layout | `None`
`group_text_anchor` | `TextAnchor | None` | The text anchor of the group layout | `None`
`group_transform` | `NoneValueType | tuple[Transformation] | None` | The transform of the group layout | `None`
`end_shorten` | `float` | The length the end of the arc will be shorten by | `0.0`
`fill` | `NoneValueType | Color | None` | The fill color of the arc | `None`
`filter` | `NoneValueType | Filter | None` | The fill filter of the arc | `None`
`path_fill` | `NoneValueType | Color | None` |  | `<momapy.drawing.NoneValueType object at 0x7fb32ae9f1d0>`
`path_filter` | `NoneValueType | Filter | None` | The path filter of the arc | `None`
`path_stroke` | `NoneValueType | Color | None` |  | `Color(red=0, green=0, blue=0, alpha=1.0)`
`path_stroke_dasharray` | `tuple[float, ...] | None` | The path stroke dasharray of the arc | `None`
`path_stroke_dashoffset` | `float | None` | The path stroke dashoffset of the arc | `None`
`path_stroke_width` | `float | None` |  | `1.25`
`path_transform` | `NoneValueType | tuple[Transformation] | None` | The path transform of the arc | `None`
`stroke` | `NoneValueType | Color | None` | The stroke color of the arc | `None`
`stroke_dasharray` | `NoneValueType | tuple[float] | None` | The stroke dasharray of the arc | `None`
`stroke_dashoffset` | `float | None` | The stroke dashoffset of the arc | `None`
`stroke_width` | `float | None` | The stroke width of the arc | `None`
`segments` | `tuple[Union[Segment, BezierCurve, EllipticalArc]]` | The path segments of the arc | `<dynamic>`
`source` | `LayoutElement | None` | The source of the arc | `None`
`start_shorten` | `float` | The length the start of the arc will be shorten by | `0.0`
`target` | `LayoutElement | None` | The target of the arc | `None`
`transform` | `NoneValueType | tuple[Transformation] | None` | The transform of the arc | `None`
`arrowhead_fill` | `NoneValueType | Color | None` |  | `Color(red=255, green=255, blue=255, alpha=1.0)`
`arrowhead_filter` | `NoneValueType | Filter | None` | The arrowhead filter of the arc | `None`
`arrowhead_stroke` | `NoneValueType | Color | None` |  | `Color(red=0, green=0, blue=0, alpha=1.0)`
`arrowhead_stroke_dasharray` | `tuple[float, ...] | None` | The arrowhead stroke dasharray of the arc | `None`
`arrowhead_stroke_dashoffset` | `float | None` | The arrowhead stroke dashoffset of the arc | `None`
`arrowhead_stroke_width` | `float | None` |  | `1.25`
`arrowhead_transform` | `NoneValueType | tuple[Transformation] | None` | The arrowhead transform of the arc | `None`

Methods:

Name | Description
--- | ---
`anchor_point` | Return an anchor point of the layout element
`arrowhead_base` | Return the arrowhead base anchor point of the single-headed arc
`arrowhead_bbox` | Return the bounding box of the single-headed arc arrowhead
`arrowhead_border` | Return the point at the intersection of the drawing elements of the single-headed arc arrowhead and the line going through the center of these drawing elements and the given point.
`arrowhead_drawing_elements` | Return the drawing elements of the single-headed arc arrowhead
`arrowhead_length` | Return the length of the single-headed arc arrowhead
`arrowhead_tip` | Return the arrowhead tip anchor point of the single-headed arc
`bbox` | Compute and return the bounding box of the group layout element
`childless` | Return a copy of the arc with no children
`children` | Return the children of the group layout.
`contains` | Return `true` if another layout element is a descendant of the layout element, `false` otherwise
`descendants` | Return the descendants of the layout element
`drawing_elements` | Return the drawing elements of the group layout.
`end_point` | Return the ending point of the arc
`equals` | Return `true` if the layout element is equal to another layout element, `false` otherwise
`flattened` | Return a list containing copy of the layout element with no children and all its descendants with no children
`fraction` | Return the position and angle on the arc at a given fraction (of the total arc length)
`length` | Return the total length of the arc path
`path_drawing_elements` | Return the drawing elements of the single-headed arc path
`points` | Return the points of the arc path
`self_bbox` | Compute and return the bounding box of the self drawing element of the group layout
`self_children` | Return the self children of the arc
`self_drawing_elements` | Return the self drawing elements of the single-headed arc
`self_to_shapely` | Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout
`start_point` | Return the starting point of the arc
`to_shapely` | Return a shapely collection of geometries reproducing the drawing elements of the layout element

#### `` anchor_point

    anchor_point(anchor_name: str) -> Point

Return an anchor point of the layout element

Source code in `src/momapy/core.py`

    130
    131
    132
    def anchor_point(self, anchor_name: str) -> momapy.geometry.Point:
        """Return an anchor point of the layout element"""
        return getattr(self, anchor_name)()

#### `` arrowhead_base

    arrowhead_base() -> Point

Return the arrowhead base anchor point of the single-headed arc

Source code in `src/momapy/core.py`

    1058
    1059
    1060
    1061
    1062
    1063
    1064
    1065
    1066
    def arrowhead_base(self) -> momapy.geometry.Point:
        """Return the arrowhead base anchor point of the single-headed arc"""
        arrowhead_length = self.arrowhead_length()
        segment = self.segments[-1]
        segment_length = segment.length()
        if segment_length == 0:
            return self.arrowhead_tip() - (arrowhead_length, 0)
        fraction = 1 - (arrowhead_length + self.end_shorten) / segment_length
        return segment.get_position_at_fraction(fraction)

#### `` arrowhead_bbox

    arrowhead_bbox() -> Bbox

Return the bounding box of the single-headed arc arrowhead

Source code in `src/momapy/core.py`

    1068
    1069
    1070
    1071
    1072
    def arrowhead_bbox(self) -> momapy.geometry.Bbox:
        """Return the bounding box of the single-headed arc arrowhead"""
        return momapy.drawing.get_drawing_elements_bbox(
            self.arrowhead_drawing_elements()
        )

#### `` arrowhead_border

    arrowhead_border(point) -> Point

Return the point at the intersection of the drawing elements of the single-headed arc arrowhead and the line going through the center of these drawing elements and the given point. When there are multiple intersection points, the one closest to the given point is returned

Source code in `src/momapy/core.py`

    1074
    1075
    1076
    1077
    1078
    1079
    1080
    1081
    1082
    1083
    1084
    def arrowhead_border(self, point) -> momapy.geometry.Point:
        """Return the point at the intersection of the drawing elements of the single-headed arc arrowhead and the line going through the center of these drawing elements and the given point.
        When there are multiple intersection points, the one closest to the given point is returned
        """

        point = momapy.drawing.get_drawing_elements_border(
            self.arrowhead_drawing_elements(), point
        )
        if point is None:
            return self.arrowhead_tip()
        return point

#### `` arrowhead_drawing_elements

    arrowhead_drawing_elements() -> list[DrawingElement]

Return the drawing elements of the single-headed arc arrowhead

Source code in `src/momapy/core.py`

    1108
    1109
    1110
    1111
    1112
    1113
    1114
    1115
    1116
    1117
    1118
    1119
    1120
    1121
    1122
    1123
    1124
    1125
    1126
    1127
    def arrowhead_drawing_elements(
        self,
    ) -> list[momapy.drawing.DrawingElement]:
        """Return the drawing elements of the single-headed arc arrowhead"""
        drawing_elements = self._arrowhead_border_drawing_elements()
        group = momapy.drawing.Group(
            class_=f"{type(self).__name__}_arrowhead",
            elements=tuple(drawing_elements),
            fill=self.arrowhead_fill,
            filter=self.arrowhead_filter,
            id_=f"{self.id_}_arrowhead",
            stroke=self.arrowhead_stroke,
            stroke_dasharray=self.arrowhead_stroke_dasharray,
            stroke_dashoffset=self.arrowhead_stroke_dashoffset,
            stroke_width=self.arrowhead_stroke_width,
            transform=self.arrowhead_transform,
        )
        transformation = self._get_arrowhead_transformation()
        group = group.transformed(transformation)
        return [group]

#### `` arrowhead_length

    arrowhead_length() -> float

Return the length of the single-headed arc arrowhead

Source code in `src/momapy/core.py`

    1040
    1041
    1042
    1043
    1044
    1045
    1046
    1047
    def arrowhead_length(self) -> float:
        """Return the length of the single-headed arc arrowhead"""
        bbox = momapy.drawing.get_drawing_elements_bbox(
            self._arrowhead_border_drawing_elements()
        )
        if math.isnan(bbox.width):
            return 0.0
        return bbox.east().x

#### `` arrowhead_tip

    arrowhead_tip() -> Point

Return the arrowhead tip anchor point of the single-headed arc

Source code in `src/momapy/core.py`

    1049
    1050
    1051
    1052
    1053
    1054
    1055
    1056
    def arrowhead_tip(self) -> momapy.geometry.Point:
        """Return the arrowhead tip anchor point of the single-headed arc"""
        segment = self.segments[-1]
        segment_length = segment.length()
        if segment_length == 0:
            return segment.p2
        fraction = 1 - self.end_shorten / segment_length
        return segment.get_position_at_fraction(fraction)

#### `` bbox

    bbox() -> Bbox

Compute and return the bounding box of the group layout element

Source code in `src/momapy/core.py`

    504
    505
    506
    507
    508
    509
    510
    511
    512
    513
    514
    515
    516
    517
    518
    519
    520
    521
    522
    523
    524
    525
    526
    def bbox(self) -> momapy.geometry.Bbox:
        """Compute and return the bounding box of the group layout element"""
        self_bbox = self.self_bbox()
        bboxes = [child.bbox() for child in self.children()]
        min_x = self_bbox.north_west().x
        min_y = self_bbox.north_west().y
        max_x = self_bbox.south_east().x
        max_y = self_bbox.south_east().y
        for bbox in bboxes:
            if bbox.north_west().x < min_x:
                min_x = bbox.north_west().x
            if bbox.north_west().y < min_y:
                min_y = bbox.north_west().y
            if bbox.south_east().x > max_x:
                max_x = bbox.south_east().x
            if bbox.south_east().y > max_y:
                max_y = bbox.south_east().y
        bbox = momapy.geometry.Bbox(
            momapy.geometry.Point(min_x / 2 + max_x / 2, min_y / 2 + max_y / 2),
            max_x - min_x,
            max_y - min_y,
        )
        return bbox

#### `` childless

    childless() -> Self

Return a copy of the arc with no children

Source code in `src/momapy/core.py`

    955
    956
    957
    def childless(self) -> typing.Self:
        """Return a copy of the arc with no children"""
        return dataclasses.replace(self, layout_elements=tuple([]))

#### `` children

    children() -> list[LayoutElement]

Return the children of the group layout. These are the self children of the group layout (returned by the `self_children` method) and the other children of the group layout (given by the `layout_elements` attribute)

Source code in `src/momapy/core.py`

    566
    567
    568
    569
    570
    def children(self) -> list[LayoutElement]:
        """Return the children of the group layout.
        These are the self children of the group layout (returned by the `self_children` method) and the other children of the group layout (given by the `layout_elements` attribute)
        """
        return self.self_children() + list(self.layout_elements)

#### `` contains

    contains(other: LayoutElement) -> bool

Return `true` if another layout element is a descendant of the layout element, `false` otherwise

Source code in `src/momapy/core.py`

    119
    120
    121
    def contains(self, other: "LayoutElement") -> bool:
        """Return `true` if another layout element is a descendant of the layout element, `false` otherwise"""
        return other in self.descendants()

#### `` descendants

    descendants() -> list[LayoutElement]

Return the descendants of the layout element

Source code in `src/momapy/core.py`

    90
    91
    92
    93
    94
    95
    96
    def descendants(self) -> list["LayoutElement"]:
        """Return the descendants of the layout element"""
        descendants = []
        for child in self.children():
            descendants.append(child)
            descendants += child.descendants()
        return descendants

#### `` drawing_elements

    drawing_elements() -> list[DrawingElement]

Return the drawing elements of the group layout. The returned drawing elements are a group drawing element formed of the self drawing elements of the group layout and the drawing elements of its children

Source code in `src/momapy/core.py`

    538
    539
    540
    541
    542
    543
    544
    545
    546
    547
    548
    549
    550
    551
    552
    553
    554
    555
    556
    557
    558
    559
    560
    561
    562
    563
    564
    def drawing_elements(self) -> list[momapy.drawing.DrawingElement]:
        """Return the drawing elements of the group layout.
        The returned drawing elements are a group drawing element formed of the self drawing elements of the group layout and the drawing elements of its children
        """
        drawing_elements = self.self_drawing_elements()
        for child in self.children():
            if child is not None:
                drawing_elements += child.drawing_elements()
        group = momapy.drawing.Group(
            class_=f"{type(self).__name__}_group",
            elements=tuple(drawing_elements),
            id_=f"{self.id_}_group",
            fill=self.group_fill,
            fill_rule=self.group_fill_rule,
            filter=self.group_filter,
            font_family=self.group_font_family,
            font_size=self.group_font_size,
            font_style=self.group_font_style,
            font_weight=self.group_font_weight,
            stroke=self.group_stroke,
            stroke_dasharray=self.group_stroke_dasharray,
            stroke_dashoffset=self.group_stroke_dashoffset,
            stroke_width=self.group_stroke_width,
            text_anchor=self.group_text_anchor,
            transform=self.group_transform,
        )
        return [group]

#### `` end_point

    end_point() -> Point

Return the ending point of the arc

Source code in `src/momapy/core.py`

    951
    952
    953
    def end_point(self) -> momapy.geometry.Point:
        """Return the ending point of the arc"""
        return self.points()[-1]

#### `` equals

    equals(
        other: LayoutElement,
        flattened: bool = False,
        unordered: bool = False,
    ) -> bool

Return `true` if the layout element is equal to another layout element, `false` otherwise

Source code in `src/momapy/core.py`

    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    def equals(
        self, other: "LayoutElement", flattened: bool = False, unordered: bool = False
    ) -> bool:
        """Return `true` if the layout element is equal to another layout element, `false` otherwise"""
        if type(self) is type(other):
            if not flattened:
                return self == other
            else:
                if not unordered:
                    return self.flattened() == other.flattened()
                else:
                    return set(self.flattened()) == set(other.flattened())
        return False

#### `` flattened

    flattened() -> list[LayoutElement]

Return a list containing copy of the layout element with no children and all its descendants with no children

Source code in `src/momapy/core.py`

     98
     99
    100
    101
    102
    103
    def flattened(self) -> list["LayoutElement"]:
        """Return a list containing copy of the layout element with no children and all its descendants with no children"""
        flattened = [self.childless()]
        for child in self.children():
            flattened += child.flattened()
        return flattened

#### `` fraction

    fraction(fraction: float) -> tuple[Point, float]

Return the position and angle on the arc at a given fraction (of the total arc length)

Source code in `src/momapy/core.py`

    959
    960
    961
    962
    963
    964
    965
    966
    967
    968
    def fraction(self, fraction: float) -> tuple[momapy.geometry.Point, float]:
        """Return the position and angle on the arc at a given fraction (of the total arc length)"""
        current_length = 0
        length_to_reach = fraction * self.length()
        for segment in self.segments:
            current_length += segment.length()
            if current_length >= length_to_reach:
                break
        position, angle = segment.get_position_and_angle_at_fraction(fraction)
        return position, angle

#### `` length

    length()

Return the total length of the arc path

Source code in `src/momapy/core.py`

    943
    944
    945
    def length(self):
        """Return the total length of the arc path"""
        return sum([segment.length() for segment in self.segments])

#### `` path_drawing_elements

    path_drawing_elements() -> list[Path]

Return the drawing elements of the single-headed arc path

Source code in `src/momapy/core.py`

    1129
    1130
    1131
    1132
    1133
    1134
    1135
    1136
    1137
    1138
    1139
    1140
    1141
    1142
    1143
    1144
    1145
    1146
    1147
    1148
    1149
    1150
    1151
    1152
    1153
    1154
    1155
    1156
    1157
    1158
    1159
    1160
    1161
    1162
    1163
    1164
    1165
    1166
    1167
    def path_drawing_elements(self) -> list[momapy.drawing.Path]:
        """Return the drawing elements of the single-headed arc path"""
        arrowhead_length = self.arrowhead_length()
        if len(self.segments) == 1:
            segment = (
                self.segments[0]
                .shortened(self.start_shorten, "start")
                .shortened(self.end_shorten + arrowhead_length, "end")
            )
            actions = [
                momapy.drawing.MoveTo(segment.p1),
                self._make_path_action_from_segment(segment),
            ]
        else:
            first_segment = self.segments[0].shortened(self.start_shorten, "start")
            last_segment = self.segments[-1].shortened(
                self.end_shorten + arrowhead_length, "end"
            )
            actions = [
                momapy.drawing.MoveTo(first_segment.p1),
                self._make_path_action_from_segment(first_segment),
            ]
            for segment in self.segments[1:-1]:
                action = self._make_path_action_from_segment(segment)
                actions.append(action)
            actions.append(self._make_path_action_from_segment(last_segment))
        path = momapy.drawing.Path(
            actions=tuple(actions),
            class_=f"{type(self).__name__}_path",
            fill=self.path_fill,
            filter=self.path_filter,
            id_=f"{self.id_}_path",
            stroke=self.path_stroke,
            stroke_dasharray=self.path_stroke_dasharray,
            stroke_dashoffset=self.path_stroke_dashoffset,
            stroke_width=self.path_stroke_width,
            transform=self.path_transform,
        )
        return [path]

#### `` points

    points() -> list[Point]

Return the points of the arc path

Source code in `src/momapy/core.py`

    935
    936
    937
    938
    939
    940
    941
    def points(self) -> list[momapy.geometry.Point]:
        """Return the points of the arc path"""
        points = []
        for segment in self.segments:
            points.append(segment.p1)
        points.append(segment.p2)
        return points

#### `` self_bbox

    self_bbox() -> Bbox

Compute and return the bounding box of the self drawing element of the group layout

Source code in `src/momapy/core.py`

    499
    500
    501
    502
    def self_bbox(self) -> momapy.geometry.Bbox:
        """Compute and return the bounding box of the self drawing element of the group layout"""
        bounds = self.self_to_shapely().bounds
        return momapy.geometry.Bbox.from_bounds(bounds)

#### `` self_children

    self_children() -> list[LayoutElement]

Return the self children of the arc

Source code in `src/momapy/core.py`

    931
    932
    933
    def self_children(self) -> list[LayoutElement]:
        """Return the self children of the arc"""
        return []

#### `` self_drawing_elements

    self_drawing_elements() -> list[DrawingElement]

Return the self drawing elements of the single-headed arc

Source code in `src/momapy/core.py`

    1169
    1170
    1171
    1172
    1173
    1174
    1175
    1176
    1177
    1178
    1179
    1180
    1181
    1182
    1183
    1184
    1185
    1186
    def self_drawing_elements(self) -> list[momapy.drawing.DrawingElement]:
        """Return the self drawing elements of the single-headed arc"""
        drawing_elements = (
            self.path_drawing_elements() + self.arrowhead_drawing_elements()
        )
        group = momapy.drawing.Group(
            class_=type(self).__name__,
            elements=tuple(drawing_elements),
            fill=self.fill,
            filter=self.filter,
            id_=self.id_,
            stroke=self.stroke,
            stroke_dasharray=self.stroke_dasharray,
            stroke_dashoffset=self.stroke_dashoffset,
            stroke_width=self.stroke_width,
            transform=self.transform,
        )
        return [group]

#### `` self_to_shapely

    self_to_shapely() -> GeometryCollection

Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout

Source code in `src/momapy/core.py`

    495
    496
    497
    def self_to_shapely(self) -> shapely.GeometryCollection:
        """Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout"""
        return momapy.drawing.drawing_elements_to_shapely(self.drawing_elements())

#### `` start_point

    start_point() -> Point

Return the starting point of the arc

Source code in `src/momapy/core.py`

    947
    948
    949
    def start_point(self) -> momapy.geometry.Point:
        """Return the starting point of the arc"""
        return self.points()[0]

#### `` to_shapely

    to_shapely(to_polygons: bool = False) -> GeometryCollection

Return a shapely collection of geometries reproducing the drawing elements of the layout element

Source code in `src/momapy/core.py`

    123
    124
    125
    126
    127
    128
    def to_shapely(self, to_polygons: bool = False) -> shapely.GeometryCollection:
        """Return a shapely collection of geometries reproducing the drawing elements of the layout element"""
        geom_collection = []
        for drawing_element in self.drawing_elements():
            geom_collection += drawing_element.to_shapely(to_polygons=to_polygons).geoms
        return shapely.GeometryCollection(geom_collection)

### `` LogicalOperator `dataclass`

    LogicalOperator(
        *,
        id_: str = make_uuid4_as_str(),
        inputs: frozenset[LogicalOperatorInput] = frozenset(),
    )

Bases: `SBGNModelElement`

Class for logical operators

Parameters:

Name | Type | Description | Default
--- | --- | --- | ---
`id_` | `str` | The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element | `'ed22cc3e-1dc7-409c-8426-fdb10e27b2a0'`
`inputs` | `frozenset[LogicalOperatorInput]` | The inputs of the logical operator | `<class 'frozenset'>`

### `` LogicalOperatorInput `dataclass`

    LogicalOperatorInput(
        *,
        id_: str = make_uuid4_as_str(),
        element: Union[
            EntityPool,
            ForwardRef(
                LogicalOperator, module=modules[__name__]
            ),
        ],
    )

Bases: `SBGNRole`

Class for inputs of logical operators

Parameters:

Name | Type | Description | Default
--- | --- | --- | ---
`id_` | `str` | The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element | `'a01150c1-2a33-412e-8c80-a1971c423ec2'`
`element` | `EntityPool | ForwardRef('LogicalOperator', module=<module 'momapy.sbgn.pd' from '/home/rougny/code/momapy/src/momapy/sbgn/pd.py'>)` | The element of the logical operator input | required

### `` Macromolecule `dataclass`

    Macromolecule(
        *,
        id_: str = make_uuid4_as_str(),
        compartment: Compartment | None = None,
        label: str | None = None,
        state_variables: frozenset[StateVariable] = frozenset(),
        units_of_information: frozenset[
            UnitOfInformation
        ] = frozenset(),
    )

Bases: `EntityPool`

Class for macromolecules

Parameters:

Name | Type | Description | Default
--- | --- | --- | ---
`id_` | `str` | The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element | `'08ac1150-1d5b-493c-b8af-38dcdfe1a44e'`
`compartment` | `Compartment | None` | The compartment of the entity pool | `None`
`label` | `str | None` | The label of the macromolecule | `None`
`state_variables` | `frozenset[StateVariable]` | The state variables of the macromolecule | `<class 'frozenset'>`
`units_of_information` | `frozenset[UnitOfInformation]` | The units of information of the macromolecule | `<class 'frozenset'>`

### `` MacromoleculeLayout `dataclass`

    MacromoleculeLayout(
        fill: NoneValueType | Color | None = white,
        stroke: NoneValueType | Color | None = black,
        stroke_width: float | None = 1.25,
        *,
        id_: str = make_uuid4_as_str(),
        layout_elements: tuple[LayoutElement] = tuple(),
        group_fill: NoneValueType | Color | None = None,
        group_fill_rule: FillRule | None = None,
        group_filter: NoneValueType | Filter | None = None,
        group_font_family: str | None = None,
        group_font_size: float | None = None,
        group_font_style: FontStyle | None = None,
        group_font_weight: FontWeight | float | None = None,
        group_stroke: NoneValueType | Color | None = None,
        group_stroke_dasharray: tuple[float, ...] | None = None,
        group_stroke_dashoffset: float | None = None,
        group_stroke_width: float | None = None,
        group_text_anchor: TextAnchor | None = None,
        group_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        filter: NoneValueType | Filter | None = None,
        height: float = 30.0,
        label: TextLayout | None = None,
        position: Point,
        stroke_dasharray: tuple[float, ...] | None = None,
        stroke_dashoffset: float | None = None,
        transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        width: float = 60.0,
        rounded_corners: float = 5.0,
    )

Bases: `_SimpleMixin`, `SBGNNode`

Class for macromolecule layouts

Parameters:

Name | Type | Description | Default
--- | --- | --- | ---
`id_` | `str` | The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element | `'a4fda4de-7c60-4e9c-b63b-d5fe65dba108'`
`layout_elements` | `tuple[LayoutElement]` | The sub-layout elements of the group layout. These are part of the children of the group layout | `<dynamic>`
`group_fill` | `NoneValueType | Color | None` | The fill color of the group layout | `None`
`group_fill_rule` | `FillRule | None` | The fill rule of the group layout | `None`
`group_filter` | `NoneValueType | Filter | None` | The filter of the group layout | `None`
`group_font_family` | `str | None` | The font family of the group layout | `None`
`group_font_size` | `float | None` | The font size of the group layout | `None`
`group_font_style` | `FontStyle | None` | The font style of the group layout | `None`
`group_font_weight` | `FontWeight | float | None` | The font weight of the group layout | `None`
`group_stroke` | `NoneValueType | Color | None` | The stroke color of the group layout | `None`
`group_stroke_dasharray` | `tuple[float, ...] | None` | The stroke dasharray of the group layout | `None`
`group_stroke_dashoffset` | `float | None` | The stroke dashoffset of the group layout | `None`
`group_stroke_width` | `float | None` | The stroke width of the group layout | `None`
`group_text_anchor` | `TextAnchor | None` | The text anchor of the group layout | `None`
`group_transform` | `NoneValueType | tuple[Transformation] | None` | The transform of the group layout | `None`
`fill` | `NoneValueType | Color | None` |  | `Color(red=255, green=255, blue=255, alpha=1.0)`
`filter` | `NoneValueType | Filter | None` | The filter of the node | `None`
`height` | `float` |  | `30.0`
`label` | `TextLayout | None` | The label of the node | `None`
`position` | `Point` | The position of the node | required
`stroke` | `NoneValueType | Color | None` |  | `Color(red=0, green=0, blue=0, alpha=1.0)`
`stroke_dasharray` | `tuple[float, ...] | None` | The stroke dasharray of the node | `None`
`stroke_dashoffset` | `float | None` | The stroke dashoffset of the node | `None`
`stroke_width` | `float | None` |  | `1.25`
`transform` | `NoneValueType | tuple[Transformation] | None` | The transform of the node | `None`
`width` | `float` |  | `60.0`
`rounded_corners` | `float` |  | `5.0`

Methods:

Name | Description
--- | ---
`anchor_point` | Return an anchor point of the layout element
`angle` | Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.
`bbox` | Compute and return the bounding box of the group layout element
`border` | Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point.
`center` | Return the center anchor of the node
`childless` | Return a copy of the node with no children
`children` | Return the children of the group layout.
`contains` | Return `true` if another layout element is a descendant of the layout element, `false` otherwise
`descendants` | Return the descendants of the layout element
`drawing_elements` | Return the drawing elements of the group layout.
`east` | Return the east anchor of the node
`east_north_east` | Return the east north east anchor of the node
`east_south_east` | Return the east south east west anchor of the node
`equals` | Return `true` if the layout element is equal to another layout element, `false` otherwise
`flattened` | Return a list containing copy of the layout element with no children and all its descendants with no children
`label_center` | Return the label center anchor of the node
`north` | Return the north anchor of the node
`north_east` | Return the north east anchor of the node
`north_north_east` | Return the north north east anchor of the node
`north_north_west` | Return the north north west anchor of the node
`north_west` | Return the north west anchor of the node
`self_angle` | Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.
`self_bbox` | Compute and return the bounding box of the self drawing element of the group layout
`self_border` | Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point.
`self_children` | Return the self children of the node. A node has unique child that is its label
`self_drawing_elements` | Return the node's own drawing elements
`self_to_shapely` | Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout
`size` | Return the size of the node
`south` | Return the south anchor of the node
`south_east` | Return the south east anchor of the node
`south_south_east` | Return the south south east anchor of the node
`south_south_west` | Return the south south west anchor of the node
`south_west` | Return the south west anchor of the node
`to_shapely` | Return a shapely collection of geometries reproducing the drawing elements of the layout element
`west` | Return the west anchor of the node
`west_north_west` | Return the west north west anchor of the node
`west_south_west` | Return the west south west anchor of the node

Attributes:

Name | Type | Description
--- | --- | ---
`x` | `float` | Return the x coordinate of the node
`y` | `float` | Return the y coordinate of the node

#### `` anchor_point

    anchor_point(anchor_name: str) -> Point

Return an anchor point of the layout element

Source code in `src/momapy/core.py`

    130
    131
    132
    def anchor_point(self, anchor_name: str) -> momapy.geometry.Point:
        """Return an anchor point of the layout element"""
        return getattr(self, anchor_name)()

#### `` angle

    angle(
        angle: float,
        unit: Literal["degrees", "radians"] = "degrees",
    ) -> Point

Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.

Source code in `src/momapy/core.py`

    817
    818
    819
    820
    821
    822
    823
    824
    825
    826
    827
    828
    def angle(
        self,
        angle: float,
        unit: typing.Literal["degrees", "radians"] = "degrees",
    ) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal."""
        return momapy.drawing.get_drawing_elements_angle(
            drawing_elements=self.drawing_elements(),
            angle=angle,
            unit=unit,
            center=self.center(),
        )

#### `` bbox

    bbox() -> Bbox

Compute and return the bounding box of the group layout element

Source code in `src/momapy/core.py`

    504
    505
    506
    507
    508
    509
    510
    511
    512
    513
    514
    515
    516
    517
    518
    519
    520
    521
    522
    523
    524
    525
    526
    def bbox(self) -> momapy.geometry.Bbox:
        """Compute and return the bounding box of the group layout element"""
        self_bbox = self.self_bbox()
        bboxes = [child.bbox() for child in self.children()]
        min_x = self_bbox.north_west().x
        min_y = self_bbox.north_west().y
        max_x = self_bbox.south_east().x
        max_y = self_bbox.south_east().y
        for bbox in bboxes:
            if bbox.north_west().x < min_x:
                min_x = bbox.north_west().x
            if bbox.north_west().y < min_y:
                min_y = bbox.north_west().y
            if bbox.south_east().x > max_x:
                max_x = bbox.south_east().x
            if bbox.south_east().y > max_y:
                max_y = bbox.south_east().y
        bbox = momapy.geometry.Bbox(
            momapy.geometry.Point(min_x / 2 + max_x / 2, min_y / 2 + max_y / 2),
            max_x - min_x,
            max_y - min_y,
        )
        return bbox

#### `` border

    border(point: Point) -> Point

Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point. When there are multiple intersection points, the one closest to the given point is returned

Source code in `src/momapy/core.py`

    794
    795
    796
    797
    798
    799
    800
    801
    802
    def border(self, point: momapy.geometry.Point) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point.
        When there are multiple intersection points, the one closest to the given point is returned
        """
        return momapy.drawing.get_drawing_elements_border(
            drawing_elements=self.drawing_elements(),
            point=point,
            center=self.center(),
        )

#### `` center

    center() -> Point

Return the center anchor of the node

Source code in `src/momapy/core.py`

    776
    777
    778
    def center(self) -> momapy.geometry.Point:
        """Return the center anchor of the node"""
        return self.position

#### `` childless

    childless() -> Self

Return a copy of the node with no children

Source code in `src/momapy/core.py`

    830
    831
    832
    def childless(self) -> typing.Self:
        """Return a copy of the node with no children"""
        return dataclasses.replace(self, label=None, layout_elements=tuple([]))

#### `` children

    children() -> list[LayoutElement]

Return the children of the group layout. These are the self children of the group layout (returned by the `self_children` method) and the other children of the group layout (given by the `layout_elements` attribute)

Source code in `src/momapy/core.py`

    566
    567
    568
    569
    570
    def children(self) -> list[LayoutElement]:
        """Return the children of the group layout.
        These are the self children of the group layout (returned by the `self_children` method) and the other children of the group layout (given by the `layout_elements` attribute)
        """
        return self.self_children() + list(self.layout_elements)

#### `` contains

    contains(other: LayoutElement) -> bool

Return `true` if another layout element is a descendant of the layout element, `false` otherwise

Source code in `src/momapy/core.py`

    119
    120
    121
    def contains(self, other: "LayoutElement") -> bool:
        """Return `true` if another layout element is a descendant of the layout element, `false` otherwise"""
        return other in self.descendants()

#### `` descendants

    descendants() -> list[LayoutElement]

Return the descendants of the layout element

Source code in `src/momapy/core.py`

    90
    91
    92
    93
    94
    95
    96
    def descendants(self) -> list["LayoutElement"]:
        """Return the descendants of the layout element"""
        descendants = []
        for child in self.children():
            descendants.append(child)
            descendants += child.descendants()
        return descendants

#### `` drawing_elements

    drawing_elements() -> list[DrawingElement]

Return the drawing elements of the group layout. The returned drawing elements are a group drawing element formed of the self drawing elements of the group layout and the drawing elements of its children

Source code in `src/momapy/core.py`

    538
    539
    540
    541
    542
    543
    544
    545
    546
    547
    548
    549
    550
    551
    552
    553
    554
    555
    556
    557
    558
    559
    560
    561
    562
    563
    564
    def drawing_elements(self) -> list[momapy.drawing.DrawingElement]:
        """Return the drawing elements of the group layout.
        The returned drawing elements are a group drawing element formed of the self drawing elements of the group layout and the drawing elements of its children
        """
        drawing_elements = self.self_drawing_elements()
        for child in self.children():
            if child is not None:
                drawing_elements += child.drawing_elements()
        group = momapy.drawing.Group(
            class_=f"{type(self).__name__}_group",
            elements=tuple(drawing_elements),
            id_=f"{self.id_}_group",
            fill=self.group_fill,
            fill_rule=self.group_fill_rule,
            filter=self.group_filter,
            font_family=self.group_font_family,
            font_size=self.group_font_size,
            font_style=self.group_font_style,
            font_weight=self.group_font_weight,
            stroke=self.group_stroke,
            stroke_dasharray=self.group_stroke_dasharray,
            stroke_dashoffset=self.group_stroke_dashoffset,
            stroke_width=self.group_stroke_width,
            text_anchor=self.group_text_anchor,
            transform=self.group_transform,
        )
        return [group]

#### `` east

    east() -> Point

Return the east anchor of the node

Source code in `src/momapy/core.py`

    708
    709
    710
    def east(self) -> momapy.geometry.Point:
        """Return the east anchor of the node"""
        return self.self_angle(0)

#### `` east_north_east

    east_north_east() -> Point

Return the east north east anchor of the node

Source code in `src/momapy/core.py`

    700
    701
    702
    703
    704
    705
    706
    def east_north_east(self) -> momapy.geometry.Point:
        """Return the east north east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, -self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` east_south_east

    east_south_east() -> Point

Return the east south east west anchor of the node

Source code in `src/momapy/core.py`

    712
    713
    714
    715
    716
    717
    718
    def east_south_east(self) -> momapy.geometry.Point:
        """Return the east south east west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` equals

    equals(
        other: LayoutElement,
        flattened: bool = False,
        unordered: bool = False,
    ) -> bool

Return `true` if the layout element is equal to another layout element, `false` otherwise

Source code in `src/momapy/core.py`

    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    def equals(
        self, other: "LayoutElement", flattened: bool = False, unordered: bool = False
    ) -> bool:
        """Return `true` if the layout element is equal to another layout element, `false` otherwise"""
        if type(self) is type(other):
            if not flattened:
                return self == other
            else:
                if not unordered:
                    return self.flattened() == other.flattened()
                else:
                    return set(self.flattened()) == set(other.flattened())
        return False

#### `` flattened

    flattened() -> list[LayoutElement]

Return a list containing copy of the layout element with no children and all its descendants with no children

Source code in `src/momapy/core.py`

     98
     99
    100
    101
    102
    103
    def flattened(self) -> list["LayoutElement"]:
        """Return a list containing copy of the layout element with no children and all its descendants with no children"""
        flattened = [self.childless()]
        for child in self.children():
            flattened += child.flattened()
        return flattened

#### `` label_center

    label_center() -> Point

Return the label center anchor of the node

Source code in `src/momapy/core.py`

    780
    781
    782
    def label_center(self) -> momapy.geometry.Point:
        """Return the label center anchor of the node"""
        return self.position

#### `` north

    north() -> Point

Return the north anchor of the node

Source code in `src/momapy/core.py`

    680
    681
    682
    def north(self) -> momapy.geometry.Point:
        """Return the north anchor of the node"""
        return self.self_angle(90)

#### `` north_east

    north_east() -> Point

Return the north east anchor of the node

Source code in `src/momapy/core.py`

    692
    693
    694
    695
    696
    697
    698
    def north_east(self) -> momapy.geometry.Point:
        """Return the north east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, -self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` north_north_east

    north_north_east() -> Point

Return the north north east anchor of the node

Source code in `src/momapy/core.py`

    684
    685
    686
    687
    688
    689
    690
    def north_north_east(self) -> momapy.geometry.Point:
        """Return the north north east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 4, -self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` north_north_west

    north_north_west() -> Point

Return the north north west anchor of the node

Source code in `src/momapy/core.py`

    672
    673
    674
    675
    676
    677
    678
    def north_north_west(self) -> momapy.geometry.Point:
        """Return the north north west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() - (self.width / 4, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` north_west

    north_west() -> Point

Return the north west anchor of the node

Source code in `src/momapy/core.py`

    664
    665
    666
    667
    668
    669
    670
    def north_west(self) -> momapy.geometry.Point:
        """Return the north west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() - (self.width / 2, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` self_angle

    self_angle(
        angle: float,
        unit: Literal["degrees", "radians"] = "degrees",
    ) -> Point

Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.

Source code in `src/momapy/core.py`

    804
    805
    806
    807
    808
    809
    810
    811
    812
    813
    814
    815
    def self_angle(
        self,
        angle: float,
        unit: typing.Literal["degrees", "radians"] = "degrees",
    ) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal."""
        return momapy.drawing.get_drawing_elements_angle(
            drawing_elements=self.self_drawing_elements(),
            angle=angle,
            unit=unit,
            center=self.center(),
        )

#### `` self_bbox

    self_bbox() -> Bbox

Compute and return the bounding box of the self drawing element of the group layout

Source code in `src/momapy/core.py`

    499
    500
    501
    502
    def self_bbox(self) -> momapy.geometry.Bbox:
        """Compute and return the bounding box of the self drawing element of the group layout"""
        bounds = self.self_to_shapely().bounds
        return momapy.geometry.Bbox.from_bounds(bounds)

#### `` self_border

    self_border(point: Point) -> Point

Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point. When there are multiple intersection points, the one closest to the given point is returned

Source code in `src/momapy/core.py`

    784
    785
    786
    787
    788
    789
    790
    791
    792
    def self_border(self, point: momapy.geometry.Point) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point.
        When there are multiple intersection points, the one closest to the given point is returned
        """
        return momapy.drawing.get_drawing_elements_border(
            drawing_elements=self.self_drawing_elements(),
            point=point,
            center=self.center(),
        )

#### `` self_children

    self_children() -> list[LayoutElement]

Return the self children of the node. A node has unique child that is its label

Source code in `src/momapy/core.py`

    654
    655
    656
    657
    658
    def self_children(self) -> list[LayoutElement]:
        """Return the self children of the node. A node has unique child that is its label"""
        if self.label is not None:
            return [self.label]
        return []

#### `` self_drawing_elements

    self_drawing_elements() -> list[DrawingElement]

Return the node's own drawing elements

Source code in `src/momapy/core.py`

    637
    638
    639
    640
    641
    642
    643
    644
    645
    646
    647
    648
    649
    650
    651
    652
    def self_drawing_elements(self) -> list[momapy.drawing.DrawingElement]:
        """Return the node's own drawing elements"""
        drawing_elements = self._border_drawing_elements()
        group = momapy.drawing.Group(
            class_=type(self).__name__,
            elements=tuple(drawing_elements),
            fill=self.fill,
            filter=self.filter,
            id_=self.id_,
            stroke=self.stroke,
            stroke_dasharray=self.stroke_dasharray,
            stroke_dashoffset=self.stroke_dashoffset,
            stroke_width=self.stroke_width,
            transform=self.transform,
        )
        return [group]

#### `` self_to_shapely

    self_to_shapely() -> GeometryCollection

Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout

Source code in `src/momapy/core.py`

    495
    496
    497
    def self_to_shapely(self) -> shapely.GeometryCollection:
        """Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout"""
        return momapy.drawing.drawing_elements_to_shapely(self.drawing_elements())

#### `` size

    size() -> tuple[float, float]

Return the size of the node

Source code in `src/momapy/core.py`

    660
    661
    662
    def size(self) -> tuple[float, float]:
        """Return the size of the node"""
        return (self.width, self.height)

#### `` south

    south() -> Point

Return the south anchor of the node

Source code in `src/momapy/core.py`

    736
    737
    738
    def south(self) -> momapy.geometry.Point:
        """Return the south anchor of the node"""
        return self.self_angle(270)

#### `` south_east

    south_east() -> Point

Return the south east anchor of the node

Source code in `src/momapy/core.py`

    720
    721
    722
    723
    724
    725
    726
    def south_east(self) -> momapy.geometry.Point:
        """Return the south east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` south_south_east

    south_south_east() -> Point

Return the south south east anchor of the node

Source code in `src/momapy/core.py`

    728
    729
    730
    731
    732
    733
    734
    def south_south_east(self) -> momapy.geometry.Point:
        """Return the south south east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 4, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` south_south_west

    south_south_west() -> Point

Return the south south west anchor of the node

Source code in `src/momapy/core.py`

    740
    741
    742
    743
    744
    745
    746
    def south_south_west(self) -> momapy.geometry.Point:
        """Return the south south west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (-self.width / 4, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` south_west

    south_west() -> Point

Return the south west anchor of the node

Source code in `src/momapy/core.py`

    748
    749
    750
    751
    752
    753
    754
    def south_west(self) -> momapy.geometry.Point:
        """Return the south west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (-self.width / 2, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` to_shapely

    to_shapely(to_polygons: bool = False) -> GeometryCollection

Return a shapely collection of geometries reproducing the drawing elements of the layout element

Source code in `src/momapy/core.py`

    123
    124
    125
    126
    127
    128
    def to_shapely(self, to_polygons: bool = False) -> shapely.GeometryCollection:
        """Return a shapely collection of geometries reproducing the drawing elements of the layout element"""
        geom_collection = []
        for drawing_element in self.drawing_elements():
            geom_collection += drawing_element.to_shapely(to_polygons=to_polygons).geoms
        return shapely.GeometryCollection(geom_collection)

#### `` west

    west() -> Point

Return the west anchor of the node

Source code in `src/momapy/core.py`

    764
    765
    766
    def west(self) -> momapy.geometry.Point:
        """Return the west anchor of the node"""
        return self.self_angle(180)

#### `` west_north_west

    west_north_west() -> Point

Return the west north west anchor of the node

Source code in `src/momapy/core.py`

    768
    769
    770
    771
    772
    773
    774
    def west_north_west(self) -> momapy.geometry.Point:
        """Return the west north west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() - (self.width / 2, self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` west_south_west

    west_south_west() -> Point

Return the west south west anchor of the node

Source code in `src/momapy/core.py`

    756
    757
    758
    759
    760
    761
    762
    def west_south_west(self) -> momapy.geometry.Point:
        """Return the west south west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (-self.width / 2, self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` x `property`

    x: float

Return the x coordinate of the node

#### `` y `property`

    y: float

Return the y coordinate of the node

### `` MacromoleculeMultimer `dataclass`

    MacromoleculeMultimer(
        *,
        id_: str = make_uuid4_as_str(),
        compartment: Compartment | None = None,
        label: str | None = None,
        state_variables: frozenset[StateVariable] = frozenset(),
        units_of_information: frozenset[
            UnitOfInformation
        ] = frozenset(),
        subunits: frozenset[Subunit] = frozenset(),
        cardinality: int | None = None,
    )

Bases: `Multimer`

Class for macromolecule multimers

Parameters:

Name | Type | Description | Default
--- | --- | --- | ---
`id_` | `str` | The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element | `'bf6ad08e-9a72-4568-8570-eabb1ee274d3'`
`compartment` | `Compartment | None` | The compartment of the entity pool | `None`
`label` | `str | None` | The label of the complex | `None`
`state_variables` | `frozenset[StateVariable]` | The state variables of the complex | `<class 'frozenset'>`
`units_of_information` | `frozenset[UnitOfInformation]` | The units of information of the complex | `<class 'frozenset'>`
`subunits` | `frozenset[Subunit]` | The subunits of the complex | `<class 'frozenset'>`
`cardinality` | `int | None` | The cardinality of the multimer | `None`

### `` MacromoleculeMultimerLayout `dataclass`

    MacromoleculeMultimerLayout(
        fill: NoneValueType | Color | None = white,
        stroke: NoneValueType | Color | None = black,
        stroke_width: float | None = 1.25,
        offset: float = 3.0,
        subunits_stroke: tuple[NoneValueType | Color]
        | None = None,
        subunits_stroke_width: tuple[NoneValueType | float]
        | None = None,
        subunits_stroke_dasharray: tuple[
            NoneValueType | tuple[float]
        ]
        | None = None,
        subunits_stroke_dashoffset: tuple[float] | None = None,
        subunits_fill: tuple[NoneValueType | Color]
        | None = None,
        subunits_transform: tuple[
            NoneValueType | tuple[Transformation]
        ]
        | None = None,
        subunits_filter: tuple[NoneValueType | Filter]
        | None = None,
        *,
        id_: str = make_uuid4_as_str(),
        layout_elements: tuple[LayoutElement] = tuple(),
        group_fill: NoneValueType | Color | None = None,
        group_fill_rule: FillRule | None = None,
        group_filter: NoneValueType | Filter | None = None,
        group_font_family: str | None = None,
        group_font_size: float | None = None,
        group_font_style: FontStyle | None = None,
        group_font_weight: FontWeight | float | None = None,
        group_stroke: NoneValueType | Color | None = None,
        group_stroke_dasharray: tuple[float, ...] | None = None,
        group_stroke_dashoffset: float | None = None,
        group_stroke_width: float | None = None,
        group_text_anchor: TextAnchor | None = None,
        group_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        filter: NoneValueType | Filter | None = None,
        height: float = 30.0,
        label: TextLayout | None = None,
        position: Point,
        stroke_dasharray: tuple[float, ...] | None = None,
        stroke_dashoffset: float | None = None,
        transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        width: float = 60.0,
        rounded_corners: float = 5.0,
    )

Bases: `_MultiMixin`, `SBGNNode`

Class for macromolecule multimer layouts

Parameters:

Name | Type | Description | Default
--- | --- | --- | ---
`id_` | `str` | The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element | `'0d1576e9-4bb7-4004-acee-fe0e1641178c'`
`layout_elements` | `tuple[LayoutElement]` | The sub-layout elements of the group layout. These are part of the children of the group layout | `<dynamic>`
`group_fill` | `NoneValueType | Color | None` | The fill color of the group layout | `None`
`group_fill_rule` | `FillRule | None` | The fill rule of the group layout | `None`
`group_filter` | `NoneValueType | Filter | None` | The filter of the group layout | `None`
`group_font_family` | `str | None` | The font family of the group layout | `None`
`group_font_size` | `float | None` | The font size of the group layout | `None`
`group_font_style` | `FontStyle | None` | The font style of the group layout | `None`
`group_font_weight` | `FontWeight | float | None` | The font weight of the group layout | `None`
`group_stroke` | `NoneValueType | Color | None` | The stroke color of the group layout | `None`
`group_stroke_dasharray` | `tuple[float, ...] | None` | The stroke dasharray of the group layout | `None`
`group_stroke_dashoffset` | `float | None` | The stroke dashoffset of the group layout | `None`
`group_stroke_width` | `float | None` | The stroke width of the group layout | `None`
`group_text_anchor` | `TextAnchor | None` | The text anchor of the group layout | `None`
`group_transform` | `NoneValueType | tuple[Transformation] | None` | The transform of the group layout | `None`
`fill` | `NoneValueType | Color | None` |  | `Color(red=255, green=255, blue=255, alpha=1.0)`
`filter` | `NoneValueType | Filter | None` | The filter of the node | `None`
`height` | `float` |  | `30.0`
`label` | `TextLayout | None` | The label of the node | `None`
`position` | `Point` | The position of the node | required
`stroke` | `NoneValueType | Color | None` |  | `Color(red=0, green=0, blue=0, alpha=1.0)`
`stroke_dasharray` | `tuple[float, ...] | None` | The stroke dasharray of the node | `None`
`stroke_dashoffset` | `float | None` | The stroke dashoffset of the node | `None`
`stroke_width` | `float | None` |  | `1.25`
`transform` | `NoneValueType | tuple[Transformation] | None` | The transform of the node | `None`
`width` | `float` |  | `60.0`
`offset` | `float` |  | `3.0`
`subunits_stroke` | `tuple[Union[NoneValueType, Color]] | None` |  | `None`
`subunits_stroke_width` | `tuple[Union[NoneValueType, float]] | None` |  | `None`
`subunits_stroke_dasharray` | `tuple[Union[NoneValueType, tuple[float]]] | None` |  | `None`
`subunits_stroke_dashoffset` | `tuple[float] | None` |  | `None`
`subunits_fill` | `tuple[Union[NoneValueType, Color]] | None` |  | `None`
`subunits_transform` | `tuple[Union[NoneValueType, tuple[Transformation]]] | None` |  | `None`
`subunits_filter` | `tuple[Union[NoneValueType, Filter]] | None` |  | `None`
`rounded_corners` | `float` |  | `5.0`

Methods:

Name | Description
--- | ---
`anchor_point` | Return an anchor point of the layout element
`angle` | Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.
`bbox` | Compute and return the bounding box of the group layout element
`border` | Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point.
`center` | Return the center anchor of the node
`childless` | Return a copy of the node with no children
`children` | Return the children of the group layout.
`contains` | Return `true` if another layout element is a descendant of the layout element, `false` otherwise
`descendants` | Return the descendants of the layout element
`drawing_elements` | Return the drawing elements of the group layout.
`east` | Return the east anchor of the node
`east_north_east` | Return the east north east anchor of the node
`east_south_east` | Return the east south east west anchor of the node
`equals` | Return `true` if the layout element is equal to another layout element, `false` otherwise
`flattened` | Return a list containing copy of the layout element with no children and all its descendants with no children
`north` | Return the north anchor of the node
`north_east` | Return the north east anchor of the node
`north_north_east` | Return the north north east anchor of the node
`north_north_west` | Return the north north west anchor of the node
`north_west` | Return the north west anchor of the node
`self_angle` | Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.
`self_bbox` | Compute and return the bounding box of the self drawing element of the group layout
`self_border` | Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point.
`self_children` | Return the self children of the node. A node has unique child that is its label
`self_drawing_elements` | Return the node's own drawing elements
`self_to_shapely` | Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout
`size` | Return the size of the node
`south` | Return the south anchor of the node
`south_east` | Return the south east anchor of the node
`south_south_east` | Return the south south east anchor of the node
`south_south_west` | Return the south south west anchor of the node
`south_west` | Return the south west anchor of the node
`to_shapely` | Return a shapely collection of geometries reproducing the drawing elements of the layout element
`west` | Return the west anchor of the node
`west_north_west` | Return the west north west anchor of the node
`west_south_west` | Return the west south west anchor of the node

Attributes:

Name | Type | Description
--- | --- | ---
`x` | `float` | Return the x coordinate of the node
`y` | `float` | Return the y coordinate of the node

#### `` anchor_point

    anchor_point(anchor_name: str) -> Point

Return an anchor point of the layout element

Source code in `src/momapy/core.py`

    130
    131
    132
    def anchor_point(self, anchor_name: str) -> momapy.geometry.Point:
        """Return an anchor point of the layout element"""
        return getattr(self, anchor_name)()

#### `` angle

    angle(
        angle: float,
        unit: Literal["degrees", "radians"] = "degrees",
    ) -> Point

Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.

Source code in `src/momapy/core.py`

    817
    818
    819
    820
    821
    822
    823
    824
    825
    826
    827
    828
    def angle(
        self,
        angle: float,
        unit: typing.Literal["degrees", "radians"] = "degrees",
    ) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal."""
        return momapy.drawing.get_drawing_elements_angle(
            drawing_elements=self.drawing_elements(),
            angle=angle,
            unit=unit,
            center=self.center(),
        )

#### `` bbox

    bbox() -> Bbox

Compute and return the bounding box of the group layout element

Source code in `src/momapy/core.py`

    504
    505
    506
    507
    508
    509
    510
    511
    512
    513
    514
    515
    516
    517
    518
    519
    520
    521
    522
    523
    524
    525
    526
    def bbox(self) -> momapy.geometry.Bbox:
        """Compute and return the bounding box of the group layout element"""
        self_bbox = self.self_bbox()
        bboxes = [child.bbox() for child in self.children()]
        min_x = self_bbox.north_west().x
        min_y = self_bbox.north_west().y
        max_x = self_bbox.south_east().x
        max_y = self_bbox.south_east().y
        for bbox in bboxes:
            if bbox.north_west().x < min_x:
                min_x = bbox.north_west().x
            if bbox.north_west().y < min_y:
                min_y = bbox.north_west().y
            if bbox.south_east().x > max_x:
                max_x = bbox.south_east().x
            if bbox.south_east().y > max_y:
                max_y = bbox.south_east().y
        bbox = momapy.geometry.Bbox(
            momapy.geometry.Point(min_x / 2 + max_x / 2, min_y / 2 + max_y / 2),
            max_x - min_x,
            max_y - min_y,
        )
        return bbox

#### `` border

    border(point: Point) -> Point

Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point. When there are multiple intersection points, the one closest to the given point is returned

Source code in `src/momapy/core.py`

    794
    795
    796
    797
    798
    799
    800
    801
    802
    def border(self, point: momapy.geometry.Point) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point.
        When there are multiple intersection points, the one closest to the given point is returned
        """
        return momapy.drawing.get_drawing_elements_border(
            drawing_elements=self.drawing_elements(),
            point=point,
            center=self.center(),
        )

#### `` center

    center() -> Point

Return the center anchor of the node

Source code in `src/momapy/core.py`

    776
    777
    778
    def center(self) -> momapy.geometry.Point:
        """Return the center anchor of the node"""
        return self.position

#### `` childless

    childless() -> Self

Return a copy of the node with no children

Source code in `src/momapy/core.py`

    830
    831
    832
    def childless(self) -> typing.Self:
        """Return a copy of the node with no children"""
        return dataclasses.replace(self, label=None, layout_elements=tuple([]))

#### `` children

    children() -> list[LayoutElement]

Return the children of the group layout. These are the self children of the group layout (returned by the `self_children` method) and the other children of the group layout (given by the `layout_elements` attribute)

Source code in `src/momapy/core.py`

    566
    567
    568
    569
    570
    def children(self) -> list[LayoutElement]:
        """Return the children of the group layout.
        These are the self children of the group layout (returned by the `self_children` method) and the other children of the group layout (given by the `layout_elements` attribute)
        """
        return self.self_children() + list(self.layout_elements)

#### `` contains

    contains(other: LayoutElement) -> bool

Return `true` if another layout element is a descendant of the layout element, `false` otherwise

Source code in `src/momapy/core.py`

    119
    120
    121
    def contains(self, other: "LayoutElement") -> bool:
        """Return `true` if another layout element is a descendant of the layout element, `false` otherwise"""
        return other in self.descendants()

#### `` descendants

    descendants() -> list[LayoutElement]

Return the descendants of the layout element

Source code in `src/momapy/core.py`

    90
    91
    92
    93
    94
    95
    96
    def descendants(self) -> list["LayoutElement"]:
        """Return the descendants of the layout element"""
        descendants = []
        for child in self.children():
            descendants.append(child)
            descendants += child.descendants()
        return descendants

#### `` drawing_elements

    drawing_elements() -> list[DrawingElement]

Return the drawing elements of the group layout. The returned drawing elements are a group drawing element formed of the self drawing elements of the group layout and the drawing elements of its children

Source code in `src/momapy/core.py`

    538
    539
    540
    541
    542
    543
    544
    545
    546
    547
    548
    549
    550
    551
    552
    553
    554
    555
    556
    557
    558
    559
    560
    561
    562
    563
    564
    def drawing_elements(self) -> list[momapy.drawing.DrawingElement]:
        """Return the drawing elements of the group layout.
        The returned drawing elements are a group drawing element formed of the self drawing elements of the group layout and the drawing elements of its children
        """
        drawing_elements = self.self_drawing_elements()
        for child in self.children():
            if child is not None:
                drawing_elements += child.drawing_elements()
        group = momapy.drawing.Group(
            class_=f"{type(self).__name__}_group",
            elements=tuple(drawing_elements),
            id_=f"{self.id_}_group",
            fill=self.group_fill,
            fill_rule=self.group_fill_rule,
            filter=self.group_filter,
            font_family=self.group_font_family,
            font_size=self.group_font_size,
            font_style=self.group_font_style,
            font_weight=self.group_font_weight,
            stroke=self.group_stroke,
            stroke_dasharray=self.group_stroke_dasharray,
            stroke_dashoffset=self.group_stroke_dashoffset,
            stroke_width=self.group_stroke_width,
            text_anchor=self.group_text_anchor,
            transform=self.group_transform,
        )
        return [group]

#### `` east

    east() -> Point

Return the east anchor of the node

Source code in `src/momapy/core.py`

    708
    709
    710
    def east(self) -> momapy.geometry.Point:
        """Return the east anchor of the node"""
        return self.self_angle(0)

#### `` east_north_east

    east_north_east() -> Point

Return the east north east anchor of the node

Source code in `src/momapy/core.py`

    700
    701
    702
    703
    704
    705
    706
    def east_north_east(self) -> momapy.geometry.Point:
        """Return the east north east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, -self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` east_south_east

    east_south_east() -> Point

Return the east south east west anchor of the node

Source code in `src/momapy/core.py`

    712
    713
    714
    715
    716
    717
    718
    def east_south_east(self) -> momapy.geometry.Point:
        """Return the east south east west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` equals

    equals(
        other: LayoutElement,
        flattened: bool = False,
        unordered: bool = False,
    ) -> bool

Return `true` if the layout element is equal to another layout element, `false` otherwise

Source code in `src/momapy/core.py`

    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    def equals(
        self, other: "LayoutElement", flattened: bool = False, unordered: bool = False
    ) -> bool:
        """Return `true` if the layout element is equal to another layout element, `false` otherwise"""
        if type(self) is type(other):
            if not flattened:
                return self == other
            else:
                if not unordered:
                    return self.flattened() == other.flattened()
                else:
                    return set(self.flattened()) == set(other.flattened())
        return False

#### `` flattened

    flattened() -> list[LayoutElement]

Return a list containing copy of the layout element with no children and all its descendants with no children

Source code in `src/momapy/core.py`

     98
     99
    100
    101
    102
    103
    def flattened(self) -> list["LayoutElement"]:
        """Return a list containing copy of the layout element with no children and all its descendants with no children"""
        flattened = [self.childless()]
        for child in self.children():
            flattened += child.flattened()
        return flattened

#### `` north

    north() -> Point

Return the north anchor of the node

Source code in `src/momapy/core.py`

    680
    681
    682
    def north(self) -> momapy.geometry.Point:
        """Return the north anchor of the node"""
        return self.self_angle(90)

#### `` north_east

    north_east() -> Point

Return the north east anchor of the node

Source code in `src/momapy/core.py`

    692
    693
    694
    695
    696
    697
    698
    def north_east(self) -> momapy.geometry.Point:
        """Return the north east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, -self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` north_north_east

    north_north_east() -> Point

Return the north north east anchor of the node

Source code in `src/momapy/core.py`

    684
    685
    686
    687
    688
    689
    690
    def north_north_east(self) -> momapy.geometry.Point:
        """Return the north north east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 4, -self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` north_north_west

    north_north_west() -> Point

Return the north north west anchor of the node

Source code in `src/momapy/core.py`

    672
    673
    674
    675
    676
    677
    678
    def north_north_west(self) -> momapy.geometry.Point:
        """Return the north north west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() - (self.width / 4, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` north_west

    north_west() -> Point

Return the north west anchor of the node

Source code in `src/momapy/core.py`

    664
    665
    666
    667
    668
    669
    670
    def north_west(self) -> momapy.geometry.Point:
        """Return the north west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() - (self.width / 2, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` self_angle

    self_angle(
        angle: float,
        unit: Literal["degrees", "radians"] = "degrees",
    ) -> Point

Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.

Source code in `src/momapy/core.py`

    804
    805
    806
    807
    808
    809
    810
    811
    812
    813
    814
    815
    def self_angle(
        self,
        angle: float,
        unit: typing.Literal["degrees", "radians"] = "degrees",
    ) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal."""
        return momapy.drawing.get_drawing_elements_angle(
            drawing_elements=self.self_drawing_elements(),
            angle=angle,
            unit=unit,
            center=self.center(),
        )

#### `` self_bbox

    self_bbox() -> Bbox

Compute and return the bounding box of the self drawing element of the group layout

Source code in `src/momapy/core.py`

    499
    500
    501
    502
    def self_bbox(self) -> momapy.geometry.Bbox:
        """Compute and return the bounding box of the self drawing element of the group layout"""
        bounds = self.self_to_shapely().bounds
        return momapy.geometry.Bbox.from_bounds(bounds)

#### `` self_border

    self_border(point: Point) -> Point

Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point. When there are multiple intersection points, the one closest to the given point is returned

Source code in `src/momapy/core.py`

    784
    785
    786
    787
    788
    789
    790
    791
    792
    def self_border(self, point: momapy.geometry.Point) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point.
        When there are multiple intersection points, the one closest to the given point is returned
        """
        return momapy.drawing.get_drawing_elements_border(
            drawing_elements=self.self_drawing_elements(),
            point=point,
            center=self.center(),
        )

#### `` self_children

    self_children() -> list[LayoutElement]

Return the self children of the node. A node has unique child that is its label

Source code in `src/momapy/core.py`

    654
    655
    656
    657
    658
    def self_children(self) -> list[LayoutElement]:
        """Return the self children of the node. A node has unique child that is its label"""
        if self.label is not None:
            return [self.label]
        return []

#### `` self_drawing_elements

    self_drawing_elements() -> list[DrawingElement]

Return the node's own drawing elements

Source code in `src/momapy/core.py`

    637
    638
    639
    640
    641
    642
    643
    644
    645
    646
    647
    648
    649
    650
    651
    652
    def self_drawing_elements(self) -> list[momapy.drawing.DrawingElement]:
        """Return the node's own drawing elements"""
        drawing_elements = self._border_drawing_elements()
        group = momapy.drawing.Group(
            class_=type(self).__name__,
            elements=tuple(drawing_elements),
            fill=self.fill,
            filter=self.filter,
            id_=self.id_,
            stroke=self.stroke,
            stroke_dasharray=self.stroke_dasharray,
            stroke_dashoffset=self.stroke_dashoffset,
            stroke_width=self.stroke_width,
            transform=self.transform,
        )
        return [group]

#### `` self_to_shapely

    self_to_shapely() -> GeometryCollection

Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout

Source code in `src/momapy/core.py`

    495
    496
    497
    def self_to_shapely(self) -> shapely.GeometryCollection:
        """Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout"""
        return momapy.drawing.drawing_elements_to_shapely(self.drawing_elements())

#### `` size

    size() -> tuple[float, float]

Return the size of the node

Source code in `src/momapy/core.py`

    660
    661
    662
    def size(self) -> tuple[float, float]:
        """Return the size of the node"""
        return (self.width, self.height)

#### `` south

    south() -> Point

Return the south anchor of the node

Source code in `src/momapy/core.py`

    736
    737
    738
    def south(self) -> momapy.geometry.Point:
        """Return the south anchor of the node"""
        return self.self_angle(270)

#### `` south_east

    south_east() -> Point

Return the south east anchor of the node

Source code in `src/momapy/core.py`

    720
    721
    722
    723
    724
    725
    726
    def south_east(self) -> momapy.geometry.Point:
        """Return the south east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` south_south_east

    south_south_east() -> Point

Return the south south east anchor of the node

Source code in `src/momapy/core.py`

    728
    729
    730
    731
    732
    733
    734
    def south_south_east(self) -> momapy.geometry.Point:
        """Return the south south east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 4, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` south_south_west

    south_south_west() -> Point

Return the south south west anchor of the node

Source code in `src/momapy/core.py`

    740
    741
    742
    743
    744
    745
    746
    def south_south_west(self) -> momapy.geometry.Point:
        """Return the south south west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (-self.width / 4, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` south_west

    south_west() -> Point

Return the south west anchor of the node

Source code in `src/momapy/core.py`

    748
    749
    750
    751
    752
    753
    754
    def south_west(self) -> momapy.geometry.Point:
        """Return the south west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (-self.width / 2, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` to_shapely

    to_shapely(to_polygons: bool = False) -> GeometryCollection

Return a shapely collection of geometries reproducing the drawing elements of the layout element

Source code in `src/momapy/core.py`

    123
    124
    125
    126
    127
    128
    def to_shapely(self, to_polygons: bool = False) -> shapely.GeometryCollection:
        """Return a shapely collection of geometries reproducing the drawing elements of the layout element"""
        geom_collection = []
        for drawing_element in self.drawing_elements():
            geom_collection += drawing_element.to_shapely(to_polygons=to_polygons).geoms
        return shapely.GeometryCollection(geom_collection)

#### `` west

    west() -> Point

Return the west anchor of the node

Source code in `src/momapy/core.py`

    764
    765
    766
    def west(self) -> momapy.geometry.Point:
        """Return the west anchor of the node"""
        return self.self_angle(180)

#### `` west_north_west

    west_north_west() -> Point

Return the west north west anchor of the node

Source code in `src/momapy/core.py`

    768
    769
    770
    771
    772
    773
    774
    def west_north_west(self) -> momapy.geometry.Point:
        """Return the west north west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() - (self.width / 2, self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` west_south_west

    west_south_west() -> Point

Return the west south west anchor of the node

Source code in `src/momapy/core.py`

    756
    757
    758
    759
    760
    761
    762
    def west_south_west(self) -> momapy.geometry.Point:
        """Return the west south west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (-self.width / 2, self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` x `property`

    x: float

Return the x coordinate of the node

#### `` y `property`

    y: float

Return the y coordinate of the node

### `` MacromoleculeMultimerSubunit `dataclass`

    MacromoleculeMultimerSubunit(
        *,
        id_: str = make_uuid4_as_str(),
        label: str | None = None,
        state_variables: frozenset[StateVariable] = frozenset(),
        units_of_information: frozenset[
            UnitOfInformation
        ] = frozenset(),
        subunits: frozenset[Subunit] = frozenset(),
        cardinality: int | None = None,
    )

Bases: `MultimerSubunit`

Class for macromolecule multimer subunits

Parameters:

Name | Type | Description | Default
--- | --- | --- | ---
`id_` | `str` | The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element | `'45273ddb-98a9-4edf-ba09-a6e55b8bc0cb'`
`label` | `str | None` | The label of the subunit | `None`
`state_variables` | `frozenset[StateVariable]` | The state variables of the complex subunit | `<class 'frozenset'>`
`units_of_information` | `frozenset[UnitOfInformation]` | The units of information of the complex subunit | `<class 'frozenset'>`
`subunits` | `frozenset[Subunit]` | The subunits of the complex subunit | `<class 'frozenset'>`
`cardinality` | `int | None` | The cardinality of the multimer subunit | `None`

### `` MacromoleculeMultimerSubunitLayout `dataclass`

    MacromoleculeMultimerSubunitLayout(
        fill: NoneValueType | Color | None = white,
        stroke: NoneValueType | Color | None = black,
        stroke_width: float | None = 1.25,
        offset: float = 3.0,
        subunits_stroke: tuple[NoneValueType | Color]
        | None = None,
        subunits_stroke_width: tuple[NoneValueType | float]
        | None = None,
        subunits_stroke_dasharray: tuple[
            NoneValueType | tuple[float]
        ]
        | None = None,
        subunits_stroke_dashoffset: tuple[float] | None = None,
        subunits_fill: tuple[NoneValueType | Color]
        | None = None,
        subunits_transform: tuple[
            NoneValueType | tuple[Transformation]
        ]
        | None = None,
        subunits_filter: tuple[NoneValueType | Filter]
        | None = None,
        *,
        id_: str = make_uuid4_as_str(),
        layout_elements: tuple[LayoutElement] = tuple(),
        group_fill: NoneValueType | Color | None = None,
        group_fill_rule: FillRule | None = None,
        group_filter: NoneValueType | Filter | None = None,
        group_font_family: str | None = None,
        group_font_size: float | None = None,
        group_font_style: FontStyle | None = None,
        group_font_weight: FontWeight | float | None = None,
        group_stroke: NoneValueType | Color | None = None,
        group_stroke_dasharray: tuple[float, ...] | None = None,
        group_stroke_dashoffset: float | None = None,
        group_stroke_width: float | None = None,
        group_text_anchor: TextAnchor | None = None,
        group_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        filter: NoneValueType | Filter | None = None,
        height: float = 30.0,
        label: TextLayout | None = None,
        position: Point,
        stroke_dasharray: tuple[float, ...] | None = None,
        stroke_dashoffset: float | None = None,
        transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        width: float = 60.0,
        rounded_corners: float = 5.0,
    )

Bases: `_MultiMixin`, `SBGNNode`

Class for macromolecule multimer subunit layouts

Parameters:

Name | Type | Description | Default
--- | --- | --- | ---
`id_` | `str` | The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element | `'ab1d012a-be82-4f85-b3c2-3df2a8c7256f'`
`layout_elements` | `tuple[LayoutElement]` | The sub-layout elements of the group layout. These are part of the children of the group layout | `<dynamic>`
`group_fill` | `NoneValueType | Color | None` | The fill color of the group layout | `None`
`group_fill_rule` | `FillRule | None` | The fill rule of the group layout | `None`
`group_filter` | `NoneValueType | Filter | None` | The filter of the group layout | `None`
`group_font_family` | `str | None` | The font family of the group layout | `None`
`group_font_size` | `float | None` | The font size of the group layout | `None`
`group_font_style` | `FontStyle | None` | The font style of the group layout | `None`
`group_font_weight` | `FontWeight | float | None` | The font weight of the group layout | `None`
`group_stroke` | `NoneValueType | Color | None` | The stroke color of the group layout | `None`
`group_stroke_dasharray` | `tuple[float, ...] | None` | The stroke dasharray of the group layout | `None`
`group_stroke_dashoffset` | `float | None` | The stroke dashoffset of the group layout | `None`
`group_stroke_width` | `float | None` | The stroke width of the group layout | `None`
`group_text_anchor` | `TextAnchor | None` | The text anchor of the group layout | `None`
`group_transform` | `NoneValueType | tuple[Transformation] | None` | The transform of the group layout | `None`
`fill` | `NoneValueType | Color | None` |  | `Color(red=255, green=255, blue=255, alpha=1.0)`
`filter` | `NoneValueType | Filter | None` | The filter of the node | `None`
`height` | `float` |  | `30.0`
`label` | `TextLayout | None` | The label of the node | `None`
`position` | `Point` | The position of the node | required
`stroke` | `NoneValueType | Color | None` |  | `Color(red=0, green=0, blue=0, alpha=1.0)`
`stroke_dasharray` | `tuple[float, ...] | None` | The stroke dasharray of the node | `None`
`stroke_dashoffset` | `float | None` | The stroke dashoffset of the node | `None`
`stroke_width` | `float | None` |  | `1.25`
`transform` | `NoneValueType | tuple[Transformation] | None` | The transform of the node | `None`
`width` | `float` |  | `60.0`
`offset` | `float` |  | `3.0`
`subunits_stroke` | `tuple[Union[NoneValueType, Color]] | None` |  | `None`
`subunits_stroke_width` | `tuple[Union[NoneValueType, float]] | None` |  | `None`
`subunits_stroke_dasharray` | `tuple[Union[NoneValueType, tuple[float]]] | None` |  | `None`
`subunits_stroke_dashoffset` | `tuple[float] | None` |  | `None`
`subunits_fill` | `tuple[Union[NoneValueType, Color]] | None` |  | `None`
`subunits_transform` | `tuple[Union[NoneValueType, tuple[Transformation]]] | None` |  | `None`
`subunits_filter` | `tuple[Union[NoneValueType, Filter]] | None` |  | `None`
`rounded_corners` | `float` |  | `5.0`

Methods:

Name | Description
--- | ---
`anchor_point` | Return an anchor point of the layout element
`angle` | Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.
`bbox` | Compute and return the bounding box of the group layout element
`border` | Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point.
`center` | Return the center anchor of the node
`childless` | Return a copy of the node with no children
`children` | Return the children of the group layout.
`contains` | Return `true` if another layout element is a descendant of the layout element, `false` otherwise
`descendants` | Return the descendants of the layout element
`drawing_elements` | Return the drawing elements of the group layout.
`east` | Return the east anchor of the node
`east_north_east` | Return the east north east anchor of the node
`east_south_east` | Return the east south east west anchor of the node
`equals` | Return `true` if the layout element is equal to another layout element, `false` otherwise
`flattened` | Return a list containing copy of the layout element with no children and all its descendants with no children
`north` | Return the north anchor of the node
`north_east` | Return the north east anchor of the node
`north_north_east` | Return the north north east anchor of the node
`north_north_west` | Return the north north west anchor of the node
`north_west` | Return the north west anchor of the node
`self_angle` | Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.
`self_bbox` | Compute and return the bounding box of the self drawing element of the group layout
`self_border` | Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point.
`self_children` | Return the self children of the node. A node has unique child that is its label
`self_drawing_elements` | Return the node's own drawing elements
`self_to_shapely` | Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout
`size` | Return the size of the node
`south` | Return the south anchor of the node
`south_east` | Return the south east anchor of the node
`south_south_east` | Return the south south east anchor of the node
`south_south_west` | Return the south south west anchor of the node
`south_west` | Return the south west anchor of the node
`to_shapely` | Return a shapely collection of geometries reproducing the drawing elements of the layout element
`west` | Return the west anchor of the node
`west_north_west` | Return the west north west anchor of the node
`west_south_west` | Return the west south west anchor of the node

Attributes:

Name | Type | Description
--- | --- | ---
`x` | `float` | Return the x coordinate of the node
`y` | `float` | Return the y coordinate of the node

#### `` anchor_point

    anchor_point(anchor_name: str) -> Point

Return an anchor point of the layout element

Source code in `src/momapy/core.py`

    130
    131
    132
    def anchor_point(self, anchor_name: str) -> momapy.geometry.Point:
        """Return an anchor point of the layout element"""
        return getattr(self, anchor_name)()

#### `` angle

    angle(
        angle: float,
        unit: Literal["degrees", "radians"] = "degrees",
    ) -> Point

Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.

Source code in `src/momapy/core.py`

    817
    818
    819
    820
    821
    822
    823
    824
    825
    826
    827
    828
    def angle(
        self,
        angle: float,
        unit: typing.Literal["degrees", "radians"] = "degrees",
    ) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal."""
        return momapy.drawing.get_drawing_elements_angle(
            drawing_elements=self.drawing_elements(),
            angle=angle,
            unit=unit,
            center=self.center(),
        )

#### `` bbox

    bbox() -> Bbox

Compute and return the bounding box of the group layout element

Source code in `src/momapy/core.py`

    504
    505
    506
    507
    508
    509
    510
    511
    512
    513
    514
    515
    516
    517
    518
    519
    520
    521
    522
    523
    524
    525
    526
    def bbox(self) -> momapy.geometry.Bbox:
        """Compute and return the bounding box of the group layout element"""
        self_bbox = self.self_bbox()
        bboxes = [child.bbox() for child in self.children()]
        min_x = self_bbox.north_west().x
        min_y = self_bbox.north_west().y
        max_x = self_bbox.south_east().x
        max_y = self_bbox.south_east().y
        for bbox in bboxes:
            if bbox.north_west().x < min_x:
                min_x = bbox.north_west().x
            if bbox.north_west().y < min_y:
                min_y = bbox.north_west().y
            if bbox.south_east().x > max_x:
                max_x = bbox.south_east().x
            if bbox.south_east().y > max_y:
                max_y = bbox.south_east().y
        bbox = momapy.geometry.Bbox(
            momapy.geometry.Point(min_x / 2 + max_x / 2, min_y / 2 + max_y / 2),
            max_x - min_x,
            max_y - min_y,
        )
        return bbox

#### `` border

    border(point: Point) -> Point

Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point. When there are multiple intersection points, the one closest to the given point is returned

Source code in `src/momapy/core.py`

    794
    795
    796
    797
    798
    799
    800
    801
    802
    def border(self, point: momapy.geometry.Point) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point.
        When there are multiple intersection points, the one closest to the given point is returned
        """
        return momapy.drawing.get_drawing_elements_border(
            drawing_elements=self.drawing_elements(),
            point=point,
            center=self.center(),
        )

#### `` center

    center() -> Point

Return the center anchor of the node

Source code in `src/momapy/core.py`

    776
    777
    778
    def center(self) -> momapy.geometry.Point:
        """Return the center anchor of the node"""
        return self.position

#### `` childless

    childless() -> Self

Return a copy of the node with no children

Source code in `src/momapy/core.py`

    830
    831
    832
    def childless(self) -> typing.Self:
        """Return a copy of the node with no children"""
        return dataclasses.replace(self, label=None, layout_elements=tuple([]))

#### `` children

    children() -> list[LayoutElement]

Return the children of the group layout. These are the self children of the group layout (returned by the `self_children` method) and the other children of the group layout (given by the `layout_elements` attribute)

Source code in `src/momapy/core.py`

    566
    567
    568
    569
    570
    def children(self) -> list[LayoutElement]:
        """Return the children of the group layout.
        These are the self children of the group layout (returned by the `self_children` method) and the other children of the group layout (given by the `layout_elements` attribute)
        """
        return self.self_children() + list(self.layout_elements)

#### `` contains

    contains(other: LayoutElement) -> bool

Return `true` if another layout element is a descendant of the layout element, `false` otherwise

Source code in `src/momapy/core.py`

    119
    120
    121
    def contains(self, other: "LayoutElement") -> bool:
        """Return `true` if another layout element is a descendant of the layout element, `false` otherwise"""
        return other in self.descendants()

#### `` descendants

    descendants() -> list[LayoutElement]

Return the descendants of the layout element

Source code in `src/momapy/core.py`

    90
    91
    92
    93
    94
    95
    96
    def descendants(self) -> list["LayoutElement"]:
        """Return the descendants of the layout element"""
        descendants = []
        for child in self.children():
            descendants.append(child)
            descendants += child.descendants()
        return descendants

#### `` drawing_elements

    drawing_elements() -> list[DrawingElement]

Return the drawing elements of the group layout. The returned drawing elements are a group drawing element formed of the self drawing elements of the group layout and the drawing elements of its children

Source code in `src/momapy/core.py`

    538
    539
    540
    541
    542
    543
    544
    545
    546
    547
    548
    549
    550
    551
    552
    553
    554
    555
    556
    557
    558
    559
    560
    561
    562
    563
    564
    def drawing_elements(self) -> list[momapy.drawing.DrawingElement]:
        """Return the drawing elements of the group layout.
        The returned drawing elements are a group drawing element formed of the self drawing elements of the group layout and the drawing elements of its children
        """
        drawing_elements = self.self_drawing_elements()
        for child in self.children():
            if child is not None:
                drawing_elements += child.drawing_elements()
        group = momapy.drawing.Group(
            class_=f"{type(self).__name__}_group",
            elements=tuple(drawing_elements),
            id_=f"{self.id_}_group",
            fill=self.group_fill,
            fill_rule=self.group_fill_rule,
            filter=self.group_filter,
            font_family=self.group_font_family,
            font_size=self.group_font_size,
            font_style=self.group_font_style,
            font_weight=self.group_font_weight,
            stroke=self.group_stroke,
            stroke_dasharray=self.group_stroke_dasharray,
            stroke_dashoffset=self.group_stroke_dashoffset,
            stroke_width=self.group_stroke_width,
            text_anchor=self.group_text_anchor,
            transform=self.group_transform,
        )
        return [group]

#### `` east

    east() -> Point

Return the east anchor of the node

Source code in `src/momapy/core.py`

    708
    709
    710
    def east(self) -> momapy.geometry.Point:
        """Return the east anchor of the node"""
        return self.self_angle(0)

#### `` east_north_east

    east_north_east() -> Point

Return the east north east anchor of the node

Source code in `src/momapy/core.py`

    700
    701
    702
    703
    704
    705
    706
    def east_north_east(self) -> momapy.geometry.Point:
        """Return the east north east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, -self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` east_south_east

    east_south_east() -> Point

Return the east south east west anchor of the node

Source code in `src/momapy/core.py`

    712
    713
    714
    715
    716
    717
    718
    def east_south_east(self) -> momapy.geometry.Point:
        """Return the east south east west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` equals

    equals(
        other: LayoutElement,
        flattened: bool = False,
        unordered: bool = False,
    ) -> bool

Return `true` if the layout element is equal to another layout element, `false` otherwise

Source code in `src/momapy/core.py`

    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    def equals(
        self, other: "LayoutElement", flattened: bool = False, unordered: bool = False
    ) -> bool:
        """Return `true` if the layout element is equal to another layout element, `false` otherwise"""
        if type(self) is type(other):
            if not flattened:
                return self == other
            else:
                if not unordered:
                    return self.flattened() == other.flattened()
                else:
                    return set(self.flattened()) == set(other.flattened())
        return False

#### `` flattened

    flattened() -> list[LayoutElement]

Return a list containing copy of the layout element with no children and all its descendants with no children

Source code in `src/momapy/core.py`

     98
     99
    100
    101
    102
    103
    def flattened(self) -> list["LayoutElement"]:
        """Return a list containing copy of the layout element with no children and all its descendants with no children"""
        flattened = [self.childless()]
        for child in self.children():
            flattened += child.flattened()
        return flattened

#### `` north

    north() -> Point

Return the north anchor of the node

Source code in `src/momapy/core.py`

    680
    681
    682
    def north(self) -> momapy.geometry.Point:
        """Return the north anchor of the node"""
        return self.self_angle(90)

#### `` north_east

    north_east() -> Point

Return the north east anchor of the node

Source code in `src/momapy/core.py`

    692
    693
    694
    695
    696
    697
    698
    def north_east(self) -> momapy.geometry.Point:
        """Return the north east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, -self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` north_north_east

    north_north_east() -> Point

Return the north north east anchor of the node

Source code in `src/momapy/core.py`

    684
    685
    686
    687
    688
    689
    690
    def north_north_east(self) -> momapy.geometry.Point:
        """Return the north north east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 4, -self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` north_north_west

    north_north_west() -> Point

Return the north north west anchor of the node

Source code in `src/momapy/core.py`

    672
    673
    674
    675
    676
    677
    678
    def north_north_west(self) -> momapy.geometry.Point:
        """Return the north north west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() - (self.width / 4, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` north_west

    north_west() -> Point

Return the north west anchor of the node

Source code in `src/momapy/core.py`

    664
    665
    666
    667
    668
    669
    670
    def north_west(self) -> momapy.geometry.Point:
        """Return the north west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() - (self.width / 2, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` self_angle

    self_angle(
        angle: float,
        unit: Literal["degrees", "radians"] = "degrees",
    ) -> Point

Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.

Source code in `src/momapy/core.py`

    804
    805
    806
    807
    808
    809
    810
    811
    812
    813
    814
    815
    def self_angle(
        self,
        angle: float,
        unit: typing.Literal["degrees", "radians"] = "degrees",
    ) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal."""
        return momapy.drawing.get_drawing_elements_angle(
            drawing_elements=self.self_drawing_elements(),
            angle=angle,
            unit=unit,
            center=self.center(),
        )

#### `` self_bbox

    self_bbox() -> Bbox

Compute and return the bounding box of the self drawing element of the group layout

Source code in `src/momapy/core.py`

    499
    500
    501
    502
    def self_bbox(self) -> momapy.geometry.Bbox:
        """Compute and return the bounding box of the self drawing element of the group layout"""
        bounds = self.self_to_shapely().bounds
        return momapy.geometry.Bbox.from_bounds(bounds)

#### `` self_border

    self_border(point: Point) -> Point

Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point. When there are multiple intersection points, the one closest to the given point is returned

Source code in `src/momapy/core.py`

    784
    785
    786
    787
    788
    789
    790
    791
    792
    def self_border(self, point: momapy.geometry.Point) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point.
        When there are multiple intersection points, the one closest to the given point is returned
        """
        return momapy.drawing.get_drawing_elements_border(
            drawing_elements=self.self_drawing_elements(),
            point=point,
            center=self.center(),
        )

#### `` self_children

    self_children() -> list[LayoutElement]

Return the self children of the node. A node has unique child that is its label

Source code in `src/momapy/core.py`

    654
    655
    656
    657
    658
    def self_children(self) -> list[LayoutElement]:
        """Return the self children of the node. A node has unique child that is its label"""
        if self.label is not None:
            return [self.label]
        return []

#### `` self_drawing_elements

    self_drawing_elements() -> list[DrawingElement]

Return the node's own drawing elements

Source code in `src/momapy/core.py`

    637
    638
    639
    640
    641
    642
    643
    644
    645
    646
    647
    648
    649
    650
    651
    652
    def self_drawing_elements(self) -> list[momapy.drawing.DrawingElement]:
        """Return the node's own drawing elements"""
        drawing_elements = self._border_drawing_elements()
        group = momapy.drawing.Group(
            class_=type(self).__name__,
            elements=tuple(drawing_elements),
            fill=self.fill,
            filter=self.filter,
            id_=self.id_,
            stroke=self.stroke,
            stroke_dasharray=self.stroke_dasharray,
            stroke_dashoffset=self.stroke_dashoffset,
            stroke_width=self.stroke_width,
            transform=self.transform,
        )
        return [group]

#### `` self_to_shapely

    self_to_shapely() -> GeometryCollection

Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout

Source code in `src/momapy/core.py`

    495
    496
    497
    def self_to_shapely(self) -> shapely.GeometryCollection:
        """Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout"""
        return momapy.drawing.drawing_elements_to_shapely(self.drawing_elements())

#### `` size

    size() -> tuple[float, float]

Return the size of the node

Source code in `src/momapy/core.py`

    660
    661
    662
    def size(self) -> tuple[float, float]:
        """Return the size of the node"""
        return (self.width, self.height)

#### `` south

    south() -> Point

Return the south anchor of the node

Source code in `src/momapy/core.py`

    736
    737
    738
    def south(self) -> momapy.geometry.Point:
        """Return the south anchor of the node"""
        return self.self_angle(270)

#### `` south_east

    south_east() -> Point

Return the south east anchor of the node

Source code in `src/momapy/core.py`

    720
    721
    722
    723
    724
    725
    726
    def south_east(self) -> momapy.geometry.Point:
        """Return the south east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` south_south_east

    south_south_east() -> Point

Return the south south east anchor of the node

Source code in `src/momapy/core.py`

    728
    729
    730
    731
    732
    733
    734
    def south_south_east(self) -> momapy.geometry.Point:
        """Return the south south east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 4, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` south_south_west

    south_south_west() -> Point

Return the south south west anchor of the node

Source code in `src/momapy/core.py`

    740
    741
    742
    743
    744
    745
    746
    def south_south_west(self) -> momapy.geometry.Point:
        """Return the south south west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (-self.width / 4, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` south_west

    south_west() -> Point

Return the south west anchor of the node

Source code in `src/momapy/core.py`

    748
    749
    750
    751
    752
    753
    754
    def south_west(self) -> momapy.geometry.Point:
        """Return the south west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (-self.width / 2, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` to_shapely

    to_shapely(to_polygons: bool = False) -> GeometryCollection

Return a shapely collection of geometries reproducing the drawing elements of the layout element

Source code in `src/momapy/core.py`

    123
    124
    125
    126
    127
    128
    def to_shapely(self, to_polygons: bool = False) -> shapely.GeometryCollection:
        """Return a shapely collection of geometries reproducing the drawing elements of the layout element"""
        geom_collection = []
        for drawing_element in self.drawing_elements():
            geom_collection += drawing_element.to_shapely(to_polygons=to_polygons).geoms
        return shapely.GeometryCollection(geom_collection)

#### `` west

    west() -> Point

Return the west anchor of the node

Source code in `src/momapy/core.py`

    764
    765
    766
    def west(self) -> momapy.geometry.Point:
        """Return the west anchor of the node"""
        return self.self_angle(180)

#### `` west_north_west

    west_north_west() -> Point

Return the west north west anchor of the node

Source code in `src/momapy/core.py`

    768
    769
    770
    771
    772
    773
    774
    def west_north_west(self) -> momapy.geometry.Point:
        """Return the west north west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() - (self.width / 2, self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` west_south_west

    west_south_west() -> Point

Return the west south west anchor of the node

Source code in `src/momapy/core.py`

    756
    757
    758
    759
    760
    761
    762
    def west_south_west(self) -> momapy.geometry.Point:
        """Return the west south west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (-self.width / 2, self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` x `property`

    x: float

Return the x coordinate of the node

#### `` y `property`

    y: float

Return the y coordinate of the node

### `` MacromoleculeSubunit `dataclass`

    MacromoleculeSubunit(
        *,
        id_: str = make_uuid4_as_str(),
        label: str | None = None,
        state_variables: frozenset[StateVariable] = frozenset(),
        units_of_information: frozenset[
            UnitOfInformation
        ] = frozenset(),
    )

Bases: `Subunit`

Class for macromolecule subunits

Parameters:

Name | Type | Description | Default
--- | --- | --- | ---
`id_` | `str` | The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element | `'498dde63-00a4-45ba-9e00-1850ffd139ac'`
`label` | `str | None` | The label of the subunit | `None`
`state_variables` | `frozenset[StateVariable]` | The state variables of the macromolecule subunit | `<class 'frozenset'>`
`units_of_information` | `frozenset[UnitOfInformation]` | The units of information of the macromolecule subunit | `<class 'frozenset'>`

### `` MacromoleculeSubunitLayout `dataclass`

    MacromoleculeSubunitLayout(
        fill: NoneValueType | Color | None = white,
        stroke: NoneValueType | Color | None = black,
        stroke_width: float | None = 1.25,
        *,
        id_: str = make_uuid4_as_str(),
        layout_elements: tuple[LayoutElement] = tuple(),
        group_fill: NoneValueType | Color | None = None,
        group_fill_rule: FillRule | None = None,
        group_filter: NoneValueType | Filter | None = None,
        group_font_family: str | None = None,
        group_font_size: float | None = None,
        group_font_style: FontStyle | None = None,
        group_font_weight: FontWeight | float | None = None,
        group_stroke: NoneValueType | Color | None = None,
        group_stroke_dasharray: tuple[float, ...] | None = None,
        group_stroke_dashoffset: float | None = None,
        group_stroke_width: float | None = None,
        group_text_anchor: TextAnchor | None = None,
        group_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        filter: NoneValueType | Filter | None = None,
        height: float = 30.0,
        label: TextLayout | None = None,
        position: Point,
        stroke_dasharray: tuple[float, ...] | None = None,
        stroke_dashoffset: float | None = None,
        transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        width: float = 60.0,
        rounded_corners: float = 5.0,
    )

Bases: `_SimpleMixin`, `SBGNNode`

Class for macromolecule subunit layouts

Parameters:

Name | Type | Description | Default
--- | --- | --- | ---
`id_` | `str` | The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element | `'6a76ec70-3bb2-4e66-b10d-71e39bc12b41'`
`layout_elements` | `tuple[LayoutElement]` | The sub-layout elements of the group layout. These are part of the children of the group layout | `<dynamic>`
`group_fill` | `NoneValueType | Color | None` | The fill color of the group layout | `None`
`group_fill_rule` | `FillRule | None` | The fill rule of the group layout | `None`
`group_filter` | `NoneValueType | Filter | None` | The filter of the group layout | `None`
`group_font_family` | `str | None` | The font family of the group layout | `None`
`group_font_size` | `float | None` | The font size of the group layout | `None`
`group_font_style` | `FontStyle | None` | The font style of the group layout | `None`
`group_font_weight` | `FontWeight | float | None` | The font weight of the group layout | `None`
`group_stroke` | `NoneValueType | Color | None` | The stroke color of the group layout | `None`
`group_stroke_dasharray` | `tuple[float, ...] | None` | The stroke dasharray of the group layout | `None`
`group_stroke_dashoffset` | `float | None` | The stroke dashoffset of the group layout | `None`
`group_stroke_width` | `float | None` | The stroke width of the group layout | `None`
`group_text_anchor` | `TextAnchor | None` | The text anchor of the group layout | `None`
`group_transform` | `NoneValueType | tuple[Transformation] | None` | The transform of the group layout | `None`
`fill` | `NoneValueType | Color | None` |  | `Color(red=255, green=255, blue=255, alpha=1.0)`
`filter` | `NoneValueType | Filter | None` | The filter of the node | `None`
`height` | `float` |  | `30.0`
`label` | `TextLayout | None` | The label of the node | `None`
`position` | `Point` | The position of the node | required
`stroke` | `NoneValueType | Color | None` |  | `Color(red=0, green=0, blue=0, alpha=1.0)`
`stroke_dasharray` | `tuple[float, ...] | None` | The stroke dasharray of the node | `None`
`stroke_dashoffset` | `float | None` | The stroke dashoffset of the node | `None`
`stroke_width` | `float | None` |  | `1.25`
`transform` | `NoneValueType | tuple[Transformation] | None` | The transform of the node | `None`
`width` | `float` |  | `60.0`
`rounded_corners` | `float` |  | `5.0`

Methods:

Name | Description
--- | ---
`anchor_point` | Return an anchor point of the layout element
`angle` | Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.
`bbox` | Compute and return the bounding box of the group layout element
`border` | Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point.
`center` | Return the center anchor of the node
`childless` | Return a copy of the node with no children
`children` | Return the children of the group layout.
`contains` | Return `true` if another layout element is a descendant of the layout element, `false` otherwise
`descendants` | Return the descendants of the layout element
`drawing_elements` | Return the drawing elements of the group layout.
`east` | Return the east anchor of the node
`east_north_east` | Return the east north east anchor of the node
`east_south_east` | Return the east south east west anchor of the node
`equals` | Return `true` if the layout element is equal to another layout element, `false` otherwise
`flattened` | Return a list containing copy of the layout element with no children and all its descendants with no children
`label_center` | Return the label center anchor of the node
`north` | Return the north anchor of the node
`north_east` | Return the north east anchor of the node
`north_north_east` | Return the north north east anchor of the node
`north_north_west` | Return the north north west anchor of the node
`north_west` | Return the north west anchor of the node
`self_angle` | Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.
`self_bbox` | Compute and return the bounding box of the self drawing element of the group layout
`self_border` | Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point.
`self_children` | Return the self children of the node. A node has unique child that is its label
`self_drawing_elements` | Return the node's own drawing elements
`self_to_shapely` | Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout
`size` | Return the size of the node
`south` | Return the south anchor of the node
`south_east` | Return the south east anchor of the node
`south_south_east` | Return the south south east anchor of the node
`south_south_west` | Return the south south west anchor of the node
`south_west` | Return the south west anchor of the node
`to_shapely` | Return a shapely collection of geometries reproducing the drawing elements of the layout element
`west` | Return the west anchor of the node
`west_north_west` | Return the west north west anchor of the node
`west_south_west` | Return the west south west anchor of the node

Attributes:

Name | Type | Description
--- | --- | ---
`x` | `float` | Return the x coordinate of the node
`y` | `float` | Return the y coordinate of the node

#### `` anchor_point

    anchor_point(anchor_name: str) -> Point

Return an anchor point of the layout element

Source code in `src/momapy/core.py`

    130
    131
    132
    def anchor_point(self, anchor_name: str) -> momapy.geometry.Point:
        """Return an anchor point of the layout element"""
        return getattr(self, anchor_name)()

#### `` angle

    angle(
        angle: float,
        unit: Literal["degrees", "radians"] = "degrees",
    ) -> Point

Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.

Source code in `src/momapy/core.py`

    817
    818
    819
    820
    821
    822
    823
    824
    825
    826
    827
    828
    def angle(
        self,
        angle: float,
        unit: typing.Literal["degrees", "radians"] = "degrees",
    ) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal."""
        return momapy.drawing.get_drawing_elements_angle(
            drawing_elements=self.drawing_elements(),
            angle=angle,
            unit=unit,
            center=self.center(),
        )

#### `` bbox

    bbox() -> Bbox

Compute and return the bounding box of the group layout element

Source code in `src/momapy/core.py`

    504
    505
    506
    507
    508
    509
    510
    511
    512
    513
    514
    515
    516
    517
    518
    519
    520
    521
    522
    523
    524
    525
    526
    def bbox(self) -> momapy.geometry.Bbox:
        """Compute and return the bounding box of the group layout element"""
        self_bbox = self.self_bbox()
        bboxes = [child.bbox() for child in self.children()]
        min_x = self_bbox.north_west().x
        min_y = self_bbox.north_west().y
        max_x = self_bbox.south_east().x
        max_y = self_bbox.south_east().y
        for bbox in bboxes:
            if bbox.north_west().x < min_x:
                min_x = bbox.north_west().x
            if bbox.north_west().y < min_y:
                min_y = bbox.north_west().y
            if bbox.south_east().x > max_x:
                max_x = bbox.south_east().x
            if bbox.south_east().y > max_y:
                max_y = bbox.south_east().y
        bbox = momapy.geometry.Bbox(
            momapy.geometry.Point(min_x / 2 + max_x / 2, min_y / 2 + max_y / 2),
            max_x - min_x,
            max_y - min_y,
        )
        return bbox

#### `` border

    border(point: Point) -> Point

Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point. When there are multiple intersection points, the one closest to the given point is returned

Source code in `src/momapy/core.py`

    794
    795
    796
    797
    798
    799
    800
    801
    802
    def border(self, point: momapy.geometry.Point) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point.
        When there are multiple intersection points, the one closest to the given point is returned
        """
        return momapy.drawing.get_drawing_elements_border(
            drawing_elements=self.drawing_elements(),
            point=point,
            center=self.center(),
        )

#### `` center

    center() -> Point

Return the center anchor of the node

Source code in `src/momapy/core.py`

    776
    777
    778
    def center(self) -> momapy.geometry.Point:
        """Return the center anchor of the node"""
        return self.position

#### `` childless

    childless() -> Self

Return a copy of the node with no children

Source code in `src/momapy/core.py`

    830
    831
    832
    def childless(self) -> typing.Self:
        """Return a copy of the node with no children"""
        return dataclasses.replace(self, label=None, layout_elements=tuple([]))

#### `` children

    children() -> list[LayoutElement]

Return the children of the group layout. These are the self children of the group layout (returned by the `self_children` method) and the other children of the group layout (given by the `layout_elements` attribute)

Source code in `src/momapy/core.py`

    566
    567
    568
    569
    570
    def children(self) -> list[LayoutElement]:
        """Return the children of the group layout.
        These are the self children of the group layout (returned by the `self_children` method) and the other children of the group layout (given by the `layout_elements` attribute)
        """
        return self.self_children() + list(self.layout_elements)

#### `` contains

    contains(other: LayoutElement) -> bool

Return `true` if another layout element is a descendant of the layout element, `false` otherwise

Source code in `src/momapy/core.py`

    119
    120
    121
    def contains(self, other: "LayoutElement") -> bool:
        """Return `true` if another layout element is a descendant of the layout element, `false` otherwise"""
        return other in self.descendants()

#### `` descendants

    descendants() -> list[LayoutElement]

Return the descendants of the layout element

Source code in `src/momapy/core.py`

    90
    91
    92
    93
    94
    95
    96
    def descendants(self) -> list["LayoutElement"]:
        """Return the descendants of the layout element"""
        descendants = []
        for child in self.children():
            descendants.append(child)
            descendants += child.descendants()
        return descendants

#### `` drawing_elements

    drawing_elements() -> list[DrawingElement]

Return the drawing elements of the group layout. The returned drawing elements are a group drawing element formed of the self drawing elements of the group layout and the drawing elements of its children

Source code in `src/momapy/core.py`

    538
    539
    540
    541
    542
    543
    544
    545
    546
    547
    548
    549
    550
    551
    552
    553
    554
    555
    556
    557
    558
    559
    560
    561
    562
    563
    564
    def drawing_elements(self) -> list[momapy.drawing.DrawingElement]:
        """Return the drawing elements of the group layout.
        The returned drawing elements are a group drawing element formed of the self drawing elements of the group layout and the drawing elements of its children
        """
        drawing_elements = self.self_drawing_elements()
        for child in self.children():
            if child is not None:
                drawing_elements += child.drawing_elements()
        group = momapy.drawing.Group(
            class_=f"{type(self).__name__}_group",
            elements=tuple(drawing_elements),
            id_=f"{self.id_}_group",
            fill=self.group_fill,
            fill_rule=self.group_fill_rule,
            filter=self.group_filter,
            font_family=self.group_font_family,
            font_size=self.group_font_size,
            font_style=self.group_font_style,
            font_weight=self.group_font_weight,
            stroke=self.group_stroke,
            stroke_dasharray=self.group_stroke_dasharray,
            stroke_dashoffset=self.group_stroke_dashoffset,
            stroke_width=self.group_stroke_width,
            text_anchor=self.group_text_anchor,
            transform=self.group_transform,
        )
        return [group]

#### `` east

    east() -> Point

Return the east anchor of the node

Source code in `src/momapy/core.py`

    708
    709
    710
    def east(self) -> momapy.geometry.Point:
        """Return the east anchor of the node"""
        return self.self_angle(0)

#### `` east_north_east

    east_north_east() -> Point

Return the east north east anchor of the node

Source code in `src/momapy/core.py`

    700
    701
    702
    703
    704
    705
    706
    def east_north_east(self) -> momapy.geometry.Point:
        """Return the east north east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, -self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` east_south_east

    east_south_east() -> Point

Return the east south east west anchor of the node

Source code in `src/momapy/core.py`

    712
    713
    714
    715
    716
    717
    718
    def east_south_east(self) -> momapy.geometry.Point:
        """Return the east south east west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` equals

    equals(
        other: LayoutElement,
        flattened: bool = False,
        unordered: bool = False,
    ) -> bool

Return `true` if the layout element is equal to another layout element, `false` otherwise

Source code in `src/momapy/core.py`

    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    def equals(
        self, other: "LayoutElement", flattened: bool = False, unordered: bool = False
    ) -> bool:
        """Return `true` if the layout element is equal to another layout element, `false` otherwise"""
        if type(self) is type(other):
            if not flattened:
                return self == other
            else:
                if not unordered:
                    return self.flattened() == other.flattened()
                else:
                    return set(self.flattened()) == set(other.flattened())
        return False

#### `` flattened

    flattened() -> list[LayoutElement]

Return a list containing copy of the layout element with no children and all its descendants with no children

Source code in `src/momapy/core.py`

     98
     99
    100
    101
    102
    103
    def flattened(self) -> list["LayoutElement"]:
        """Return a list containing copy of the layout element with no children and all its descendants with no children"""
        flattened = [self.childless()]
        for child in self.children():
            flattened += child.flattened()
        return flattened

#### `` label_center

    label_center() -> Point

Return the label center anchor of the node

Source code in `src/momapy/core.py`

    780
    781
    782
    def label_center(self) -> momapy.geometry.Point:
        """Return the label center anchor of the node"""
        return self.position

#### `` north

    north() -> Point

Return the north anchor of the node

Source code in `src/momapy/core.py`

    680
    681
    682
    def north(self) -> momapy.geometry.Point:
        """Return the north anchor of the node"""
        return self.self_angle(90)

#### `` north_east

    north_east() -> Point

Return the north east anchor of the node

Source code in `src/momapy/core.py`

    692
    693
    694
    695
    696
    697
    698
    def north_east(self) -> momapy.geometry.Point:
        """Return the north east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, -self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` north_north_east

    north_north_east() -> Point

Return the north north east anchor of the node

Source code in `src/momapy/core.py`

    684
    685
    686
    687
    688
    689
    690
    def north_north_east(self) -> momapy.geometry.Point:
        """Return the north north east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 4, -self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` north_north_west

    north_north_west() -> Point

Return the north north west anchor of the node

Source code in `src/momapy/core.py`

    672
    673
    674
    675
    676
    677
    678
    def north_north_west(self) -> momapy.geometry.Point:
        """Return the north north west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() - (self.width / 4, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` north_west

    north_west() -> Point

Return the north west anchor of the node

Source code in `src/momapy/core.py`

    664
    665
    666
    667
    668
    669
    670
    def north_west(self) -> momapy.geometry.Point:
        """Return the north west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() - (self.width / 2, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` self_angle

    self_angle(
        angle: float,
        unit: Literal["degrees", "radians"] = "degrees",
    ) -> Point

Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.

Source code in `src/momapy/core.py`

    804
    805
    806
    807
    808
    809
    810
    811
    812
    813
    814
    815
    def self_angle(
        self,
        angle: float,
        unit: typing.Literal["degrees", "radians"] = "degrees",
    ) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal."""
        return momapy.drawing.get_drawing_elements_angle(
            drawing_elements=self.self_drawing_elements(),
            angle=angle,
            unit=unit,
            center=self.center(),
        )

#### `` self_bbox

    self_bbox() -> Bbox

Compute and return the bounding box of the self drawing element of the group layout

Source code in `src/momapy/core.py`

    499
    500
    501
    502
    def self_bbox(self) -> momapy.geometry.Bbox:
        """Compute and return the bounding box of the self drawing element of the group layout"""
        bounds = self.self_to_shapely().bounds
        return momapy.geometry.Bbox.from_bounds(bounds)

#### `` self_border

    self_border(point: Point) -> Point

Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point. When there are multiple intersection points, the one closest to the given point is returned

Source code in `src/momapy/core.py`

    784
    785
    786
    787
    788
    789
    790
    791
    792
    def self_border(self, point: momapy.geometry.Point) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point.
        When there are multiple intersection points, the one closest to the given point is returned
        """
        return momapy.drawing.get_drawing_elements_border(
            drawing_elements=self.self_drawing_elements(),
            point=point,
            center=self.center(),
        )

#### `` self_children

    self_children() -> list[LayoutElement]

Return the self children of the node. A node has unique child that is its label

Source code in `src/momapy/core.py`

    654
    655
    656
    657
    658
    def self_children(self) -> list[LayoutElement]:
        """Return the self children of the node. A node has unique child that is its label"""
        if self.label is not None:
            return [self.label]
        return []

#### `` self_drawing_elements

    self_drawing_elements() -> list[DrawingElement]

Return the node's own drawing elements

Source code in `src/momapy/core.py`

    637
    638
    639
    640
    641
    642
    643
    644
    645
    646
    647
    648
    649
    650
    651
    652
    def self_drawing_elements(self) -> list[momapy.drawing.DrawingElement]:
        """Return the node's own drawing elements"""
        drawing_elements = self._border_drawing_elements()
        group = momapy.drawing.Group(
            class_=type(self).__name__,
            elements=tuple(drawing_elements),
            fill=self.fill,
            filter=self.filter,
            id_=self.id_,
            stroke=self.stroke,
            stroke_dasharray=self.stroke_dasharray,
            stroke_dashoffset=self.stroke_dashoffset,
            stroke_width=self.stroke_width,
            transform=self.transform,
        )
        return [group]

#### `` self_to_shapely

    self_to_shapely() -> GeometryCollection

Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout

Source code in `src/momapy/core.py`

    495
    496
    497
    def self_to_shapely(self) -> shapely.GeometryCollection:
        """Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout"""
        return momapy.drawing.drawing_elements_to_shapely(self.drawing_elements())

#### `` size

    size() -> tuple[float, float]

Return the size of the node

Source code in `src/momapy/core.py`

    660
    661
    662
    def size(self) -> tuple[float, float]:
        """Return the size of the node"""
        return (self.width, self.height)

#### `` south

    south() -> Point

Return the south anchor of the node

Source code in `src/momapy/core.py`

    736
    737
    738
    def south(self) -> momapy.geometry.Point:
        """Return the south anchor of the node"""
        return self.self_angle(270)

#### `` south_east

    south_east() -> Point

Return the south east anchor of the node

Source code in `src/momapy/core.py`

    720
    721
    722
    723
    724
    725
    726
    def south_east(self) -> momapy.geometry.Point:
        """Return the south east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` south_south_east

    south_south_east() -> Point

Return the south south east anchor of the node

Source code in `src/momapy/core.py`

    728
    729
    730
    731
    732
    733
    734
    def south_south_east(self) -> momapy.geometry.Point:
        """Return the south south east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 4, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` south_south_west

    south_south_west() -> Point

Return the south south west anchor of the node

Source code in `src/momapy/core.py`

    740
    741
    742
    743
    744
    745
    746
    def south_south_west(self) -> momapy.geometry.Point:
        """Return the south south west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (-self.width / 4, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` south_west

    south_west() -> Point

Return the south west anchor of the node

Source code in `src/momapy/core.py`

    748
    749
    750
    751
    752
    753
    754
    def south_west(self) -> momapy.geometry.Point:
        """Return the south west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (-self.width / 2, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` to_shapely

    to_shapely(to_polygons: bool = False) -> GeometryCollection

Return a shapely collection of geometries reproducing the drawing elements of the layout element

Source code in `src/momapy/core.py`

    123
    124
    125
    126
    127
    128
    def to_shapely(self, to_polygons: bool = False) -> shapely.GeometryCollection:
        """Return a shapely collection of geometries reproducing the drawing elements of the layout element"""
        geom_collection = []
        for drawing_element in self.drawing_elements():
            geom_collection += drawing_element.to_shapely(to_polygons=to_polygons).geoms
        return shapely.GeometryCollection(geom_collection)

#### `` west

    west() -> Point

Return the west anchor of the node

Source code in `src/momapy/core.py`

    764
    765
    766
    def west(self) -> momapy.geometry.Point:
        """Return the west anchor of the node"""
        return self.self_angle(180)

#### `` west_north_west

    west_north_west() -> Point

Return the west north west anchor of the node

Source code in `src/momapy/core.py`

    768
    769
    770
    771
    772
    773
    774
    def west_north_west(self) -> momapy.geometry.Point:
        """Return the west north west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() - (self.width / 2, self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` west_south_west

    west_south_west() -> Point

Return the west south west anchor of the node

Source code in `src/momapy/core.py`

    756
    757
    758
    759
    760
    761
    762
    def west_south_west(self) -> momapy.geometry.Point:
        """Return the west south west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (-self.width / 2, self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` x `property`

    x: float

Return the x coordinate of the node

#### `` y `property`

    y: float

Return the y coordinate of the node

### `` Modulation `dataclass`

    Modulation(
        *,
        id_: str = make_uuid4_as_str(),
        source: EntityPool | LogicalOperator,
        target: Process,
    )

Bases: `SBGNModelElement`

Class for modulations

Parameters:

Name | Type | Description | Default
--- | --- | --- | ---
`id_` | `str` | The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element | `'08429b65-9a63-4751-9f6f-11f2c71de6d9'`
`source` | `EntityPool | LogicalOperator` | The source of the modulation | required
`target` | `Process` | The target of the modulation | required

### `` ModulationLayout `dataclass`

    ModulationLayout(
        path_fill: NoneValueType | Color | None = NoneValue,
        path_stroke: NoneValueType | Color | None = black,
        path_stroke_width: float | None = 1.25,
        arrowhead_stroke: NoneValueType | Color | None = black,
        arrowhead_stroke_width: float | None = 1.25,
        *,
        id_: str = make_uuid4_as_str(),
        layout_elements: tuple[LayoutElement] = tuple(),
        group_fill: NoneValueType | Color | None = None,
        group_fill_rule: FillRule | None = None,
        group_filter: NoneValueType | Filter | None = None,
        group_font_family: str | None = None,
        group_font_size: float | None = None,
        group_font_style: FontStyle | None = None,
        group_font_weight: FontWeight | float | None = None,
        group_stroke: NoneValueType | Color | None = None,
        group_stroke_dasharray: tuple[float, ...] | None = None,
        group_stroke_dashoffset: float | None = None,
        group_stroke_width: float | None = None,
        group_text_anchor: TextAnchor | None = None,
        group_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        end_shorten: float = 0.0,
        fill: NoneValueType | Color | None = None,
        filter: NoneValueType | Filter | None = None,
        path_filter: NoneValueType | Filter | None = None,
        path_stroke_dasharray: tuple[float, ...] | None = None,
        path_stroke_dashoffset: float | None = None,
        path_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        stroke: NoneValueType | Color | None = None,
        stroke_dasharray: NoneValueType
        | tuple[float]
        | None = None,
        stroke_dashoffset: float | None = None,
        stroke_width: float | None = None,
        segments: tuple[
            Segment | BezierCurve | EllipticalArc
        ] = tuple(),
        source: LayoutElement | None = None,
        start_shorten: float = 0.0,
        target: LayoutElement | None = None,
        transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        arrowhead_fill: NoneValueType | Color | None = white,
        arrowhead_filter: NoneValueType | Filter | None = None,
        arrowhead_stroke_dasharray: tuple[float, ...]
        | None = None,
        arrowhead_stroke_dashoffset: float | None = None,
        arrowhead_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        arrowhead_height: float = 10.0,
        arrowhead_width: float = 10.0,
    )

Bases: `SBGNSingleHeadedArc`

Class for modulation layouts

Parameters:

Name | Type | Description | Default
--- | --- | --- | ---
`id_` | `str` | The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element | `'9bd1b8f3-dcae-41cf-b083-e67094298e1b'`
`layout_elements` | `tuple[LayoutElement]` | The sub-layout elements of the group layout. These are part of the children of the group layout | `<dynamic>`
`group_fill` | `NoneValueType | Color | None` | The fill color of the group layout | `None`
`group_fill_rule` | `FillRule | None` | The fill rule of the group layout | `None`
`group_filter` | `NoneValueType | Filter | None` | The filter of the group layout | `None`
`group_font_family` | `str | None` | The font family of the group layout | `None`
`group_font_size` | `float | None` | The font size of the group layout | `None`
`group_font_style` | `FontStyle | None` | The font style of the group layout | `None`
`group_font_weight` | `FontWeight | float | None` | The font weight of the group layout | `None`
`group_stroke` | `NoneValueType | Color | None` | The stroke color of the group layout | `None`
`group_stroke_dasharray` | `tuple[float, ...] | None` | The stroke dasharray of the group layout | `None`
`group_stroke_dashoffset` | `float | None` | The stroke dashoffset of the group layout | `None`
`group_stroke_width` | `float | None` | The stroke width of the group layout | `None`
`group_text_anchor` | `TextAnchor | None` | The text anchor of the group layout | `None`
`group_transform` | `NoneValueType | tuple[Transformation] | None` | The transform of the group layout | `None`
`end_shorten` | `float` | The length the end of the arc will be shorten by | `0.0`
`fill` | `NoneValueType | Color | None` | The fill color of the arc | `None`
`filter` | `NoneValueType | Filter | None` | The fill filter of the arc | `None`
`path_fill` | `NoneValueType | Color | None` |  | `<momapy.drawing.NoneValueType object at 0x7fb32ae9f1d0>`
`path_filter` | `NoneValueType | Filter | None` | The path filter of the arc | `None`
`path_stroke` | `NoneValueType | Color | None` |  | `Color(red=0, green=0, blue=0, alpha=1.0)`
`path_stroke_dasharray` | `tuple[float, ...] | None` | The path stroke dasharray of the arc | `None`
`path_stroke_dashoffset` | `float | None` | The path stroke dashoffset of the arc | `None`
`path_stroke_width` | `float | None` |  | `1.25`
`path_transform` | `NoneValueType | tuple[Transformation] | None` | The path transform of the arc | `None`
`stroke` | `NoneValueType | Color | None` | The stroke color of the arc | `None`
`stroke_dasharray` | `NoneValueType | tuple[float] | None` | The stroke dasharray of the arc | `None`
`stroke_dashoffset` | `float | None` | The stroke dashoffset of the arc | `None`
`stroke_width` | `float | None` | The stroke width of the arc | `None`
`segments` | `tuple[Union[Segment, BezierCurve, EllipticalArc]]` | The path segments of the arc | `<dynamic>`
`source` | `LayoutElement | None` | The source of the arc | `None`
`start_shorten` | `float` | The length the start of the arc will be shorten by | `0.0`
`target` | `LayoutElement | None` | The target of the arc | `None`
`transform` | `NoneValueType | tuple[Transformation] | None` | The transform of the arc | `None`
`arrowhead_fill` | `NoneValueType | Color | None` |  | `Color(red=255, green=255, blue=255, alpha=1.0)`
`arrowhead_filter` | `NoneValueType | Filter | None` | The arrowhead filter of the arc | `None`
`arrowhead_stroke` | `NoneValueType | Color | None` |  | `Color(red=0, green=0, blue=0, alpha=1.0)`
`arrowhead_stroke_dasharray` | `tuple[float, ...] | None` | The arrowhead stroke dasharray of the arc | `None`
`arrowhead_stroke_dashoffset` | `float | None` | The arrowhead stroke dashoffset of the arc | `None`
`arrowhead_stroke_width` | `float | None` |  | `1.25`
`arrowhead_transform` | `NoneValueType | tuple[Transformation] | None` | The arrowhead transform of the arc | `None`
`arrowhead_height` | `float` |  | `10.0`
`arrowhead_width` | `float` |  | `10.0`

Methods:

Name | Description
--- | ---
`anchor_point` | Return an anchor point of the layout element
`arrowhead_base` | Return the arrowhead base anchor point of the single-headed arc
`arrowhead_bbox` | Return the bounding box of the single-headed arc arrowhead
`arrowhead_border` | Return the point at the intersection of the drawing elements of the single-headed arc arrowhead and the line going through the center of these drawing elements and the given point.
`arrowhead_drawing_elements` | Return the drawing elements of the single-headed arc arrowhead
`arrowhead_length` | Return the length of the single-headed arc arrowhead
`arrowhead_tip` | Return the arrowhead tip anchor point of the single-headed arc
`bbox` | Compute and return the bounding box of the group layout element
`childless` | Return a copy of the arc with no children
`children` | Return the children of the group layout.
`contains` | Return `true` if another layout element is a descendant of the layout element, `false` otherwise
`descendants` | Return the descendants of the layout element
`drawing_elements` | Return the drawing elements of the group layout.
`end_point` | Return the ending point of the arc
`equals` | Return `true` if the layout element is equal to another layout element, `false` otherwise
`flattened` | Return a list containing copy of the layout element with no children and all its descendants with no children
`fraction` | Return the position and angle on the arc at a given fraction (of the total arc length)
`length` | Return the total length of the arc path
`path_drawing_elements` | Return the drawing elements of the single-headed arc path
`points` | Return the points of the arc path
`self_bbox` | Compute and return the bounding box of the self drawing element of the group layout
`self_children` | Return the self children of the arc
`self_drawing_elements` | Return the self drawing elements of the single-headed arc
`self_to_shapely` | Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout
`start_point` | Return the starting point of the arc
`to_shapely` | Return a shapely collection of geometries reproducing the drawing elements of the layout element

#### `` anchor_point

    anchor_point(anchor_name: str) -> Point

Return an anchor point of the layout element

Source code in `src/momapy/core.py`

    130
    131
    132
    def anchor_point(self, anchor_name: str) -> momapy.geometry.Point:
        """Return an anchor point of the layout element"""
        return getattr(self, anchor_name)()

#### `` arrowhead_base

    arrowhead_base() -> Point

Return the arrowhead base anchor point of the single-headed arc

Source code in `src/momapy/core.py`

    1058
    1059
    1060
    1061
    1062
    1063
    1064
    1065
    1066
    def arrowhead_base(self) -> momapy.geometry.Point:
        """Return the arrowhead base anchor point of the single-headed arc"""
        arrowhead_length = self.arrowhead_length()
        segment = self.segments[-1]
        segment_length = segment.length()
        if segment_length == 0:
            return self.arrowhead_tip() - (arrowhead_length, 0)
        fraction = 1 - (arrowhead_length + self.end_shorten) / segment_length
        return segment.get_position_at_fraction(fraction)

#### `` arrowhead_bbox

    arrowhead_bbox() -> Bbox

Return the bounding box of the single-headed arc arrowhead

Source code in `src/momapy/core.py`

    1068
    1069
    1070
    1071
    1072
    def arrowhead_bbox(self) -> momapy.geometry.Bbox:
        """Return the bounding box of the single-headed arc arrowhead"""
        return momapy.drawing.get_drawing_elements_bbox(
            self.arrowhead_drawing_elements()
        )

#### `` arrowhead_border

    arrowhead_border(point) -> Point

Return the point at the intersection of the drawing elements of the single-headed arc arrowhead and the line going through the center of these drawing elements and the given point. When there are multiple intersection points, the one closest to the given point is returned

Source code in `src/momapy/core.py`

    1074
    1075
    1076
    1077
    1078
    1079
    1080
    1081
    1082
    1083
    1084
    def arrowhead_border(self, point) -> momapy.geometry.Point:
        """Return the point at the intersection of the drawing elements of the single-headed arc arrowhead and the line going through the center of these drawing elements and the given point.
        When there are multiple intersection points, the one closest to the given point is returned
        """

        point = momapy.drawing.get_drawing_elements_border(
            self.arrowhead_drawing_elements(), point
        )
        if point is None:
            return self.arrowhead_tip()
        return point

#### `` arrowhead_drawing_elements

    arrowhead_drawing_elements() -> list[DrawingElement]

Return the drawing elements of the single-headed arc arrowhead

Source code in `src/momapy/core.py`

    1108
    1109
    1110
    1111
    1112
    1113
    1114
    1115
    1116
    1117
    1118
    1119
    1120
    1121
    1122
    1123
    1124
    1125
    1126
    1127
    def arrowhead_drawing_elements(
        self,
    ) -> list[momapy.drawing.DrawingElement]:
        """Return the drawing elements of the single-headed arc arrowhead"""
        drawing_elements = self._arrowhead_border_drawing_elements()
        group = momapy.drawing.Group(
            class_=f"{type(self).__name__}_arrowhead",
            elements=tuple(drawing_elements),
            fill=self.arrowhead_fill,
            filter=self.arrowhead_filter,
            id_=f"{self.id_}_arrowhead",
            stroke=self.arrowhead_stroke,
            stroke_dasharray=self.arrowhead_stroke_dasharray,
            stroke_dashoffset=self.arrowhead_stroke_dashoffset,
            stroke_width=self.arrowhead_stroke_width,
            transform=self.arrowhead_transform,
        )
        transformation = self._get_arrowhead_transformation()
        group = group.transformed(transformation)
        return [group]

#### `` arrowhead_length

    arrowhead_length() -> float

Return the length of the single-headed arc arrowhead

Source code in `src/momapy/core.py`

    1040
    1041
    1042
    1043
    1044
    1045
    1046
    1047
    def arrowhead_length(self) -> float:
        """Return the length of the single-headed arc arrowhead"""
        bbox = momapy.drawing.get_drawing_elements_bbox(
            self._arrowhead_border_drawing_elements()
        )
        if math.isnan(bbox.width):
            return 0.0
        return bbox.east().x

#### `` arrowhead_tip

    arrowhead_tip() -> Point

Return the arrowhead tip anchor point of the single-headed arc

Source code in `src/momapy/core.py`

    1049
    1050
    1051
    1052
    1053
    1054
    1055
    1056
    def arrowhead_tip(self) -> momapy.geometry.Point:
        """Return the arrowhead tip anchor point of the single-headed arc"""
        segment = self.segments[-1]
        segment_length = segment.length()
        if segment_length == 0:
            return segment.p2
        fraction = 1 - self.end_shorten / segment_length
        return segment.get_position_at_fraction(fraction)

#### `` bbox

    bbox() -> Bbox

Compute and return the bounding box of the group layout element

Source code in `src/momapy/core.py`

    504
    505
    506
    507
    508
    509
    510
    511
    512
    513
    514
    515
    516
    517
    518
    519
    520
    521
    522
    523
    524
    525
    526
    def bbox(self) -> momapy.geometry.Bbox:
        """Compute and return the bounding box of the group layout element"""
        self_bbox = self.self_bbox()
        bboxes = [child.bbox() for child in self.children()]
        min_x = self_bbox.north_west().x
        min_y = self_bbox.north_west().y
        max_x = self_bbox.south_east().x
        max_y = self_bbox.south_east().y
        for bbox in bboxes:
            if bbox.north_west().x < min_x:
                min_x = bbox.north_west().x
            if bbox.north_west().y < min_y:
                min_y = bbox.north_west().y
            if bbox.south_east().x > max_x:
                max_x = bbox.south_east().x
            if bbox.south_east().y > max_y:
                max_y = bbox.south_east().y
        bbox = momapy.geometry.Bbox(
            momapy.geometry.Point(min_x / 2 + max_x / 2, min_y / 2 + max_y / 2),
            max_x - min_x,
            max_y - min_y,
        )
        return bbox

#### `` childless

    childless() -> Self

Return a copy of the arc with no children

Source code in `src/momapy/core.py`

    955
    956
    957
    def childless(self) -> typing.Self:
        """Return a copy of the arc with no children"""
        return dataclasses.replace(self, layout_elements=tuple([]))

#### `` children

    children() -> list[LayoutElement]

Return the children of the group layout. These are the self children of the group layout (returned by the `self_children` method) and the other children of the group layout (given by the `layout_elements` attribute)

Source code in `src/momapy/core.py`

    566
    567
    568
    569
    570
    def children(self) -> list[LayoutElement]:
        """Return the children of the group layout.
        These are the self children of the group layout (returned by the `self_children` method) and the other children of the group layout (given by the `layout_elements` attribute)
        """
        return self.self_children() + list(self.layout_elements)

#### `` contains

    contains(other: LayoutElement) -> bool

Return `true` if another layout element is a descendant of the layout element, `false` otherwise

Source code in `src/momapy/core.py`

    119
    120
    121
    def contains(self, other: "LayoutElement") -> bool:
        """Return `true` if another layout element is a descendant of the layout element, `false` otherwise"""
        return other in self.descendants()

#### `` descendants

    descendants() -> list[LayoutElement]

Return the descendants of the layout element

Source code in `src/momapy/core.py`

    90
    91
    92
    93
    94
    95
    96
    def descendants(self) -> list["LayoutElement"]:
        """Return the descendants of the layout element"""
        descendants = []
        for child in self.children():
            descendants.append(child)
            descendants += child.descendants()
        return descendants

#### `` drawing_elements

    drawing_elements() -> list[DrawingElement]

Return the drawing elements of the group layout. The returned drawing elements are a group drawing element formed of the self drawing elements of the group layout and the drawing elements of its children

Source code in `src/momapy/core.py`

    538
    539
    540
    541
    542
    543
    544
    545
    546
    547
    548
    549
    550
    551
    552
    553
    554
    555
    556
    557
    558
    559
    560
    561
    562
    563
    564
    def drawing_elements(self) -> list[momapy.drawing.DrawingElement]:
        """Return the drawing elements of the group layout.
        The returned drawing elements are a group drawing element formed of the self drawing elements of the group layout and the drawing elements of its children
        """
        drawing_elements = self.self_drawing_elements()
        for child in self.children():
            if child is not None:
                drawing_elements += child.drawing_elements()
        group = momapy.drawing.Group(
            class_=f"{type(self).__name__}_group",
            elements=tuple(drawing_elements),
            id_=f"{self.id_}_group",
            fill=self.group_fill,
            fill_rule=self.group_fill_rule,
            filter=self.group_filter,
            font_family=self.group_font_family,
            font_size=self.group_font_size,
            font_style=self.group_font_style,
            font_weight=self.group_font_weight,
            stroke=self.group_stroke,
            stroke_dasharray=self.group_stroke_dasharray,
            stroke_dashoffset=self.group_stroke_dashoffset,
            stroke_width=self.group_stroke_width,
            text_anchor=self.group_text_anchor,
            transform=self.group_transform,
        )
        return [group]

#### `` end_point

    end_point() -> Point

Return the ending point of the arc

Source code in `src/momapy/core.py`

    951
    952
    953
    def end_point(self) -> momapy.geometry.Point:
        """Return the ending point of the arc"""
        return self.points()[-1]

#### `` equals

    equals(
        other: LayoutElement,
        flattened: bool = False,
        unordered: bool = False,
    ) -> bool

Return `true` if the layout element is equal to another layout element, `false` otherwise

Source code in `src/momapy/core.py`

    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    def equals(
        self, other: "LayoutElement", flattened: bool = False, unordered: bool = False
    ) -> bool:
        """Return `true` if the layout element is equal to another layout element, `false` otherwise"""
        if type(self) is type(other):
            if not flattened:
                return self == other
            else:
                if not unordered:
                    return self.flattened() == other.flattened()
                else:
                    return set(self.flattened()) == set(other.flattened())
        return False

#### `` flattened

    flattened() -> list[LayoutElement]

Return a list containing copy of the layout element with no children and all its descendants with no children

Source code in `src/momapy/core.py`

     98
     99
    100
    101
    102
    103
    def flattened(self) -> list["LayoutElement"]:
        """Return a list containing copy of the layout element with no children and all its descendants with no children"""
        flattened = [self.childless()]
        for child in self.children():
            flattened += child.flattened()
        return flattened

#### `` fraction

    fraction(fraction: float) -> tuple[Point, float]

Return the position and angle on the arc at a given fraction (of the total arc length)

Source code in `src/momapy/core.py`

    959
    960
    961
    962
    963
    964
    965
    966
    967
    968
    def fraction(self, fraction: float) -> tuple[momapy.geometry.Point, float]:
        """Return the position and angle on the arc at a given fraction (of the total arc length)"""
        current_length = 0
        length_to_reach = fraction * self.length()
        for segment in self.segments:
            current_length += segment.length()
            if current_length >= length_to_reach:
                break
        position, angle = segment.get_position_and_angle_at_fraction(fraction)
        return position, angle

#### `` length

    length()

Return the total length of the arc path

Source code in `src/momapy/core.py`

    943
    944
    945
    def length(self):
        """Return the total length of the arc path"""
        return sum([segment.length() for segment in self.segments])

#### `` path_drawing_elements

    path_drawing_elements() -> list[Path]

Return the drawing elements of the single-headed arc path

Source code in `src/momapy/core.py`

    1129
    1130
    1131
    1132
    1133
    1134
    1135
    1136
    1137
    1138
    1139
    1140
    1141
    1142
    1143
    1144
    1145
    1146
    1147
    1148
    1149
    1150
    1151
    1152
    1153
    1154
    1155
    1156
    1157
    1158
    1159
    1160
    1161
    1162
    1163
    1164
    1165
    1166
    1167
    def path_drawing_elements(self) -> list[momapy.drawing.Path]:
        """Return the drawing elements of the single-headed arc path"""
        arrowhead_length = self.arrowhead_length()
        if len(self.segments) == 1:
            segment = (
                self.segments[0]
                .shortened(self.start_shorten, "start")
                .shortened(self.end_shorten + arrowhead_length, "end")
            )
            actions = [
                momapy.drawing.MoveTo(segment.p1),
                self._make_path_action_from_segment(segment),
            ]
        else:
            first_segment = self.segments[0].shortened(self.start_shorten, "start")
            last_segment = self.segments[-1].shortened(
                self.end_shorten + arrowhead_length, "end"
            )
            actions = [
                momapy.drawing.MoveTo(first_segment.p1),
                self._make_path_action_from_segment(first_segment),
            ]
            for segment in self.segments[1:-1]:
                action = self._make_path_action_from_segment(segment)
                actions.append(action)
            actions.append(self._make_path_action_from_segment(last_segment))
        path = momapy.drawing.Path(
            actions=tuple(actions),
            class_=f"{type(self).__name__}_path",
            fill=self.path_fill,
            filter=self.path_filter,
            id_=f"{self.id_}_path",
            stroke=self.path_stroke,
            stroke_dasharray=self.path_stroke_dasharray,
            stroke_dashoffset=self.path_stroke_dashoffset,
            stroke_width=self.path_stroke_width,
            transform=self.path_transform,
        )
        return [path]

#### `` points

    points() -> list[Point]

Return the points of the arc path

Source code in `src/momapy/core.py`

    935
    936
    937
    938
    939
    940
    941
    def points(self) -> list[momapy.geometry.Point]:
        """Return the points of the arc path"""
        points = []
        for segment in self.segments:
            points.append(segment.p1)
        points.append(segment.p2)
        return points

#### `` self_bbox

    self_bbox() -> Bbox

Compute and return the bounding box of the self drawing element of the group layout

Source code in `src/momapy/core.py`

    499
    500
    501
    502
    def self_bbox(self) -> momapy.geometry.Bbox:
        """Compute and return the bounding box of the self drawing element of the group layout"""
        bounds = self.self_to_shapely().bounds
        return momapy.geometry.Bbox.from_bounds(bounds)

#### `` self_children

    self_children() -> list[LayoutElement]

Return the self children of the arc

Source code in `src/momapy/core.py`

    931
    932
    933
    def self_children(self) -> list[LayoutElement]:
        """Return the self children of the arc"""
        return []

#### `` self_drawing_elements

    self_drawing_elements() -> list[DrawingElement]

Return the self drawing elements of the single-headed arc

Source code in `src/momapy/core.py`

    1169
    1170
    1171
    1172
    1173
    1174
    1175
    1176
    1177
    1178
    1179
    1180
    1181
    1182
    1183
    1184
    1185
    1186
    def self_drawing_elements(self) -> list[momapy.drawing.DrawingElement]:
        """Return the self drawing elements of the single-headed arc"""
        drawing_elements = (
            self.path_drawing_elements() + self.arrowhead_drawing_elements()
        )
        group = momapy.drawing.Group(
            class_=type(self).__name__,
            elements=tuple(drawing_elements),
            fill=self.fill,
            filter=self.filter,
            id_=self.id_,
            stroke=self.stroke,
            stroke_dasharray=self.stroke_dasharray,
            stroke_dashoffset=self.stroke_dashoffset,
            stroke_width=self.stroke_width,
            transform=self.transform,
        )
        return [group]

#### `` self_to_shapely

    self_to_shapely() -> GeometryCollection

Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout

Source code in `src/momapy/core.py`

    495
    496
    497
    def self_to_shapely(self) -> shapely.GeometryCollection:
        """Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout"""
        return momapy.drawing.drawing_elements_to_shapely(self.drawing_elements())

#### `` start_point

    start_point() -> Point

Return the starting point of the arc

Source code in `src/momapy/core.py`

    947
    948
    949
    def start_point(self) -> momapy.geometry.Point:
        """Return the starting point of the arc"""
        return self.points()[0]

#### `` to_shapely

    to_shapely(to_polygons: bool = False) -> GeometryCollection

Return a shapely collection of geometries reproducing the drawing elements of the layout element

Source code in `src/momapy/core.py`

    123
    124
    125
    126
    127
    128
    def to_shapely(self, to_polygons: bool = False) -> shapely.GeometryCollection:
        """Return a shapely collection of geometries reproducing the drawing elements of the layout element"""
        geom_collection = []
        for drawing_element in self.drawing_elements():
            geom_collection += drawing_element.to_shapely(to_polygons=to_polygons).geoms
        return shapely.GeometryCollection(geom_collection)

### `` Multimer `dataclass`

    Multimer(
        *,
        id_: str = make_uuid4_as_str(),
        compartment: Compartment | None = None,
        label: str | None = None,
        state_variables: frozenset[StateVariable] = frozenset(),
        units_of_information: frozenset[
            UnitOfInformation
        ] = frozenset(),
        subunits: frozenset[Subunit] = frozenset(),
        cardinality: int | None = None,
    )

Bases: `Complex`

Base class for multimers

Parameters:

Name | Type | Description | Default
--- | --- | --- | ---
`id_` | `str` | The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element | `'3db67a07-93b6-40a5-beaa-bc1a6bdc5b29'`
`compartment` | `Compartment | None` | The compartment of the entity pool | `None`
`label` | `str | None` | The label of the complex | `None`
`state_variables` | `frozenset[StateVariable]` | The state variables of the complex | `<class 'frozenset'>`
`units_of_information` | `frozenset[UnitOfInformation]` | The units of information of the complex | `<class 'frozenset'>`
`subunits` | `frozenset[Subunit]` | The subunits of the complex | `<class 'frozenset'>`
`cardinality` | `int | None` | The cardinality of the multimer | `None`

### `` MultimerSubunit `dataclass`

    MultimerSubunit(
        *,
        id_: str = make_uuid4_as_str(),
        label: str | None = None,
        state_variables: frozenset[StateVariable] = frozenset(),
        units_of_information: frozenset[
            UnitOfInformation
        ] = frozenset(),
        subunits: frozenset[Subunit] = frozenset(),
        cardinality: int | None = None,
    )

Bases: `ComplexSubunit`

Base class for multimer subunits

Parameters:

Name | Type | Description | Default
--- | --- | --- | ---
`id_` | `str` | The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element | `'2f488645-66ac-4caa-9bf6-d131d65a1eb3'`
`label` | `str | None` | The label of the subunit | `None`
`state_variables` | `frozenset[StateVariable]` | The state variables of the complex subunit | `<class 'frozenset'>`
`units_of_information` | `frozenset[UnitOfInformation]` | The units of information of the complex subunit | `<class 'frozenset'>`
`subunits` | `frozenset[Subunit]` | The subunits of the complex subunit | `<class 'frozenset'>`
`cardinality` | `int | None` | The cardinality of the multimer subunit | `None`

### `` NecessaryStimulation `dataclass`

    NecessaryStimulation(
        *,
        id_: str = make_uuid4_as_str(),
        source: EntityPool | LogicalOperator,
        target: Process,
    )

Bases: `Stimulation`

Class for necessary stimulations

Parameters:

Name | Type | Description | Default
--- | --- | --- | ---
`id_` | `str` | The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element | `'ac65dbfc-f720-438d-a463-e879c0d83063'`
`source` | `EntityPool | LogicalOperator` | The source of the modulation | required
`target` | `Process` | The target of the modulation | required

### `` NecessaryStimulationLayout `dataclass`

    NecessaryStimulationLayout(
        path_fill: NoneValueType | Color | None = NoneValue,
        path_stroke: NoneValueType | Color | None = black,
        path_stroke_width: float | None = 1.25,
        arrowhead_fill: NoneValueType | Color | None = white,
        arrowhead_stroke: NoneValueType | Color | None = black,
        arrowhead_stroke_width: float | None = 1.25,
        *,
        id_: str = make_uuid4_as_str(),
        layout_elements: tuple[LayoutElement] = tuple(),
        group_fill: NoneValueType | Color | None = None,
        group_fill_rule: FillRule | None = None,
        group_filter: NoneValueType | Filter | None = None,
        group_font_family: str | None = None,
        group_font_size: float | None = None,
        group_font_style: FontStyle | None = None,
        group_font_weight: FontWeight | float | None = None,
        group_stroke: NoneValueType | Color | None = None,
        group_stroke_dasharray: tuple[float, ...] | None = None,
        group_stroke_dashoffset: float | None = None,
        group_stroke_width: float | None = None,
        group_text_anchor: TextAnchor | None = None,
        group_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        end_shorten: float = 0.0,
        fill: NoneValueType | Color | None = None,
        filter: NoneValueType | Filter | None = None,
        path_filter: NoneValueType | Filter | None = None,
        path_stroke_dasharray: tuple[float, ...] | None = None,
        path_stroke_dashoffset: float | None = None,
        path_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        stroke: NoneValueType | Color | None = None,
        stroke_dasharray: NoneValueType
        | tuple[float]
        | None = None,
        stroke_dashoffset: float | None = None,
        stroke_width: float | None = None,
        segments: tuple[
            Segment | BezierCurve | EllipticalArc
        ] = tuple(),
        source: LayoutElement | None = None,
        start_shorten: float = 0.0,
        target: LayoutElement | None = None,
        transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        arrowhead_filter: NoneValueType | Filter | None = None,
        arrowhead_stroke_dasharray: tuple[float, ...]
        | None = None,
        arrowhead_stroke_dashoffset: float | None = None,
        arrowhead_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        arrowhead_bar_height: float = 12.0,
        arrowhead_sep: float = 3.0,
        arrowhead_triangle_height: float = 10.0,
        arrowhead_triangle_width: float = 10.0,
    )

Bases: `SBGNSingleHeadedArc`

Class for necessary stimulation layouts

Parameters:

Name | Type | Description | Default
--- | --- | --- | ---
`id_` | `str` | The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element | `'f61f88f4-af61-4f52-a33b-9c4e489d8dce'`
`layout_elements` | `tuple[LayoutElement]` | The sub-layout elements of the group layout. These are part of the children of the group layout | `<dynamic>`
`group_fill` | `NoneValueType | Color | None` | The fill color of the group layout | `None`
`group_fill_rule` | `FillRule | None` | The fill rule of the group layout | `None`
`group_filter` | `NoneValueType | Filter | None` | The filter of the group layout | `None`
`group_font_family` | `str | None` | The font family of the group layout | `None`
`group_font_size` | `float | None` | The font size of the group layout | `None`
`group_font_style` | `FontStyle | None` | The font style of the group layout | `None`
`group_font_weight` | `FontWeight | float | None` | The font weight of the group layout | `None`
`group_stroke` | `NoneValueType | Color | None` | The stroke color of the group layout | `None`
`group_stroke_dasharray` | `tuple[float, ...] | None` | The stroke dasharray of the group layout | `None`
`group_stroke_dashoffset` | `float | None` | The stroke dashoffset of the group layout | `None`
`group_stroke_width` | `float | None` | The stroke width of the group layout | `None`
`group_text_anchor` | `TextAnchor | None` | The text anchor of the group layout | `None`
`group_transform` | `NoneValueType | tuple[Transformation] | None` | The transform of the group layout | `None`
`end_shorten` | `float` | The length the end of the arc will be shorten by | `0.0`
`fill` | `NoneValueType | Color | None` | The fill color of the arc | `None`
`filter` | `NoneValueType | Filter | None` | The fill filter of the arc | `None`
`path_fill` | `NoneValueType | Color | None` |  | `<momapy.drawing.NoneValueType object at 0x7fb32ae9f1d0>`
`path_filter` | `NoneValueType | Filter | None` | The path filter of the arc | `None`
`path_stroke` | `NoneValueType | Color | None` |  | `Color(red=0, green=0, blue=0, alpha=1.0)`
`path_stroke_dasharray` | `tuple[float, ...] | None` | The path stroke dasharray of the arc | `None`
`path_stroke_dashoffset` | `float | None` | The path stroke dashoffset of the arc | `None`
`path_stroke_width` | `float | None` |  | `1.25`
`path_transform` | `NoneValueType | tuple[Transformation] | None` | The path transform of the arc | `None`
`stroke` | `NoneValueType | Color | None` | The stroke color of the arc | `None`
`stroke_dasharray` | `NoneValueType | tuple[float] | None` | The stroke dasharray of the arc | `None`
`stroke_dashoffset` | `float | None` | The stroke dashoffset of the arc | `None`
`stroke_width` | `float | None` | The stroke width of the arc | `None`
`segments` | `tuple[Union[Segment, BezierCurve, EllipticalArc]]` | The path segments of the arc | `<dynamic>`
`source` | `LayoutElement | None` | The source of the arc | `None`
`start_shorten` | `float` | The length the start of the arc will be shorten by | `0.0`
`target` | `LayoutElement | None` | The target of the arc | `None`
`transform` | `NoneValueType | tuple[Transformation] | None` | The transform of the arc | `None`
`arrowhead_fill` | `NoneValueType | Color | None` |  | `Color(red=255, green=255, blue=255, alpha=1.0)`
`arrowhead_filter` | `NoneValueType | Filter | None` | The arrowhead filter of the arc | `None`
`arrowhead_stroke` | `NoneValueType | Color | None` |  | `Color(red=0, green=0, blue=0, alpha=1.0)`
`arrowhead_stroke_dasharray` | `tuple[float, ...] | None` | The arrowhead stroke dasharray of the arc | `None`
`arrowhead_stroke_dashoffset` | `float | None` | The arrowhead stroke dashoffset of the arc | `None`
`arrowhead_stroke_width` | `float | None` |  | `1.25`
`arrowhead_transform` | `NoneValueType | tuple[Transformation] | None` | The arrowhead transform of the arc | `None`
`arrowhead_bar_height` | `float` |  | `12.0`
`arrowhead_sep` | `float` |  | `3.0`
`arrowhead_triangle_height` | `float` |  | `10.0`
`arrowhead_triangle_width` | `float` |  | `10.0`

Methods:

Name | Description
--- | ---
`anchor_point` | Return an anchor point of the layout element
`arrowhead_base` | Return the arrowhead base anchor point of the single-headed arc
`arrowhead_bbox` | Return the bounding box of the single-headed arc arrowhead
`arrowhead_border` | Return the point at the intersection of the drawing elements of the single-headed arc arrowhead and the line going through the center of these drawing elements and the given point.
`arrowhead_drawing_elements` | Return the drawing elements of the single-headed arc arrowhead
`arrowhead_length` | Return the length of the single-headed arc arrowhead
`arrowhead_tip` | Return the arrowhead tip anchor point of the single-headed arc
`bbox` | Compute and return the bounding box of the group layout element
`childless` | Return a copy of the arc with no children
`children` | Return the children of the group layout.
`contains` | Return `true` if another layout element is a descendant of the layout element, `false` otherwise
`descendants` | Return the descendants of the layout element
`drawing_elements` | Return the drawing elements of the group layout.
`end_point` | Return the ending point of the arc
`equals` | Return `true` if the layout element is equal to another layout element, `false` otherwise
`flattened` | Return a list containing copy of the layout element with no children and all its descendants with no children
`fraction` | Return the position and angle on the arc at a given fraction (of the total arc length)
`length` | Return the total length of the arc path
`path_drawing_elements` | Return the drawing elements of the single-headed arc path
`points` | Return the points of the arc path
`self_bbox` | Compute and return the bounding box of the self drawing element of the group layout
`self_children` | Return the self children of the arc
`self_drawing_elements` | Return the self drawing elements of the single-headed arc
`self_to_shapely` | Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout
`start_point` | Return the starting point of the arc
`to_shapely` | Return a shapely collection of geometries reproducing the drawing elements of the layout element

#### `` anchor_point

    anchor_point(anchor_name: str) -> Point

Return an anchor point of the layout element

Source code in `src/momapy/core.py`

    130
    131
    132
    def anchor_point(self, anchor_name: str) -> momapy.geometry.Point:
        """Return an anchor point of the layout element"""
        return getattr(self, anchor_name)()

#### `` arrowhead_base

    arrowhead_base() -> Point

Return the arrowhead base anchor point of the single-headed arc

Source code in `src/momapy/core.py`

    1058
    1059
    1060
    1061
    1062
    1063
    1064
    1065
    1066
    def arrowhead_base(self) -> momapy.geometry.Point:
        """Return the arrowhead base anchor point of the single-headed arc"""
        arrowhead_length = self.arrowhead_length()
        segment = self.segments[-1]
        segment_length = segment.length()
        if segment_length == 0:
            return self.arrowhead_tip() - (arrowhead_length, 0)
        fraction = 1 - (arrowhead_length + self.end_shorten) / segment_length
        return segment.get_position_at_fraction(fraction)

#### `` arrowhead_bbox

    arrowhead_bbox() -> Bbox

Return the bounding box of the single-headed arc arrowhead

Source code in `src/momapy/core.py`

    1068
    1069
    1070
    1071
    1072
    def arrowhead_bbox(self) -> momapy.geometry.Bbox:
        """Return the bounding box of the single-headed arc arrowhead"""
        return momapy.drawing.get_drawing_elements_bbox(
            self.arrowhead_drawing_elements()
        )

#### `` arrowhead_border

    arrowhead_border(point) -> Point

Return the point at the intersection of the drawing elements of the single-headed arc arrowhead and the line going through the center of these drawing elements and the given point. When there are multiple intersection points, the one closest to the given point is returned

Source code in `src/momapy/core.py`

    1074
    1075
    1076
    1077
    1078
    1079
    1080
    1081
    1082
    1083
    1084
    def arrowhead_border(self, point) -> momapy.geometry.Point:
        """Return the point at the intersection of the drawing elements of the single-headed arc arrowhead and the line going through the center of these drawing elements and the given point.
        When there are multiple intersection points, the one closest to the given point is returned
        """

        point = momapy.drawing.get_drawing_elements_border(
            self.arrowhead_drawing_elements(), point
        )
        if point is None:
            return self.arrowhead_tip()
        return point

#### `` arrowhead_drawing_elements

    arrowhead_drawing_elements() -> list[DrawingElement]

Return the drawing elements of the single-headed arc arrowhead

Source code in `src/momapy/core.py`

    1108
    1109
    1110
    1111
    1112
    1113
    1114
    1115
    1116
    1117
    1118
    1119
    1120
    1121
    1122
    1123
    1124
    1125
    1126
    1127
    def arrowhead_drawing_elements(
        self,
    ) -> list[momapy.drawing.DrawingElement]:
        """Return the drawing elements of the single-headed arc arrowhead"""
        drawing_elements = self._arrowhead_border_drawing_elements()
        group = momapy.drawing.Group(
            class_=f"{type(self).__name__}_arrowhead",
            elements=tuple(drawing_elements),
            fill=self.arrowhead_fill,
            filter=self.arrowhead_filter,
            id_=f"{self.id_}_arrowhead",
            stroke=self.arrowhead_stroke,
            stroke_dasharray=self.arrowhead_stroke_dasharray,
            stroke_dashoffset=self.arrowhead_stroke_dashoffset,
            stroke_width=self.arrowhead_stroke_width,
            transform=self.arrowhead_transform,
        )
        transformation = self._get_arrowhead_transformation()
        group = group.transformed(transformation)
        return [group]

#### `` arrowhead_length

    arrowhead_length() -> float

Return the length of the single-headed arc arrowhead

Source code in `src/momapy/core.py`

    1040
    1041
    1042
    1043
    1044
    1045
    1046
    1047
    def arrowhead_length(self) -> float:
        """Return the length of the single-headed arc arrowhead"""
        bbox = momapy.drawing.get_drawing_elements_bbox(
            self._arrowhead_border_drawing_elements()
        )
        if math.isnan(bbox.width):
            return 0.0
        return bbox.east().x

#### `` arrowhead_tip

    arrowhead_tip() -> Point

Return the arrowhead tip anchor point of the single-headed arc

Source code in `src/momapy/core.py`

    1049
    1050
    1051
    1052
    1053
    1054
    1055
    1056
    def arrowhead_tip(self) -> momapy.geometry.Point:
        """Return the arrowhead tip anchor point of the single-headed arc"""
        segment = self.segments[-1]
        segment_length = segment.length()
        if segment_length == 0:
            return segment.p2
        fraction = 1 - self.end_shorten / segment_length
        return segment.get_position_at_fraction(fraction)

#### `` bbox

    bbox() -> Bbox

Compute and return the bounding box of the group layout element

Source code in `src/momapy/core.py`

    504
    505
    506
    507
    508
    509
    510
    511
    512
    513
    514
    515
    516
    517
    518
    519
    520
    521
    522
    523
    524
    525
    526
    def bbox(self) -> momapy.geometry.Bbox:
        """Compute and return the bounding box of the group layout element"""
        self_bbox = self.self_bbox()
        bboxes = [child.bbox() for child in self.children()]
        min_x = self_bbox.north_west().x
        min_y = self_bbox.north_west().y
        max_x = self_bbox.south_east().x
        max_y = self_bbox.south_east().y
        for bbox in bboxes:
            if bbox.north_west().x < min_x:
                min_x = bbox.north_west().x
            if bbox.north_west().y < min_y:
                min_y = bbox.north_west().y
            if bbox.south_east().x > max_x:
                max_x = bbox.south_east().x
            if bbox.south_east().y > max_y:
                max_y = bbox.south_east().y
        bbox = momapy.geometry.Bbox(
            momapy.geometry.Point(min_x / 2 + max_x / 2, min_y / 2 + max_y / 2),
            max_x - min_x,
            max_y - min_y,
        )
        return bbox

#### `` childless

    childless() -> Self

Return a copy of the arc with no children

Source code in `src/momapy/core.py`

    955
    956
    957
    def childless(self) -> typing.Self:
        """Return a copy of the arc with no children"""
        return dataclasses.replace(self, layout_elements=tuple([]))

#### `` children

    children() -> list[LayoutElement]

Return the children of the group layout. These are the self children of the group layout (returned by the `self_children` method) and the other children of the group layout (given by the `layout_elements` attribute)

Source code in `src/momapy/core.py`

    566
    567
    568
    569
    570
    def children(self) -> list[LayoutElement]:
        """Return the children of the group layout.
        These are the self children of the group layout (returned by the `self_children` method) and the other children of the group layout (given by the `layout_elements` attribute)
        """
        return self.self_children() + list(self.layout_elements)

#### `` contains

    contains(other: LayoutElement) -> bool

Return `true` if another layout element is a descendant of the layout element, `false` otherwise

Source code in `src/momapy/core.py`

    119
    120
    121
    def contains(self, other: "LayoutElement") -> bool:
        """Return `true` if another layout element is a descendant of the layout element, `false` otherwise"""
        return other in self.descendants()

#### `` descendants

    descendants() -> list[LayoutElement]

Return the descendants of the layout element

Source code in `src/momapy/core.py`

    90
    91
    92
    93
    94
    95
    96
    def descendants(self) -> list["LayoutElement"]:
        """Return the descendants of the layout element"""
        descendants = []
        for child in self.children():
            descendants.append(child)
            descendants += child.descendants()
        return descendants

#### `` drawing_elements

    drawing_elements() -> list[DrawingElement]

Return the drawing elements of the group layout. The returned drawing elements are a group drawing element formed of the self drawing elements of the group layout and the drawing elements of its children

Source code in `src/momapy/core.py`

    538
    539
    540
    541
    542
    543
    544
    545
    546
    547
    548
    549
    550
    551
    552
    553
    554
    555
    556
    557
    558
    559
    560
    561
    562
    563
    564
    def drawing_elements(self) -> list[momapy.drawing.DrawingElement]:
        """Return the drawing elements of the group layout.
        The returned drawing elements are a group drawing element formed of the self drawing elements of the group layout and the drawing elements of its children
        """
        drawing_elements = self.self_drawing_elements()
        for child in self.children():
            if child is not None:
                drawing_elements += child.drawing_elements()
        group = momapy.drawing.Group(
            class_=f"{type(self).__name__}_group",
            elements=tuple(drawing_elements),
            id_=f"{self.id_}_group",
            fill=self.group_fill,
            fill_rule=self.group_fill_rule,
            filter=self.group_filter,
            font_family=self.group_font_family,
            font_size=self.group_font_size,
            font_style=self.group_font_style,
            font_weight=self.group_font_weight,
            stroke=self.group_stroke,
            stroke_dasharray=self.group_stroke_dasharray,
            stroke_dashoffset=self.group_stroke_dashoffset,
            stroke_width=self.group_stroke_width,
            text_anchor=self.group_text_anchor,
            transform=self.group_transform,
        )
        return [group]

#### `` end_point

    end_point() -> Point

Return the ending point of the arc

Source code in `src/momapy/core.py`

    951
    952
    953
    def end_point(self) -> momapy.geometry.Point:
        """Return the ending point of the arc"""
        return self.points()[-1]

#### `` equals

    equals(
        other: LayoutElement,
        flattened: bool = False,
        unordered: bool = False,
    ) -> bool

Return `true` if the layout element is equal to another layout element, `false` otherwise

Source code in `src/momapy/core.py`

    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    def equals(
        self, other: "LayoutElement", flattened: bool = False, unordered: bool = False
    ) -> bool:
        """Return `true` if the layout element is equal to another layout element, `false` otherwise"""
        if type(self) is type(other):
            if not flattened:
                return self == other
            else:
                if not unordered:
                    return self.flattened() == other.flattened()
                else:
                    return set(self.flattened()) == set(other.flattened())
        return False

#### `` flattened

    flattened() -> list[LayoutElement]

Return a list containing copy of the layout element with no children and all its descendants with no children

Source code in `src/momapy/core.py`

     98
     99
    100
    101
    102
    103
    def flattened(self) -> list["LayoutElement"]:
        """Return a list containing copy of the layout element with no children and all its descendants with no children"""
        flattened = [self.childless()]
        for child in self.children():
            flattened += child.flattened()
        return flattened

#### `` fraction

    fraction(fraction: float) -> tuple[Point, float]

Return the position and angle on the arc at a given fraction (of the total arc length)

Source code in `src/momapy/core.py`

    959
    960
    961
    962
    963
    964
    965
    966
    967
    968
    def fraction(self, fraction: float) -> tuple[momapy.geometry.Point, float]:
        """Return the position and angle on the arc at a given fraction (of the total arc length)"""
        current_length = 0
        length_to_reach = fraction * self.length()
        for segment in self.segments:
            current_length += segment.length()
            if current_length >= length_to_reach:
                break
        position, angle = segment.get_position_and_angle_at_fraction(fraction)
        return position, angle

#### `` length

    length()

Return the total length of the arc path

Source code in `src/momapy/core.py`

    943
    944
    945
    def length(self):
        """Return the total length of the arc path"""
        return sum([segment.length() for segment in self.segments])

#### `` path_drawing_elements

    path_drawing_elements() -> list[Path]

Return the drawing elements of the single-headed arc path

Source code in `src/momapy/core.py`

    1129
    1130
    1131
    1132
    1133
    1134
    1135
    1136
    1137
    1138
    1139
    1140
    1141
    1142
    1143
    1144
    1145
    1146
    1147
    1148
    1149
    1150
    1151
    1152
    1153
    1154
    1155
    1156
    1157
    1158
    1159
    1160
    1161
    1162
    1163
    1164
    1165
    1166
    1167
    def path_drawing_elements(self) -> list[momapy.drawing.Path]:
        """Return the drawing elements of the single-headed arc path"""
        arrowhead_length = self.arrowhead_length()
        if len(self.segments) == 1:
            segment = (
                self.segments[0]
                .shortened(self.start_shorten, "start")
                .shortened(self.end_shorten + arrowhead_length, "end")
            )
            actions = [
                momapy.drawing.MoveTo(segment.p1),
                self._make_path_action_from_segment(segment),
            ]
        else:
            first_segment = self.segments[0].shortened(self.start_shorten, "start")
            last_segment = self.segments[-1].shortened(
                self.end_shorten + arrowhead_length, "end"
            )
            actions = [
                momapy.drawing.MoveTo(first_segment.p1),
                self._make_path_action_from_segment(first_segment),
            ]
            for segment in self.segments[1:-1]:
                action = self._make_path_action_from_segment(segment)
                actions.append(action)
            actions.append(self._make_path_action_from_segment(last_segment))
        path = momapy.drawing.Path(
            actions=tuple(actions),
            class_=f"{type(self).__name__}_path",
            fill=self.path_fill,
            filter=self.path_filter,
            id_=f"{self.id_}_path",
            stroke=self.path_stroke,
            stroke_dasharray=self.path_stroke_dasharray,
            stroke_dashoffset=self.path_stroke_dashoffset,
            stroke_width=self.path_stroke_width,
            transform=self.path_transform,
        )
        return [path]

#### `` points

    points() -> list[Point]

Return the points of the arc path

Source code in `src/momapy/core.py`

    935
    936
    937
    938
    939
    940
    941
    def points(self) -> list[momapy.geometry.Point]:
        """Return the points of the arc path"""
        points = []
        for segment in self.segments:
            points.append(segment.p1)
        points.append(segment.p2)
        return points

#### `` self_bbox

    self_bbox() -> Bbox

Compute and return the bounding box of the self drawing element of the group layout

Source code in `src/momapy/core.py`

    499
    500
    501
    502
    def self_bbox(self) -> momapy.geometry.Bbox:
        """Compute and return the bounding box of the self drawing element of the group layout"""
        bounds = self.self_to_shapely().bounds
        return momapy.geometry.Bbox.from_bounds(bounds)

#### `` self_children

    self_children() -> list[LayoutElement]

Return the self children of the arc

Source code in `src/momapy/core.py`

    931
    932
    933
    def self_children(self) -> list[LayoutElement]:
        """Return the self children of the arc"""
        return []

#### `` self_drawing_elements

    self_drawing_elements() -> list[DrawingElement]

Return the self drawing elements of the single-headed arc

Source code in `src/momapy/core.py`

    1169
    1170
    1171
    1172
    1173
    1174
    1175
    1176
    1177
    1178
    1179
    1180
    1181
    1182
    1183
    1184
    1185
    1186
    def self_drawing_elements(self) -> list[momapy.drawing.DrawingElement]:
        """Return the self drawing elements of the single-headed arc"""
        drawing_elements = (
            self.path_drawing_elements() + self.arrowhead_drawing_elements()
        )
        group = momapy.drawing.Group(
            class_=type(self).__name__,
            elements=tuple(drawing_elements),
            fill=self.fill,
            filter=self.filter,
            id_=self.id_,
            stroke=self.stroke,
            stroke_dasharray=self.stroke_dasharray,
            stroke_dashoffset=self.stroke_dashoffset,
            stroke_width=self.stroke_width,
            transform=self.transform,
        )
        return [group]

#### `` self_to_shapely

    self_to_shapely() -> GeometryCollection

Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout

Source code in `src/momapy/core.py`

    495
    496
    497
    def self_to_shapely(self) -> shapely.GeometryCollection:
        """Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout"""
        return momapy.drawing.drawing_elements_to_shapely(self.drawing_elements())

#### `` start_point

    start_point() -> Point

Return the starting point of the arc

Source code in `src/momapy/core.py`

    947
    948
    949
    def start_point(self) -> momapy.geometry.Point:
        """Return the starting point of the arc"""
        return self.points()[0]

#### `` to_shapely

    to_shapely(to_polygons: bool = False) -> GeometryCollection

Return a shapely collection of geometries reproducing the drawing elements of the layout element

Source code in `src/momapy/core.py`

    123
    124
    125
    126
    127
    128
    def to_shapely(self, to_polygons: bool = False) -> shapely.GeometryCollection:
        """Return a shapely collection of geometries reproducing the drawing elements of the layout element"""
        geom_collection = []
        for drawing_element in self.drawing_elements():
            geom_collection += drawing_element.to_shapely(to_polygons=to_polygons).geoms
        return shapely.GeometryCollection(geom_collection)

### `` NotOperator `dataclass`

    NotOperator(
        *,
        id_: str = make_uuid4_as_str(),
        inputs: frozenset[LogicalOperatorInput] = frozenset(),
    )

Bases: `LogicalOperator`

Class for not operators

Parameters:

Name | Type | Description | Default
--- | --- | --- | ---
`id_` | `str` | The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element | `'1c171be7-47fa-4362-b635-6f13bc118240'`
`inputs` | `frozenset[LogicalOperatorInput]` | The inputs of the logical operator | `<class 'frozenset'>`

### `` NotOperatorLayout `dataclass`

    NotOperatorLayout(
        fill: NoneValueType | Color | None = white,
        stroke: NoneValueType | Color | None = black,
        stroke_width: float | None = 1.25,
        *,
        id_: str = make_uuid4_as_str(),
        layout_elements: tuple[LayoutElement] = tuple(),
        group_fill: NoneValueType | Color | None = None,
        group_fill_rule: FillRule | None = None,
        group_filter: NoneValueType | Filter | None = None,
        group_font_family: str | None = None,
        group_font_size: float | None = None,
        group_font_style: FontStyle | None = None,
        group_font_weight: FontWeight | float | None = None,
        group_stroke: NoneValueType | Color | None = None,
        group_stroke_dasharray: tuple[float, ...] | None = None,
        group_stroke_dashoffset: float | None = None,
        group_stroke_width: float | None = None,
        group_text_anchor: TextAnchor | None = None,
        group_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        filter: NoneValueType | Filter | None = None,
        height: float = 30.0,
        label: TextLayout | None = None,
        position: Point,
        stroke_dasharray: tuple[float, ...] | None = None,
        stroke_dashoffset: float | None = None,
        transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        width: float = 30.0,
        direction: Direction = HORIZONTAL,
        left_to_right: bool = True,
        left_connector_length: float = 10.0,
        right_connector_length: float = 10.0,
        left_connector_stroke: NoneValueType
        | Color
        | None = None,
        left_connector_stroke_width: float | None = None,
        left_connector_stroke_dasharray: NoneValueType
        | tuple[float]
        | None = None,
        left_connector_stroke_dashoffset: float | None = None,
        left_connector_fill: NoneValueType
        | Color
        | None = None,
        left_connector_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        left_connector_filter: NoneValueType
        | Filter
        | None = None,
        right_connector_stroke: NoneValueType
        | Color
        | None = None,
        right_connector_stroke_width: float | None = None,
        right_connector_stroke_dasharray: NoneValueType
        | tuple[float]
        | None = None,
        right_connector_stroke_dashoffset: float | None = None,
        right_connector_fill: NoneValueType
        | Color
        | None = None,
        right_connector_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        right_connector_filter: NoneValueType
        | Filter
        | None = None,
    )

Bases: `_ConnectorsMixin`, `_SimpleMixin`, `_TextMixin`, `SBGNNode`

Class for not operator layouts

Parameters:

Name | Type | Description | Default
--- | --- | --- | ---
`id_` | `str` | The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element | `'6f7beaab-87ce-42a6-8f8b-3648c51035bb'`
`layout_elements` | `tuple[LayoutElement]` | The sub-layout elements of the group layout. These are part of the children of the group layout | `<dynamic>`
`group_fill` | `NoneValueType | Color | None` | The fill color of the group layout | `None`
`group_fill_rule` | `FillRule | None` | The fill rule of the group layout | `None`
`group_filter` | `NoneValueType | Filter | None` | The filter of the group layout | `None`
`group_font_family` | `str | None` | The font family of the group layout | `None`
`group_font_size` | `float | None` | The font size of the group layout | `None`
`group_font_style` | `FontStyle | None` | The font style of the group layout | `None`
`group_font_weight` | `FontWeight | float | None` | The font weight of the group layout | `None`
`group_stroke` | `NoneValueType | Color | None` | The stroke color of the group layout | `None`
`group_stroke_dasharray` | `tuple[float, ...] | None` | The stroke dasharray of the group layout | `None`
`group_stroke_dashoffset` | `float | None` | The stroke dashoffset of the group layout | `None`
`group_stroke_width` | `float | None` | The stroke width of the group layout | `None`
`group_text_anchor` | `TextAnchor | None` | The text anchor of the group layout | `None`
`group_transform` | `NoneValueType | tuple[Transformation] | None` | The transform of the group layout | `None`
`fill` | `NoneValueType | Color | None` |  | `Color(red=255, green=255, blue=255, alpha=1.0)`
`filter` | `NoneValueType | Filter | None` | The filter of the node | `None`
`height` | `float` |  | `30.0`
`label` | `TextLayout | None` | The label of the node | `None`
`position` | `Point` | The position of the node | required
`stroke` | `NoneValueType | Color | None` |  | `Color(red=0, green=0, blue=0, alpha=1.0)`
`stroke_dasharray` | `tuple[float, ...] | None` | The stroke dasharray of the node | `None`
`stroke_dashoffset` | `float | None` | The stroke dashoffset of the node | `None`
`stroke_width` | `float | None` |  | `1.25`
`transform` | `NoneValueType | tuple[Transformation] | None` | The transform of the node | `None`
`width` | `float` |  | `30.0`
`direction` | `Direction` |  | `<Direction.HORIZONTAL: 1>`
`left_to_right` | `bool` |  | `True`
`left_connector_length` | `float` |  | `10.0`
`right_connector_length` | `float` |  | `10.0`
`left_connector_stroke` | `NoneValueType | Color | None` |  | `None`
`left_connector_stroke_width` | `float | None` |  | `None`
`left_connector_stroke_dasharray` | `NoneValueType | tuple[float] | None` |  | `None`
`left_connector_stroke_dashoffset` | `float | None` |  | `None`
`left_connector_fill` | `NoneValueType | Color | None` |  | `None`
`left_connector_transform` | `NoneValueType | tuple[Transformation] | None` |  | `None`
`left_connector_filter` | `NoneValueType | Filter | None` |  | `None`
`right_connector_stroke` | `NoneValueType | Color | None` |  | `None`
`right_connector_stroke_width` | `float | None` |  | `None`
`right_connector_stroke_dasharray` | `NoneValueType | tuple[float] | None` |  | `None`
`right_connector_stroke_dashoffset` | `float | None` |  | `None`
`right_connector_fill` | `NoneValueType | Color | None` |  | `None`
`right_connector_transform` | `NoneValueType | tuple[Transformation] | None` |  | `None`
`right_connector_filter` | `NoneValueType | Filter | None` |  | `None`

Methods:

Name | Description
--- | ---
`anchor_point` | Return an anchor point of the layout element
`angle` | Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.
`bbox` | Compute and return the bounding box of the group layout element
`border` | Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point.
`center` | Return the center anchor of the node
`childless` | Return a copy of the node with no children
`children` | Return the children of the group layout.
`contains` | Return `true` if another layout element is a descendant of the layout element, `false` otherwise
`descendants` | Return the descendants of the layout element
`drawing_elements` | Return the drawing elements of the group layout.
`east_north_east` | Return the east north east anchor of the node
`east_south_east` | Return the east south east west anchor of the node
`equals` | Return `true` if the layout element is equal to another layout element, `false` otherwise
`flattened` | Return a list containing copy of the layout element with no children and all its descendants with no children
`label_center` | Return the label center anchor of the node
`north_east` | Return the north east anchor of the node
`north_north_east` | Return the north north east anchor of the node
`north_north_west` | Return the north north west anchor of the node
`north_west` | Return the north west anchor of the node
`self_angle` | Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.
`self_bbox` | Compute and return the bounding box of the self drawing element of the group layout
`self_border` | Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point.
`self_children` | Return the self children of the node. A node has unique child that is its label
`self_drawing_elements` | Return the node's own drawing elements
`self_to_shapely` | Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout
`size` | Return the size of the node
`south_east` | Return the south east anchor of the node
`south_south_east` | Return the south south east anchor of the node
`south_south_west` | Return the south south west anchor of the node
`south_west` | Return the south west anchor of the node
`to_shapely` | Return a shapely collection of geometries reproducing the drawing elements of the layout element
`west_north_west` | Return the west north west anchor of the node
`west_south_west` | Return the west south west anchor of the node

Attributes:

Name | Type | Description
--- | --- | ---
`x` | `float` | Return the x coordinate of the node
`y` | `float` | Return the y coordinate of the node

#### `` anchor_point

    anchor_point(anchor_name: str) -> Point

Return an anchor point of the layout element

Source code in `src/momapy/core.py`

    130
    131
    132
    def anchor_point(self, anchor_name: str) -> momapy.geometry.Point:
        """Return an anchor point of the layout element"""
        return getattr(self, anchor_name)()

#### `` angle

    angle(
        angle: float,
        unit: Literal["degrees", "radians"] = "degrees",
    ) -> Point

Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.

Source code in `src/momapy/core.py`

    817
    818
    819
    820
    821
    822
    823
    824
    825
    826
    827
    828
    def angle(
        self,
        angle: float,
        unit: typing.Literal["degrees", "radians"] = "degrees",
    ) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal."""
        return momapy.drawing.get_drawing_elements_angle(
            drawing_elements=self.drawing_elements(),
            angle=angle,
            unit=unit,
            center=self.center(),
        )

#### `` bbox

    bbox() -> Bbox

Compute and return the bounding box of the group layout element

Source code in `src/momapy/core.py`

    504
    505
    506
    507
    508
    509
    510
    511
    512
    513
    514
    515
    516
    517
    518
    519
    520
    521
    522
    523
    524
    525
    526
    def bbox(self) -> momapy.geometry.Bbox:
        """Compute and return the bounding box of the group layout element"""
        self_bbox = self.self_bbox()
        bboxes = [child.bbox() for child in self.children()]
        min_x = self_bbox.north_west().x
        min_y = self_bbox.north_west().y
        max_x = self_bbox.south_east().x
        max_y = self_bbox.south_east().y
        for bbox in bboxes:
            if bbox.north_west().x < min_x:
                min_x = bbox.north_west().x
            if bbox.north_west().y < min_y:
                min_y = bbox.north_west().y
            if bbox.south_east().x > max_x:
                max_x = bbox.south_east().x
            if bbox.south_east().y > max_y:
                max_y = bbox.south_east().y
        bbox = momapy.geometry.Bbox(
            momapy.geometry.Point(min_x / 2 + max_x / 2, min_y / 2 + max_y / 2),
            max_x - min_x,
            max_y - min_y,
        )
        return bbox

#### `` border

    border(point: Point) -> Point

Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point. When there are multiple intersection points, the one closest to the given point is returned

Source code in `src/momapy/core.py`

    794
    795
    796
    797
    798
    799
    800
    801
    802
    def border(self, point: momapy.geometry.Point) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point.
        When there are multiple intersection points, the one closest to the given point is returned
        """
        return momapy.drawing.get_drawing_elements_border(
            drawing_elements=self.drawing_elements(),
            point=point,
            center=self.center(),
        )

#### `` center

    center() -> Point

Return the center anchor of the node

Source code in `src/momapy/core.py`

    776
    777
    778
    def center(self) -> momapy.geometry.Point:
        """Return the center anchor of the node"""
        return self.position

#### `` childless

    childless() -> Self

Return a copy of the node with no children

Source code in `src/momapy/core.py`

    830
    831
    832
    def childless(self) -> typing.Self:
        """Return a copy of the node with no children"""
        return dataclasses.replace(self, label=None, layout_elements=tuple([]))

#### `` children

    children() -> list[LayoutElement]

Return the children of the group layout. These are the self children of the group layout (returned by the `self_children` method) and the other children of the group layout (given by the `layout_elements` attribute)

Source code in `src/momapy/core.py`

    566
    567
    568
    569
    570
    def children(self) -> list[LayoutElement]:
        """Return the children of the group layout.
        These are the self children of the group layout (returned by the `self_children` method) and the other children of the group layout (given by the `layout_elements` attribute)
        """
        return self.self_children() + list(self.layout_elements)

#### `` contains

    contains(other: LayoutElement) -> bool

Return `true` if another layout element is a descendant of the layout element, `false` otherwise

Source code in `src/momapy/core.py`

    119
    120
    121
    def contains(self, other: "LayoutElement") -> bool:
        """Return `true` if another layout element is a descendant of the layout element, `false` otherwise"""
        return other in self.descendants()

#### `` descendants

    descendants() -> list[LayoutElement]

Return the descendants of the layout element

Source code in `src/momapy/core.py`

    90
    91
    92
    93
    94
    95
    96
    def descendants(self) -> list["LayoutElement"]:
        """Return the descendants of the layout element"""
        descendants = []
        for child in self.children():
            descendants.append(child)
            descendants += child.descendants()
        return descendants

#### `` drawing_elements

    drawing_elements() -> list[DrawingElement]

Return the drawing elements of the group layout. The returned drawing elements are a group drawing element formed of the self drawing elements of the group layout and the drawing elements of its children

Source code in `src/momapy/core.py`

    538
    539
    540
    541
    542
    543
    544
    545
    546
    547
    548
    549
    550
    551
    552
    553
    554
    555
    556
    557
    558
    559
    560
    561
    562
    563
    564
    def drawing_elements(self) -> list[momapy.drawing.DrawingElement]:
        """Return the drawing elements of the group layout.
        The returned drawing elements are a group drawing element formed of the self drawing elements of the group layout and the drawing elements of its children
        """
        drawing_elements = self.self_drawing_elements()
        for child in self.children():
            if child is not None:
                drawing_elements += child.drawing_elements()
        group = momapy.drawing.Group(
            class_=f"{type(self).__name__}_group",
            elements=tuple(drawing_elements),
            id_=f"{self.id_}_group",
            fill=self.group_fill,
            fill_rule=self.group_fill_rule,
            filter=self.group_filter,
            font_family=self.group_font_family,
            font_size=self.group_font_size,
            font_style=self.group_font_style,
            font_weight=self.group_font_weight,
            stroke=self.group_stroke,
            stroke_dasharray=self.group_stroke_dasharray,
            stroke_dashoffset=self.group_stroke_dashoffset,
            stroke_width=self.group_stroke_width,
            text_anchor=self.group_text_anchor,
            transform=self.group_transform,
        )
        return [group]

#### `` east_north_east

    east_north_east() -> Point

Return the east north east anchor of the node

Source code in `src/momapy/core.py`

    700
    701
    702
    703
    704
    705
    706
    def east_north_east(self) -> momapy.geometry.Point:
        """Return the east north east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, -self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` east_south_east

    east_south_east() -> Point

Return the east south east west anchor of the node

Source code in `src/momapy/core.py`

    712
    713
    714
    715
    716
    717
    718
    def east_south_east(self) -> momapy.geometry.Point:
        """Return the east south east west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` equals

    equals(
        other: LayoutElement,
        flattened: bool = False,
        unordered: bool = False,
    ) -> bool

Return `true` if the layout element is equal to another layout element, `false` otherwise

Source code in `src/momapy/core.py`

    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    def equals(
        self, other: "LayoutElement", flattened: bool = False, unordered: bool = False
    ) -> bool:
        """Return `true` if the layout element is equal to another layout element, `false` otherwise"""
        if type(self) is type(other):
            if not flattened:
                return self == other
            else:
                if not unordered:
                    return self.flattened() == other.flattened()
                else:
                    return set(self.flattened()) == set(other.flattened())
        return False

#### `` flattened

    flattened() -> list[LayoutElement]

Return a list containing copy of the layout element with no children and all its descendants with no children

Source code in `src/momapy/core.py`

     98
     99
    100
    101
    102
    103
    def flattened(self) -> list["LayoutElement"]:
        """Return a list containing copy of the layout element with no children and all its descendants with no children"""
        flattened = [self.childless()]
        for child in self.children():
            flattened += child.flattened()
        return flattened

#### `` label_center

    label_center() -> Point

Return the label center anchor of the node

Source code in `src/momapy/core.py`

    780
    781
    782
    def label_center(self) -> momapy.geometry.Point:
        """Return the label center anchor of the node"""
        return self.position

#### `` north_east

    north_east() -> Point

Return the north east anchor of the node

Source code in `src/momapy/core.py`

    692
    693
    694
    695
    696
    697
    698
    def north_east(self) -> momapy.geometry.Point:
        """Return the north east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, -self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` north_north_east

    north_north_east() -> Point

Return the north north east anchor of the node

Source code in `src/momapy/core.py`

    684
    685
    686
    687
    688
    689
    690
    def north_north_east(self) -> momapy.geometry.Point:
        """Return the north north east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 4, -self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` north_north_west

    north_north_west() -> Point

Return the north north west anchor of the node

Source code in `src/momapy/core.py`

    672
    673
    674
    675
    676
    677
    678
    def north_north_west(self) -> momapy.geometry.Point:
        """Return the north north west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() - (self.width / 4, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` north_west

    north_west() -> Point

Return the north west anchor of the node

Source code in `src/momapy/core.py`

    664
    665
    666
    667
    668
    669
    670
    def north_west(self) -> momapy.geometry.Point:
        """Return the north west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() - (self.width / 2, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` self_angle

    self_angle(
        angle: float,
        unit: Literal["degrees", "radians"] = "degrees",
    ) -> Point

Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.

Source code in `src/momapy/core.py`

    804
    805
    806
    807
    808
    809
    810
    811
    812
    813
    814
    815
    def self_angle(
        self,
        angle: float,
        unit: typing.Literal["degrees", "radians"] = "degrees",
    ) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal."""
        return momapy.drawing.get_drawing_elements_angle(
            drawing_elements=self.self_drawing_elements(),
            angle=angle,
            unit=unit,
            center=self.center(),
        )

#### `` self_bbox

    self_bbox() -> Bbox

Compute and return the bounding box of the self drawing element of the group layout

Source code in `src/momapy/core.py`

    499
    500
    501
    502
    def self_bbox(self) -> momapy.geometry.Bbox:
        """Compute and return the bounding box of the self drawing element of the group layout"""
        bounds = self.self_to_shapely().bounds
        return momapy.geometry.Bbox.from_bounds(bounds)

#### `` self_border

    self_border(point: Point) -> Point

Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point. When there are multiple intersection points, the one closest to the given point is returned

Source code in `src/momapy/core.py`

    784
    785
    786
    787
    788
    789
    790
    791
    792
    def self_border(self, point: momapy.geometry.Point) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point.
        When there are multiple intersection points, the one closest to the given point is returned
        """
        return momapy.drawing.get_drawing_elements_border(
            drawing_elements=self.self_drawing_elements(),
            point=point,
            center=self.center(),
        )

#### `` self_children

    self_children() -> list[LayoutElement]

Return the self children of the node. A node has unique child that is its label

Source code in `src/momapy/core.py`

    654
    655
    656
    657
    658
    def self_children(self) -> list[LayoutElement]:
        """Return the self children of the node. A node has unique child that is its label"""
        if self.label is not None:
            return [self.label]
        return []

#### `` self_drawing_elements

    self_drawing_elements() -> list[DrawingElement]

Return the node's own drawing elements

Source code in `src/momapy/core.py`

    637
    638
    639
    640
    641
    642
    643
    644
    645
    646
    647
    648
    649
    650
    651
    652
    def self_drawing_elements(self) -> list[momapy.drawing.DrawingElement]:
        """Return the node's own drawing elements"""
        drawing_elements = self._border_drawing_elements()
        group = momapy.drawing.Group(
            class_=type(self).__name__,
            elements=tuple(drawing_elements),
            fill=self.fill,
            filter=self.filter,
            id_=self.id_,
            stroke=self.stroke,
            stroke_dasharray=self.stroke_dasharray,
            stroke_dashoffset=self.stroke_dashoffset,
            stroke_width=self.stroke_width,
            transform=self.transform,
        )
        return [group]

#### `` self_to_shapely

    self_to_shapely() -> GeometryCollection

Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout

Source code in `src/momapy/core.py`

    495
    496
    497
    def self_to_shapely(self) -> shapely.GeometryCollection:
        """Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout"""
        return momapy.drawing.drawing_elements_to_shapely(self.drawing_elements())

#### `` size

    size() -> tuple[float, float]

Return the size of the node

Source code in `src/momapy/core.py`

    660
    661
    662
    def size(self) -> tuple[float, float]:
        """Return the size of the node"""
        return (self.width, self.height)

#### `` south_east

    south_east() -> Point

Return the south east anchor of the node

Source code in `src/momapy/core.py`

    720
    721
    722
    723
    724
    725
    726
    def south_east(self) -> momapy.geometry.Point:
        """Return the south east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` south_south_east

    south_south_east() -> Point

Return the south south east anchor of the node

Source code in `src/momapy/core.py`

    728
    729
    730
    731
    732
    733
    734
    def south_south_east(self) -> momapy.geometry.Point:
        """Return the south south east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 4, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` south_south_west

    south_south_west() -> Point

Return the south south west anchor of the node

Source code in `src/momapy/core.py`

    740
    741
    742
    743
    744
    745
    746
    def south_south_west(self) -> momapy.geometry.Point:
        """Return the south south west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (-self.width / 4, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` south_west

    south_west() -> Point

Return the south west anchor of the node

Source code in `src/momapy/core.py`

    748
    749
    750
    751
    752
    753
    754
    def south_west(self) -> momapy.geometry.Point:
        """Return the south west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (-self.width / 2, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` to_shapely

    to_shapely(to_polygons: bool = False) -> GeometryCollection

Return a shapely collection of geometries reproducing the drawing elements of the layout element

Source code in `src/momapy/core.py`

    123
    124
    125
    126
    127
    128
    def to_shapely(self, to_polygons: bool = False) -> shapely.GeometryCollection:
        """Return a shapely collection of geometries reproducing the drawing elements of the layout element"""
        geom_collection = []
        for drawing_element in self.drawing_elements():
            geom_collection += drawing_element.to_shapely(to_polygons=to_polygons).geoms
        return shapely.GeometryCollection(geom_collection)

#### `` west_north_west

    west_north_west() -> Point

Return the west north west anchor of the node

Source code in `src/momapy/core.py`

    768
    769
    770
    771
    772
    773
    774
    def west_north_west(self) -> momapy.geometry.Point:
        """Return the west north west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() - (self.width / 2, self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` west_south_west

    west_south_west() -> Point

Return the west south west anchor of the node

Source code in `src/momapy/core.py`

    756
    757
    758
    759
    760
    761
    762
    def west_south_west(self) -> momapy.geometry.Point:
        """Return the west south west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (-self.width / 2, self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` x `property`

    x: float

Return the x coordinate of the node

#### `` y `property`

    y: float

Return the y coordinate of the node

### `` NucleicAcidFeature `dataclass`

    NucleicAcidFeature(
        *,
        id_: str = make_uuid4_as_str(),
        compartment: Compartment | None = None,
        label: str | None = None,
        state_variables: frozenset[StateVariable] = frozenset(),
        units_of_information: frozenset[
            UnitOfInformation
        ] = frozenset(),
    )

Bases: `EntityPool`

Class for nucleic acid features

Parameters:

Name | Type | Description | Default
--- | --- | --- | ---
`id_` | `str` | The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element | `'2ea54ac4-bdec-45c5-a258-c165c152778d'`
`compartment` | `Compartment | None` | The compartment of the entity pool | `None`
`label` | `str | None` | The label of the nucleic acid feature | `None`
`state_variables` | `frozenset[StateVariable]` | The state variables of the nucleic acid feature | `<class 'frozenset'>`
`units_of_information` | `frozenset[UnitOfInformation]` | The units of information of the nucleic acid feature | `<class 'frozenset'>`

### `` NucleicAcidFeatureLayout `dataclass`

    NucleicAcidFeatureLayout(
        fill: NoneValueType | Color | None = white,
        stroke: NoneValueType | Color | None = black,
        stroke_width: float | None = 1.25,
        *,
        id_: str = make_uuid4_as_str(),
        layout_elements: tuple[LayoutElement] = tuple(),
        group_fill: NoneValueType | Color | None = None,
        group_fill_rule: FillRule | None = None,
        group_filter: NoneValueType | Filter | None = None,
        group_font_family: str | None = None,
        group_font_size: float | None = None,
        group_font_style: FontStyle | None = None,
        group_font_weight: FontWeight | float | None = None,
        group_stroke: NoneValueType | Color | None = None,
        group_stroke_dasharray: tuple[float, ...] | None = None,
        group_stroke_dashoffset: float | None = None,
        group_stroke_width: float | None = None,
        group_text_anchor: TextAnchor | None = None,
        group_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        filter: NoneValueType | Filter | None = None,
        height: float = 30.0,
        label: TextLayout | None = None,
        position: Point,
        stroke_dasharray: tuple[float, ...] | None = None,
        stroke_dashoffset: float | None = None,
        transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        width: float = 60.0,
        rounded_corners: float = 5.0,
    )

Bases: `_SimpleMixin`, `SBGNNode`

Class for nucleic acid feature layouts

Parameters:

Name | Type | Description | Default
--- | --- | --- | ---
`id_` | `str` | The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element | `'642985c2-0564-4545-9b73-a65f772998ae'`
`layout_elements` | `tuple[LayoutElement]` | The sub-layout elements of the group layout. These are part of the children of the group layout | `<dynamic>`
`group_fill` | `NoneValueType | Color | None` | The fill color of the group layout | `None`
`group_fill_rule` | `FillRule | None` | The fill rule of the group layout | `None`
`group_filter` | `NoneValueType | Filter | None` | The filter of the group layout | `None`
`group_font_family` | `str | None` | The font family of the group layout | `None`
`group_font_size` | `float | None` | The font size of the group layout | `None`
`group_font_style` | `FontStyle | None` | The font style of the group layout | `None`
`group_font_weight` | `FontWeight | float | None` | The font weight of the group layout | `None`
`group_stroke` | `NoneValueType | Color | None` | The stroke color of the group layout | `None`
`group_stroke_dasharray` | `tuple[float, ...] | None` | The stroke dasharray of the group layout | `None`
`group_stroke_dashoffset` | `float | None` | The stroke dashoffset of the group layout | `None`
`group_stroke_width` | `float | None` | The stroke width of the group layout | `None`
`group_text_anchor` | `TextAnchor | None` | The text anchor of the group layout | `None`
`group_transform` | `NoneValueType | tuple[Transformation] | None` | The transform of the group layout | `None`
`fill` | `NoneValueType | Color | None` |  | `Color(red=255, green=255, blue=255, alpha=1.0)`
`filter` | `NoneValueType | Filter | None` | The filter of the node | `None`
`height` | `float` |  | `30.0`
`label` | `TextLayout | None` | The label of the node | `None`
`position` | `Point` | The position of the node | required
`stroke` | `NoneValueType | Color | None` |  | `Color(red=0, green=0, blue=0, alpha=1.0)`
`stroke_dasharray` | `tuple[float, ...] | None` | The stroke dasharray of the node | `None`
`stroke_dashoffset` | `float | None` | The stroke dashoffset of the node | `None`
`stroke_width` | `float | None` |  | `1.25`
`transform` | `NoneValueType | tuple[Transformation] | None` | The transform of the node | `None`
`width` | `float` |  | `60.0`
`rounded_corners` | `float` |  | `5.0`

Methods:

Name | Description
--- | ---
`anchor_point` | Return an anchor point of the layout element
`angle` | Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.
`bbox` | Compute and return the bounding box of the group layout element
`border` | Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point.
`center` | Return the center anchor of the node
`childless` | Return a copy of the node with no children
`children` | Return the children of the group layout.
`contains` | Return `true` if another layout element is a descendant of the layout element, `false` otherwise
`descendants` | Return the descendants of the layout element
`drawing_elements` | Return the drawing elements of the group layout.
`east` | Return the east anchor of the node
`east_north_east` | Return the east north east anchor of the node
`east_south_east` | Return the east south east west anchor of the node
`equals` | Return `true` if the layout element is equal to another layout element, `false` otherwise
`flattened` | Return a list containing copy of the layout element with no children and all its descendants with no children
`label_center` | Return the label center anchor of the node
`north` | Return the north anchor of the node
`north_east` | Return the north east anchor of the node
`north_north_east` | Return the north north east anchor of the node
`north_north_west` | Return the north north west anchor of the node
`north_west` | Return the north west anchor of the node
`self_angle` | Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.
`self_bbox` | Compute and return the bounding box of the self drawing element of the group layout
`self_border` | Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point.
`self_children` | Return the self children of the node. A node has unique child that is its label
`self_drawing_elements` | Return the node's own drawing elements
`self_to_shapely` | Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout
`size` | Return the size of the node
`south` | Return the south anchor of the node
`south_east` | Return the south east anchor of the node
`south_south_east` | Return the south south east anchor of the node
`south_south_west` | Return the south south west anchor of the node
`south_west` | Return the south west anchor of the node
`to_shapely` | Return a shapely collection of geometries reproducing the drawing elements of the layout element
`west` | Return the west anchor of the node
`west_north_west` | Return the west north west anchor of the node
`west_south_west` | Return the west south west anchor of the node

Attributes:

Name | Type | Description
--- | --- | ---
`x` | `float` | Return the x coordinate of the node
`y` | `float` | Return the y coordinate of the node

#### `` anchor_point

    anchor_point(anchor_name: str) -> Point

Return an anchor point of the layout element

Source code in `src/momapy/core.py`

    130
    131
    132
    def anchor_point(self, anchor_name: str) -> momapy.geometry.Point:
        """Return an anchor point of the layout element"""
        return getattr(self, anchor_name)()

#### `` angle

    angle(
        angle: float,
        unit: Literal["degrees", "radians"] = "degrees",
    ) -> Point

Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.

Source code in `src/momapy/core.py`

    817
    818
    819
    820
    821
    822
    823
    824
    825
    826
    827
    828
    def angle(
        self,
        angle: float,
        unit: typing.Literal["degrees", "radians"] = "degrees",
    ) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal."""
        return momapy.drawing.get_drawing_elements_angle(
            drawing_elements=self.drawing_elements(),
            angle=angle,
            unit=unit,
            center=self.center(),
        )

#### `` bbox

    bbox() -> Bbox

Compute and return the bounding box of the group layout element

Source code in `src/momapy/core.py`

    504
    505
    506
    507
    508
    509
    510
    511
    512
    513
    514
    515
    516
    517
    518
    519
    520
    521
    522
    523
    524
    525
    526
    def bbox(self) -> momapy.geometry.Bbox:
        """Compute and return the bounding box of the group layout element"""
        self_bbox = self.self_bbox()
        bboxes = [child.bbox() for child in self.children()]
        min_x = self_bbox.north_west().x
        min_y = self_bbox.north_west().y
        max_x = self_bbox.south_east().x
        max_y = self_bbox.south_east().y
        for bbox in bboxes:
            if bbox.north_west().x < min_x:
                min_x = bbox.north_west().x
            if bbox.north_west().y < min_y:
                min_y = bbox.north_west().y
            if bbox.south_east().x > max_x:
                max_x = bbox.south_east().x
            if bbox.south_east().y > max_y:
                max_y = bbox.south_east().y
        bbox = momapy.geometry.Bbox(
            momapy.geometry.Point(min_x / 2 + max_x / 2, min_y / 2 + max_y / 2),
            max_x - min_x,
            max_y - min_y,
        )
        return bbox

#### `` border

    border(point: Point) -> Point

Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point. When there are multiple intersection points, the one closest to the given point is returned

Source code in `src/momapy/core.py`

    794
    795
    796
    797
    798
    799
    800
    801
    802
    def border(self, point: momapy.geometry.Point) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point.
        When there are multiple intersection points, the one closest to the given point is returned
        """
        return momapy.drawing.get_drawing_elements_border(
            drawing_elements=self.drawing_elements(),
            point=point,
            center=self.center(),
        )

#### `` center

    center() -> Point

Return the center anchor of the node

Source code in `src/momapy/core.py`

    776
    777
    778
    def center(self) -> momapy.geometry.Point:
        """Return the center anchor of the node"""
        return self.position

#### `` childless

    childless() -> Self

Return a copy of the node with no children

Source code in `src/momapy/core.py`

    830
    831
    832
    def childless(self) -> typing.Self:
        """Return a copy of the node with no children"""
        return dataclasses.replace(self, label=None, layout_elements=tuple([]))

#### `` children

    children() -> list[LayoutElement]

Return the children of the group layout. These are the self children of the group layout (returned by the `self_children` method) and the other children of the group layout (given by the `layout_elements` attribute)

Source code in `src/momapy/core.py`

    566
    567
    568
    569
    570
    def children(self) -> list[LayoutElement]:
        """Return the children of the group layout.
        These are the self children of the group layout (returned by the `self_children` method) and the other children of the group layout (given by the `layout_elements` attribute)
        """
        return self.self_children() + list(self.layout_elements)

#### `` contains

    contains(other: LayoutElement) -> bool

Return `true` if another layout element is a descendant of the layout element, `false` otherwise

Source code in `src/momapy/core.py`

    119
    120
    121
    def contains(self, other: "LayoutElement") -> bool:
        """Return `true` if another layout element is a descendant of the layout element, `false` otherwise"""
        return other in self.descendants()

#### `` descendants

    descendants() -> list[LayoutElement]

Return the descendants of the layout element

Source code in `src/momapy/core.py`

    90
    91
    92
    93
    94
    95
    96
    def descendants(self) -> list["LayoutElement"]:
        """Return the descendants of the layout element"""
        descendants = []
        for child in self.children():
            descendants.append(child)
            descendants += child.descendants()
        return descendants

#### `` drawing_elements

    drawing_elements() -> list[DrawingElement]

Return the drawing elements of the group layout. The returned drawing elements are a group drawing element formed of the self drawing elements of the group layout and the drawing elements of its children

Source code in `src/momapy/core.py`

    538
    539
    540
    541
    542
    543
    544
    545
    546
    547
    548
    549
    550
    551
    552
    553
    554
    555
    556
    557
    558
    559
    560
    561
    562
    563
    564
    def drawing_elements(self) -> list[momapy.drawing.DrawingElement]:
        """Return the drawing elements of the group layout.
        The returned drawing elements are a group drawing element formed of the self drawing elements of the group layout and the drawing elements of its children
        """
        drawing_elements = self.self_drawing_elements()
        for child in self.children():
            if child is not None:
                drawing_elements += child.drawing_elements()
        group = momapy.drawing.Group(
            class_=f"{type(self).__name__}_group",
            elements=tuple(drawing_elements),
            id_=f"{self.id_}_group",
            fill=self.group_fill,
            fill_rule=self.group_fill_rule,
            filter=self.group_filter,
            font_family=self.group_font_family,
            font_size=self.group_font_size,
            font_style=self.group_font_style,
            font_weight=self.group_font_weight,
            stroke=self.group_stroke,
            stroke_dasharray=self.group_stroke_dasharray,
            stroke_dashoffset=self.group_stroke_dashoffset,
            stroke_width=self.group_stroke_width,
            text_anchor=self.group_text_anchor,
            transform=self.group_transform,
        )
        return [group]

#### `` east

    east() -> Point

Return the east anchor of the node

Source code in `src/momapy/core.py`

    708
    709
    710
    def east(self) -> momapy.geometry.Point:
        """Return the east anchor of the node"""
        return self.self_angle(0)

#### `` east_north_east

    east_north_east() -> Point

Return the east north east anchor of the node

Source code in `src/momapy/core.py`

    700
    701
    702
    703
    704
    705
    706
    def east_north_east(self) -> momapy.geometry.Point:
        """Return the east north east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, -self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` east_south_east

    east_south_east() -> Point

Return the east south east west anchor of the node

Source code in `src/momapy/core.py`

    712
    713
    714
    715
    716
    717
    718
    def east_south_east(self) -> momapy.geometry.Point:
        """Return the east south east west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` equals

    equals(
        other: LayoutElement,
        flattened: bool = False,
        unordered: bool = False,
    ) -> bool

Return `true` if the layout element is equal to another layout element, `false` otherwise

Source code in `src/momapy/core.py`

    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    def equals(
        self, other: "LayoutElement", flattened: bool = False, unordered: bool = False
    ) -> bool:
        """Return `true` if the layout element is equal to another layout element, `false` otherwise"""
        if type(self) is type(other):
            if not flattened:
                return self == other
            else:
                if not unordered:
                    return self.flattened() == other.flattened()
                else:
                    return set(self.flattened()) == set(other.flattened())
        return False

#### `` flattened

    flattened() -> list[LayoutElement]

Return a list containing copy of the layout element with no children and all its descendants with no children

Source code in `src/momapy/core.py`

     98
     99
    100
    101
    102
    103
    def flattened(self) -> list["LayoutElement"]:
        """Return a list containing copy of the layout element with no children and all its descendants with no children"""
        flattened = [self.childless()]
        for child in self.children():
            flattened += child.flattened()
        return flattened

#### `` label_center

    label_center() -> Point

Return the label center anchor of the node

Source code in `src/momapy/core.py`

    780
    781
    782
    def label_center(self) -> momapy.geometry.Point:
        """Return the label center anchor of the node"""
        return self.position

#### `` north

    north() -> Point

Return the north anchor of the node

Source code in `src/momapy/core.py`

    680
    681
    682
    def north(self) -> momapy.geometry.Point:
        """Return the north anchor of the node"""
        return self.self_angle(90)

#### `` north_east

    north_east() -> Point

Return the north east anchor of the node

Source code in `src/momapy/core.py`

    692
    693
    694
    695
    696
    697
    698
    def north_east(self) -> momapy.geometry.Point:
        """Return the north east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, -self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` north_north_east

    north_north_east() -> Point

Return the north north east anchor of the node

Source code in `src/momapy/core.py`

    684
    685
    686
    687
    688
    689
    690
    def north_north_east(self) -> momapy.geometry.Point:
        """Return the north north east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 4, -self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` north_north_west

    north_north_west() -> Point

Return the north north west anchor of the node

Source code in `src/momapy/core.py`

    672
    673
    674
    675
    676
    677
    678
    def north_north_west(self) -> momapy.geometry.Point:
        """Return the north north west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() - (self.width / 4, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` north_west

    north_west() -> Point

Return the north west anchor of the node

Source code in `src/momapy/core.py`

    664
    665
    666
    667
    668
    669
    670
    def north_west(self) -> momapy.geometry.Point:
        """Return the north west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() - (self.width / 2, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` self_angle

    self_angle(
        angle: float,
        unit: Literal["degrees", "radians"] = "degrees",
    ) -> Point

Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.

Source code in `src/momapy/core.py`

    804
    805
    806
    807
    808
    809
    810
    811
    812
    813
    814
    815
    def self_angle(
        self,
        angle: float,
        unit: typing.Literal["degrees", "radians"] = "degrees",
    ) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal."""
        return momapy.drawing.get_drawing_elements_angle(
            drawing_elements=self.self_drawing_elements(),
            angle=angle,
            unit=unit,
            center=self.center(),
        )

#### `` self_bbox

    self_bbox() -> Bbox

Compute and return the bounding box of the self drawing element of the group layout

Source code in `src/momapy/core.py`

    499
    500
    501
    502
    def self_bbox(self) -> momapy.geometry.Bbox:
        """Compute and return the bounding box of the self drawing element of the group layout"""
        bounds = self.self_to_shapely().bounds
        return momapy.geometry.Bbox.from_bounds(bounds)

#### `` self_border

    self_border(point: Point) -> Point

Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point. When there are multiple intersection points, the one closest to the given point is returned

Source code in `src/momapy/core.py`

    784
    785
    786
    787
    788
    789
    790
    791
    792
    def self_border(self, point: momapy.geometry.Point) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point.
        When there are multiple intersection points, the one closest to the given point is returned
        """
        return momapy.drawing.get_drawing_elements_border(
            drawing_elements=self.self_drawing_elements(),
            point=point,
            center=self.center(),
        )

#### `` self_children

    self_children() -> list[LayoutElement]

Return the self children of the node. A node has unique child that is its label

Source code in `src/momapy/core.py`

    654
    655
    656
    657
    658
    def self_children(self) -> list[LayoutElement]:
        """Return the self children of the node. A node has unique child that is its label"""
        if self.label is not None:
            return [self.label]
        return []

#### `` self_drawing_elements

    self_drawing_elements() -> list[DrawingElement]

Return the node's own drawing elements

Source code in `src/momapy/core.py`

    637
    638
    639
    640
    641
    642
    643
    644
    645
    646
    647
    648
    649
    650
    651
    652
    def self_drawing_elements(self) -> list[momapy.drawing.DrawingElement]:
        """Return the node's own drawing elements"""
        drawing_elements = self._border_drawing_elements()
        group = momapy.drawing.Group(
            class_=type(self).__name__,
            elements=tuple(drawing_elements),
            fill=self.fill,
            filter=self.filter,
            id_=self.id_,
            stroke=self.stroke,
            stroke_dasharray=self.stroke_dasharray,
            stroke_dashoffset=self.stroke_dashoffset,
            stroke_width=self.stroke_width,
            transform=self.transform,
        )
        return [group]

#### `` self_to_shapely

    self_to_shapely() -> GeometryCollection

Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout

Source code in `src/momapy/core.py`

    495
    496
    497
    def self_to_shapely(self) -> shapely.GeometryCollection:
        """Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout"""
        return momapy.drawing.drawing_elements_to_shapely(self.drawing_elements())

#### `` size

    size() -> tuple[float, float]

Return the size of the node

Source code in `src/momapy/core.py`

    660
    661
    662
    def size(self) -> tuple[float, float]:
        """Return the size of the node"""
        return (self.width, self.height)

#### `` south

    south() -> Point

Return the south anchor of the node

Source code in `src/momapy/core.py`

    736
    737
    738
    def south(self) -> momapy.geometry.Point:
        """Return the south anchor of the node"""
        return self.self_angle(270)

#### `` south_east

    south_east() -> Point

Return the south east anchor of the node

Source code in `src/momapy/core.py`

    720
    721
    722
    723
    724
    725
    726
    def south_east(self) -> momapy.geometry.Point:
        """Return the south east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` south_south_east

    south_south_east() -> Point

Return the south south east anchor of the node

Source code in `src/momapy/core.py`

    728
    729
    730
    731
    732
    733
    734
    def south_south_east(self) -> momapy.geometry.Point:
        """Return the south south east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 4, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` south_south_west

    south_south_west() -> Point

Return the south south west anchor of the node

Source code in `src/momapy/core.py`

    740
    741
    742
    743
    744
    745
    746
    def south_south_west(self) -> momapy.geometry.Point:
        """Return the south south west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (-self.width / 4, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` south_west

    south_west() -> Point

Return the south west anchor of the node

Source code in `src/momapy/core.py`

    748
    749
    750
    751
    752
    753
    754
    def south_west(self) -> momapy.geometry.Point:
        """Return the south west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (-self.width / 2, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` to_shapely

    to_shapely(to_polygons: bool = False) -> GeometryCollection

Return a shapely collection of geometries reproducing the drawing elements of the layout element

Source code in `src/momapy/core.py`

    123
    124
    125
    126
    127
    128
    def to_shapely(self, to_polygons: bool = False) -> shapely.GeometryCollection:
        """Return a shapely collection of geometries reproducing the drawing elements of the layout element"""
        geom_collection = []
        for drawing_element in self.drawing_elements():
            geom_collection += drawing_element.to_shapely(to_polygons=to_polygons).geoms
        return shapely.GeometryCollection(geom_collection)

#### `` west

    west() -> Point

Return the west anchor of the node

Source code in `src/momapy/core.py`

    764
    765
    766
    def west(self) -> momapy.geometry.Point:
        """Return the west anchor of the node"""
        return self.self_angle(180)

#### `` west_north_west

    west_north_west() -> Point

Return the west north west anchor of the node

Source code in `src/momapy/core.py`

    768
    769
    770
    771
    772
    773
    774
    def west_north_west(self) -> momapy.geometry.Point:
        """Return the west north west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() - (self.width / 2, self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` west_south_west

    west_south_west() -> Point

Return the west south west anchor of the node

Source code in `src/momapy/core.py`

    756
    757
    758
    759
    760
    761
    762
    def west_south_west(self) -> momapy.geometry.Point:
        """Return the west south west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (-self.width / 2, self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` x `property`

    x: float

Return the x coordinate of the node

#### `` y `property`

    y: float

Return the y coordinate of the node

### `` NucleicAcidFeatureMultimer `dataclass`

    NucleicAcidFeatureMultimer(
        *,
        id_: str = make_uuid4_as_str(),
        compartment: Compartment | None = None,
        label: str | None = None,
        state_variables: frozenset[StateVariable] = frozenset(),
        units_of_information: frozenset[
            UnitOfInformation
        ] = frozenset(),
        subunits: frozenset[Subunit] = frozenset(),
        cardinality: int | None = None,
    )

Bases: `Multimer`

Class for nucleic acid feature multimers

Parameters:

Name | Type | Description | Default
--- | --- | --- | ---
`id_` | `str` | The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element | `'95964f2a-c591-4565-b71f-44e7508c37d8'`
`compartment` | `Compartment | None` | The compartment of the entity pool | `None`
`label` | `str | None` | The label of the complex | `None`
`state_variables` | `frozenset[StateVariable]` | The state variables of the complex | `<class 'frozenset'>`
`units_of_information` | `frozenset[UnitOfInformation]` | The units of information of the complex | `<class 'frozenset'>`
`subunits` | `frozenset[Subunit]` | The subunits of the complex | `<class 'frozenset'>`
`cardinality` | `int | None` | The cardinality of the multimer | `None`

### `` NucleicAcidFeatureMultimerLayout `dataclass`

    NucleicAcidFeatureMultimerLayout(
        fill: NoneValueType | Color | None = white,
        stroke: NoneValueType | Color | None = black,
        stroke_width: float | None = 1.25,
        offset: float = 3.0,
        subunits_stroke: tuple[NoneValueType | Color]
        | None = None,
        subunits_stroke_width: tuple[NoneValueType | float]
        | None = None,
        subunits_stroke_dasharray: tuple[
            NoneValueType | tuple[float]
        ]
        | None = None,
        subunits_stroke_dashoffset: tuple[float] | None = None,
        subunits_fill: tuple[NoneValueType | Color]
        | None = None,
        subunits_transform: tuple[
            NoneValueType | tuple[Transformation]
        ]
        | None = None,
        subunits_filter: tuple[NoneValueType | Filter]
        | None = None,
        *,
        id_: str = make_uuid4_as_str(),
        layout_elements: tuple[LayoutElement] = tuple(),
        group_fill: NoneValueType | Color | None = None,
        group_fill_rule: FillRule | None = None,
        group_filter: NoneValueType | Filter | None = None,
        group_font_family: str | None = None,
        group_font_size: float | None = None,
        group_font_style: FontStyle | None = None,
        group_font_weight: FontWeight | float | None = None,
        group_stroke: NoneValueType | Color | None = None,
        group_stroke_dasharray: tuple[float, ...] | None = None,
        group_stroke_dashoffset: float | None = None,
        group_stroke_width: float | None = None,
        group_text_anchor: TextAnchor | None = None,
        group_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        filter: NoneValueType | Filter | None = None,
        height: float = 30.0,
        label: TextLayout | None = None,
        position: Point,
        stroke_dasharray: tuple[float, ...] | None = None,
        stroke_dashoffset: float | None = None,
        transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        width: float = 60.0,
        rounded_corners: float = 5.0,
    )

Bases: `_MultiMixin`, `SBGNNode`

Class for nucleic acid feature multimer layouts

Parameters:

Name | Type | Description | Default
--- | --- | --- | ---
`id_` | `str` | The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element | `'4b25cf10-e4ae-4bfb-bf59-0a6654e19062'`
`layout_elements` | `tuple[LayoutElement]` | The sub-layout elements of the group layout. These are part of the children of the group layout | `<dynamic>`
`group_fill` | `NoneValueType | Color | None` | The fill color of the group layout | `None`
`group_fill_rule` | `FillRule | None` | The fill rule of the group layout | `None`
`group_filter` | `NoneValueType | Filter | None` | The filter of the group layout | `None`
`group_font_family` | `str | None` | The font family of the group layout | `None`
`group_font_size` | `float | None` | The font size of the group layout | `None`
`group_font_style` | `FontStyle | None` | The font style of the group layout | `None`
`group_font_weight` | `FontWeight | float | None` | The font weight of the group layout | `None`
`group_stroke` | `NoneValueType | Color | None` | The stroke color of the group layout | `None`
`group_stroke_dasharray` | `tuple[float, ...] | None` | The stroke dasharray of the group layout | `None`
`group_stroke_dashoffset` | `float | None` | The stroke dashoffset of the group layout | `None`
`group_stroke_width` | `float | None` | The stroke width of the group layout | `None`
`group_text_anchor` | `TextAnchor | None` | The text anchor of the group layout | `None`
`group_transform` | `NoneValueType | tuple[Transformation] | None` | The transform of the group layout | `None`
`fill` | `NoneValueType | Color | None` |  | `Color(red=255, green=255, blue=255, alpha=1.0)`
`filter` | `NoneValueType | Filter | None` | The filter of the node | `None`
`height` | `float` |  | `30.0`
`label` | `TextLayout | None` | The label of the node | `None`
`position` | `Point` | The position of the node | required
`stroke` | `NoneValueType | Color | None` |  | `Color(red=0, green=0, blue=0, alpha=1.0)`
`stroke_dasharray` | `tuple[float, ...] | None` | The stroke dasharray of the node | `None`
`stroke_dashoffset` | `float | None` | The stroke dashoffset of the node | `None`
`stroke_width` | `float | None` |  | `1.25`
`transform` | `NoneValueType | tuple[Transformation] | None` | The transform of the node | `None`
`width` | `float` |  | `60.0`
`offset` | `float` |  | `3.0`
`subunits_stroke` | `tuple[Union[NoneValueType, Color]] | None` |  | `None`
`subunits_stroke_width` | `tuple[Union[NoneValueType, float]] | None` |  | `None`
`subunits_stroke_dasharray` | `tuple[Union[NoneValueType, tuple[float]]] | None` |  | `None`
`subunits_stroke_dashoffset` | `tuple[float] | None` |  | `None`
`subunits_fill` | `tuple[Union[NoneValueType, Color]] | None` |  | `None`
`subunits_transform` | `tuple[Union[NoneValueType, tuple[Transformation]]] | None` |  | `None`
`subunits_filter` | `tuple[Union[NoneValueType, Filter]] | None` |  | `None`
`rounded_corners` | `float` |  | `5.0`

Methods:

Name | Description
--- | ---
`anchor_point` | Return an anchor point of the layout element
`angle` | Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.
`bbox` | Compute and return the bounding box of the group layout element
`border` | Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point.
`center` | Return the center anchor of the node
`childless` | Return a copy of the node with no children
`children` | Return the children of the group layout.
`contains` | Return `true` if another layout element is a descendant of the layout element, `false` otherwise
`descendants` | Return the descendants of the layout element
`drawing_elements` | Return the drawing elements of the group layout.
`east` | Return the east anchor of the node
`east_north_east` | Return the east north east anchor of the node
`east_south_east` | Return the east south east west anchor of the node
`equals` | Return `true` if the layout element is equal to another layout element, `false` otherwise
`flattened` | Return a list containing copy of the layout element with no children and all its descendants with no children
`north` | Return the north anchor of the node
`north_east` | Return the north east anchor of the node
`north_north_east` | Return the north north east anchor of the node
`north_north_west` | Return the north north west anchor of the node
`north_west` | Return the north west anchor of the node
`self_angle` | Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.
`self_bbox` | Compute and return the bounding box of the self drawing element of the group layout
`self_border` | Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point.
`self_children` | Return the self children of the node. A node has unique child that is its label
`self_drawing_elements` | Return the node's own drawing elements
`self_to_shapely` | Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout
`size` | Return the size of the node
`south` | Return the south anchor of the node
`south_east` | Return the south east anchor of the node
`south_south_east` | Return the south south east anchor of the node
`south_south_west` | Return the south south west anchor of the node
`south_west` | Return the south west anchor of the node
`to_shapely` | Return a shapely collection of geometries reproducing the drawing elements of the layout element
`west` | Return the west anchor of the node
`west_north_west` | Return the west north west anchor of the node
`west_south_west` | Return the west south west anchor of the node

Attributes:

Name | Type | Description
--- | --- | ---
`x` | `float` | Return the x coordinate of the node
`y` | `float` | Return the y coordinate of the node

#### `` anchor_point

    anchor_point(anchor_name: str) -> Point

Return an anchor point of the layout element

Source code in `src/momapy/core.py`

    130
    131
    132
    def anchor_point(self, anchor_name: str) -> momapy.geometry.Point:
        """Return an anchor point of the layout element"""
        return getattr(self, anchor_name)()

#### `` angle

    angle(
        angle: float,
        unit: Literal["degrees", "radians"] = "degrees",
    ) -> Point

Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.

Source code in `src/momapy/core.py`

    817
    818
    819
    820
    821
    822
    823
    824
    825
    826
    827
    828
    def angle(
        self,
        angle: float,
        unit: typing.Literal["degrees", "radians"] = "degrees",
    ) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal."""
        return momapy.drawing.get_drawing_elements_angle(
            drawing_elements=self.drawing_elements(),
            angle=angle,
            unit=unit,
            center=self.center(),
        )

#### `` bbox

    bbox() -> Bbox

Compute and return the bounding box of the group layout element

Source code in `src/momapy/core.py`

    504
    505
    506
    507
    508
    509
    510
    511
    512
    513
    514
    515
    516
    517
    518
    519
    520
    521
    522
    523
    524
    525
    526
    def bbox(self) -> momapy.geometry.Bbox:
        """Compute and return the bounding box of the group layout element"""
        self_bbox = self.self_bbox()
        bboxes = [child.bbox() for child in self.children()]
        min_x = self_bbox.north_west().x
        min_y = self_bbox.north_west().y
        max_x = self_bbox.south_east().x
        max_y = self_bbox.south_east().y
        for bbox in bboxes:
            if bbox.north_west().x < min_x:
                min_x = bbox.north_west().x
            if bbox.north_west().y < min_y:
                min_y = bbox.north_west().y
            if bbox.south_east().x > max_x:
                max_x = bbox.south_east().x
            if bbox.south_east().y > max_y:
                max_y = bbox.south_east().y
        bbox = momapy.geometry.Bbox(
            momapy.geometry.Point(min_x / 2 + max_x / 2, min_y / 2 + max_y / 2),
            max_x - min_x,
            max_y - min_y,
        )
        return bbox

#### `` border

    border(point: Point) -> Point

Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point. When there are multiple intersection points, the one closest to the given point is returned

Source code in `src/momapy/core.py`

    794
    795
    796
    797
    798
    799
    800
    801
    802
    def border(self, point: momapy.geometry.Point) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point.
        When there are multiple intersection points, the one closest to the given point is returned
        """
        return momapy.drawing.get_drawing_elements_border(
            drawing_elements=self.drawing_elements(),
            point=point,
            center=self.center(),
        )

#### `` center

    center() -> Point

Return the center anchor of the node

Source code in `src/momapy/core.py`

    776
    777
    778
    def center(self) -> momapy.geometry.Point:
        """Return the center anchor of the node"""
        return self.position

#### `` childless

    childless() -> Self

Return a copy of the node with no children

Source code in `src/momapy/core.py`

    830
    831
    832
    def childless(self) -> typing.Self:
        """Return a copy of the node with no children"""
        return dataclasses.replace(self, label=None, layout_elements=tuple([]))

#### `` children

    children() -> list[LayoutElement]

Return the children of the group layout. These are the self children of the group layout (returned by the `self_children` method) and the other children of the group layout (given by the `layout_elements` attribute)

Source code in `src/momapy/core.py`

    566
    567
    568
    569
    570
    def children(self) -> list[LayoutElement]:
        """Return the children of the group layout.
        These are the self children of the group layout (returned by the `self_children` method) and the other children of the group layout (given by the `layout_elements` attribute)
        """
        return self.self_children() + list(self.layout_elements)

#### `` contains

    contains(other: LayoutElement) -> bool

Return `true` if another layout element is a descendant of the layout element, `false` otherwise

Source code in `src/momapy/core.py`

    119
    120
    121
    def contains(self, other: "LayoutElement") -> bool:
        """Return `true` if another layout element is a descendant of the layout element, `false` otherwise"""
        return other in self.descendants()

#### `` descendants

    descendants() -> list[LayoutElement]

Return the descendants of the layout element

Source code in `src/momapy/core.py`

    90
    91
    92
    93
    94
    95
    96
    def descendants(self) -> list["LayoutElement"]:
        """Return the descendants of the layout element"""
        descendants = []
        for child in self.children():
            descendants.append(child)
            descendants += child.descendants()
        return descendants

#### `` drawing_elements

    drawing_elements() -> list[DrawingElement]

Return the drawing elements of the group layout. The returned drawing elements are a group drawing element formed of the self drawing elements of the group layout and the drawing elements of its children

Source code in `src/momapy/core.py`

    538
    539
    540
    541
    542
    543
    544
    545
    546
    547
    548
    549
    550
    551
    552
    553
    554
    555
    556
    557
    558
    559
    560
    561
    562
    563
    564
    def drawing_elements(self) -> list[momapy.drawing.DrawingElement]:
        """Return the drawing elements of the group layout.
        The returned drawing elements are a group drawing element formed of the self drawing elements of the group layout and the drawing elements of its children
        """
        drawing_elements = self.self_drawing_elements()
        for child in self.children():
            if child is not None:
                drawing_elements += child.drawing_elements()
        group = momapy.drawing.Group(
            class_=f"{type(self).__name__}_group",
            elements=tuple(drawing_elements),
            id_=f"{self.id_}_group",
            fill=self.group_fill,
            fill_rule=self.group_fill_rule,
            filter=self.group_filter,
            font_family=self.group_font_family,
            font_size=self.group_font_size,
            font_style=self.group_font_style,
            font_weight=self.group_font_weight,
            stroke=self.group_stroke,
            stroke_dasharray=self.group_stroke_dasharray,
            stroke_dashoffset=self.group_stroke_dashoffset,
            stroke_width=self.group_stroke_width,
            text_anchor=self.group_text_anchor,
            transform=self.group_transform,
        )
        return [group]

#### `` east

    east() -> Point

Return the east anchor of the node

Source code in `src/momapy/core.py`

    708
    709
    710
    def east(self) -> momapy.geometry.Point:
        """Return the east anchor of the node"""
        return self.self_angle(0)

#### `` east_north_east

    east_north_east() -> Point

Return the east north east anchor of the node

Source code in `src/momapy/core.py`

    700
    701
    702
    703
    704
    705
    706
    def east_north_east(self) -> momapy.geometry.Point:
        """Return the east north east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, -self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` east_south_east

    east_south_east() -> Point

Return the east south east west anchor of the node

Source code in `src/momapy/core.py`

    712
    713
    714
    715
    716
    717
    718
    def east_south_east(self) -> momapy.geometry.Point:
        """Return the east south east west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` equals

    equals(
        other: LayoutElement,
        flattened: bool = False,
        unordered: bool = False,
    ) -> bool

Return `true` if the layout element is equal to another layout element, `false` otherwise

Source code in `src/momapy/core.py`

    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    def equals(
        self, other: "LayoutElement", flattened: bool = False, unordered: bool = False
    ) -> bool:
        """Return `true` if the layout element is equal to another layout element, `false` otherwise"""
        if type(self) is type(other):
            if not flattened:
                return self == other
            else:
                if not unordered:
                    return self.flattened() == other.flattened()
                else:
                    return set(self.flattened()) == set(other.flattened())
        return False

#### `` flattened

    flattened() -> list[LayoutElement]

Return a list containing copy of the layout element with no children and all its descendants with no children

Source code in `src/momapy/core.py`

     98
     99
    100
    101
    102
    103
    def flattened(self) -> list["LayoutElement"]:
        """Return a list containing copy of the layout element with no children and all its descendants with no children"""
        flattened = [self.childless()]
        for child in self.children():
            flattened += child.flattened()
        return flattened

#### `` north

    north() -> Point

Return the north anchor of the node

Source code in `src/momapy/core.py`

    680
    681
    682
    def north(self) -> momapy.geometry.Point:
        """Return the north anchor of the node"""
        return self.self_angle(90)

#### `` north_east

    north_east() -> Point

Return the north east anchor of the node

Source code in `src/momapy/core.py`

    692
    693
    694
    695
    696
    697
    698
    def north_east(self) -> momapy.geometry.Point:
        """Return the north east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, -self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` north_north_east

    north_north_east() -> Point

Return the north north east anchor of the node

Source code in `src/momapy/core.py`

    684
    685
    686
    687
    688
    689
    690
    def north_north_east(self) -> momapy.geometry.Point:
        """Return the north north east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 4, -self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` north_north_west

    north_north_west() -> Point

Return the north north west anchor of the node

Source code in `src/momapy/core.py`

    672
    673
    674
    675
    676
    677
    678
    def north_north_west(self) -> momapy.geometry.Point:
        """Return the north north west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() - (self.width / 4, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` north_west

    north_west() -> Point

Return the north west anchor of the node

Source code in `src/momapy/core.py`

    664
    665
    666
    667
    668
    669
    670
    def north_west(self) -> momapy.geometry.Point:
        """Return the north west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() - (self.width / 2, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` self_angle

    self_angle(
        angle: float,
        unit: Literal["degrees", "radians"] = "degrees",
    ) -> Point

Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.

Source code in `src/momapy/core.py`

    804
    805
    806
    807
    808
    809
    810
    811
    812
    813
    814
    815
    def self_angle(
        self,
        angle: float,
        unit: typing.Literal["degrees", "radians"] = "degrees",
    ) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal."""
        return momapy.drawing.get_drawing_elements_angle(
            drawing_elements=self.self_drawing_elements(),
            angle=angle,
            unit=unit,
            center=self.center(),
        )

#### `` self_bbox

    self_bbox() -> Bbox

Compute and return the bounding box of the self drawing element of the group layout

Source code in `src/momapy/core.py`

    499
    500
    501
    502
    def self_bbox(self) -> momapy.geometry.Bbox:
        """Compute and return the bounding box of the self drawing element of the group layout"""
        bounds = self.self_to_shapely().bounds
        return momapy.geometry.Bbox.from_bounds(bounds)

#### `` self_border

    self_border(point: Point) -> Point

Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point. When there are multiple intersection points, the one closest to the given point is returned

Source code in `src/momapy/core.py`

    784
    785
    786
    787
    788
    789
    790
    791
    792
    def self_border(self, point: momapy.geometry.Point) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point.
        When there are multiple intersection points, the one closest to the given point is returned
        """
        return momapy.drawing.get_drawing_elements_border(
            drawing_elements=self.self_drawing_elements(),
            point=point,
            center=self.center(),
        )

#### `` self_children

    self_children() -> list[LayoutElement]

Return the self children of the node. A node has unique child that is its label

Source code in `src/momapy/core.py`

    654
    655
    656
    657
    658
    def self_children(self) -> list[LayoutElement]:
        """Return the self children of the node. A node has unique child that is its label"""
        if self.label is not None:
            return [self.label]
        return []

#### `` self_drawing_elements

    self_drawing_elements() -> list[DrawingElement]

Return the node's own drawing elements

Source code in `src/momapy/core.py`

    637
    638
    639
    640
    641
    642
    643
    644
    645
    646
    647
    648
    649
    650
    651
    652
    def self_drawing_elements(self) -> list[momapy.drawing.DrawingElement]:
        """Return the node's own drawing elements"""
        drawing_elements = self._border_drawing_elements()
        group = momapy.drawing.Group(
            class_=type(self).__name__,
            elements=tuple(drawing_elements),
            fill=self.fill,
            filter=self.filter,
            id_=self.id_,
            stroke=self.stroke,
            stroke_dasharray=self.stroke_dasharray,
            stroke_dashoffset=self.stroke_dashoffset,
            stroke_width=self.stroke_width,
            transform=self.transform,
        )
        return [group]

#### `` self_to_shapely

    self_to_shapely() -> GeometryCollection

Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout

Source code in `src/momapy/core.py`

    495
    496
    497
    def self_to_shapely(self) -> shapely.GeometryCollection:
        """Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout"""
        return momapy.drawing.drawing_elements_to_shapely(self.drawing_elements())

#### `` size

    size() -> tuple[float, float]

Return the size of the node

Source code in `src/momapy/core.py`

    660
    661
    662
    def size(self) -> tuple[float, float]:
        """Return the size of the node"""
        return (self.width, self.height)

#### `` south

    south() -> Point

Return the south anchor of the node

Source code in `src/momapy/core.py`

    736
    737
    738
    def south(self) -> momapy.geometry.Point:
        """Return the south anchor of the node"""
        return self.self_angle(270)

#### `` south_east

    south_east() -> Point

Return the south east anchor of the node

Source code in `src/momapy/core.py`

    720
    721
    722
    723
    724
    725
    726
    def south_east(self) -> momapy.geometry.Point:
        """Return the south east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` south_south_east

    south_south_east() -> Point

Return the south south east anchor of the node

Source code in `src/momapy/core.py`

    728
    729
    730
    731
    732
    733
    734
    def south_south_east(self) -> momapy.geometry.Point:
        """Return the south south east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 4, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` south_south_west

    south_south_west() -> Point

Return the south south west anchor of the node

Source code in `src/momapy/core.py`

    740
    741
    742
    743
    744
    745
    746
    def south_south_west(self) -> momapy.geometry.Point:
        """Return the south south west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (-self.width / 4, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` south_west

    south_west() -> Point

Return the south west anchor of the node

Source code in `src/momapy/core.py`

    748
    749
    750
    751
    752
    753
    754
    def south_west(self) -> momapy.geometry.Point:
        """Return the south west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (-self.width / 2, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` to_shapely

    to_shapely(to_polygons: bool = False) -> GeometryCollection

Return a shapely collection of geometries reproducing the drawing elements of the layout element

Source code in `src/momapy/core.py`

    123
    124
    125
    126
    127
    128
    def to_shapely(self, to_polygons: bool = False) -> shapely.GeometryCollection:
        """Return a shapely collection of geometries reproducing the drawing elements of the layout element"""
        geom_collection = []
        for drawing_element in self.drawing_elements():
            geom_collection += drawing_element.to_shapely(to_polygons=to_polygons).geoms
        return shapely.GeometryCollection(geom_collection)

#### `` west

    west() -> Point

Return the west anchor of the node

Source code in `src/momapy/core.py`

    764
    765
    766
    def west(self) -> momapy.geometry.Point:
        """Return the west anchor of the node"""
        return self.self_angle(180)

#### `` west_north_west

    west_north_west() -> Point

Return the west north west anchor of the node

Source code in `src/momapy/core.py`

    768
    769
    770
    771
    772
    773
    774
    def west_north_west(self) -> momapy.geometry.Point:
        """Return the west north west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() - (self.width / 2, self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` west_south_west

    west_south_west() -> Point

Return the west south west anchor of the node

Source code in `src/momapy/core.py`

    756
    757
    758
    759
    760
    761
    762
    def west_south_west(self) -> momapy.geometry.Point:
        """Return the west south west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (-self.width / 2, self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` x `property`

    x: float

Return the x coordinate of the node

#### `` y `property`

    y: float

Return the y coordinate of the node

### `` NucleicAcidFeatureMultimerSubunit `dataclass`

    NucleicAcidFeatureMultimerSubunit(
        *,
        id_: str = make_uuid4_as_str(),
        label: str | None = None,
        state_variables: frozenset[StateVariable] = frozenset(),
        units_of_information: frozenset[
            UnitOfInformation
        ] = frozenset(),
        subunits: frozenset[Subunit] = frozenset(),
        cardinality: int | None = None,
    )

Bases: `MultimerSubunit`

Class for nucleic acid feature multimer subunits

Parameters:

Name | Type | Description | Default
--- | --- | --- | ---
`id_` | `str` | The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element | `'a78e87fc-1a52-46d3-a348-3ad097aeca16'`
`label` | `str | None` | The label of the subunit | `None`
`state_variables` | `frozenset[StateVariable]` | The state variables of the complex subunit | `<class 'frozenset'>`
`units_of_information` | `frozenset[UnitOfInformation]` | The units of information of the complex subunit | `<class 'frozenset'>`
`subunits` | `frozenset[Subunit]` | The subunits of the complex subunit | `<class 'frozenset'>`
`cardinality` | `int | None` | The cardinality of the multimer subunit | `None`

### `` NucleicAcidFeatureMultimerSubunitLayout `dataclass`

    NucleicAcidFeatureMultimerSubunitLayout(
        fill: NoneValueType | Color | None = white,
        stroke: NoneValueType | Color | None = black,
        stroke_width: float | None = 1.25,
        offset: float = 3.0,
        subunits_stroke: tuple[NoneValueType | Color]
        | None = None,
        subunits_stroke_width: tuple[NoneValueType | float]
        | None = None,
        subunits_stroke_dasharray: tuple[
            NoneValueType | tuple[float]
        ]
        | None = None,
        subunits_stroke_dashoffset: tuple[float] | None = None,
        subunits_fill: tuple[NoneValueType | Color]
        | None = None,
        subunits_transform: tuple[
            NoneValueType | tuple[Transformation]
        ]
        | None = None,
        subunits_filter: tuple[NoneValueType | Filter]
        | None = None,
        *,
        id_: str = make_uuid4_as_str(),
        layout_elements: tuple[LayoutElement] = tuple(),
        group_fill: NoneValueType | Color | None = None,
        group_fill_rule: FillRule | None = None,
        group_filter: NoneValueType | Filter | None = None,
        group_font_family: str | None = None,
        group_font_size: float | None = None,
        group_font_style: FontStyle | None = None,
        group_font_weight: FontWeight | float | None = None,
        group_stroke: NoneValueType | Color | None = None,
        group_stroke_dasharray: tuple[float, ...] | None = None,
        group_stroke_dashoffset: float | None = None,
        group_stroke_width: float | None = None,
        group_text_anchor: TextAnchor | None = None,
        group_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        filter: NoneValueType | Filter | None = None,
        height: float = 30.0,
        label: TextLayout | None = None,
        position: Point,
        stroke_dasharray: tuple[float, ...] | None = None,
        stroke_dashoffset: float | None = None,
        transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        width: float = 60.0,
        rounded_corners: float = 5.0,
    )

Bases: `_MultiMixin`, `SBGNNode`

Class for nucleic acid feature multimer subunit layouts

Parameters:

Name | Type | Description | Default
--- | --- | --- | ---
`id_` | `str` | The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element | `'76fdba80-7390-4379-abf6-ee6eb5263d6d'`
`layout_elements` | `tuple[LayoutElement]` | The sub-layout elements of the group layout. These are part of the children of the group layout | `<dynamic>`
`group_fill` | `NoneValueType | Color | None` | The fill color of the group layout | `None`
`group_fill_rule` | `FillRule | None` | The fill rule of the group layout | `None`
`group_filter` | `NoneValueType | Filter | None` | The filter of the group layout | `None`
`group_font_family` | `str | None` | The font family of the group layout | `None`
`group_font_size` | `float | None` | The font size of the group layout | `None`
`group_font_style` | `FontStyle | None` | The font style of the group layout | `None`
`group_font_weight` | `FontWeight | float | None` | The font weight of the group layout | `None`
`group_stroke` | `NoneValueType | Color | None` | The stroke color of the group layout | `None`
`group_stroke_dasharray` | `tuple[float, ...] | None` | The stroke dasharray of the group layout | `None`
`group_stroke_dashoffset` | `float | None` | The stroke dashoffset of the group layout | `None`
`group_stroke_width` | `float | None` | The stroke width of the group layout | `None`
`group_text_anchor` | `TextAnchor | None` | The text anchor of the group layout | `None`
`group_transform` | `NoneValueType | tuple[Transformation] | None` | The transform of the group layout | `None`
`fill` | `NoneValueType | Color | None` |  | `Color(red=255, green=255, blue=255, alpha=1.0)`
`filter` | `NoneValueType | Filter | None` | The filter of the node | `None`
`height` | `float` |  | `30.0`
`label` | `TextLayout | None` | The label of the node | `None`
`position` | `Point` | The position of the node | required
`stroke` | `NoneValueType | Color | None` |  | `Color(red=0, green=0, blue=0, alpha=1.0)`
`stroke_dasharray` | `tuple[float, ...] | None` | The stroke dasharray of the node | `None`
`stroke_dashoffset` | `float | None` | The stroke dashoffset of the node | `None`
`stroke_width` | `float | None` |  | `1.25`
`transform` | `NoneValueType | tuple[Transformation] | None` | The transform of the node | `None`
`width` | `float` |  | `60.0`
`offset` | `float` |  | `3.0`
`subunits_stroke` | `tuple[Union[NoneValueType, Color]] | None` |  | `None`
`subunits_stroke_width` | `tuple[Union[NoneValueType, float]] | None` |  | `None`
`subunits_stroke_dasharray` | `tuple[Union[NoneValueType, tuple[float]]] | None` |  | `None`
`subunits_stroke_dashoffset` | `tuple[float] | None` |  | `None`
`subunits_fill` | `tuple[Union[NoneValueType, Color]] | None` |  | `None`
`subunits_transform` | `tuple[Union[NoneValueType, tuple[Transformation]]] | None` |  | `None`
`subunits_filter` | `tuple[Union[NoneValueType, Filter]] | None` |  | `None`
`rounded_corners` | `float` |  | `5.0`

Methods:

Name | Description
--- | ---
`anchor_point` | Return an anchor point of the layout element
`angle` | Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.
`bbox` | Compute and return the bounding box of the group layout element
`border` | Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point.
`center` | Return the center anchor of the node
`childless` | Return a copy of the node with no children
`children` | Return the children of the group layout.
`contains` | Return `true` if another layout element is a descendant of the layout element, `false` otherwise
`descendants` | Return the descendants of the layout element
`drawing_elements` | Return the drawing elements of the group layout.
`east` | Return the east anchor of the node
`east_north_east` | Return the east north east anchor of the node
`east_south_east` | Return the east south east west anchor of the node
`equals` | Return `true` if the layout element is equal to another layout element, `false` otherwise
`flattened` | Return a list containing copy of the layout element with no children and all its descendants with no children
`north` | Return the north anchor of the node
`north_east` | Return the north east anchor of the node
`north_north_east` | Return the north north east anchor of the node
`north_north_west` | Return the north north west anchor of the node
`north_west` | Return the north west anchor of the node
`self_angle` | Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.
`self_bbox` | Compute and return the bounding box of the self drawing element of the group layout
`self_border` | Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point.
`self_children` | Return the self children of the node. A node has unique child that is its label
`self_drawing_elements` | Return the node's own drawing elements
`self_to_shapely` | Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout
`size` | Return the size of the node
`south` | Return the south anchor of the node
`south_east` | Return the south east anchor of the node
`south_south_east` | Return the south south east anchor of the node
`south_south_west` | Return the south south west anchor of the node
`south_west` | Return the south west anchor of the node
`to_shapely` | Return a shapely collection of geometries reproducing the drawing elements of the layout element
`west` | Return the west anchor of the node
`west_north_west` | Return the west north west anchor of the node
`west_south_west` | Return the west south west anchor of the node

Attributes:

Name | Type | Description
--- | --- | ---
`x` | `float` | Return the x coordinate of the node
`y` | `float` | Return the y coordinate of the node

#### `` anchor_point

    anchor_point(anchor_name: str) -> Point

Return an anchor point of the layout element

Source code in `src/momapy/core.py`

    130
    131
    132
    def anchor_point(self, anchor_name: str) -> momapy.geometry.Point:
        """Return an anchor point of the layout element"""
        return getattr(self, anchor_name)()

#### `` angle

    angle(
        angle: float,
        unit: Literal["degrees", "radians"] = "degrees",
    ) -> Point

Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.

Source code in `src/momapy/core.py`

    817
    818
    819
    820
    821
    822
    823
    824
    825
    826
    827
    828
    def angle(
        self,
        angle: float,
        unit: typing.Literal["degrees", "radians"] = "degrees",
    ) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal."""
        return momapy.drawing.get_drawing_elements_angle(
            drawing_elements=self.drawing_elements(),
            angle=angle,
            unit=unit,
            center=self.center(),
        )

#### `` bbox

    bbox() -> Bbox

Compute and return the bounding box of the group layout element

Source code in `src/momapy/core.py`

    504
    505
    506
    507
    508
    509
    510
    511
    512
    513
    514
    515
    516
    517
    518
    519
    520
    521
    522
    523
    524
    525
    526
    def bbox(self) -> momapy.geometry.Bbox:
        """Compute and return the bounding box of the group layout element"""
        self_bbox = self.self_bbox()
        bboxes = [child.bbox() for child in self.children()]
        min_x = self_bbox.north_west().x
        min_y = self_bbox.north_west().y
        max_x = self_bbox.south_east().x
        max_y = self_bbox.south_east().y
        for bbox in bboxes:
            if bbox.north_west().x < min_x:
                min_x = bbox.north_west().x
            if bbox.north_west().y < min_y:
                min_y = bbox.north_west().y
            if bbox.south_east().x > max_x:
                max_x = bbox.south_east().x
            if bbox.south_east().y > max_y:
                max_y = bbox.south_east().y
        bbox = momapy.geometry.Bbox(
            momapy.geometry.Point(min_x / 2 + max_x / 2, min_y / 2 + max_y / 2),
            max_x - min_x,
            max_y - min_y,
        )
        return bbox

#### `` border

    border(point: Point) -> Point

Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point. When there are multiple intersection points, the one closest to the given point is returned

Source code in `src/momapy/core.py`

    794
    795
    796
    797
    798
    799
    800
    801
    802
    def border(self, point: momapy.geometry.Point) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point.
        When there are multiple intersection points, the one closest to the given point is returned
        """
        return momapy.drawing.get_drawing_elements_border(
            drawing_elements=self.drawing_elements(),
            point=point,
            center=self.center(),
        )

#### `` center

    center() -> Point

Return the center anchor of the node

Source code in `src/momapy/core.py`

    776
    777
    778
    def center(self) -> momapy.geometry.Point:
        """Return the center anchor of the node"""
        return self.position

#### `` childless

    childless() -> Self

Return a copy of the node with no children

Source code in `src/momapy/core.py`

    830
    831
    832
    def childless(self) -> typing.Self:
        """Return a copy of the node with no children"""
        return dataclasses.replace(self, label=None, layout_elements=tuple([]))

#### `` children

    children() -> list[LayoutElement]

Return the children of the group layout. These are the self children of the group layout (returned by the `self_children` method) and the other children of the group layout (given by the `layout_elements` attribute)

Source code in `src/momapy/core.py`

    566
    567
    568
    569
    570
    def children(self) -> list[LayoutElement]:
        """Return the children of the group layout.
        These are the self children of the group layout (returned by the `self_children` method) and the other children of the group layout (given by the `layout_elements` attribute)
        """
        return self.self_children() + list(self.layout_elements)

#### `` contains

    contains(other: LayoutElement) -> bool

Return `true` if another layout element is a descendant of the layout element, `false` otherwise

Source code in `src/momapy/core.py`

    119
    120
    121
    def contains(self, other: "LayoutElement") -> bool:
        """Return `true` if another layout element is a descendant of the layout element, `false` otherwise"""
        return other in self.descendants()

#### `` descendants

    descendants() -> list[LayoutElement]

Return the descendants of the layout element

Source code in `src/momapy/core.py`

    90
    91
    92
    93
    94
    95
    96
    def descendants(self) -> list["LayoutElement"]:
        """Return the descendants of the layout element"""
        descendants = []
        for child in self.children():
            descendants.append(child)
            descendants += child.descendants()
        return descendants

#### `` drawing_elements

    drawing_elements() -> list[DrawingElement]

Return the drawing elements of the group layout. The returned drawing elements are a group drawing element formed of the self drawing elements of the group layout and the drawing elements of its children

Source code in `src/momapy/core.py`

    538
    539
    540
    541
    542
    543
    544
    545
    546
    547
    548
    549
    550
    551
    552
    553
    554
    555
    556
    557
    558
    559
    560
    561
    562
    563
    564
    def drawing_elements(self) -> list[momapy.drawing.DrawingElement]:
        """Return the drawing elements of the group layout.
        The returned drawing elements are a group drawing element formed of the self drawing elements of the group layout and the drawing elements of its children
        """
        drawing_elements = self.self_drawing_elements()
        for child in self.children():
            if child is not None:
                drawing_elements += child.drawing_elements()
        group = momapy.drawing.Group(
            class_=f"{type(self).__name__}_group",
            elements=tuple(drawing_elements),
            id_=f"{self.id_}_group",
            fill=self.group_fill,
            fill_rule=self.group_fill_rule,
            filter=self.group_filter,
            font_family=self.group_font_family,
            font_size=self.group_font_size,
            font_style=self.group_font_style,
            font_weight=self.group_font_weight,
            stroke=self.group_stroke,
            stroke_dasharray=self.group_stroke_dasharray,
            stroke_dashoffset=self.group_stroke_dashoffset,
            stroke_width=self.group_stroke_width,
            text_anchor=self.group_text_anchor,
            transform=self.group_transform,
        )
        return [group]

#### `` east

    east() -> Point

Return the east anchor of the node

Source code in `src/momapy/core.py`

    708
    709
    710
    def east(self) -> momapy.geometry.Point:
        """Return the east anchor of the node"""
        return self.self_angle(0)

#### `` east_north_east

    east_north_east() -> Point

Return the east north east anchor of the node

Source code in `src/momapy/core.py`

    700
    701
    702
    703
    704
    705
    706
    def east_north_east(self) -> momapy.geometry.Point:
        """Return the east north east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, -self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` east_south_east

    east_south_east() -> Point

Return the east south east west anchor of the node

Source code in `src/momapy/core.py`

    712
    713
    714
    715
    716
    717
    718
    def east_south_east(self) -> momapy.geometry.Point:
        """Return the east south east west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` equals

    equals(
        other: LayoutElement,
        flattened: bool = False,
        unordered: bool = False,
    ) -> bool

Return `true` if the layout element is equal to another layout element, `false` otherwise

Source code in `src/momapy/core.py`

    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    def equals(
        self, other: "LayoutElement", flattened: bool = False, unordered: bool = False
    ) -> bool:
        """Return `true` if the layout element is equal to another layout element, `false` otherwise"""
        if type(self) is type(other):
            if not flattened:
                return self == other
            else:
                if not unordered:
                    return self.flattened() == other.flattened()
                else:
                    return set(self.flattened()) == set(other.flattened())
        return False

#### `` flattened

    flattened() -> list[LayoutElement]

Return a list containing copy of the layout element with no children and all its descendants with no children

Source code in `src/momapy/core.py`

     98
     99
    100
    101
    102
    103
    def flattened(self) -> list["LayoutElement"]:
        """Return a list containing copy of the layout element with no children and all its descendants with no children"""
        flattened = [self.childless()]
        for child in self.children():
            flattened += child.flattened()
        return flattened

#### `` north

    north() -> Point

Return the north anchor of the node

Source code in `src/momapy/core.py`

    680
    681
    682
    def north(self) -> momapy.geometry.Point:
        """Return the north anchor of the node"""
        return self.self_angle(90)

#### `` north_east

    north_east() -> Point

Return the north east anchor of the node

Source code in `src/momapy/core.py`

    692
    693
    694
    695
    696
    697
    698
    def north_east(self) -> momapy.geometry.Point:
        """Return the north east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, -self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` north_north_east

    north_north_east() -> Point

Return the north north east anchor of the node

Source code in `src/momapy/core.py`

    684
    685
    686
    687
    688
    689
    690
    def north_north_east(self) -> momapy.geometry.Point:
        """Return the north north east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 4, -self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` north_north_west

    north_north_west() -> Point

Return the north north west anchor of the node

Source code in `src/momapy/core.py`

    672
    673
    674
    675
    676
    677
    678
    def north_north_west(self) -> momapy.geometry.Point:
        """Return the north north west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() - (self.width / 4, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` north_west

    north_west() -> Point

Return the north west anchor of the node

Source code in `src/momapy/core.py`

    664
    665
    666
    667
    668
    669
    670
    def north_west(self) -> momapy.geometry.Point:
        """Return the north west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() - (self.width / 2, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` self_angle

    self_angle(
        angle: float,
        unit: Literal["degrees", "radians"] = "degrees",
    ) -> Point

Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.

Source code in `src/momapy/core.py`

    804
    805
    806
    807
    808
    809
    810
    811
    812
    813
    814
    815
    def self_angle(
        self,
        angle: float,
        unit: typing.Literal["degrees", "radians"] = "degrees",
    ) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal."""
        return momapy.drawing.get_drawing_elements_angle(
            drawing_elements=self.self_drawing_elements(),
            angle=angle,
            unit=unit,
            center=self.center(),
        )

#### `` self_bbox

    self_bbox() -> Bbox

Compute and return the bounding box of the self drawing element of the group layout

Source code in `src/momapy/core.py`

    499
    500
    501
    502
    def self_bbox(self) -> momapy.geometry.Bbox:
        """Compute and return the bounding box of the self drawing element of the group layout"""
        bounds = self.self_to_shapely().bounds
        return momapy.geometry.Bbox.from_bounds(bounds)

#### `` self_border

    self_border(point: Point) -> Point

Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point. When there are multiple intersection points, the one closest to the given point is returned

Source code in `src/momapy/core.py`

    784
    785
    786
    787
    788
    789
    790
    791
    792
    def self_border(self, point: momapy.geometry.Point) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point.
        When there are multiple intersection points, the one closest to the given point is returned
        """
        return momapy.drawing.get_drawing_elements_border(
            drawing_elements=self.self_drawing_elements(),
            point=point,
            center=self.center(),
        )

#### `` self_children

    self_children() -> list[LayoutElement]

Return the self children of the node. A node has unique child that is its label

Source code in `src/momapy/core.py`

    654
    655
    656
    657
    658
    def self_children(self) -> list[LayoutElement]:
        """Return the self children of the node. A node has unique child that is its label"""
        if self.label is not None:
            return [self.label]
        return []

#### `` self_drawing_elements

    self_drawing_elements() -> list[DrawingElement]

Return the node's own drawing elements

Source code in `src/momapy/core.py`

    637
    638
    639
    640
    641
    642
    643
    644
    645
    646
    647
    648
    649
    650
    651
    652
    def self_drawing_elements(self) -> list[momapy.drawing.DrawingElement]:
        """Return the node's own drawing elements"""
        drawing_elements = self._border_drawing_elements()
        group = momapy.drawing.Group(
            class_=type(self).__name__,
            elements=tuple(drawing_elements),
            fill=self.fill,
            filter=self.filter,
            id_=self.id_,
            stroke=self.stroke,
            stroke_dasharray=self.stroke_dasharray,
            stroke_dashoffset=self.stroke_dashoffset,
            stroke_width=self.stroke_width,
            transform=self.transform,
        )
        return [group]

#### `` self_to_shapely

    self_to_shapely() -> GeometryCollection

Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout

Source code in `src/momapy/core.py`

    495
    496
    497
    def self_to_shapely(self) -> shapely.GeometryCollection:
        """Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout"""
        return momapy.drawing.drawing_elements_to_shapely(self.drawing_elements())

#### `` size

    size() -> tuple[float, float]

Return the size of the node

Source code in `src/momapy/core.py`

    660
    661
    662
    def size(self) -> tuple[float, float]:
        """Return the size of the node"""
        return (self.width, self.height)

#### `` south

    south() -> Point

Return the south anchor of the node

Source code in `src/momapy/core.py`

    736
    737
    738
    def south(self) -> momapy.geometry.Point:
        """Return the south anchor of the node"""
        return self.self_angle(270)

#### `` south_east

    south_east() -> Point

Return the south east anchor of the node

Source code in `src/momapy/core.py`

    720
    721
    722
    723
    724
    725
    726
    def south_east(self) -> momapy.geometry.Point:
        """Return the south east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` south_south_east

    south_south_east() -> Point

Return the south south east anchor of the node

Source code in `src/momapy/core.py`

    728
    729
    730
    731
    732
    733
    734
    def south_south_east(self) -> momapy.geometry.Point:
        """Return the south south east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 4, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` south_south_west

    south_south_west() -> Point

Return the south south west anchor of the node

Source code in `src/momapy/core.py`

    740
    741
    742
    743
    744
    745
    746
    def south_south_west(self) -> momapy.geometry.Point:
        """Return the south south west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (-self.width / 4, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` south_west

    south_west() -> Point

Return the south west anchor of the node

Source code in `src/momapy/core.py`

    748
    749
    750
    751
    752
    753
    754
    def south_west(self) -> momapy.geometry.Point:
        """Return the south west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (-self.width / 2, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` to_shapely

    to_shapely(to_polygons: bool = False) -> GeometryCollection

Return a shapely collection of geometries reproducing the drawing elements of the layout element

Source code in `src/momapy/core.py`

    123
    124
    125
    126
    127
    128
    def to_shapely(self, to_polygons: bool = False) -> shapely.GeometryCollection:
        """Return a shapely collection of geometries reproducing the drawing elements of the layout element"""
        geom_collection = []
        for drawing_element in self.drawing_elements():
            geom_collection += drawing_element.to_shapely(to_polygons=to_polygons).geoms
        return shapely.GeometryCollection(geom_collection)

#### `` west

    west() -> Point

Return the west anchor of the node

Source code in `src/momapy/core.py`

    764
    765
    766
    def west(self) -> momapy.geometry.Point:
        """Return the west anchor of the node"""
        return self.self_angle(180)

#### `` west_north_west

    west_north_west() -> Point

Return the west north west anchor of the node

Source code in `src/momapy/core.py`

    768
    769
    770
    771
    772
    773
    774
    def west_north_west(self) -> momapy.geometry.Point:
        """Return the west north west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() - (self.width / 2, self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` west_south_west

    west_south_west() -> Point

Return the west south west anchor of the node

Source code in `src/momapy/core.py`

    756
    757
    758
    759
    760
    761
    762
    def west_south_west(self) -> momapy.geometry.Point:
        """Return the west south west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (-self.width / 2, self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` x `property`

    x: float

Return the x coordinate of the node

#### `` y `property`

    y: float

Return the y coordinate of the node

### `` NucleicAcidFeatureSubunit `dataclass`

    NucleicAcidFeatureSubunit(
        *,
        id_: str = make_uuid4_as_str(),
        label: str | None = None,
        state_variables: frozenset[StateVariable] = frozenset(),
        units_of_information: frozenset[
            UnitOfInformation
        ] = frozenset(),
    )

Bases: `Subunit`

Class for nucleic acid feature subunits

Parameters:

Name | Type | Description | Default
--- | --- | --- | ---
`id_` | `str` | The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element | `'d827393c-3e22-424f-b492-f613d1a049ba'`
`label` | `str | None` | The label of the subunit | `None`
`state_variables` | `frozenset[StateVariable]` | The state variables of the nucleic acid feature subunit | `<class 'frozenset'>`
`units_of_information` | `frozenset[UnitOfInformation]` | The units of information of the nucleic acid feature subunit | `<class 'frozenset'>`

### `` NucleicAcidFeatureSubunitLayout `dataclass`

    NucleicAcidFeatureSubunitLayout(
        fill: NoneValueType | Color | None = white,
        stroke: NoneValueType | Color | None = black,
        stroke_width: float | None = 1.25,
        *,
        id_: str = make_uuid4_as_str(),
        layout_elements: tuple[LayoutElement] = tuple(),
        group_fill: NoneValueType | Color | None = None,
        group_fill_rule: FillRule | None = None,
        group_filter: NoneValueType | Filter | None = None,
        group_font_family: str | None = None,
        group_font_size: float | None = None,
        group_font_style: FontStyle | None = None,
        group_font_weight: FontWeight | float | None = None,
        group_stroke: NoneValueType | Color | None = None,
        group_stroke_dasharray: tuple[float, ...] | None = None,
        group_stroke_dashoffset: float | None = None,
        group_stroke_width: float | None = None,
        group_text_anchor: TextAnchor | None = None,
        group_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        filter: NoneValueType | Filter | None = None,
        height: float = 30.0,
        label: TextLayout | None = None,
        position: Point,
        stroke_dasharray: tuple[float, ...] | None = None,
        stroke_dashoffset: float | None = None,
        transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        width: float = 60.0,
        rounded_corners: float = 5.0,
    )

Bases: `_SimpleMixin`, `SBGNNode`

Class for nucleic acid feature subunit layouts

Parameters:

Name | Type | Description | Default
--- | --- | --- | ---
`id_` | `str` | The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element | `'5f417057-82a0-4788-b6a1-4f5bf789828f'`
`layout_elements` | `tuple[LayoutElement]` | The sub-layout elements of the group layout. These are part of the children of the group layout | `<dynamic>`
`group_fill` | `NoneValueType | Color | None` | The fill color of the group layout | `None`
`group_fill_rule` | `FillRule | None` | The fill rule of the group layout | `None`
`group_filter` | `NoneValueType | Filter | None` | The filter of the group layout | `None`
`group_font_family` | `str | None` | The font family of the group layout | `None`
`group_font_size` | `float | None` | The font size of the group layout | `None`
`group_font_style` | `FontStyle | None` | The font style of the group layout | `None`
`group_font_weight` | `FontWeight | float | None` | The font weight of the group layout | `None`
`group_stroke` | `NoneValueType | Color | None` | The stroke color of the group layout | `None`
`group_stroke_dasharray` | `tuple[float, ...] | None` | The stroke dasharray of the group layout | `None`
`group_stroke_dashoffset` | `float | None` | The stroke dashoffset of the group layout | `None`
`group_stroke_width` | `float | None` | The stroke width of the group layout | `None`
`group_text_anchor` | `TextAnchor | None` | The text anchor of the group layout | `None`
`group_transform` | `NoneValueType | tuple[Transformation] | None` | The transform of the group layout | `None`
`fill` | `NoneValueType | Color | None` |  | `Color(red=255, green=255, blue=255, alpha=1.0)`
`filter` | `NoneValueType | Filter | None` | The filter of the node | `None`
`height` | `float` |  | `30.0`
`label` | `TextLayout | None` | The label of the node | `None`
`position` | `Point` | The position of the node | required
`stroke` | `NoneValueType | Color | None` |  | `Color(red=0, green=0, blue=0, alpha=1.0)`
`stroke_dasharray` | `tuple[float, ...] | None` | The stroke dasharray of the node | `None`
`stroke_dashoffset` | `float | None` | The stroke dashoffset of the node | `None`
`stroke_width` | `float | None` |  | `1.25`
`transform` | `NoneValueType | tuple[Transformation] | None` | The transform of the node | `None`
`width` | `float` |  | `60.0`
`rounded_corners` | `float` |  | `5.0`

Methods:

Name | Description
--- | ---
`anchor_point` | Return an anchor point of the layout element
`angle` | Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.
`bbox` | Compute and return the bounding box of the group layout element
`border` | Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point.
`center` | Return the center anchor of the node
`childless` | Return a copy of the node with no children
`children` | Return the children of the group layout.
`contains` | Return `true` if another layout element is a descendant of the layout element, `false` otherwise
`descendants` | Return the descendants of the layout element
`drawing_elements` | Return the drawing elements of the group layout.
`east` | Return the east anchor of the node
`east_north_east` | Return the east north east anchor of the node
`east_south_east` | Return the east south east west anchor of the node
`equals` | Return `true` if the layout element is equal to another layout element, `false` otherwise
`flattened` | Return a list containing copy of the layout element with no children and all its descendants with no children
`label_center` | Return the label center anchor of the node
`north` | Return the north anchor of the node
`north_east` | Return the north east anchor of the node
`north_north_east` | Return the north north east anchor of the node
`north_north_west` | Return the north north west anchor of the node
`north_west` | Return the north west anchor of the node
`self_angle` | Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.
`self_bbox` | Compute and return the bounding box of the self drawing element of the group layout
`self_border` | Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point.
`self_children` | Return the self children of the node. A node has unique child that is its label
`self_drawing_elements` | Return the node's own drawing elements
`self_to_shapely` | Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout
`size` | Return the size of the node
`south` | Return the south anchor of the node
`south_east` | Return the south east anchor of the node
`south_south_east` | Return the south south east anchor of the node
`south_south_west` | Return the south south west anchor of the node
`south_west` | Return the south west anchor of the node
`to_shapely` | Return a shapely collection of geometries reproducing the drawing elements of the layout element
`west` | Return the west anchor of the node
`west_north_west` | Return the west north west anchor of the node
`west_south_west` | Return the west south west anchor of the node

Attributes:

Name | Type | Description
--- | --- | ---
`x` | `float` | Return the x coordinate of the node
`y` | `float` | Return the y coordinate of the node

#### `` anchor_point

    anchor_point(anchor_name: str) -> Point

Return an anchor point of the layout element

Source code in `src/momapy/core.py`

    130
    131
    132
    def anchor_point(self, anchor_name: str) -> momapy.geometry.Point:
        """Return an anchor point of the layout element"""
        return getattr(self, anchor_name)()

#### `` angle

    angle(
        angle: float,
        unit: Literal["degrees", "radians"] = "degrees",
    ) -> Point

Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.

Source code in `src/momapy/core.py`

    817
    818
    819
    820
    821
    822
    823
    824
    825
    826
    827
    828
    def angle(
        self,
        angle: float,
        unit: typing.Literal["degrees", "radians"] = "degrees",
    ) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal."""
        return momapy.drawing.get_drawing_elements_angle(
            drawing_elements=self.drawing_elements(),
            angle=angle,
            unit=unit,
            center=self.center(),
        )

#### `` bbox

    bbox() -> Bbox

Compute and return the bounding box of the group layout element

Source code in `src/momapy/core.py`

    504
    505
    506
    507
    508
    509
    510
    511
    512
    513
    514
    515
    516
    517
    518
    519
    520
    521
    522
    523
    524
    525
    526
    def bbox(self) -> momapy.geometry.Bbox:
        """Compute and return the bounding box of the group layout element"""
        self_bbox = self.self_bbox()
        bboxes = [child.bbox() for child in self.children()]
        min_x = self_bbox.north_west().x
        min_y = self_bbox.north_west().y
        max_x = self_bbox.south_east().x
        max_y = self_bbox.south_east().y
        for bbox in bboxes:
            if bbox.north_west().x < min_x:
                min_x = bbox.north_west().x
            if bbox.north_west().y < min_y:
                min_y = bbox.north_west().y
            if bbox.south_east().x > max_x:
                max_x = bbox.south_east().x
            if bbox.south_east().y > max_y:
                max_y = bbox.south_east().y
        bbox = momapy.geometry.Bbox(
            momapy.geometry.Point(min_x / 2 + max_x / 2, min_y / 2 + max_y / 2),
            max_x - min_x,
            max_y - min_y,
        )
        return bbox

#### `` border

    border(point: Point) -> Point

Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point. When there are multiple intersection points, the one closest to the given point is returned

Source code in `src/momapy/core.py`

    794
    795
    796
    797
    798
    799
    800
    801
    802
    def border(self, point: momapy.geometry.Point) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point.
        When there are multiple intersection points, the one closest to the given point is returned
        """
        return momapy.drawing.get_drawing_elements_border(
            drawing_elements=self.drawing_elements(),
            point=point,
            center=self.center(),
        )

#### `` center

    center() -> Point

Return the center anchor of the node

Source code in `src/momapy/core.py`

    776
    777
    778
    def center(self) -> momapy.geometry.Point:
        """Return the center anchor of the node"""
        return self.position

#### `` childless

    childless() -> Self

Return a copy of the node with no children

Source code in `src/momapy/core.py`

    830
    831
    832
    def childless(self) -> typing.Self:
        """Return a copy of the node with no children"""
        return dataclasses.replace(self, label=None, layout_elements=tuple([]))

#### `` children

    children() -> list[LayoutElement]

Return the children of the group layout. These are the self children of the group layout (returned by the `self_children` method) and the other children of the group layout (given by the `layout_elements` attribute)

Source code in `src/momapy/core.py`

    566
    567
    568
    569
    570
    def children(self) -> list[LayoutElement]:
        """Return the children of the group layout.
        These are the self children of the group layout (returned by the `self_children` method) and the other children of the group layout (given by the `layout_elements` attribute)
        """
        return self.self_children() + list(self.layout_elements)

#### `` contains

    contains(other: LayoutElement) -> bool

Return `true` if another layout element is a descendant of the layout element, `false` otherwise

Source code in `src/momapy/core.py`

    119
    120
    121
    def contains(self, other: "LayoutElement") -> bool:
        """Return `true` if another layout element is a descendant of the layout element, `false` otherwise"""
        return other in self.descendants()

#### `` descendants

    descendants() -> list[LayoutElement]

Return the descendants of the layout element

Source code in `src/momapy/core.py`

    90
    91
    92
    93
    94
    95
    96
    def descendants(self) -> list["LayoutElement"]:
        """Return the descendants of the layout element"""
        descendants = []
        for child in self.children():
            descendants.append(child)
            descendants += child.descendants()
        return descendants

#### `` drawing_elements

    drawing_elements() -> list[DrawingElement]

Return the drawing elements of the group layout. The returned drawing elements are a group drawing element formed of the self drawing elements of the group layout and the drawing elements of its children

Source code in `src/momapy/core.py`

    538
    539
    540
    541
    542
    543
    544
    545
    546
    547
    548
    549
    550
    551
    552
    553
    554
    555
    556
    557
    558
    559
    560
    561
    562
    563
    564
    def drawing_elements(self) -> list[momapy.drawing.DrawingElement]:
        """Return the drawing elements of the group layout.
        The returned drawing elements are a group drawing element formed of the self drawing elements of the group layout and the drawing elements of its children
        """
        drawing_elements = self.self_drawing_elements()
        for child in self.children():
            if child is not None:
                drawing_elements += child.drawing_elements()
        group = momapy.drawing.Group(
            class_=f"{type(self).__name__}_group",
            elements=tuple(drawing_elements),
            id_=f"{self.id_}_group",
            fill=self.group_fill,
            fill_rule=self.group_fill_rule,
            filter=self.group_filter,
            font_family=self.group_font_family,
            font_size=self.group_font_size,
            font_style=self.group_font_style,
            font_weight=self.group_font_weight,
            stroke=self.group_stroke,
            stroke_dasharray=self.group_stroke_dasharray,
            stroke_dashoffset=self.group_stroke_dashoffset,
            stroke_width=self.group_stroke_width,
            text_anchor=self.group_text_anchor,
            transform=self.group_transform,
        )
        return [group]

#### `` east

    east() -> Point

Return the east anchor of the node

Source code in `src/momapy/core.py`

    708
    709
    710
    def east(self) -> momapy.geometry.Point:
        """Return the east anchor of the node"""
        return self.self_angle(0)

#### `` east_north_east

    east_north_east() -> Point

Return the east north east anchor of the node

Source code in `src/momapy/core.py`

    700
    701
    702
    703
    704
    705
    706
    def east_north_east(self) -> momapy.geometry.Point:
        """Return the east north east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, -self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` east_south_east

    east_south_east() -> Point

Return the east south east west anchor of the node

Source code in `src/momapy/core.py`

    712
    713
    714
    715
    716
    717
    718
    def east_south_east(self) -> momapy.geometry.Point:
        """Return the east south east west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` equals

    equals(
        other: LayoutElement,
        flattened: bool = False,
        unordered: bool = False,
    ) -> bool

Return `true` if the layout element is equal to another layout element, `false` otherwise

Source code in `src/momapy/core.py`

    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    def equals(
        self, other: "LayoutElement", flattened: bool = False, unordered: bool = False
    ) -> bool:
        """Return `true` if the layout element is equal to another layout element, `false` otherwise"""
        if type(self) is type(other):
            if not flattened:
                return self == other
            else:
                if not unordered:
                    return self.flattened() == other.flattened()
                else:
                    return set(self.flattened()) == set(other.flattened())
        return False

#### `` flattened

    flattened() -> list[LayoutElement]

Return a list containing copy of the layout element with no children and all its descendants with no children

Source code in `src/momapy/core.py`

     98
     99
    100
    101
    102
    103
    def flattened(self) -> list["LayoutElement"]:
        """Return a list containing copy of the layout element with no children and all its descendants with no children"""
        flattened = [self.childless()]
        for child in self.children():
            flattened += child.flattened()
        return flattened

#### `` label_center

    label_center() -> Point

Return the label center anchor of the node

Source code in `src/momapy/core.py`

    780
    781
    782
    def label_center(self) -> momapy.geometry.Point:
        """Return the label center anchor of the node"""
        return self.position

#### `` north

    north() -> Point

Return the north anchor of the node

Source code in `src/momapy/core.py`

    680
    681
    682
    def north(self) -> momapy.geometry.Point:
        """Return the north anchor of the node"""
        return self.self_angle(90)

#### `` north_east

    north_east() -> Point

Return the north east anchor of the node

Source code in `src/momapy/core.py`

    692
    693
    694
    695
    696
    697
    698
    def north_east(self) -> momapy.geometry.Point:
        """Return the north east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, -self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` north_north_east

    north_north_east() -> Point

Return the north north east anchor of the node

Source code in `src/momapy/core.py`

    684
    685
    686
    687
    688
    689
    690
    def north_north_east(self) -> momapy.geometry.Point:
        """Return the north north east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 4, -self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` north_north_west

    north_north_west() -> Point

Return the north north west anchor of the node

Source code in `src/momapy/core.py`

    672
    673
    674
    675
    676
    677
    678
    def north_north_west(self) -> momapy.geometry.Point:
        """Return the north north west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() - (self.width / 4, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` north_west

    north_west() -> Point

Return the north west anchor of the node

Source code in `src/momapy/core.py`

    664
    665
    666
    667
    668
    669
    670
    def north_west(self) -> momapy.geometry.Point:
        """Return the north west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() - (self.width / 2, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` self_angle

    self_angle(
        angle: float,
        unit: Literal["degrees", "radians"] = "degrees",
    ) -> Point

Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.

Source code in `src/momapy/core.py`

    804
    805
    806
    807
    808
    809
    810
    811
    812
    813
    814
    815
    def self_angle(
        self,
        angle: float,
        unit: typing.Literal["degrees", "radians"] = "degrees",
    ) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal."""
        return momapy.drawing.get_drawing_elements_angle(
            drawing_elements=self.self_drawing_elements(),
            angle=angle,
            unit=unit,
            center=self.center(),
        )

#### `` self_bbox

    self_bbox() -> Bbox

Compute and return the bounding box of the self drawing element of the group layout

Source code in `src/momapy/core.py`

    499
    500
    501
    502
    def self_bbox(self) -> momapy.geometry.Bbox:
        """Compute and return the bounding box of the self drawing element of the group layout"""
        bounds = self.self_to_shapely().bounds
        return momapy.geometry.Bbox.from_bounds(bounds)

#### `` self_border

    self_border(point: Point) -> Point

Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point. When there are multiple intersection points, the one closest to the given point is returned

Source code in `src/momapy/core.py`

    784
    785
    786
    787
    788
    789
    790
    791
    792
    def self_border(self, point: momapy.geometry.Point) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point.
        When there are multiple intersection points, the one closest to the given point is returned
        """
        return momapy.drawing.get_drawing_elements_border(
            drawing_elements=self.self_drawing_elements(),
            point=point,
            center=self.center(),
        )

#### `` self_children

    self_children() -> list[LayoutElement]

Return the self children of the node. A node has unique child that is its label

Source code in `src/momapy/core.py`

    654
    655
    656
    657
    658
    def self_children(self) -> list[LayoutElement]:
        """Return the self children of the node. A node has unique child that is its label"""
        if self.label is not None:
            return [self.label]
        return []

#### `` self_drawing_elements

    self_drawing_elements() -> list[DrawingElement]

Return the node's own drawing elements

Source code in `src/momapy/core.py`

    637
    638
    639
    640
    641
    642
    643
    644
    645
    646
    647
    648
    649
    650
    651
    652
    def self_drawing_elements(self) -> list[momapy.drawing.DrawingElement]:
        """Return the node's own drawing elements"""
        drawing_elements = self._border_drawing_elements()
        group = momapy.drawing.Group(
            class_=type(self).__name__,
            elements=tuple(drawing_elements),
            fill=self.fill,
            filter=self.filter,
            id_=self.id_,
            stroke=self.stroke,
            stroke_dasharray=self.stroke_dasharray,
            stroke_dashoffset=self.stroke_dashoffset,
            stroke_width=self.stroke_width,
            transform=self.transform,
        )
        return [group]

#### `` self_to_shapely

    self_to_shapely() -> GeometryCollection

Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout

Source code in `src/momapy/core.py`

    495
    496
    497
    def self_to_shapely(self) -> shapely.GeometryCollection:
        """Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout"""
        return momapy.drawing.drawing_elements_to_shapely(self.drawing_elements())

#### `` size

    size() -> tuple[float, float]

Return the size of the node

Source code in `src/momapy/core.py`

    660
    661
    662
    def size(self) -> tuple[float, float]:
        """Return the size of the node"""
        return (self.width, self.height)

#### `` south

    south() -> Point

Return the south anchor of the node

Source code in `src/momapy/core.py`

    736
    737
    738
    def south(self) -> momapy.geometry.Point:
        """Return the south anchor of the node"""
        return self.self_angle(270)

#### `` south_east

    south_east() -> Point

Return the south east anchor of the node

Source code in `src/momapy/core.py`

    720
    721
    722
    723
    724
    725
    726
    def south_east(self) -> momapy.geometry.Point:
        """Return the south east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` south_south_east

    south_south_east() -> Point

Return the south south east anchor of the node

Source code in `src/momapy/core.py`

    728
    729
    730
    731
    732
    733
    734
    def south_south_east(self) -> momapy.geometry.Point:
        """Return the south south east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 4, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` south_south_west

    south_south_west() -> Point

Return the south south west anchor of the node

Source code in `src/momapy/core.py`

    740
    741
    742
    743
    744
    745
    746
    def south_south_west(self) -> momapy.geometry.Point:
        """Return the south south west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (-self.width / 4, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` south_west

    south_west() -> Point

Return the south west anchor of the node

Source code in `src/momapy/core.py`

    748
    749
    750
    751
    752
    753
    754
    def south_west(self) -> momapy.geometry.Point:
        """Return the south west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (-self.width / 2, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` to_shapely

    to_shapely(to_polygons: bool = False) -> GeometryCollection

Return a shapely collection of geometries reproducing the drawing elements of the layout element

Source code in `src/momapy/core.py`

    123
    124
    125
    126
    127
    128
    def to_shapely(self, to_polygons: bool = False) -> shapely.GeometryCollection:
        """Return a shapely collection of geometries reproducing the drawing elements of the layout element"""
        geom_collection = []
        for drawing_element in self.drawing_elements():
            geom_collection += drawing_element.to_shapely(to_polygons=to_polygons).geoms
        return shapely.GeometryCollection(geom_collection)

#### `` west

    west() -> Point

Return the west anchor of the node

Source code in `src/momapy/core.py`

    764
    765
    766
    def west(self) -> momapy.geometry.Point:
        """Return the west anchor of the node"""
        return self.self_angle(180)

#### `` west_north_west

    west_north_west() -> Point

Return the west north west anchor of the node

Source code in `src/momapy/core.py`

    768
    769
    770
    771
    772
    773
    774
    def west_north_west(self) -> momapy.geometry.Point:
        """Return the west north west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() - (self.width / 2, self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` west_south_west

    west_south_west() -> Point

Return the west south west anchor of the node

Source code in `src/momapy/core.py`

    756
    757
    758
    759
    760
    761
    762
    def west_south_west(self) -> momapy.geometry.Point:
        """Return the west south west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (-self.width / 2, self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` x `property`

    x: float

Return the x coordinate of the node

#### `` y `property`

    y: float

Return the y coordinate of the node

### `` OmittedProcess `dataclass`

    OmittedProcess(
        *,
        id_: str = make_uuid4_as_str(),
        reactants: frozenset[Reactant] = frozenset(),
        products: frozenset[Product] = frozenset(),
        reversible: bool = False,
    )

Bases: `GenericProcess`

Class for omitted processes

Parameters:

Name | Type | Description | Default
--- | --- | --- | ---
`id_` | `str` | The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element | `'71774d23-8a64-4ca7-b180-15705e6c458b'`
`reactants` | `frozenset[Reactant]` | The reactants of the stoichiometric process | `<class 'frozenset'>`
`products` | `frozenset[Product]` | The products of the stoichiometric process | `<class 'frozenset'>`
`reversible` | `bool` | Whether the stoichiometric process is reversible or not | `False`

### `` OmittedProcessLayout `dataclass`

    OmittedProcessLayout(
        fill: NoneValueType | Color | None = white,
        stroke: NoneValueType | Color | None = black,
        stroke_width: float | None = 1.25,
        *,
        id_: str = make_uuid4_as_str(),
        layout_elements: tuple[LayoutElement] = tuple(),
        group_fill: NoneValueType | Color | None = None,
        group_fill_rule: FillRule | None = None,
        group_filter: NoneValueType | Filter | None = None,
        group_font_family: str | None = None,
        group_font_size: float | None = None,
        group_font_style: FontStyle | None = None,
        group_font_weight: FontWeight | float | None = None,
        group_stroke: NoneValueType | Color | None = None,
        group_stroke_dasharray: tuple[float, ...] | None = None,
        group_stroke_dashoffset: float | None = None,
        group_stroke_width: float | None = None,
        group_text_anchor: TextAnchor | None = None,
        group_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        filter: NoneValueType | Filter | None = None,
        height: float = 20.0,
        label: TextLayout | None = None,
        position: Point,
        stroke_dasharray: tuple[float, ...] | None = None,
        stroke_dashoffset: float | None = None,
        transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        width: float = 20.0,
        direction: Direction = HORIZONTAL,
        left_to_right: bool = True,
        left_connector_length: float = 10.0,
        right_connector_length: float = 10.0,
        left_connector_stroke: NoneValueType
        | Color
        | None = None,
        left_connector_stroke_width: float | None = None,
        left_connector_stroke_dasharray: NoneValueType
        | tuple[float]
        | None = None,
        left_connector_stroke_dashoffset: float | None = None,
        left_connector_fill: NoneValueType
        | Color
        | None = None,
        left_connector_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        left_connector_filter: NoneValueType
        | Filter
        | None = None,
        right_connector_stroke: NoneValueType
        | Color
        | None = None,
        right_connector_stroke_width: float | None = None,
        right_connector_stroke_dasharray: NoneValueType
        | tuple[float]
        | None = None,
        right_connector_stroke_dashoffset: float | None = None,
        right_connector_fill: NoneValueType
        | Color
        | None = None,
        right_connector_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        right_connector_filter: NoneValueType
        | Filter
        | None = None,
    )

Bases: `_ConnectorsMixin`, `_SimpleMixin`, `_TextMixin`, `SBGNNode`

Class for omitted process layouts

Parameters:

Name | Type | Description | Default
--- | --- | --- | ---
`id_` | `str` | The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element | `'0e4f6907-49e6-417b-9237-e4c762b33544'`
`layout_elements` | `tuple[LayoutElement]` | The sub-layout elements of the group layout. These are part of the children of the group layout | `<dynamic>`
`group_fill` | `NoneValueType | Color | None` | The fill color of the group layout | `None`
`group_fill_rule` | `FillRule | None` | The fill rule of the group layout | `None`
`group_filter` | `NoneValueType | Filter | None` | The filter of the group layout | `None`
`group_font_family` | `str | None` | The font family of the group layout | `None`
`group_font_size` | `float | None` | The font size of the group layout | `None`
`group_font_style` | `FontStyle | None` | The font style of the group layout | `None`
`group_font_weight` | `FontWeight | float | None` | The font weight of the group layout | `None`
`group_stroke` | `NoneValueType | Color | None` | The stroke color of the group layout | `None`
`group_stroke_dasharray` | `tuple[float, ...] | None` | The stroke dasharray of the group layout | `None`
`group_stroke_dashoffset` | `float | None` | The stroke dashoffset of the group layout | `None`
`group_stroke_width` | `float | None` | The stroke width of the group layout | `None`
`group_text_anchor` | `TextAnchor | None` | The text anchor of the group layout | `None`
`group_transform` | `NoneValueType | tuple[Transformation] | None` | The transform of the group layout | `None`
`fill` | `NoneValueType | Color | None` |  | `Color(red=255, green=255, blue=255, alpha=1.0)`
`filter` | `NoneValueType | Filter | None` | The filter of the node | `None`
`height` | `float` |  | `20.0`
`label` | `TextLayout | None` | The label of the node | `None`
`position` | `Point` | The position of the node | required
`stroke` | `NoneValueType | Color | None` |  | `Color(red=0, green=0, blue=0, alpha=1.0)`
`stroke_dasharray` | `tuple[float, ...] | None` | The stroke dasharray of the node | `None`
`stroke_dashoffset` | `float | None` | The stroke dashoffset of the node | `None`
`stroke_width` | `float | None` |  | `1.25`
`transform` | `NoneValueType | tuple[Transformation] | None` | The transform of the node | `None`
`width` | `float` |  | `20.0`
`direction` | `Direction` |  | `<Direction.HORIZONTAL: 1>`
`left_to_right` | `bool` |  | `True`
`left_connector_length` | `float` |  | `10.0`
`right_connector_length` | `float` |  | `10.0`
`left_connector_stroke` | `NoneValueType | Color | None` |  | `None`
`left_connector_stroke_width` | `float | None` |  | `None`
`left_connector_stroke_dasharray` | `NoneValueType | tuple[float] | None` |  | `None`
`left_connector_stroke_dashoffset` | `float | None` |  | `None`
`left_connector_fill` | `NoneValueType | Color | None` |  | `None`
`left_connector_transform` | `NoneValueType | tuple[Transformation] | None` |  | `None`
`left_connector_filter` | `NoneValueType | Filter | None` |  | `None`
`right_connector_stroke` | `NoneValueType | Color | None` |  | `None`
`right_connector_stroke_width` | `float | None` |  | `None`
`right_connector_stroke_dasharray` | `NoneValueType | tuple[float] | None` |  | `None`
`right_connector_stroke_dashoffset` | `float | None` |  | `None`
`right_connector_fill` | `NoneValueType | Color | None` |  | `None`
`right_connector_transform` | `NoneValueType | tuple[Transformation] | None` |  | `None`
`right_connector_filter` | `NoneValueType | Filter | None` |  | `None`

Methods:

Name | Description
--- | ---
`anchor_point` | Return an anchor point of the layout element
`angle` | Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.
`bbox` | Compute and return the bounding box of the group layout element
`border` | Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point.
`center` | Return the center anchor of the node
`childless` | Return a copy of the node with no children
`children` | Return the children of the group layout.
`contains` | Return `true` if another layout element is a descendant of the layout element, `false` otherwise
`descendants` | Return the descendants of the layout element
`drawing_elements` | Return the drawing elements of the group layout.
`east_north_east` | Return the east north east anchor of the node
`east_south_east` | Return the east south east west anchor of the node
`equals` | Return `true` if the layout element is equal to another layout element, `false` otherwise
`flattened` | Return a list containing copy of the layout element with no children and all its descendants with no children
`label_center` | Return the label center anchor of the node
`north_east` | Return the north east anchor of the node
`north_north_east` | Return the north north east anchor of the node
`north_north_west` | Return the north north west anchor of the node
`north_west` | Return the north west anchor of the node
`self_angle` | Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.
`self_bbox` | Compute and return the bounding box of the self drawing element of the group layout
`self_border` | Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point.
`self_children` | Return the self children of the node. A node has unique child that is its label
`self_drawing_elements` | Return the node's own drawing elements
`self_to_shapely` | Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout
`size` | Return the size of the node
`south_east` | Return the south east anchor of the node
`south_south_east` | Return the south south east anchor of the node
`south_south_west` | Return the south south west anchor of the node
`south_west` | Return the south west anchor of the node
`to_shapely` | Return a shapely collection of geometries reproducing the drawing elements of the layout element
`west_north_west` | Return the west north west anchor of the node
`west_south_west` | Return the west south west anchor of the node

Attributes:

Name | Type | Description
--- | --- | ---
`x` | `float` | Return the x coordinate of the node
`y` | `float` | Return the y coordinate of the node

#### `` anchor_point

    anchor_point(anchor_name: str) -> Point

Return an anchor point of the layout element

Source code in `src/momapy/core.py`

    130
    131
    132
    def anchor_point(self, anchor_name: str) -> momapy.geometry.Point:
        """Return an anchor point of the layout element"""
        return getattr(self, anchor_name)()

#### `` angle

    angle(
        angle: float,
        unit: Literal["degrees", "radians"] = "degrees",
    ) -> Point

Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.

Source code in `src/momapy/core.py`

    817
    818
    819
    820
    821
    822
    823
    824
    825
    826
    827
    828
    def angle(
        self,
        angle: float,
        unit: typing.Literal["degrees", "radians"] = "degrees",
    ) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal."""
        return momapy.drawing.get_drawing_elements_angle(
            drawing_elements=self.drawing_elements(),
            angle=angle,
            unit=unit,
            center=self.center(),
        )

#### `` bbox

    bbox() -> Bbox

Compute and return the bounding box of the group layout element

Source code in `src/momapy/core.py`

    504
    505
    506
    507
    508
    509
    510
    511
    512
    513
    514
    515
    516
    517
    518
    519
    520
    521
    522
    523
    524
    525
    526
    def bbox(self) -> momapy.geometry.Bbox:
        """Compute and return the bounding box of the group layout element"""
        self_bbox = self.self_bbox()
        bboxes = [child.bbox() for child in self.children()]
        min_x = self_bbox.north_west().x
        min_y = self_bbox.north_west().y
        max_x = self_bbox.south_east().x
        max_y = self_bbox.south_east().y
        for bbox in bboxes:
            if bbox.north_west().x < min_x:
                min_x = bbox.north_west().x
            if bbox.north_west().y < min_y:
                min_y = bbox.north_west().y
            if bbox.south_east().x > max_x:
                max_x = bbox.south_east().x
            if bbox.south_east().y > max_y:
                max_y = bbox.south_east().y
        bbox = momapy.geometry.Bbox(
            momapy.geometry.Point(min_x / 2 + max_x / 2, min_y / 2 + max_y / 2),
            max_x - min_x,
            max_y - min_y,
        )
        return bbox

#### `` border

    border(point: Point) -> Point

Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point. When there are multiple intersection points, the one closest to the given point is returned

Source code in `src/momapy/core.py`

    794
    795
    796
    797
    798
    799
    800
    801
    802
    def border(self, point: momapy.geometry.Point) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point.
        When there are multiple intersection points, the one closest to the given point is returned
        """
        return momapy.drawing.get_drawing_elements_border(
            drawing_elements=self.drawing_elements(),
            point=point,
            center=self.center(),
        )

#### `` center

    center() -> Point

Return the center anchor of the node

Source code in `src/momapy/core.py`

    776
    777
    778
    def center(self) -> momapy.geometry.Point:
        """Return the center anchor of the node"""
        return self.position

#### `` childless

    childless() -> Self

Return a copy of the node with no children

Source code in `src/momapy/core.py`

    830
    831
    832
    def childless(self) -> typing.Self:
        """Return a copy of the node with no children"""
        return dataclasses.replace(self, label=None, layout_elements=tuple([]))

#### `` children

    children() -> list[LayoutElement]

Return the children of the group layout. These are the self children of the group layout (returned by the `self_children` method) and the other children of the group layout (given by the `layout_elements` attribute)

Source code in `src/momapy/core.py`

    566
    567
    568
    569
    570
    def children(self) -> list[LayoutElement]:
        """Return the children of the group layout.
        These are the self children of the group layout (returned by the `self_children` method) and the other children of the group layout (given by the `layout_elements` attribute)
        """
        return self.self_children() + list(self.layout_elements)

#### `` contains

    contains(other: LayoutElement) -> bool

Return `true` if another layout element is a descendant of the layout element, `false` otherwise

Source code in `src/momapy/core.py`

    119
    120
    121
    def contains(self, other: "LayoutElement") -> bool:
        """Return `true` if another layout element is a descendant of the layout element, `false` otherwise"""
        return other in self.descendants()

#### `` descendants

    descendants() -> list[LayoutElement]

Return the descendants of the layout element

Source code in `src/momapy/core.py`

    90
    91
    92
    93
    94
    95
    96
    def descendants(self) -> list["LayoutElement"]:
        """Return the descendants of the layout element"""
        descendants = []
        for child in self.children():
            descendants.append(child)
            descendants += child.descendants()
        return descendants

#### `` drawing_elements

    drawing_elements() -> list[DrawingElement]

Return the drawing elements of the group layout. The returned drawing elements are a group drawing element formed of the self drawing elements of the group layout and the drawing elements of its children

Source code in `src/momapy/core.py`

    538
    539
    540
    541
    542
    543
    544
    545
    546
    547
    548
    549
    550
    551
    552
    553
    554
    555
    556
    557
    558
    559
    560
    561
    562
    563
    564
    def drawing_elements(self) -> list[momapy.drawing.DrawingElement]:
        """Return the drawing elements of the group layout.
        The returned drawing elements are a group drawing element formed of the self drawing elements of the group layout and the drawing elements of its children
        """
        drawing_elements = self.self_drawing_elements()
        for child in self.children():
            if child is not None:
                drawing_elements += child.drawing_elements()
        group = momapy.drawing.Group(
            class_=f"{type(self).__name__}_group",
            elements=tuple(drawing_elements),
            id_=f"{self.id_}_group",
            fill=self.group_fill,
            fill_rule=self.group_fill_rule,
            filter=self.group_filter,
            font_family=self.group_font_family,
            font_size=self.group_font_size,
            font_style=self.group_font_style,
            font_weight=self.group_font_weight,
            stroke=self.group_stroke,
            stroke_dasharray=self.group_stroke_dasharray,
            stroke_dashoffset=self.group_stroke_dashoffset,
            stroke_width=self.group_stroke_width,
            text_anchor=self.group_text_anchor,
            transform=self.group_transform,
        )
        return [group]

#### `` east_north_east

    east_north_east() -> Point

Return the east north east anchor of the node

Source code in `src/momapy/core.py`

    700
    701
    702
    703
    704
    705
    706
    def east_north_east(self) -> momapy.geometry.Point:
        """Return the east north east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, -self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` east_south_east

    east_south_east() -> Point

Return the east south east west anchor of the node

Source code in `src/momapy/core.py`

    712
    713
    714
    715
    716
    717
    718
    def east_south_east(self) -> momapy.geometry.Point:
        """Return the east south east west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` equals

    equals(
        other: LayoutElement,
        flattened: bool = False,
        unordered: bool = False,
    ) -> bool

Return `true` if the layout element is equal to another layout element, `false` otherwise

Source code in `src/momapy/core.py`

    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    def equals(
        self, other: "LayoutElement", flattened: bool = False, unordered: bool = False
    ) -> bool:
        """Return `true` if the layout element is equal to another layout element, `false` otherwise"""
        if type(self) is type(other):
            if not flattened:
                return self == other
            else:
                if not unordered:
                    return self.flattened() == other.flattened()
                else:
                    return set(self.flattened()) == set(other.flattened())
        return False

#### `` flattened

    flattened() -> list[LayoutElement]

Return a list containing copy of the layout element with no children and all its descendants with no children

Source code in `src/momapy/core.py`

     98
     99
    100
    101
    102
    103
    def flattened(self) -> list["LayoutElement"]:
        """Return a list containing copy of the layout element with no children and all its descendants with no children"""
        flattened = [self.childless()]
        for child in self.children():
            flattened += child.flattened()
        return flattened

#### `` label_center

    label_center() -> Point

Return the label center anchor of the node

Source code in `src/momapy/core.py`

    780
    781
    782
    def label_center(self) -> momapy.geometry.Point:
        """Return the label center anchor of the node"""
        return self.position

#### `` north_east

    north_east() -> Point

Return the north east anchor of the node

Source code in `src/momapy/core.py`

    692
    693
    694
    695
    696
    697
    698
    def north_east(self) -> momapy.geometry.Point:
        """Return the north east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, -self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` north_north_east

    north_north_east() -> Point

Return the north north east anchor of the node

Source code in `src/momapy/core.py`

    684
    685
    686
    687
    688
    689
    690
    def north_north_east(self) -> momapy.geometry.Point:
        """Return the north north east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 4, -self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` north_north_west

    north_north_west() -> Point

Return the north north west anchor of the node

Source code in `src/momapy/core.py`

    672
    673
    674
    675
    676
    677
    678
    def north_north_west(self) -> momapy.geometry.Point:
        """Return the north north west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() - (self.width / 4, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` north_west

    north_west() -> Point

Return the north west anchor of the node

Source code in `src/momapy/core.py`

    664
    665
    666
    667
    668
    669
    670
    def north_west(self) -> momapy.geometry.Point:
        """Return the north west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() - (self.width / 2, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` self_angle

    self_angle(
        angle: float,
        unit: Literal["degrees", "radians"] = "degrees",
    ) -> Point

Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.

Source code in `src/momapy/core.py`

    804
    805
    806
    807
    808
    809
    810
    811
    812
    813
    814
    815
    def self_angle(
        self,
        angle: float,
        unit: typing.Literal["degrees", "radians"] = "degrees",
    ) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal."""
        return momapy.drawing.get_drawing_elements_angle(
            drawing_elements=self.self_drawing_elements(),
            angle=angle,
            unit=unit,
            center=self.center(),
        )

#### `` self_bbox

    self_bbox() -> Bbox

Compute and return the bounding box of the self drawing element of the group layout

Source code in `src/momapy/core.py`

    499
    500
    501
    502
    def self_bbox(self) -> momapy.geometry.Bbox:
        """Compute and return the bounding box of the self drawing element of the group layout"""
        bounds = self.self_to_shapely().bounds
        return momapy.geometry.Bbox.from_bounds(bounds)

#### `` self_border

    self_border(point: Point) -> Point

Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point. When there are multiple intersection points, the one closest to the given point is returned

Source code in `src/momapy/core.py`

    784
    785
    786
    787
    788
    789
    790
    791
    792
    def self_border(self, point: momapy.geometry.Point) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point.
        When there are multiple intersection points, the one closest to the given point is returned
        """
        return momapy.drawing.get_drawing_elements_border(
            drawing_elements=self.self_drawing_elements(),
            point=point,
            center=self.center(),
        )

#### `` self_children

    self_children() -> list[LayoutElement]

Return the self children of the node. A node has unique child that is its label

Source code in `src/momapy/core.py`

    654
    655
    656
    657
    658
    def self_children(self) -> list[LayoutElement]:
        """Return the self children of the node. A node has unique child that is its label"""
        if self.label is not None:
            return [self.label]
        return []

#### `` self_drawing_elements

    self_drawing_elements() -> list[DrawingElement]

Return the node's own drawing elements

Source code in `src/momapy/core.py`

    637
    638
    639
    640
    641
    642
    643
    644
    645
    646
    647
    648
    649
    650
    651
    652
    def self_drawing_elements(self) -> list[momapy.drawing.DrawingElement]:
        """Return the node's own drawing elements"""
        drawing_elements = self._border_drawing_elements()
        group = momapy.drawing.Group(
            class_=type(self).__name__,
            elements=tuple(drawing_elements),
            fill=self.fill,
            filter=self.filter,
            id_=self.id_,
            stroke=self.stroke,
            stroke_dasharray=self.stroke_dasharray,
            stroke_dashoffset=self.stroke_dashoffset,
            stroke_width=self.stroke_width,
            transform=self.transform,
        )
        return [group]

#### `` self_to_shapely

    self_to_shapely() -> GeometryCollection

Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout

Source code in `src/momapy/core.py`

    495
    496
    497
    def self_to_shapely(self) -> shapely.GeometryCollection:
        """Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout"""
        return momapy.drawing.drawing_elements_to_shapely(self.drawing_elements())

#### `` size

    size() -> tuple[float, float]

Return the size of the node

Source code in `src/momapy/core.py`

    660
    661
    662
    def size(self) -> tuple[float, float]:
        """Return the size of the node"""
        return (self.width, self.height)

#### `` south_east

    south_east() -> Point

Return the south east anchor of the node

Source code in `src/momapy/core.py`

    720
    721
    722
    723
    724
    725
    726
    def south_east(self) -> momapy.geometry.Point:
        """Return the south east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` south_south_east

    south_south_east() -> Point

Return the south south east anchor of the node

Source code in `src/momapy/core.py`

    728
    729
    730
    731
    732
    733
    734
    def south_south_east(self) -> momapy.geometry.Point:
        """Return the south south east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 4, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` south_south_west

    south_south_west() -> Point

Return the south south west anchor of the node

Source code in `src/momapy/core.py`

    740
    741
    742
    743
    744
    745
    746
    def south_south_west(self) -> momapy.geometry.Point:
        """Return the south south west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (-self.width / 4, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` south_west

    south_west() -> Point

Return the south west anchor of the node

Source code in `src/momapy/core.py`

    748
    749
    750
    751
    752
    753
    754
    def south_west(self) -> momapy.geometry.Point:
        """Return the south west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (-self.width / 2, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` to_shapely

    to_shapely(to_polygons: bool = False) -> GeometryCollection

Return a shapely collection of geometries reproducing the drawing elements of the layout element

Source code in `src/momapy/core.py`

    123
    124
    125
    126
    127
    128
    def to_shapely(self, to_polygons: bool = False) -> shapely.GeometryCollection:
        """Return a shapely collection of geometries reproducing the drawing elements of the layout element"""
        geom_collection = []
        for drawing_element in self.drawing_elements():
            geom_collection += drawing_element.to_shapely(to_polygons=to_polygons).geoms
        return shapely.GeometryCollection(geom_collection)

#### `` west_north_west

    west_north_west() -> Point

Return the west north west anchor of the node

Source code in `src/momapy/core.py`

    768
    769
    770
    771
    772
    773
    774
    def west_north_west(self) -> momapy.geometry.Point:
        """Return the west north west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() - (self.width / 2, self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` west_south_west

    west_south_west() -> Point

Return the west south west anchor of the node

Source code in `src/momapy/core.py`

    756
    757
    758
    759
    760
    761
    762
    def west_south_west(self) -> momapy.geometry.Point:
        """Return the west south west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (-self.width / 2, self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` x `property`

    x: float

Return the x coordinate of the node

#### `` y `property`

    y: float

Return the y coordinate of the node

### `` OrOperator `dataclass`

    OrOperator(
        *,
        id_: str = make_uuid4_as_str(),
        inputs: frozenset[LogicalOperatorInput] = frozenset(),
    )

Bases: `LogicalOperator`

Class for or operators

Parameters:

Name | Type | Description | Default
--- | --- | --- | ---
`id_` | `str` | The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element | `'25bd09fa-f6ab-421b-b015-c9745e5441ef'`
`inputs` | `frozenset[LogicalOperatorInput]` | The inputs of the logical operator | `<class 'frozenset'>`

### `` OrOperatorLayout `dataclass`

    OrOperatorLayout(
        fill: NoneValueType | Color | None = white,
        stroke: NoneValueType | Color | None = black,
        stroke_width: float | None = 1.25,
        *,
        id_: str = make_uuid4_as_str(),
        layout_elements: tuple[LayoutElement] = tuple(),
        group_fill: NoneValueType | Color | None = None,
        group_fill_rule: FillRule | None = None,
        group_filter: NoneValueType | Filter | None = None,
        group_font_family: str | None = None,
        group_font_size: float | None = None,
        group_font_style: FontStyle | None = None,
        group_font_weight: FontWeight | float | None = None,
        group_stroke: NoneValueType | Color | None = None,
        group_stroke_dasharray: tuple[float, ...] | None = None,
        group_stroke_dashoffset: float | None = None,
        group_stroke_width: float | None = None,
        group_text_anchor: TextAnchor | None = None,
        group_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        filter: NoneValueType | Filter | None = None,
        height: float = 30.0,
        label: TextLayout | None = None,
        position: Point,
        stroke_dasharray: tuple[float, ...] | None = None,
        stroke_dashoffset: float | None = None,
        transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        width: float = 30.0,
        direction: Direction = HORIZONTAL,
        left_to_right: bool = True,
        left_connector_length: float = 10.0,
        right_connector_length: float = 10.0,
        left_connector_stroke: NoneValueType
        | Color
        | None = None,
        left_connector_stroke_width: float | None = None,
        left_connector_stroke_dasharray: NoneValueType
        | tuple[float]
        | None = None,
        left_connector_stroke_dashoffset: float | None = None,
        left_connector_fill: NoneValueType
        | Color
        | None = None,
        left_connector_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        left_connector_filter: NoneValueType
        | Filter
        | None = None,
        right_connector_stroke: NoneValueType
        | Color
        | None = None,
        right_connector_stroke_width: float | None = None,
        right_connector_stroke_dasharray: NoneValueType
        | tuple[float]
        | None = None,
        right_connector_stroke_dashoffset: float | None = None,
        right_connector_fill: NoneValueType
        | Color
        | None = None,
        right_connector_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        right_connector_filter: NoneValueType
        | Filter
        | None = None,
    )

Bases: `_ConnectorsMixin`, `_SimpleMixin`, `_TextMixin`, `SBGNNode`

Class for or operator layouts

Parameters:

Name | Type | Description | Default
--- | --- | --- | ---
`id_` | `str` | The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element | `'7a845c1e-cf05-4edc-a075-4a48823b26cc'`
`layout_elements` | `tuple[LayoutElement]` | The sub-layout elements of the group layout. These are part of the children of the group layout | `<dynamic>`
`group_fill` | `NoneValueType | Color | None` | The fill color of the group layout | `None`
`group_fill_rule` | `FillRule | None` | The fill rule of the group layout | `None`
`group_filter` | `NoneValueType | Filter | None` | The filter of the group layout | `None`
`group_font_family` | `str | None` | The font family of the group layout | `None`
`group_font_size` | `float | None` | The font size of the group layout | `None`
`group_font_style` | `FontStyle | None` | The font style of the group layout | `None`
`group_font_weight` | `FontWeight | float | None` | The font weight of the group layout | `None`
`group_stroke` | `NoneValueType | Color | None` | The stroke color of the group layout | `None`
`group_stroke_dasharray` | `tuple[float, ...] | None` | The stroke dasharray of the group layout | `None`
`group_stroke_dashoffset` | `float | None` | The stroke dashoffset of the group layout | `None`
`group_stroke_width` | `float | None` | The stroke width of the group layout | `None`
`group_text_anchor` | `TextAnchor | None` | The text anchor of the group layout | `None`
`group_transform` | `NoneValueType | tuple[Transformation] | None` | The transform of the group layout | `None`
`fill` | `NoneValueType | Color | None` |  | `Color(red=255, green=255, blue=255, alpha=1.0)`
`filter` | `NoneValueType | Filter | None` | The filter of the node | `None`
`height` | `float` |  | `30.0`
`label` | `TextLayout | None` | The label of the node | `None`
`position` | `Point` | The position of the node | required
`stroke` | `NoneValueType | Color | None` |  | `Color(red=0, green=0, blue=0, alpha=1.0)`
`stroke_dasharray` | `tuple[float, ...] | None` | The stroke dasharray of the node | `None`
`stroke_dashoffset` | `float | None` | The stroke dashoffset of the node | `None`
`stroke_width` | `float | None` |  | `1.25`
`transform` | `NoneValueType | tuple[Transformation] | None` | The transform of the node | `None`
`width` | `float` |  | `30.0`
`direction` | `Direction` |  | `<Direction.HORIZONTAL: 1>`
`left_to_right` | `bool` |  | `True`
`left_connector_length` | `float` |  | `10.0`
`right_connector_length` | `float` |  | `10.0`
`left_connector_stroke` | `NoneValueType | Color | None` |  | `None`
`left_connector_stroke_width` | `float | None` |  | `None`
`left_connector_stroke_dasharray` | `NoneValueType | tuple[float] | None` |  | `None`
`left_connector_stroke_dashoffset` | `float | None` |  | `None`
`left_connector_fill` | `NoneValueType | Color | None` |  | `None`
`left_connector_transform` | `NoneValueType | tuple[Transformation] | None` |  | `None`
`left_connector_filter` | `NoneValueType | Filter | None` |  | `None`
`right_connector_stroke` | `NoneValueType | Color | None` |  | `None`
`right_connector_stroke_width` | `float | None` |  | `None`
`right_connector_stroke_dasharray` | `NoneValueType | tuple[float] | None` |  | `None`
`right_connector_stroke_dashoffset` | `float | None` |  | `None`
`right_connector_fill` | `NoneValueType | Color | None` |  | `None`
`right_connector_transform` | `NoneValueType | tuple[Transformation] | None` |  | `None`
`right_connector_filter` | `NoneValueType | Filter | None` |  | `None`

Methods:

Name | Description
--- | ---
`anchor_point` | Return an anchor point of the layout element
`angle` | Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.
`bbox` | Compute and return the bounding box of the group layout element
`border` | Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point.
`center` | Return the center anchor of the node
`childless` | Return a copy of the node with no children
`children` | Return the children of the group layout.
`contains` | Return `true` if another layout element is a descendant of the layout element, `false` otherwise
`descendants` | Return the descendants of the layout element
`drawing_elements` | Return the drawing elements of the group layout.
`east_north_east` | Return the east north east anchor of the node
`east_south_east` | Return the east south east west anchor of the node
`equals` | Return `true` if the layout element is equal to another layout element, `false` otherwise
`flattened` | Return a list containing copy of the layout element with no children and all its descendants with no children
`label_center` | Return the label center anchor of the node
`north_east` | Return the north east anchor of the node
`north_north_east` | Return the north north east anchor of the node
`north_north_west` | Return the north north west anchor of the node
`north_west` | Return the north west anchor of the node
`self_angle` | Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.
`self_bbox` | Compute and return the bounding box of the self drawing element of the group layout
`self_border` | Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point.
`self_children` | Return the self children of the node. A node has unique child that is its label
`self_drawing_elements` | Return the node's own drawing elements
`self_to_shapely` | Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout
`size` | Return the size of the node
`south_east` | Return the south east anchor of the node
`south_south_east` | Return the south south east anchor of the node
`south_south_west` | Return the south south west anchor of the node
`south_west` | Return the south west anchor of the node
`to_shapely` | Return a shapely collection of geometries reproducing the drawing elements of the layout element
`west_north_west` | Return the west north west anchor of the node
`west_south_west` | Return the west south west anchor of the node

Attributes:

Name | Type | Description
--- | --- | ---
`x` | `float` | Return the x coordinate of the node
`y` | `float` | Return the y coordinate of the node

#### `` anchor_point

    anchor_point(anchor_name: str) -> Point

Return an anchor point of the layout element

Source code in `src/momapy/core.py`

    130
    131
    132
    def anchor_point(self, anchor_name: str) -> momapy.geometry.Point:
        """Return an anchor point of the layout element"""
        return getattr(self, anchor_name)()

#### `` angle

    angle(
        angle: float,
        unit: Literal["degrees", "radians"] = "degrees",
    ) -> Point

Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.

Source code in `src/momapy/core.py`

    817
    818
    819
    820
    821
    822
    823
    824
    825
    826
    827
    828
    def angle(
        self,
        angle: float,
        unit: typing.Literal["degrees", "radians"] = "degrees",
    ) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal."""
        return momapy.drawing.get_drawing_elements_angle(
            drawing_elements=self.drawing_elements(),
            angle=angle,
            unit=unit,
            center=self.center(),
        )

#### `` bbox

    bbox() -> Bbox

Compute and return the bounding box of the group layout element

Source code in `src/momapy/core.py`

    504
    505
    506
    507
    508
    509
    510
    511
    512
    513
    514
    515
    516
    517
    518
    519
    520
    521
    522
    523
    524
    525
    526
    def bbox(self) -> momapy.geometry.Bbox:
        """Compute and return the bounding box of the group layout element"""
        self_bbox = self.self_bbox()
        bboxes = [child.bbox() for child in self.children()]
        min_x = self_bbox.north_west().x
        min_y = self_bbox.north_west().y
        max_x = self_bbox.south_east().x
        max_y = self_bbox.south_east().y
        for bbox in bboxes:
            if bbox.north_west().x < min_x:
                min_x = bbox.north_west().x
            if bbox.north_west().y < min_y:
                min_y = bbox.north_west().y
            if bbox.south_east().x > max_x:
                max_x = bbox.south_east().x
            if bbox.south_east().y > max_y:
                max_y = bbox.south_east().y
        bbox = momapy.geometry.Bbox(
            momapy.geometry.Point(min_x / 2 + max_x / 2, min_y / 2 + max_y / 2),
            max_x - min_x,
            max_y - min_y,
        )
        return bbox

#### `` border

    border(point: Point) -> Point

Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point. When there are multiple intersection points, the one closest to the given point is returned

Source code in `src/momapy/core.py`

    794
    795
    796
    797
    798
    799
    800
    801
    802
    def border(self, point: momapy.geometry.Point) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point.
        When there are multiple intersection points, the one closest to the given point is returned
        """
        return momapy.drawing.get_drawing_elements_border(
            drawing_elements=self.drawing_elements(),
            point=point,
            center=self.center(),
        )

#### `` center

    center() -> Point

Return the center anchor of the node

Source code in `src/momapy/core.py`

    776
    777
    778
    def center(self) -> momapy.geometry.Point:
        """Return the center anchor of the node"""
        return self.position

#### `` childless

    childless() -> Self

Return a copy of the node with no children

Source code in `src/momapy/core.py`

    830
    831
    832
    def childless(self) -> typing.Self:
        """Return a copy of the node with no children"""
        return dataclasses.replace(self, label=None, layout_elements=tuple([]))

#### `` children

    children() -> list[LayoutElement]

Return the children of the group layout. These are the self children of the group layout (returned by the `self_children` method) and the other children of the group layout (given by the `layout_elements` attribute)

Source code in `src/momapy/core.py`

    566
    567
    568
    569
    570
    def children(self) -> list[LayoutElement]:
        """Return the children of the group layout.
        These are the self children of the group layout (returned by the `self_children` method) and the other children of the group layout (given by the `layout_elements` attribute)
        """
        return self.self_children() + list(self.layout_elements)

#### `` contains

    contains(other: LayoutElement) -> bool

Return `true` if another layout element is a descendant of the layout element, `false` otherwise

Source code in `src/momapy/core.py`

    119
    120
    121
    def contains(self, other: "LayoutElement") -> bool:
        """Return `true` if another layout element is a descendant of the layout element, `false` otherwise"""
        return other in self.descendants()

#### `` descendants

    descendants() -> list[LayoutElement]

Return the descendants of the layout element

Source code in `src/momapy/core.py`

    90
    91
    92
    93
    94
    95
    96
    def descendants(self) -> list["LayoutElement"]:
        """Return the descendants of the layout element"""
        descendants = []
        for child in self.children():
            descendants.append(child)
            descendants += child.descendants()
        return descendants

#### `` drawing_elements

    drawing_elements() -> list[DrawingElement]

Return the drawing elements of the group layout. The returned drawing elements are a group drawing element formed of the self drawing elements of the group layout and the drawing elements of its children

Source code in `src/momapy/core.py`

    538
    539
    540
    541
    542
    543
    544
    545
    546
    547
    548
    549
    550
    551
    552
    553
    554
    555
    556
    557
    558
    559
    560
    561
    562
    563
    564
    def drawing_elements(self) -> list[momapy.drawing.DrawingElement]:
        """Return the drawing elements of the group layout.
        The returned drawing elements are a group drawing element formed of the self drawing elements of the group layout and the drawing elements of its children
        """
        drawing_elements = self.self_drawing_elements()
        for child in self.children():
            if child is not None:
                drawing_elements += child.drawing_elements()
        group = momapy.drawing.Group(
            class_=f"{type(self).__name__}_group",
            elements=tuple(drawing_elements),
            id_=f"{self.id_}_group",
            fill=self.group_fill,
            fill_rule=self.group_fill_rule,
            filter=self.group_filter,
            font_family=self.group_font_family,
            font_size=self.group_font_size,
            font_style=self.group_font_style,
            font_weight=self.group_font_weight,
            stroke=self.group_stroke,
            stroke_dasharray=self.group_stroke_dasharray,
            stroke_dashoffset=self.group_stroke_dashoffset,
            stroke_width=self.group_stroke_width,
            text_anchor=self.group_text_anchor,
            transform=self.group_transform,
        )
        return [group]

#### `` east_north_east

    east_north_east() -> Point

Return the east north east anchor of the node

Source code in `src/momapy/core.py`

    700
    701
    702
    703
    704
    705
    706
    def east_north_east(self) -> momapy.geometry.Point:
        """Return the east north east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, -self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` east_south_east

    east_south_east() -> Point

Return the east south east west anchor of the node

Source code in `src/momapy/core.py`

    712
    713
    714
    715
    716
    717
    718
    def east_south_east(self) -> momapy.geometry.Point:
        """Return the east south east west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` equals

    equals(
        other: LayoutElement,
        flattened: bool = False,
        unordered: bool = False,
    ) -> bool

Return `true` if the layout element is equal to another layout element, `false` otherwise

Source code in `src/momapy/core.py`

    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    def equals(
        self, other: "LayoutElement", flattened: bool = False, unordered: bool = False
    ) -> bool:
        """Return `true` if the layout element is equal to another layout element, `false` otherwise"""
        if type(self) is type(other):
            if not flattened:
                return self == other
            else:
                if not unordered:
                    return self.flattened() == other.flattened()
                else:
                    return set(self.flattened()) == set(other.flattened())
        return False

#### `` flattened

    flattened() -> list[LayoutElement]

Return a list containing copy of the layout element with no children and all its descendants with no children

Source code in `src/momapy/core.py`

     98
     99
    100
    101
    102
    103
    def flattened(self) -> list["LayoutElement"]:
        """Return a list containing copy of the layout element with no children and all its descendants with no children"""
        flattened = [self.childless()]
        for child in self.children():
            flattened += child.flattened()
        return flattened

#### `` label_center

    label_center() -> Point

Return the label center anchor of the node

Source code in `src/momapy/core.py`

    780
    781
    782
    def label_center(self) -> momapy.geometry.Point:
        """Return the label center anchor of the node"""
        return self.position

#### `` north_east

    north_east() -> Point

Return the north east anchor of the node

Source code in `src/momapy/core.py`

    692
    693
    694
    695
    696
    697
    698
    def north_east(self) -> momapy.geometry.Point:
        """Return the north east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, -self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` north_north_east

    north_north_east() -> Point

Return the north north east anchor of the node

Source code in `src/momapy/core.py`

    684
    685
    686
    687
    688
    689
    690
    def north_north_east(self) -> momapy.geometry.Point:
        """Return the north north east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 4, -self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` north_north_west

    north_north_west() -> Point

Return the north north west anchor of the node

Source code in `src/momapy/core.py`

    672
    673
    674
    675
    676
    677
    678
    def north_north_west(self) -> momapy.geometry.Point:
        """Return the north north west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() - (self.width / 4, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` north_west

    north_west() -> Point

Return the north west anchor of the node

Source code in `src/momapy/core.py`

    664
    665
    666
    667
    668
    669
    670
    def north_west(self) -> momapy.geometry.Point:
        """Return the north west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() - (self.width / 2, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` self_angle

    self_angle(
        angle: float,
        unit: Literal["degrees", "radians"] = "degrees",
    ) -> Point

Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.

Source code in `src/momapy/core.py`

    804
    805
    806
    807
    808
    809
    810
    811
    812
    813
    814
    815
    def self_angle(
        self,
        angle: float,
        unit: typing.Literal["degrees", "radians"] = "degrees",
    ) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal."""
        return momapy.drawing.get_drawing_elements_angle(
            drawing_elements=self.self_drawing_elements(),
            angle=angle,
            unit=unit,
            center=self.center(),
        )

#### `` self_bbox

    self_bbox() -> Bbox

Compute and return the bounding box of the self drawing element of the group layout

Source code in `src/momapy/core.py`

    499
    500
    501
    502
    def self_bbox(self) -> momapy.geometry.Bbox:
        """Compute and return the bounding box of the self drawing element of the group layout"""
        bounds = self.self_to_shapely().bounds
        return momapy.geometry.Bbox.from_bounds(bounds)

#### `` self_border

    self_border(point: Point) -> Point

Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point. When there are multiple intersection points, the one closest to the given point is returned

Source code in `src/momapy/core.py`

    784
    785
    786
    787
    788
    789
    790
    791
    792
    def self_border(self, point: momapy.geometry.Point) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point.
        When there are multiple intersection points, the one closest to the given point is returned
        """
        return momapy.drawing.get_drawing_elements_border(
            drawing_elements=self.self_drawing_elements(),
            point=point,
            center=self.center(),
        )

#### `` self_children

    self_children() -> list[LayoutElement]

Return the self children of the node. A node has unique child that is its label

Source code in `src/momapy/core.py`

    654
    655
    656
    657
    658
    def self_children(self) -> list[LayoutElement]:
        """Return the self children of the node. A node has unique child that is its label"""
        if self.label is not None:
            return [self.label]
        return []

#### `` self_drawing_elements

    self_drawing_elements() -> list[DrawingElement]

Return the node's own drawing elements

Source code in `src/momapy/core.py`

    637
    638
    639
    640
    641
    642
    643
    644
    645
    646
    647
    648
    649
    650
    651
    652
    def self_drawing_elements(self) -> list[momapy.drawing.DrawingElement]:
        """Return the node's own drawing elements"""
        drawing_elements = self._border_drawing_elements()
        group = momapy.drawing.Group(
            class_=type(self).__name__,
            elements=tuple(drawing_elements),
            fill=self.fill,
            filter=self.filter,
            id_=self.id_,
            stroke=self.stroke,
            stroke_dasharray=self.stroke_dasharray,
            stroke_dashoffset=self.stroke_dashoffset,
            stroke_width=self.stroke_width,
            transform=self.transform,
        )
        return [group]

#### `` self_to_shapely

    self_to_shapely() -> GeometryCollection

Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout

Source code in `src/momapy/core.py`

    495
    496
    497
    def self_to_shapely(self) -> shapely.GeometryCollection:
        """Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout"""
        return momapy.drawing.drawing_elements_to_shapely(self.drawing_elements())

#### `` size

    size() -> tuple[float, float]

Return the size of the node

Source code in `src/momapy/core.py`

    660
    661
    662
    def size(self) -> tuple[float, float]:
        """Return the size of the node"""
        return (self.width, self.height)

#### `` south_east

    south_east() -> Point

Return the south east anchor of the node

Source code in `src/momapy/core.py`

    720
    721
    722
    723
    724
    725
    726
    def south_east(self) -> momapy.geometry.Point:
        """Return the south east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` south_south_east

    south_south_east() -> Point

Return the south south east anchor of the node

Source code in `src/momapy/core.py`

    728
    729
    730
    731
    732
    733
    734
    def south_south_east(self) -> momapy.geometry.Point:
        """Return the south south east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 4, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` south_south_west

    south_south_west() -> Point

Return the south south west anchor of the node

Source code in `src/momapy/core.py`

    740
    741
    742
    743
    744
    745
    746
    def south_south_west(self) -> momapy.geometry.Point:
        """Return the south south west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (-self.width / 4, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` south_west

    south_west() -> Point

Return the south west anchor of the node

Source code in `src/momapy/core.py`

    748
    749
    750
    751
    752
    753
    754
    def south_west(self) -> momapy.geometry.Point:
        """Return the south west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (-self.width / 2, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` to_shapely

    to_shapely(to_polygons: bool = False) -> GeometryCollection

Return a shapely collection of geometries reproducing the drawing elements of the layout element

Source code in `src/momapy/core.py`

    123
    124
    125
    126
    127
    128
    def to_shapely(self, to_polygons: bool = False) -> shapely.GeometryCollection:
        """Return a shapely collection of geometries reproducing the drawing elements of the layout element"""
        geom_collection = []
        for drawing_element in self.drawing_elements():
            geom_collection += drawing_element.to_shapely(to_polygons=to_polygons).geoms
        return shapely.GeometryCollection(geom_collection)

#### `` west_north_west

    west_north_west() -> Point

Return the west north west anchor of the node

Source code in `src/momapy/core.py`

    768
    769
    770
    771
    772
    773
    774
    def west_north_west(self) -> momapy.geometry.Point:
        """Return the west north west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() - (self.width / 2, self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` west_south_west

    west_south_west() -> Point

Return the west south west anchor of the node

Source code in `src/momapy/core.py`

    756
    757
    758
    759
    760
    761
    762
    def west_south_west(self) -> momapy.geometry.Point:
        """Return the west south west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (-self.width / 2, self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` x `property`

    x: float

Return the x coordinate of the node

#### `` y `property`

    y: float

Return the y coordinate of the node

### `` PerturbingAgent `dataclass`

    PerturbingAgent(
        *,
        id_: str = make_uuid4_as_str(),
        compartment: Compartment | None = None,
        label: str | None = None,
    )

Bases: `EntityPool`

Class for perturbing agents

Parameters:

Name | Type | Description | Default
--- | --- | --- | ---
`id_` | `str` | The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element | `'b1e534e2-8c1d-4256-847a-1899e0110ead'`
`compartment` | `Compartment | None` | The compartment of the entity pool | `None`
`label` | `str | None` | The label of the perturbing agent | `None`

### `` PerturbingAgentLayout `dataclass`

    PerturbingAgentLayout(
        fill: NoneValueType | Color | None = white,
        stroke: NoneValueType | Color | None = black,
        stroke_width: float | None = 1.25,
        *,
        id_: str = make_uuid4_as_str(),
        layout_elements: tuple[LayoutElement] = tuple(),
        group_fill: NoneValueType | Color | None = None,
        group_fill_rule: FillRule | None = None,
        group_filter: NoneValueType | Filter | None = None,
        group_font_family: str | None = None,
        group_font_size: float | None = None,
        group_font_style: FontStyle | None = None,
        group_font_weight: FontWeight | float | None = None,
        group_stroke: NoneValueType | Color | None = None,
        group_stroke_dasharray: tuple[float, ...] | None = None,
        group_stroke_dashoffset: float | None = None,
        group_stroke_width: float | None = None,
        group_text_anchor: TextAnchor | None = None,
        group_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        filter: NoneValueType | Filter | None = None,
        height: float = 30.0,
        label: TextLayout | None = None,
        position: Point,
        stroke_dasharray: tuple[float, ...] | None = None,
        stroke_dashoffset: float | None = None,
        transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        width: float = 60.0,
        angle: float = 70.0,
    )

Bases: `_SimpleMixin`, `SBGNNode`

Class for perturbing agent layouts

Parameters:

Name | Type | Description | Default
--- | --- | --- | ---
`id_` | `str` | The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element | `'8a8152de-811e-45db-ab68-ed019f2d869d'`
`layout_elements` | `tuple[LayoutElement]` | The sub-layout elements of the group layout. These are part of the children of the group layout | `<dynamic>`
`group_fill` | `NoneValueType | Color | None` | The fill color of the group layout | `None`
`group_fill_rule` | `FillRule | None` | The fill rule of the group layout | `None`
`group_filter` | `NoneValueType | Filter | None` | The filter of the group layout | `None`
`group_font_family` | `str | None` | The font family of the group layout | `None`
`group_font_size` | `float | None` | The font size of the group layout | `None`
`group_font_style` | `FontStyle | None` | The font style of the group layout | `None`
`group_font_weight` | `FontWeight | float | None` | The font weight of the group layout | `None`
`group_stroke` | `NoneValueType | Color | None` | The stroke color of the group layout | `None`
`group_stroke_dasharray` | `tuple[float, ...] | None` | The stroke dasharray of the group layout | `None`
`group_stroke_dashoffset` | `float | None` | The stroke dashoffset of the group layout | `None`
`group_stroke_width` | `float | None` | The stroke width of the group layout | `None`
`group_text_anchor` | `TextAnchor | None` | The text anchor of the group layout | `None`
`group_transform` | `NoneValueType | tuple[Transformation] | None` | The transform of the group layout | `None`
`fill` | `NoneValueType | Color | None` |  | `Color(red=255, green=255, blue=255, alpha=1.0)`
`filter` | `NoneValueType | Filter | None` | The filter of the node | `None`
`height` | `float` |  | `30.0`
`label` | `TextLayout | None` | The label of the node | `None`
`position` | `Point` | The position of the node | required
`stroke` | `NoneValueType | Color | None` |  | `Color(red=0, green=0, blue=0, alpha=1.0)`
`stroke_dasharray` | `tuple[float, ...] | None` | The stroke dasharray of the node | `None`
`stroke_dashoffset` | `float | None` | The stroke dashoffset of the node | `None`
`stroke_width` | `float | None` |  | `1.25`
`transform` | `NoneValueType | tuple[Transformation] | None` | The transform of the node | `None`
`width` | `float` |  | `60.0`
`angle` | `float` |  | `70.0`

Methods:

Name | Description
--- | ---
`anchor_point` | Return an anchor point of the layout element
`bbox` | Compute and return the bounding box of the group layout element
`border` | Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point.
`center` | Return the center anchor of the node
`childless` | Return a copy of the node with no children
`children` | Return the children of the group layout.
`contains` | Return `true` if another layout element is a descendant of the layout element, `false` otherwise
`descendants` | Return the descendants of the layout element
`drawing_elements` | Return the drawing elements of the group layout.
`east` | Return the east anchor of the node
`east_north_east` | Return the east north east anchor of the node
`east_south_east` | Return the east south east west anchor of the node
`equals` | Return `true` if the layout element is equal to another layout element, `false` otherwise
`flattened` | Return a list containing copy of the layout element with no children and all its descendants with no children
`label_center` | Return the label center anchor of the node
`north` | Return the north anchor of the node
`north_east` | Return the north east anchor of the node
`north_north_east` | Return the north north east anchor of the node
`north_north_west` | Return the north north west anchor of the node
`north_west` | Return the north west anchor of the node
`self_angle` | Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.
`self_bbox` | Compute and return the bounding box of the self drawing element of the group layout
`self_border` | Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point.
`self_children` | Return the self children of the node. A node has unique child that is its label
`self_drawing_elements` | Return the node's own drawing elements
`self_to_shapely` | Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout
`size` | Return the size of the node
`south` | Return the south anchor of the node
`south_east` | Return the south east anchor of the node
`south_south_east` | Return the south south east anchor of the node
`south_south_west` | Return the south south west anchor of the node
`south_west` | Return the south west anchor of the node
`to_shapely` | Return a shapely collection of geometries reproducing the drawing elements of the layout element
`west` | Return the west anchor of the node
`west_north_west` | Return the west north west anchor of the node
`west_south_west` | Return the west south west anchor of the node

Attributes:

Name | Type | Description
--- | --- | ---
`angle` | `float` | Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.
`x` | `float` | Return the x coordinate of the node
`y` | `float` | Return the y coordinate of the node

#### `` anchor_point

    anchor_point(anchor_name: str) -> Point

Return an anchor point of the layout element

Source code in `src/momapy/core.py`

    130
    131
    132
    def anchor_point(self, anchor_name: str) -> momapy.geometry.Point:
        """Return an anchor point of the layout element"""
        return getattr(self, anchor_name)()

#### `` angle `class-attribute` `instance-attribute`

    angle: float = 70.0

Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.

#### `` bbox

    bbox() -> Bbox

Compute and return the bounding box of the group layout element

Source code in `src/momapy/core.py`

    504
    505
    506
    507
    508
    509
    510
    511
    512
    513
    514
    515
    516
    517
    518
    519
    520
    521
    522
    523
    524
    525
    526
    def bbox(self) -> momapy.geometry.Bbox:
        """Compute and return the bounding box of the group layout element"""
        self_bbox = self.self_bbox()
        bboxes = [child.bbox() for child in self.children()]
        min_x = self_bbox.north_west().x
        min_y = self_bbox.north_west().y
        max_x = self_bbox.south_east().x
        max_y = self_bbox.south_east().y
        for bbox in bboxes:
            if bbox.north_west().x < min_x:
                min_x = bbox.north_west().x
            if bbox.north_west().y < min_y:
                min_y = bbox.north_west().y
            if bbox.south_east().x > max_x:
                max_x = bbox.south_east().x
            if bbox.south_east().y > max_y:
                max_y = bbox.south_east().y
        bbox = momapy.geometry.Bbox(
            momapy.geometry.Point(min_x / 2 + max_x / 2, min_y / 2 + max_y / 2),
            max_x - min_x,
            max_y - min_y,
        )
        return bbox

#### `` border

    border(point: Point) -> Point

Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point. When there are multiple intersection points, the one closest to the given point is returned

Source code in `src/momapy/core.py`

    794
    795
    796
    797
    798
    799
    800
    801
    802
    def border(self, point: momapy.geometry.Point) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point.
        When there are multiple intersection points, the one closest to the given point is returned
        """
        return momapy.drawing.get_drawing_elements_border(
            drawing_elements=self.drawing_elements(),
            point=point,
            center=self.center(),
        )

#### `` center

    center() -> Point

Return the center anchor of the node

Source code in `src/momapy/core.py`

    776
    777
    778
    def center(self) -> momapy.geometry.Point:
        """Return the center anchor of the node"""
        return self.position

#### `` childless

    childless() -> Self

Return a copy of the node with no children

Source code in `src/momapy/core.py`

    830
    831
    832
    def childless(self) -> typing.Self:
        """Return a copy of the node with no children"""
        return dataclasses.replace(self, label=None, layout_elements=tuple([]))

#### `` children

    children() -> list[LayoutElement]

Return the children of the group layout. These are the self children of the group layout (returned by the `self_children` method) and the other children of the group layout (given by the `layout_elements` attribute)

Source code in `src/momapy/core.py`

    566
    567
    568
    569
    570
    def children(self) -> list[LayoutElement]:
        """Return the children of the group layout.
        These are the self children of the group layout (returned by the `self_children` method) and the other children of the group layout (given by the `layout_elements` attribute)
        """
        return self.self_children() + list(self.layout_elements)

#### `` contains

    contains(other: LayoutElement) -> bool

Return `true` if another layout element is a descendant of the layout element, `false` otherwise

Source code in `src/momapy/core.py`

    119
    120
    121
    def contains(self, other: "LayoutElement") -> bool:
        """Return `true` if another layout element is a descendant of the layout element, `false` otherwise"""
        return other in self.descendants()

#### `` descendants

    descendants() -> list[LayoutElement]

Return the descendants of the layout element

Source code in `src/momapy/core.py`

    90
    91
    92
    93
    94
    95
    96
    def descendants(self) -> list["LayoutElement"]:
        """Return the descendants of the layout element"""
        descendants = []
        for child in self.children():
            descendants.append(child)
            descendants += child.descendants()
        return descendants

#### `` drawing_elements

    drawing_elements() -> list[DrawingElement]

Return the drawing elements of the group layout. The returned drawing elements are a group drawing element formed of the self drawing elements of the group layout and the drawing elements of its children

Source code in `src/momapy/core.py`

    538
    539
    540
    541
    542
    543
    544
    545
    546
    547
    548
    549
    550
    551
    552
    553
    554
    555
    556
    557
    558
    559
    560
    561
    562
    563
    564
    def drawing_elements(self) -> list[momapy.drawing.DrawingElement]:
        """Return the drawing elements of the group layout.
        The returned drawing elements are a group drawing element formed of the self drawing elements of the group layout and the drawing elements of its children
        """
        drawing_elements = self.self_drawing_elements()
        for child in self.children():
            if child is not None:
                drawing_elements += child.drawing_elements()
        group = momapy.drawing.Group(
            class_=f"{type(self).__name__}_group",
            elements=tuple(drawing_elements),
            id_=f"{self.id_}_group",
            fill=self.group_fill,
            fill_rule=self.group_fill_rule,
            filter=self.group_filter,
            font_family=self.group_font_family,
            font_size=self.group_font_size,
            font_style=self.group_font_style,
            font_weight=self.group_font_weight,
            stroke=self.group_stroke,
            stroke_dasharray=self.group_stroke_dasharray,
            stroke_dashoffset=self.group_stroke_dashoffset,
            stroke_width=self.group_stroke_width,
            text_anchor=self.group_text_anchor,
            transform=self.group_transform,
        )
        return [group]

#### `` east

    east() -> Point

Return the east anchor of the node

Source code in `src/momapy/core.py`

    708
    709
    710
    def east(self) -> momapy.geometry.Point:
        """Return the east anchor of the node"""
        return self.self_angle(0)

#### `` east_north_east

    east_north_east() -> Point

Return the east north east anchor of the node

Source code in `src/momapy/core.py`

    700
    701
    702
    703
    704
    705
    706
    def east_north_east(self) -> momapy.geometry.Point:
        """Return the east north east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, -self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` east_south_east

    east_south_east() -> Point

Return the east south east west anchor of the node

Source code in `src/momapy/core.py`

    712
    713
    714
    715
    716
    717
    718
    def east_south_east(self) -> momapy.geometry.Point:
        """Return the east south east west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` equals

    equals(
        other: LayoutElement,
        flattened: bool = False,
        unordered: bool = False,
    ) -> bool

Return `true` if the layout element is equal to another layout element, `false` otherwise

Source code in `src/momapy/core.py`

    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    def equals(
        self, other: "LayoutElement", flattened: bool = False, unordered: bool = False
    ) -> bool:
        """Return `true` if the layout element is equal to another layout element, `false` otherwise"""
        if type(self) is type(other):
            if not flattened:
                return self == other
            else:
                if not unordered:
                    return self.flattened() == other.flattened()
                else:
                    return set(self.flattened()) == set(other.flattened())
        return False

#### `` flattened

    flattened() -> list[LayoutElement]

Return a list containing copy of the layout element with no children and all its descendants with no children

Source code in `src/momapy/core.py`

     98
     99
    100
    101
    102
    103
    def flattened(self) -> list["LayoutElement"]:
        """Return a list containing copy of the layout element with no children and all its descendants with no children"""
        flattened = [self.childless()]
        for child in self.children():
            flattened += child.flattened()
        return flattened

#### `` label_center

    label_center() -> Point

Return the label center anchor of the node

Source code in `src/momapy/core.py`

    780
    781
    782
    def label_center(self) -> momapy.geometry.Point:
        """Return the label center anchor of the node"""
        return self.position

#### `` north

    north() -> Point

Return the north anchor of the node

Source code in `src/momapy/core.py`

    680
    681
    682
    def north(self) -> momapy.geometry.Point:
        """Return the north anchor of the node"""
        return self.self_angle(90)

#### `` north_east

    north_east() -> Point

Return the north east anchor of the node

Source code in `src/momapy/core.py`

    692
    693
    694
    695
    696
    697
    698
    def north_east(self) -> momapy.geometry.Point:
        """Return the north east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, -self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` north_north_east

    north_north_east() -> Point

Return the north north east anchor of the node

Source code in `src/momapy/core.py`

    684
    685
    686
    687
    688
    689
    690
    def north_north_east(self) -> momapy.geometry.Point:
        """Return the north north east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 4, -self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` north_north_west

    north_north_west() -> Point

Return the north north west anchor of the node

Source code in `src/momapy/core.py`

    672
    673
    674
    675
    676
    677
    678
    def north_north_west(self) -> momapy.geometry.Point:
        """Return the north north west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() - (self.width / 4, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` north_west

    north_west() -> Point

Return the north west anchor of the node

Source code in `src/momapy/core.py`

    664
    665
    666
    667
    668
    669
    670
    def north_west(self) -> momapy.geometry.Point:
        """Return the north west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() - (self.width / 2, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` self_angle

    self_angle(
        angle: float,
        unit: Literal["degrees", "radians"] = "degrees",
    ) -> Point

Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.

Source code in `src/momapy/core.py`

    804
    805
    806
    807
    808
    809
    810
    811
    812
    813
    814
    815
    def self_angle(
        self,
        angle: float,
        unit: typing.Literal["degrees", "radians"] = "degrees",
    ) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal."""
        return momapy.drawing.get_drawing_elements_angle(
            drawing_elements=self.self_drawing_elements(),
            angle=angle,
            unit=unit,
            center=self.center(),
        )

#### `` self_bbox

    self_bbox() -> Bbox

Compute and return the bounding box of the self drawing element of the group layout

Source code in `src/momapy/core.py`

    499
    500
    501
    502
    def self_bbox(self) -> momapy.geometry.Bbox:
        """Compute and return the bounding box of the self drawing element of the group layout"""
        bounds = self.self_to_shapely().bounds
        return momapy.geometry.Bbox.from_bounds(bounds)

#### `` self_border

    self_border(point: Point) -> Point

Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point. When there are multiple intersection points, the one closest to the given point is returned

Source code in `src/momapy/core.py`

    784
    785
    786
    787
    788
    789
    790
    791
    792
    def self_border(self, point: momapy.geometry.Point) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point.
        When there are multiple intersection points, the one closest to the given point is returned
        """
        return momapy.drawing.get_drawing_elements_border(
            drawing_elements=self.self_drawing_elements(),
            point=point,
            center=self.center(),
        )

#### `` self_children

    self_children() -> list[LayoutElement]

Return the self children of the node. A node has unique child that is its label

Source code in `src/momapy/core.py`

    654
    655
    656
    657
    658
    def self_children(self) -> list[LayoutElement]:
        """Return the self children of the node. A node has unique child that is its label"""
        if self.label is not None:
            return [self.label]
        return []

#### `` self_drawing_elements

    self_drawing_elements() -> list[DrawingElement]

Return the node's own drawing elements

Source code in `src/momapy/core.py`

    637
    638
    639
    640
    641
    642
    643
    644
    645
    646
    647
    648
    649
    650
    651
    652
    def self_drawing_elements(self) -> list[momapy.drawing.DrawingElement]:
        """Return the node's own drawing elements"""
        drawing_elements = self._border_drawing_elements()
        group = momapy.drawing.Group(
            class_=type(self).__name__,
            elements=tuple(drawing_elements),
            fill=self.fill,
            filter=self.filter,
            id_=self.id_,
            stroke=self.stroke,
            stroke_dasharray=self.stroke_dasharray,
            stroke_dashoffset=self.stroke_dashoffset,
            stroke_width=self.stroke_width,
            transform=self.transform,
        )
        return [group]

#### `` self_to_shapely

    self_to_shapely() -> GeometryCollection

Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout

Source code in `src/momapy/core.py`

    495
    496
    497
    def self_to_shapely(self) -> shapely.GeometryCollection:
        """Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout"""
        return momapy.drawing.drawing_elements_to_shapely(self.drawing_elements())

#### `` size

    size() -> tuple[float, float]

Return the size of the node

Source code in `src/momapy/core.py`

    660
    661
    662
    def size(self) -> tuple[float, float]:
        """Return the size of the node"""
        return (self.width, self.height)

#### `` south

    south() -> Point

Return the south anchor of the node

Source code in `src/momapy/core.py`

    736
    737
    738
    def south(self) -> momapy.geometry.Point:
        """Return the south anchor of the node"""
        return self.self_angle(270)

#### `` south_east

    south_east() -> Point

Return the south east anchor of the node

Source code in `src/momapy/core.py`

    720
    721
    722
    723
    724
    725
    726
    def south_east(self) -> momapy.geometry.Point:
        """Return the south east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` south_south_east

    south_south_east() -> Point

Return the south south east anchor of the node

Source code in `src/momapy/core.py`

    728
    729
    730
    731
    732
    733
    734
    def south_south_east(self) -> momapy.geometry.Point:
        """Return the south south east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 4, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` south_south_west

    south_south_west() -> Point

Return the south south west anchor of the node

Source code in `src/momapy/core.py`

    740
    741
    742
    743
    744
    745
    746
    def south_south_west(self) -> momapy.geometry.Point:
        """Return the south south west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (-self.width / 4, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` south_west

    south_west() -> Point

Return the south west anchor of the node

Source code in `src/momapy/core.py`

    748
    749
    750
    751
    752
    753
    754
    def south_west(self) -> momapy.geometry.Point:
        """Return the south west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (-self.width / 2, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` to_shapely

    to_shapely(to_polygons: bool = False) -> GeometryCollection

Return a shapely collection of geometries reproducing the drawing elements of the layout element

Source code in `src/momapy/core.py`

    123
    124
    125
    126
    127
    128
    def to_shapely(self, to_polygons: bool = False) -> shapely.GeometryCollection:
        """Return a shapely collection of geometries reproducing the drawing elements of the layout element"""
        geom_collection = []
        for drawing_element in self.drawing_elements():
            geom_collection += drawing_element.to_shapely(to_polygons=to_polygons).geoms
        return shapely.GeometryCollection(geom_collection)

#### `` west

    west() -> Point

Return the west anchor of the node

Source code in `src/momapy/core.py`

    764
    765
    766
    def west(self) -> momapy.geometry.Point:
        """Return the west anchor of the node"""
        return self.self_angle(180)

#### `` west_north_west

    west_north_west() -> Point

Return the west north west anchor of the node

Source code in `src/momapy/core.py`

    768
    769
    770
    771
    772
    773
    774
    def west_north_west(self) -> momapy.geometry.Point:
        """Return the west north west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() - (self.width / 2, self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` west_south_west

    west_south_west() -> Point

Return the west south west anchor of the node

Source code in `src/momapy/core.py`

    756
    757
    758
    759
    760
    761
    762
    def west_south_west(self) -> momapy.geometry.Point:
        """Return the west south west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (-self.width / 2, self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` x `property`

    x: float

Return the x coordinate of the node

#### `` y `property`

    y: float

Return the y coordinate of the node

### `` Phenotype `dataclass`

    Phenotype(
        *,
        id_: str = make_uuid4_as_str(),
        label: str | None = None,
    )

Bases: `Process`

Class for phenotypes

Parameters:

Name | Type | Description | Default
--- | --- | --- | ---
`id_` | `str` | The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element | `'3ef8c519-3ae7-40de-b250-1cffc6125d7f'`
`label` | `str | None` | The label of the phenotype | `None`

### `` PhenotypeLayout `dataclass`

    PhenotypeLayout(
        fill: NoneValueType | Color | None = white,
        stroke: NoneValueType | Color | None = black,
        stroke_width: float | None = 1.25,
        *,
        id_: str = make_uuid4_as_str(),
        layout_elements: tuple[LayoutElement] = tuple(),
        group_fill: NoneValueType | Color | None = None,
        group_fill_rule: FillRule | None = None,
        group_filter: NoneValueType | Filter | None = None,
        group_font_family: str | None = None,
        group_font_size: float | None = None,
        group_font_style: FontStyle | None = None,
        group_font_weight: FontWeight | float | None = None,
        group_stroke: NoneValueType | Color | None = None,
        group_stroke_dasharray: tuple[float, ...] | None = None,
        group_stroke_dashoffset: float | None = None,
        group_stroke_width: float | None = None,
        group_text_anchor: TextAnchor | None = None,
        group_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        filter: NoneValueType | Filter | None = None,
        height: float = 30.0,
        label: TextLayout | None = None,
        position: Point,
        stroke_dasharray: tuple[float, ...] | None = None,
        stroke_dashoffset: float | None = None,
        transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        width: float = 60.0,
        angle: float = 70.0,
    )

Bases: `_SimpleMixin`, `SBGNNode`

Class for phenotype layouts

Parameters:

Name | Type | Description | Default
--- | --- | --- | ---
`id_` | `str` | The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element | `'a61b9af0-babb-4def-92ab-3ad35af654b4'`
`layout_elements` | `tuple[LayoutElement]` | The sub-layout elements of the group layout. These are part of the children of the group layout | `<dynamic>`
`group_fill` | `NoneValueType | Color | None` | The fill color of the group layout | `None`
`group_fill_rule` | `FillRule | None` | The fill rule of the group layout | `None`
`group_filter` | `NoneValueType | Filter | None` | The filter of the group layout | `None`
`group_font_family` | `str | None` | The font family of the group layout | `None`
`group_font_size` | `float | None` | The font size of the group layout | `None`
`group_font_style` | `FontStyle | None` | The font style of the group layout | `None`
`group_font_weight` | `FontWeight | float | None` | The font weight of the group layout | `None`
`group_stroke` | `NoneValueType | Color | None` | The stroke color of the group layout | `None`
`group_stroke_dasharray` | `tuple[float, ...] | None` | The stroke dasharray of the group layout | `None`
`group_stroke_dashoffset` | `float | None` | The stroke dashoffset of the group layout | `None`
`group_stroke_width` | `float | None` | The stroke width of the group layout | `None`
`group_text_anchor` | `TextAnchor | None` | The text anchor of the group layout | `None`
`group_transform` | `NoneValueType | tuple[Transformation] | None` | The transform of the group layout | `None`
`fill` | `NoneValueType | Color | None` |  | `Color(red=255, green=255, blue=255, alpha=1.0)`
`filter` | `NoneValueType | Filter | None` | The filter of the node | `None`
`height` | `float` |  | `30.0`
`label` | `TextLayout | None` | The label of the node | `None`
`position` | `Point` | The position of the node | required
`stroke` | `NoneValueType | Color | None` |  | `Color(red=0, green=0, blue=0, alpha=1.0)`
`stroke_dasharray` | `tuple[float, ...] | None` | The stroke dasharray of the node | `None`
`stroke_dashoffset` | `float | None` | The stroke dashoffset of the node | `None`
`stroke_width` | `float | None` |  | `1.25`
`transform` | `NoneValueType | tuple[Transformation] | None` | The transform of the node | `None`
`width` | `float` |  | `60.0`
`angle` | `float` |  | `70.0`

Methods:

Name | Description
--- | ---
`anchor_point` | Return an anchor point of the layout element
`bbox` | Compute and return the bounding box of the group layout element
`border` | Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point.
`center` | Return the center anchor of the node
`childless` | Return a copy of the node with no children
`children` | Return the children of the group layout.
`contains` | Return `true` if another layout element is a descendant of the layout element, `false` otherwise
`descendants` | Return the descendants of the layout element
`drawing_elements` | Return the drawing elements of the group layout.
`east` | Return the east anchor of the node
`east_north_east` | Return the east north east anchor of the node
`east_south_east` | Return the east south east west anchor of the node
`equals` | Return `true` if the layout element is equal to another layout element, `false` otherwise
`flattened` | Return a list containing copy of the layout element with no children and all its descendants with no children
`label_center` | Return the label center anchor of the node
`north` | Return the north anchor of the node
`north_east` | Return the north east anchor of the node
`north_north_east` | Return the north north east anchor of the node
`north_north_west` | Return the north north west anchor of the node
`north_west` | Return the north west anchor of the node
`self_angle` | Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.
`self_bbox` | Compute and return the bounding box of the self drawing element of the group layout
`self_border` | Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point.
`self_children` | Return the self children of the node. A node has unique child that is its label
`self_drawing_elements` | Return the node's own drawing elements
`self_to_shapely` | Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout
`size` | Return the size of the node
`south` | Return the south anchor of the node
`south_east` | Return the south east anchor of the node
`south_south_east` | Return the south south east anchor of the node
`south_south_west` | Return the south south west anchor of the node
`south_west` | Return the south west anchor of the node
`to_shapely` | Return a shapely collection of geometries reproducing the drawing elements of the layout element
`west` | Return the west anchor of the node
`west_north_west` | Return the west north west anchor of the node
`west_south_west` | Return the west south west anchor of the node

Attributes:

Name | Type | Description
--- | --- | ---
`angle` | `float` | Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.
`x` | `float` | Return the x coordinate of the node
`y` | `float` | Return the y coordinate of the node

#### `` anchor_point

    anchor_point(anchor_name: str) -> Point

Return an anchor point of the layout element

Source code in `src/momapy/core.py`

    130
    131
    132
    def anchor_point(self, anchor_name: str) -> momapy.geometry.Point:
        """Return an anchor point of the layout element"""
        return getattr(self, anchor_name)()

#### `` angle `class-attribute` `instance-attribute`

    angle: float = 70.0

Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.

#### `` bbox

    bbox() -> Bbox

Compute and return the bounding box of the group layout element

Source code in `src/momapy/core.py`

    504
    505
    506
    507
    508
    509
    510
    511
    512
    513
    514
    515
    516
    517
    518
    519
    520
    521
    522
    523
    524
    525
    526
    def bbox(self) -> momapy.geometry.Bbox:
        """Compute and return the bounding box of the group layout element"""
        self_bbox = self.self_bbox()
        bboxes = [child.bbox() for child in self.children()]
        min_x = self_bbox.north_west().x
        min_y = self_bbox.north_west().y
        max_x = self_bbox.south_east().x
        max_y = self_bbox.south_east().y
        for bbox in bboxes:
            if bbox.north_west().x < min_x:
                min_x = bbox.north_west().x
            if bbox.north_west().y < min_y:
                min_y = bbox.north_west().y
            if bbox.south_east().x > max_x:
                max_x = bbox.south_east().x
            if bbox.south_east().y > max_y:
                max_y = bbox.south_east().y
        bbox = momapy.geometry.Bbox(
            momapy.geometry.Point(min_x / 2 + max_x / 2, min_y / 2 + max_y / 2),
            max_x - min_x,
            max_y - min_y,
        )
        return bbox

#### `` border

    border(point: Point) -> Point

Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point. When there are multiple intersection points, the one closest to the given point is returned

Source code in `src/momapy/core.py`

    794
    795
    796
    797
    798
    799
    800
    801
    802
    def border(self, point: momapy.geometry.Point) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point.
        When there are multiple intersection points, the one closest to the given point is returned
        """
        return momapy.drawing.get_drawing_elements_border(
            drawing_elements=self.drawing_elements(),
            point=point,
            center=self.center(),
        )

#### `` center

    center() -> Point

Return the center anchor of the node

Source code in `src/momapy/core.py`

    776
    777
    778
    def center(self) -> momapy.geometry.Point:
        """Return the center anchor of the node"""
        return self.position

#### `` childless

    childless() -> Self

Return a copy of the node with no children

Source code in `src/momapy/core.py`

    830
    831
    832
    def childless(self) -> typing.Self:
        """Return a copy of the node with no children"""
        return dataclasses.replace(self, label=None, layout_elements=tuple([]))

#### `` children

    children() -> list[LayoutElement]

Return the children of the group layout. These are the self children of the group layout (returned by the `self_children` method) and the other children of the group layout (given by the `layout_elements` attribute)

Source code in `src/momapy/core.py`

    566
    567
    568
    569
    570
    def children(self) -> list[LayoutElement]:
        """Return the children of the group layout.
        These are the self children of the group layout (returned by the `self_children` method) and the other children of the group layout (given by the `layout_elements` attribute)
        """
        return self.self_children() + list(self.layout_elements)

#### `` contains

    contains(other: LayoutElement) -> bool

Return `true` if another layout element is a descendant of the layout element, `false` otherwise

Source code in `src/momapy/core.py`

    119
    120
    121
    def contains(self, other: "LayoutElement") -> bool:
        """Return `true` if another layout element is a descendant of the layout element, `false` otherwise"""
        return other in self.descendants()

#### `` descendants

    descendants() -> list[LayoutElement]

Return the descendants of the layout element

Source code in `src/momapy/core.py`

    90
    91
    92
    93
    94
    95
    96
    def descendants(self) -> list["LayoutElement"]:
        """Return the descendants of the layout element"""
        descendants = []
        for child in self.children():
            descendants.append(child)
            descendants += child.descendants()
        return descendants

#### `` drawing_elements

    drawing_elements() -> list[DrawingElement]

Return the drawing elements of the group layout. The returned drawing elements are a group drawing element formed of the self drawing elements of the group layout and the drawing elements of its children

Source code in `src/momapy/core.py`

    538
    539
    540
    541
    542
    543
    544
    545
    546
    547
    548
    549
    550
    551
    552
    553
    554
    555
    556
    557
    558
    559
    560
    561
    562
    563
    564
    def drawing_elements(self) -> list[momapy.drawing.DrawingElement]:
        """Return the drawing elements of the group layout.
        The returned drawing elements are a group drawing element formed of the self drawing elements of the group layout and the drawing elements of its children
        """
        drawing_elements = self.self_drawing_elements()
        for child in self.children():
            if child is not None:
                drawing_elements += child.drawing_elements()
        group = momapy.drawing.Group(
            class_=f"{type(self).__name__}_group",
            elements=tuple(drawing_elements),
            id_=f"{self.id_}_group",
            fill=self.group_fill,
            fill_rule=self.group_fill_rule,
            filter=self.group_filter,
            font_family=self.group_font_family,
            font_size=self.group_font_size,
            font_style=self.group_font_style,
            font_weight=self.group_font_weight,
            stroke=self.group_stroke,
            stroke_dasharray=self.group_stroke_dasharray,
            stroke_dashoffset=self.group_stroke_dashoffset,
            stroke_width=self.group_stroke_width,
            text_anchor=self.group_text_anchor,
            transform=self.group_transform,
        )
        return [group]

#### `` east

    east() -> Point

Return the east anchor of the node

Source code in `src/momapy/core.py`

    708
    709
    710
    def east(self) -> momapy.geometry.Point:
        """Return the east anchor of the node"""
        return self.self_angle(0)

#### `` east_north_east

    east_north_east() -> Point

Return the east north east anchor of the node

Source code in `src/momapy/core.py`

    700
    701
    702
    703
    704
    705
    706
    def east_north_east(self) -> momapy.geometry.Point:
        """Return the east north east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, -self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` east_south_east

    east_south_east() -> Point

Return the east south east west anchor of the node

Source code in `src/momapy/core.py`

    712
    713
    714
    715
    716
    717
    718
    def east_south_east(self) -> momapy.geometry.Point:
        """Return the east south east west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` equals

    equals(
        other: LayoutElement,
        flattened: bool = False,
        unordered: bool = False,
    ) -> bool

Return `true` if the layout element is equal to another layout element, `false` otherwise

Source code in `src/momapy/core.py`

    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    def equals(
        self, other: "LayoutElement", flattened: bool = False, unordered: bool = False
    ) -> bool:
        """Return `true` if the layout element is equal to another layout element, `false` otherwise"""
        if type(self) is type(other):
            if not flattened:
                return self == other
            else:
                if not unordered:
                    return self.flattened() == other.flattened()
                else:
                    return set(self.flattened()) == set(other.flattened())
        return False

#### `` flattened

    flattened() -> list[LayoutElement]

Return a list containing copy of the layout element with no children and all its descendants with no children

Source code in `src/momapy/core.py`

     98
     99
    100
    101
    102
    103
    def flattened(self) -> list["LayoutElement"]:
        """Return a list containing copy of the layout element with no children and all its descendants with no children"""
        flattened = [self.childless()]
        for child in self.children():
            flattened += child.flattened()
        return flattened

#### `` label_center

    label_center() -> Point

Return the label center anchor of the node

Source code in `src/momapy/core.py`

    780
    781
    782
    def label_center(self) -> momapy.geometry.Point:
        """Return the label center anchor of the node"""
        return self.position

#### `` north

    north() -> Point

Return the north anchor of the node

Source code in `src/momapy/core.py`

    680
    681
    682
    def north(self) -> momapy.geometry.Point:
        """Return the north anchor of the node"""
        return self.self_angle(90)

#### `` north_east

    north_east() -> Point

Return the north east anchor of the node

Source code in `src/momapy/core.py`

    692
    693
    694
    695
    696
    697
    698
    def north_east(self) -> momapy.geometry.Point:
        """Return the north east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, -self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` north_north_east

    north_north_east() -> Point

Return the north north east anchor of the node

Source code in `src/momapy/core.py`

    684
    685
    686
    687
    688
    689
    690
    def north_north_east(self) -> momapy.geometry.Point:
        """Return the north north east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 4, -self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` north_north_west

    north_north_west() -> Point

Return the north north west anchor of the node

Source code in `src/momapy/core.py`

    672
    673
    674
    675
    676
    677
    678
    def north_north_west(self) -> momapy.geometry.Point:
        """Return the north north west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() - (self.width / 4, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` north_west

    north_west() -> Point

Return the north west anchor of the node

Source code in `src/momapy/core.py`

    664
    665
    666
    667
    668
    669
    670
    def north_west(self) -> momapy.geometry.Point:
        """Return the north west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() - (self.width / 2, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` self_angle

    self_angle(
        angle: float,
        unit: Literal["degrees", "radians"] = "degrees",
    ) -> Point

Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.

Source code in `src/momapy/core.py`

    804
    805
    806
    807
    808
    809
    810
    811
    812
    813
    814
    815
    def self_angle(
        self,
        angle: float,
        unit: typing.Literal["degrees", "radians"] = "degrees",
    ) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal."""
        return momapy.drawing.get_drawing_elements_angle(
            drawing_elements=self.self_drawing_elements(),
            angle=angle,
            unit=unit,
            center=self.center(),
        )

#### `` self_bbox

    self_bbox() -> Bbox

Compute and return the bounding box of the self drawing element of the group layout

Source code in `src/momapy/core.py`

    499
    500
    501
    502
    def self_bbox(self) -> momapy.geometry.Bbox:
        """Compute and return the bounding box of the self drawing element of the group layout"""
        bounds = self.self_to_shapely().bounds
        return momapy.geometry.Bbox.from_bounds(bounds)

#### `` self_border

    self_border(point: Point) -> Point

Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point. When there are multiple intersection points, the one closest to the given point is returned

Source code in `src/momapy/core.py`

    784
    785
    786
    787
    788
    789
    790
    791
    792
    def self_border(self, point: momapy.geometry.Point) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point.
        When there are multiple intersection points, the one closest to the given point is returned
        """
        return momapy.drawing.get_drawing_elements_border(
            drawing_elements=self.self_drawing_elements(),
            point=point,
            center=self.center(),
        )

#### `` self_children

    self_children() -> list[LayoutElement]

Return the self children of the node. A node has unique child that is its label

Source code in `src/momapy/core.py`

    654
    655
    656
    657
    658
    def self_children(self) -> list[LayoutElement]:
        """Return the self children of the node. A node has unique child that is its label"""
        if self.label is not None:
            return [self.label]
        return []

#### `` self_drawing_elements

    self_drawing_elements() -> list[DrawingElement]

Return the node's own drawing elements

Source code in `src/momapy/core.py`

    637
    638
    639
    640
    641
    642
    643
    644
    645
    646
    647
    648
    649
    650
    651
    652
    def self_drawing_elements(self) -> list[momapy.drawing.DrawingElement]:
        """Return the node's own drawing elements"""
        drawing_elements = self._border_drawing_elements()
        group = momapy.drawing.Group(
            class_=type(self).__name__,
            elements=tuple(drawing_elements),
            fill=self.fill,
            filter=self.filter,
            id_=self.id_,
            stroke=self.stroke,
            stroke_dasharray=self.stroke_dasharray,
            stroke_dashoffset=self.stroke_dashoffset,
            stroke_width=self.stroke_width,
            transform=self.transform,
        )
        return [group]

#### `` self_to_shapely

    self_to_shapely() -> GeometryCollection

Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout

Source code in `src/momapy/core.py`

    495
    496
    497
    def self_to_shapely(self) -> shapely.GeometryCollection:
        """Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout"""
        return momapy.drawing.drawing_elements_to_shapely(self.drawing_elements())

#### `` size

    size() -> tuple[float, float]

Return the size of the node

Source code in `src/momapy/core.py`

    660
    661
    662
    def size(self) -> tuple[float, float]:
        """Return the size of the node"""
        return (self.width, self.height)

#### `` south

    south() -> Point

Return the south anchor of the node

Source code in `src/momapy/core.py`

    736
    737
    738
    def south(self) -> momapy.geometry.Point:
        """Return the south anchor of the node"""
        return self.self_angle(270)

#### `` south_east

    south_east() -> Point

Return the south east anchor of the node

Source code in `src/momapy/core.py`

    720
    721
    722
    723
    724
    725
    726
    def south_east(self) -> momapy.geometry.Point:
        """Return the south east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` south_south_east

    south_south_east() -> Point

Return the south south east anchor of the node

Source code in `src/momapy/core.py`

    728
    729
    730
    731
    732
    733
    734
    def south_south_east(self) -> momapy.geometry.Point:
        """Return the south south east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 4, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` south_south_west

    south_south_west() -> Point

Return the south south west anchor of the node

Source code in `src/momapy/core.py`

    740
    741
    742
    743
    744
    745
    746
    def south_south_west(self) -> momapy.geometry.Point:
        """Return the south south west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (-self.width / 4, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` south_west

    south_west() -> Point

Return the south west anchor of the node

Source code in `src/momapy/core.py`

    748
    749
    750
    751
    752
    753
    754
    def south_west(self) -> momapy.geometry.Point:
        """Return the south west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (-self.width / 2, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` to_shapely

    to_shapely(to_polygons: bool = False) -> GeometryCollection

Return a shapely collection of geometries reproducing the drawing elements of the layout element

Source code in `src/momapy/core.py`

    123
    124
    125
    126
    127
    128
    def to_shapely(self, to_polygons: bool = False) -> shapely.GeometryCollection:
        """Return a shapely collection of geometries reproducing the drawing elements of the layout element"""
        geom_collection = []
        for drawing_element in self.drawing_elements():
            geom_collection += drawing_element.to_shapely(to_polygons=to_polygons).geoms
        return shapely.GeometryCollection(geom_collection)

#### `` west

    west() -> Point

Return the west anchor of the node

Source code in `src/momapy/core.py`

    764
    765
    766
    def west(self) -> momapy.geometry.Point:
        """Return the west anchor of the node"""
        return self.self_angle(180)

#### `` west_north_west

    west_north_west() -> Point

Return the west north west anchor of the node

Source code in `src/momapy/core.py`

    768
    769
    770
    771
    772
    773
    774
    def west_north_west(self) -> momapy.geometry.Point:
        """Return the west north west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() - (self.width / 2, self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` west_south_west

    west_south_west() -> Point

Return the west south west anchor of the node

Source code in `src/momapy/core.py`

    756
    757
    758
    759
    760
    761
    762
    def west_south_west(self) -> momapy.geometry.Point:
        """Return the west south west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (-self.width / 2, self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` x `property`

    x: float

Return the x coordinate of the node

#### `` y `property`

    y: float

Return the y coordinate of the node

### `` Process `dataclass`

    Process(*, id_: str = make_uuid4_as_str())

Bases: `SBGNModelElement`

Base class for processes

Parameters:

Name | Type | Description | Default
--- | --- | --- | ---
`id_` | `str` | The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element | `'71942b87-6321-4cbb-b21d-3d055bcb6ca2'`

### `` Product `dataclass`

    Product(
        *,
        id_: str = make_uuid4_as_str(),
        element: EntityPool,
        stoichiometry: int | None = None,
    )

Bases: `FluxRole`

Class for products

Parameters:

Name | Type | Description | Default
--- | --- | --- | ---
`id_` | `str` | The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element | `'bf6f1cbe-fae3-4b9d-9f97-efc0de11ee8b'`
`element` | `EntityPool` | The entity pool of the flux role | required
`stoichiometry` | `int | None` | The stoichiometry of the flux role | `None`

### `` ProductionLayout `dataclass`

    ProductionLayout(
        path_fill: NoneValueType | Color | None = NoneValue,
        path_stroke: NoneValueType | Color | None = black,
        path_stroke_width: float | None = 1.25,
        arrowhead_stroke: NoneValueType | Color | None = black,
        arrowhead_stroke_width: float | None = 1.25,
        *,
        id_: str = make_uuid4_as_str(),
        layout_elements: tuple[LayoutElement] = tuple(),
        group_fill: NoneValueType | Color | None = None,
        group_fill_rule: FillRule | None = None,
        group_filter: NoneValueType | Filter | None = None,
        group_font_family: str | None = None,
        group_font_size: float | None = None,
        group_font_style: FontStyle | None = None,
        group_font_weight: FontWeight | float | None = None,
        group_stroke: NoneValueType | Color | None = None,
        group_stroke_dasharray: tuple[float, ...] | None = None,
        group_stroke_dashoffset: float | None = None,
        group_stroke_width: float | None = None,
        group_text_anchor: TextAnchor | None = None,
        group_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        end_shorten: float = 0.0,
        fill: NoneValueType | Color | None = None,
        filter: NoneValueType | Filter | None = None,
        path_filter: NoneValueType | Filter | None = None,
        path_stroke_dasharray: tuple[float, ...] | None = None,
        path_stroke_dashoffset: float | None = None,
        path_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        stroke: NoneValueType | Color | None = None,
        stroke_dasharray: NoneValueType
        | tuple[float]
        | None = None,
        stroke_dashoffset: float | None = None,
        stroke_width: float | None = None,
        segments: tuple[
            Segment | BezierCurve | EllipticalArc
        ] = tuple(),
        source: LayoutElement | None = None,
        start_shorten: float = 0.0,
        target: LayoutElement | None = None,
        transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        arrowhead_fill: NoneValueType | Color | None = black,
        arrowhead_filter: NoneValueType | Filter | None = None,
        arrowhead_stroke_dasharray: tuple[float, ...]
        | None = None,
        arrowhead_stroke_dashoffset: float | None = None,
        arrowhead_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        arrowhead_height: float = 10.0,
        arrowhead_width: float = 10.0,
    )

Bases: `SBGNSingleHeadedArc`

Class for production layouts

Parameters:

Name | Type | Description | Default
--- | --- | --- | ---
`id_` | `str` | The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element | `'44693393-5261-4ac5-a7d5-a7bdf8cd51ab'`
`layout_elements` | `tuple[LayoutElement]` | The sub-layout elements of the group layout. These are part of the children of the group layout | `<dynamic>`
`group_fill` | `NoneValueType | Color | None` | The fill color of the group layout | `None`
`group_fill_rule` | `FillRule | None` | The fill rule of the group layout | `None`
`group_filter` | `NoneValueType | Filter | None` | The filter of the group layout | `None`
`group_font_family` | `str | None` | The font family of the group layout | `None`
`group_font_size` | `float | None` | The font size of the group layout | `None`
`group_font_style` | `FontStyle | None` | The font style of the group layout | `None`
`group_font_weight` | `FontWeight | float | None` | The font weight of the group layout | `None`
`group_stroke` | `NoneValueType | Color | None` | The stroke color of the group layout | `None`
`group_stroke_dasharray` | `tuple[float, ...] | None` | The stroke dasharray of the group layout | `None`
`group_stroke_dashoffset` | `float | None` | The stroke dashoffset of the group layout | `None`
`group_stroke_width` | `float | None` | The stroke width of the group layout | `None`
`group_text_anchor` | `TextAnchor | None` | The text anchor of the group layout | `None`
`group_transform` | `NoneValueType | tuple[Transformation] | None` | The transform of the group layout | `None`
`end_shorten` | `float` | The length the end of the arc will be shorten by | `0.0`
`fill` | `NoneValueType | Color | None` | The fill color of the arc | `None`
`filter` | `NoneValueType | Filter | None` | The fill filter of the arc | `None`
`path_fill` | `NoneValueType | Color | None` |  | `<momapy.drawing.NoneValueType object at 0x7fb32ae9f1d0>`
`path_filter` | `NoneValueType | Filter | None` | The path filter of the arc | `None`
`path_stroke` | `NoneValueType | Color | None` |  | `Color(red=0, green=0, blue=0, alpha=1.0)`
`path_stroke_dasharray` | `tuple[float, ...] | None` | The path stroke dasharray of the arc | `None`
`path_stroke_dashoffset` | `float | None` | The path stroke dashoffset of the arc | `None`
`path_stroke_width` | `float | None` |  | `1.25`
`path_transform` | `NoneValueType | tuple[Transformation] | None` | The path transform of the arc | `None`
`stroke` | `NoneValueType | Color | None` | The stroke color of the arc | `None`
`stroke_dasharray` | `NoneValueType | tuple[float] | None` | The stroke dasharray of the arc | `None`
`stroke_dashoffset` | `float | None` | The stroke dashoffset of the arc | `None`
`stroke_width` | `float | None` | The stroke width of the arc | `None`
`segments` | `tuple[Union[Segment, BezierCurve, EllipticalArc]]` | The path segments of the arc | `<dynamic>`
`source` | `LayoutElement | None` | The source of the arc | `None`
`start_shorten` | `float` | The length the start of the arc will be shorten by | `0.0`
`target` | `LayoutElement | None` | The target of the arc | `None`
`transform` | `NoneValueType | tuple[Transformation] | None` | The transform of the arc | `None`
`arrowhead_fill` | `NoneValueType | Color | None` |  | `Color(red=0, green=0, blue=0, alpha=1.0)`
`arrowhead_filter` | `NoneValueType | Filter | None` | The arrowhead filter of the arc | `None`
`arrowhead_stroke` | `NoneValueType | Color | None` |  | `Color(red=0, green=0, blue=0, alpha=1.0)`
`arrowhead_stroke_dasharray` | `tuple[float, ...] | None` | The arrowhead stroke dasharray of the arc | `None`
`arrowhead_stroke_dashoffset` | `float | None` | The arrowhead stroke dashoffset of the arc | `None`
`arrowhead_stroke_width` | `float | None` |  | `1.25`
`arrowhead_transform` | `NoneValueType | tuple[Transformation] | None` | The arrowhead transform of the arc | `None`
`arrowhead_height` | `float` |  | `10.0`
`arrowhead_width` | `float` |  | `10.0`

Methods:

Name | Description
--- | ---
`anchor_point` | Return an anchor point of the layout element
`arrowhead_base` | Return the arrowhead base anchor point of the single-headed arc
`arrowhead_bbox` | Return the bounding box of the single-headed arc arrowhead
`arrowhead_border` | Return the point at the intersection of the drawing elements of the single-headed arc arrowhead and the line going through the center of these drawing elements and the given point.
`arrowhead_drawing_elements` | Return the drawing elements of the single-headed arc arrowhead
`arrowhead_length` | Return the length of the single-headed arc arrowhead
`arrowhead_tip` | Return the arrowhead tip anchor point of the single-headed arc
`bbox` | Compute and return the bounding box of the group layout element
`childless` | Return a copy of the arc with no children
`children` | Return the children of the group layout.
`contains` | Return `true` if another layout element is a descendant of the layout element, `false` otherwise
`descendants` | Return the descendants of the layout element
`drawing_elements` | Return the drawing elements of the group layout.
`end_point` | Return the ending point of the arc
`equals` | Return `true` if the layout element is equal to another layout element, `false` otherwise
`flattened` | Return a list containing copy of the layout element with no children and all its descendants with no children
`fraction` | Return the position and angle on the arc at a given fraction (of the total arc length)
`length` | Return the total length of the arc path
`path_drawing_elements` | Return the drawing elements of the single-headed arc path
`points` | Return the points of the arc path
`self_bbox` | Compute and return the bounding box of the self drawing element of the group layout
`self_children` | Return the self children of the arc
`self_drawing_elements` | Return the self drawing elements of the single-headed arc
`self_to_shapely` | Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout
`start_point` | Return the starting point of the arc
`to_shapely` | Return a shapely collection of geometries reproducing the drawing elements of the layout element

#### `` anchor_point

    anchor_point(anchor_name: str) -> Point

Return an anchor point of the layout element

Source code in `src/momapy/core.py`

    130
    131
    132
    def anchor_point(self, anchor_name: str) -> momapy.geometry.Point:
        """Return an anchor point of the layout element"""
        return getattr(self, anchor_name)()

#### `` arrowhead_base

    arrowhead_base() -> Point

Return the arrowhead base anchor point of the single-headed arc

Source code in `src/momapy/core.py`

    1058
    1059
    1060
    1061
    1062
    1063
    1064
    1065
    1066
    def arrowhead_base(self) -> momapy.geometry.Point:
        """Return the arrowhead base anchor point of the single-headed arc"""
        arrowhead_length = self.arrowhead_length()
        segment = self.segments[-1]
        segment_length = segment.length()
        if segment_length == 0:
            return self.arrowhead_tip() - (arrowhead_length, 0)
        fraction = 1 - (arrowhead_length + self.end_shorten) / segment_length
        return segment.get_position_at_fraction(fraction)

#### `` arrowhead_bbox

    arrowhead_bbox() -> Bbox

Return the bounding box of the single-headed arc arrowhead

Source code in `src/momapy/core.py`

    1068
    1069
    1070
    1071
    1072
    def arrowhead_bbox(self) -> momapy.geometry.Bbox:
        """Return the bounding box of the single-headed arc arrowhead"""
        return momapy.drawing.get_drawing_elements_bbox(
            self.arrowhead_drawing_elements()
        )

#### `` arrowhead_border

    arrowhead_border(point) -> Point

Return the point at the intersection of the drawing elements of the single-headed arc arrowhead and the line going through the center of these drawing elements and the given point. When there are multiple intersection points, the one closest to the given point is returned

Source code in `src/momapy/core.py`

    1074
    1075
    1076
    1077
    1078
    1079
    1080
    1081
    1082
    1083
    1084
    def arrowhead_border(self, point) -> momapy.geometry.Point:
        """Return the point at the intersection of the drawing elements of the single-headed arc arrowhead and the line going through the center of these drawing elements and the given point.
        When there are multiple intersection points, the one closest to the given point is returned
        """

        point = momapy.drawing.get_drawing_elements_border(
            self.arrowhead_drawing_elements(), point
        )
        if point is None:
            return self.arrowhead_tip()
        return point

#### `` arrowhead_drawing_elements

    arrowhead_drawing_elements() -> list[DrawingElement]

Return the drawing elements of the single-headed arc arrowhead

Source code in `src/momapy/core.py`

    1108
    1109
    1110
    1111
    1112
    1113
    1114
    1115
    1116
    1117
    1118
    1119
    1120
    1121
    1122
    1123
    1124
    1125
    1126
    1127
    def arrowhead_drawing_elements(
        self,
    ) -> list[momapy.drawing.DrawingElement]:
        """Return the drawing elements of the single-headed arc arrowhead"""
        drawing_elements = self._arrowhead_border_drawing_elements()
        group = momapy.drawing.Group(
            class_=f"{type(self).__name__}_arrowhead",
            elements=tuple(drawing_elements),
            fill=self.arrowhead_fill,
            filter=self.arrowhead_filter,
            id_=f"{self.id_}_arrowhead",
            stroke=self.arrowhead_stroke,
            stroke_dasharray=self.arrowhead_stroke_dasharray,
            stroke_dashoffset=self.arrowhead_stroke_dashoffset,
            stroke_width=self.arrowhead_stroke_width,
            transform=self.arrowhead_transform,
        )
        transformation = self._get_arrowhead_transformation()
        group = group.transformed(transformation)
        return [group]

#### `` arrowhead_length

    arrowhead_length() -> float

Return the length of the single-headed arc arrowhead

Source code in `src/momapy/core.py`

    1040
    1041
    1042
    1043
    1044
    1045
    1046
    1047
    def arrowhead_length(self) -> float:
        """Return the length of the single-headed arc arrowhead"""
        bbox = momapy.drawing.get_drawing_elements_bbox(
            self._arrowhead_border_drawing_elements()
        )
        if math.isnan(bbox.width):
            return 0.0
        return bbox.east().x

#### `` arrowhead_tip

    arrowhead_tip() -> Point

Return the arrowhead tip anchor point of the single-headed arc

Source code in `src/momapy/core.py`

    1049
    1050
    1051
    1052
    1053
    1054
    1055
    1056
    def arrowhead_tip(self) -> momapy.geometry.Point:
        """Return the arrowhead tip anchor point of the single-headed arc"""
        segment = self.segments[-1]
        segment_length = segment.length()
        if segment_length == 0:
            return segment.p2
        fraction = 1 - self.end_shorten / segment_length
        return segment.get_position_at_fraction(fraction)

#### `` bbox

    bbox() -> Bbox

Compute and return the bounding box of the group layout element

Source code in `src/momapy/core.py`

    504
    505
    506
    507
    508
    509
    510
    511
    512
    513
    514
    515
    516
    517
    518
    519
    520
    521
    522
    523
    524
    525
    526
    def bbox(self) -> momapy.geometry.Bbox:
        """Compute and return the bounding box of the group layout element"""
        self_bbox = self.self_bbox()
        bboxes = [child.bbox() for child in self.children()]
        min_x = self_bbox.north_west().x
        min_y = self_bbox.north_west().y
        max_x = self_bbox.south_east().x
        max_y = self_bbox.south_east().y
        for bbox in bboxes:
            if bbox.north_west().x < min_x:
                min_x = bbox.north_west().x
            if bbox.north_west().y < min_y:
                min_y = bbox.north_west().y
            if bbox.south_east().x > max_x:
                max_x = bbox.south_east().x
            if bbox.south_east().y > max_y:
                max_y = bbox.south_east().y
        bbox = momapy.geometry.Bbox(
            momapy.geometry.Point(min_x / 2 + max_x / 2, min_y / 2 + max_y / 2),
            max_x - min_x,
            max_y - min_y,
        )
        return bbox

#### `` childless

    childless() -> Self

Return a copy of the arc with no children

Source code in `src/momapy/core.py`

    955
    956
    957
    def childless(self) -> typing.Self:
        """Return a copy of the arc with no children"""
        return dataclasses.replace(self, layout_elements=tuple([]))

#### `` children

    children() -> list[LayoutElement]

Return the children of the group layout. These are the self children of the group layout (returned by the `self_children` method) and the other children of the group layout (given by the `layout_elements` attribute)

Source code in `src/momapy/core.py`

    566
    567
    568
    569
    570
    def children(self) -> list[LayoutElement]:
        """Return the children of the group layout.
        These are the self children of the group layout (returned by the `self_children` method) and the other children of the group layout (given by the `layout_elements` attribute)
        """
        return self.self_children() + list(self.layout_elements)

#### `` contains

    contains(other: LayoutElement) -> bool

Return `true` if another layout element is a descendant of the layout element, `false` otherwise

Source code in `src/momapy/core.py`

    119
    120
    121
    def contains(self, other: "LayoutElement") -> bool:
        """Return `true` if another layout element is a descendant of the layout element, `false` otherwise"""
        return other in self.descendants()

#### `` descendants

    descendants() -> list[LayoutElement]

Return the descendants of the layout element

Source code in `src/momapy/core.py`

    90
    91
    92
    93
    94
    95
    96
    def descendants(self) -> list["LayoutElement"]:
        """Return the descendants of the layout element"""
        descendants = []
        for child in self.children():
            descendants.append(child)
            descendants += child.descendants()
        return descendants

#### `` drawing_elements

    drawing_elements() -> list[DrawingElement]

Return the drawing elements of the group layout. The returned drawing elements are a group drawing element formed of the self drawing elements of the group layout and the drawing elements of its children

Source code in `src/momapy/core.py`

    538
    539
    540
    541
    542
    543
    544
    545
    546
    547
    548
    549
    550
    551
    552
    553
    554
    555
    556
    557
    558
    559
    560
    561
    562
    563
    564
    def drawing_elements(self) -> list[momapy.drawing.DrawingElement]:
        """Return the drawing elements of the group layout.
        The returned drawing elements are a group drawing element formed of the self drawing elements of the group layout and the drawing elements of its children
        """
        drawing_elements = self.self_drawing_elements()
        for child in self.children():
            if child is not None:
                drawing_elements += child.drawing_elements()
        group = momapy.drawing.Group(
            class_=f"{type(self).__name__}_group",
            elements=tuple(drawing_elements),
            id_=f"{self.id_}_group",
            fill=self.group_fill,
            fill_rule=self.group_fill_rule,
            filter=self.group_filter,
            font_family=self.group_font_family,
            font_size=self.group_font_size,
            font_style=self.group_font_style,
            font_weight=self.group_font_weight,
            stroke=self.group_stroke,
            stroke_dasharray=self.group_stroke_dasharray,
            stroke_dashoffset=self.group_stroke_dashoffset,
            stroke_width=self.group_stroke_width,
            text_anchor=self.group_text_anchor,
            transform=self.group_transform,
        )
        return [group]

#### `` end_point

    end_point() -> Point

Return the ending point of the arc

Source code in `src/momapy/core.py`

    951
    952
    953
    def end_point(self) -> momapy.geometry.Point:
        """Return the ending point of the arc"""
        return self.points()[-1]

#### `` equals

    equals(
        other: LayoutElement,
        flattened: bool = False,
        unordered: bool = False,
    ) -> bool

Return `true` if the layout element is equal to another layout element, `false` otherwise

Source code in `src/momapy/core.py`

    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    def equals(
        self, other: "LayoutElement", flattened: bool = False, unordered: bool = False
    ) -> bool:
        """Return `true` if the layout element is equal to another layout element, `false` otherwise"""
        if type(self) is type(other):
            if not flattened:
                return self == other
            else:
                if not unordered:
                    return self.flattened() == other.flattened()
                else:
                    return set(self.flattened()) == set(other.flattened())
        return False

#### `` flattened

    flattened() -> list[LayoutElement]

Return a list containing copy of the layout element with no children and all its descendants with no children

Source code in `src/momapy/core.py`

     98
     99
    100
    101
    102
    103
    def flattened(self) -> list["LayoutElement"]:
        """Return a list containing copy of the layout element with no children and all its descendants with no children"""
        flattened = [self.childless()]
        for child in self.children():
            flattened += child.flattened()
        return flattened

#### `` fraction

    fraction(fraction: float) -> tuple[Point, float]

Return the position and angle on the arc at a given fraction (of the total arc length)

Source code in `src/momapy/core.py`

    959
    960
    961
    962
    963
    964
    965
    966
    967
    968
    def fraction(self, fraction: float) -> tuple[momapy.geometry.Point, float]:
        """Return the position and angle on the arc at a given fraction (of the total arc length)"""
        current_length = 0
        length_to_reach = fraction * self.length()
        for segment in self.segments:
            current_length += segment.length()
            if current_length >= length_to_reach:
                break
        position, angle = segment.get_position_and_angle_at_fraction(fraction)
        return position, angle

#### `` length

    length()

Return the total length of the arc path

Source code in `src/momapy/core.py`

    943
    944
    945
    def length(self):
        """Return the total length of the arc path"""
        return sum([segment.length() for segment in self.segments])

#### `` path_drawing_elements

    path_drawing_elements() -> list[Path]

Return the drawing elements of the single-headed arc path

Source code in `src/momapy/core.py`

    1129
    1130
    1131
    1132
    1133
    1134
    1135
    1136
    1137
    1138
    1139
    1140
    1141
    1142
    1143
    1144
    1145
    1146
    1147
    1148
    1149
    1150
    1151
    1152
    1153
    1154
    1155
    1156
    1157
    1158
    1159
    1160
    1161
    1162
    1163
    1164
    1165
    1166
    1167
    def path_drawing_elements(self) -> list[momapy.drawing.Path]:
        """Return the drawing elements of the single-headed arc path"""
        arrowhead_length = self.arrowhead_length()
        if len(self.segments) == 1:
            segment = (
                self.segments[0]
                .shortened(self.start_shorten, "start")
                .shortened(self.end_shorten + arrowhead_length, "end")
            )
            actions = [
                momapy.drawing.MoveTo(segment.p1),
                self._make_path_action_from_segment(segment),
            ]
        else:
            first_segment = self.segments[0].shortened(self.start_shorten, "start")
            last_segment = self.segments[-1].shortened(
                self.end_shorten + arrowhead_length, "end"
            )
            actions = [
                momapy.drawing.MoveTo(first_segment.p1),
                self._make_path_action_from_segment(first_segment),
            ]
            for segment in self.segments[1:-1]:
                action = self._make_path_action_from_segment(segment)
                actions.append(action)
            actions.append(self._make_path_action_from_segment(last_segment))
        path = momapy.drawing.Path(
            actions=tuple(actions),
            class_=f"{type(self).__name__}_path",
            fill=self.path_fill,
            filter=self.path_filter,
            id_=f"{self.id_}_path",
            stroke=self.path_stroke,
            stroke_dasharray=self.path_stroke_dasharray,
            stroke_dashoffset=self.path_stroke_dashoffset,
            stroke_width=self.path_stroke_width,
            transform=self.path_transform,
        )
        return [path]

#### `` points

    points() -> list[Point]

Return the points of the arc path

Source code in `src/momapy/core.py`

    935
    936
    937
    938
    939
    940
    941
    def points(self) -> list[momapy.geometry.Point]:
        """Return the points of the arc path"""
        points = []
        for segment in self.segments:
            points.append(segment.p1)
        points.append(segment.p2)
        return points

#### `` self_bbox

    self_bbox() -> Bbox

Compute and return the bounding box of the self drawing element of the group layout

Source code in `src/momapy/core.py`

    499
    500
    501
    502
    def self_bbox(self) -> momapy.geometry.Bbox:
        """Compute and return the bounding box of the self drawing element of the group layout"""
        bounds = self.self_to_shapely().bounds
        return momapy.geometry.Bbox.from_bounds(bounds)

#### `` self_children

    self_children() -> list[LayoutElement]

Return the self children of the arc

Source code in `src/momapy/core.py`

    931
    932
    933
    def self_children(self) -> list[LayoutElement]:
        """Return the self children of the arc"""
        return []

#### `` self_drawing_elements

    self_drawing_elements() -> list[DrawingElement]

Return the self drawing elements of the single-headed arc

Source code in `src/momapy/core.py`

    1169
    1170
    1171
    1172
    1173
    1174
    1175
    1176
    1177
    1178
    1179
    1180
    1181
    1182
    1183
    1184
    1185
    1186
    def self_drawing_elements(self) -> list[momapy.drawing.DrawingElement]:
        """Return the self drawing elements of the single-headed arc"""
        drawing_elements = (
            self.path_drawing_elements() + self.arrowhead_drawing_elements()
        )
        group = momapy.drawing.Group(
            class_=type(self).__name__,
            elements=tuple(drawing_elements),
            fill=self.fill,
            filter=self.filter,
            id_=self.id_,
            stroke=self.stroke,
            stroke_dasharray=self.stroke_dasharray,
            stroke_dashoffset=self.stroke_dashoffset,
            stroke_width=self.stroke_width,
            transform=self.transform,
        )
        return [group]

#### `` self_to_shapely

    self_to_shapely() -> GeometryCollection

Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout

Source code in `src/momapy/core.py`

    495
    496
    497
    def self_to_shapely(self) -> shapely.GeometryCollection:
        """Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout"""
        return momapy.drawing.drawing_elements_to_shapely(self.drawing_elements())

#### `` start_point

    start_point() -> Point

Return the starting point of the arc

Source code in `src/momapy/core.py`

    947
    948
    949
    def start_point(self) -> momapy.geometry.Point:
        """Return the starting point of the arc"""
        return self.points()[0]

#### `` to_shapely

    to_shapely(to_polygons: bool = False) -> GeometryCollection

Return a shapely collection of geometries reproducing the drawing elements of the layout element

Source code in `src/momapy/core.py`

    123
    124
    125
    126
    127
    128
    def to_shapely(self, to_polygons: bool = False) -> shapely.GeometryCollection:
        """Return a shapely collection of geometries reproducing the drawing elements of the layout element"""
        geom_collection = []
        for drawing_element in self.drawing_elements():
            geom_collection += drawing_element.to_shapely(to_polygons=to_polygons).geoms
        return shapely.GeometryCollection(geom_collection)

### `` Reactant `dataclass`

    Reactant(
        *,
        id_: str = make_uuid4_as_str(),
        element: EntityPool,
        stoichiometry: int | None = None,
    )

Bases: `FluxRole`

Class for reactants

Parameters:

Name | Type | Description | Default
--- | --- | --- | ---
`id_` | `str` | The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element | `'e5d888c9-fedf-4c19-9ff2-8012fd0d36d0'`
`element` | `EntityPool` | The entity pool of the flux role | required
`stoichiometry` | `int | None` | The stoichiometry of the flux role | `None`

### `` SBGNPDLayout `dataclass`

    SBGNPDLayout(
        *,
        id_: str = make_uuid4_as_str(),
        layout_elements: tuple[LayoutElement] = tuple(),
        group_fill: NoneValueType | Color | None = None,
        group_fill_rule: FillRule | None = None,
        group_filter: NoneValueType | Filter | None = None,
        group_font_family: str | None = None,
        group_font_size: float | None = None,
        group_font_style: FontStyle | None = None,
        group_font_weight: FontWeight | float | None = None,
        group_stroke: NoneValueType | Color | None = None,
        group_stroke_dasharray: tuple[float, ...] | None = None,
        group_stroke_dashoffset: float | None = None,
        group_stroke_width: float | None = None,
        group_text_anchor: TextAnchor | None = None,
        group_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        fill: NoneValueType | Color | None = white,
        filter: NoneValueType | Filter | None = None,
        height: float,
        label: TextLayout | None = None,
        position: Point,
        stroke: NoneValueType | Color | None = None,
        stroke_dasharray: tuple[float, ...] | None = None,
        stroke_dashoffset: float | None = None,
        stroke_width: float | None = None,
        transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        width: float,
    )

Bases: `SBGNLayout`

Class for SBGN-PD layouts

Parameters:

Name | Type | Description | Default
--- | --- | --- | ---
`id_` | `str` | The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element | `'e5e30eef-ed67-4298-bf20-9f7ffbadb406'`
`layout_elements` | `tuple[LayoutElement]` | The sub-layout elements of the group layout. These are part of the children of the group layout | `<dynamic>`
`group_fill` | `NoneValueType | Color | None` | The fill color of the group layout | `None`
`group_fill_rule` | `FillRule | None` | The fill rule of the group layout | `None`
`group_filter` | `NoneValueType | Filter | None` | The filter of the group layout | `None`
`group_font_family` | `str | None` | The font family of the group layout | `None`
`group_font_size` | `float | None` | The font size of the group layout | `None`
`group_font_style` | `FontStyle | None` | The font style of the group layout | `None`
`group_font_weight` | `FontWeight | float | None` | The font weight of the group layout | `None`
`group_stroke` | `NoneValueType | Color | None` | The stroke color of the group layout | `None`
`group_stroke_dasharray` | `tuple[float, ...] | None` | The stroke dasharray of the group layout | `None`
`group_stroke_dashoffset` | `float | None` | The stroke dashoffset of the group layout | `None`
`group_stroke_width` | `float | None` | The stroke width of the group layout | `None`
`group_text_anchor` | `TextAnchor | None` | The text anchor of the group layout | `None`
`group_transform` | `NoneValueType | tuple[Transformation] | None` | The transform of the group layout | `None`
`fill` | `NoneValueType | Color | None` |  | `Color(red=255, green=255, blue=255, alpha=1.0)`
`filter` | `NoneValueType | Filter | None` | The filter of the node | `None`
`height` | `float` | The height of the node | required
`label` | `TextLayout | None` | The label of the node | `None`
`position` | `Point` | The position of the node | required
`stroke` | `NoneValueType | Color | None` | The stroke color of the node | `None`
`stroke_dasharray` | `tuple[float, ...] | None` | The stroke dasharray of the node | `None`
`stroke_dashoffset` | `float | None` | The stroke dashoffset of the node | `None`
`stroke_width` | `float | None` | The stroke width of the node | `None`
`transform` | `NoneValueType | tuple[Transformation] | None` | The transform of the node | `None`
`width` | `float` | The width width of the node | required

Methods:

Name | Description
--- | ---
`anchor_point` | Return an anchor point of the layout element
`angle` | Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.
`bbox` | Compute and return the bounding box of the group layout element
`border` | Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point.
`center` | Return the center anchor of the node
`childless` | Return a copy of the node with no children
`children` | Return the children of the group layout.
`contains` | Return `true` if another layout element is a descendant of the layout element, `false` otherwise
`descendants` | Return the descendants of the layout element
`drawing_elements` | Return the drawing elements of the group layout.
`east` | Return the east anchor of the node
`east_north_east` | Return the east north east anchor of the node
`east_south_east` | Return the east south east west anchor of the node
`equals` | Return `true` if the layout element is equal to another layout element, `false` otherwise
`flattened` | Return a list containing copy of the layout element with no children and all its descendants with no children
`is_sublayout` | Return `true` if another given layout is a sublayout of the layout, `false` otherwise
`label_center` | Return the label center anchor of the node
`north` | Return the north anchor of the node
`north_east` | Return the north east anchor of the node
`north_north_east` | Return the north north east anchor of the node
`north_north_west` | Return the north north west anchor of the node
`north_west` | Return the north west anchor of the node
`self_angle` | Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.
`self_bbox` | Compute and return the bounding box of the self drawing element of the group layout
`self_border` | Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point.
`self_children` | Return the self children of the node. A node has unique child that is its label
`self_drawing_elements` | Return the node's own drawing elements
`self_to_shapely` | Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout
`size` | Return the size of the node
`south` | Return the south anchor of the node
`south_east` | Return the south east anchor of the node
`south_south_east` | Return the south south east anchor of the node
`south_south_west` | Return the south south west anchor of the node
`south_west` | Return the south west anchor of the node
`to_shapely` | Return a shapely collection of geometries reproducing the drawing elements of the layout element
`west` | Return the west anchor of the node
`west_north_west` | Return the west north west anchor of the node
`west_south_west` | Return the west south west anchor of the node

Attributes:

Name | Type | Description
--- | --- | ---
`x` | `float` | Return the x coordinate of the node
`y` | `float` | Return the y coordinate of the node

#### `` anchor_point

    anchor_point(anchor_name: str) -> Point

Return an anchor point of the layout element

Source code in `src/momapy/core.py`

    130
    131
    132
    def anchor_point(self, anchor_name: str) -> momapy.geometry.Point:
        """Return an anchor point of the layout element"""
        return getattr(self, anchor_name)()

#### `` angle

    angle(
        angle: float,
        unit: Literal["degrees", "radians"] = "degrees",
    ) -> Point

Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.

Source code in `src/momapy/core.py`

    817
    818
    819
    820
    821
    822
    823
    824
    825
    826
    827
    828
    def angle(
        self,
        angle: float,
        unit: typing.Literal["degrees", "radians"] = "degrees",
    ) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal."""
        return momapy.drawing.get_drawing_elements_angle(
            drawing_elements=self.drawing_elements(),
            angle=angle,
            unit=unit,
            center=self.center(),
        )

#### `` bbox

    bbox() -> Bbox

Compute and return the bounding box of the group layout element

Source code in `src/momapy/core.py`

    504
    505
    506
    507
    508
    509
    510
    511
    512
    513
    514
    515
    516
    517
    518
    519
    520
    521
    522
    523
    524
    525
    526
    def bbox(self) -> momapy.geometry.Bbox:
        """Compute and return the bounding box of the group layout element"""
        self_bbox = self.self_bbox()
        bboxes = [child.bbox() for child in self.children()]
        min_x = self_bbox.north_west().x
        min_y = self_bbox.north_west().y
        max_x = self_bbox.south_east().x
        max_y = self_bbox.south_east().y
        for bbox in bboxes:
            if bbox.north_west().x < min_x:
                min_x = bbox.north_west().x
            if bbox.north_west().y < min_y:
                min_y = bbox.north_west().y
            if bbox.south_east().x > max_x:
                max_x = bbox.south_east().x
            if bbox.south_east().y > max_y:
                max_y = bbox.south_east().y
        bbox = momapy.geometry.Bbox(
            momapy.geometry.Point(min_x / 2 + max_x / 2, min_y / 2 + max_y / 2),
            max_x - min_x,
            max_y - min_y,
        )
        return bbox

#### `` border

    border(point: Point) -> Point

Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point. When there are multiple intersection points, the one closest to the given point is returned

Source code in `src/momapy/core.py`

    794
    795
    796
    797
    798
    799
    800
    801
    802
    def border(self, point: momapy.geometry.Point) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point.
        When there are multiple intersection points, the one closest to the given point is returned
        """
        return momapy.drawing.get_drawing_elements_border(
            drawing_elements=self.drawing_elements(),
            point=point,
            center=self.center(),
        )

#### `` center

    center() -> Point

Return the center anchor of the node

Source code in `src/momapy/core.py`

    776
    777
    778
    def center(self) -> momapy.geometry.Point:
        """Return the center anchor of the node"""
        return self.position

#### `` childless

    childless() -> Self

Return a copy of the node with no children

Source code in `src/momapy/core.py`

    830
    831
    832
    def childless(self) -> typing.Self:
        """Return a copy of the node with no children"""
        return dataclasses.replace(self, label=None, layout_elements=tuple([]))

#### `` children

    children() -> list[LayoutElement]

Return the children of the group layout. These are the self children of the group layout (returned by the `self_children` method) and the other children of the group layout (given by the `layout_elements` attribute)

Source code in `src/momapy/core.py`

    566
    567
    568
    569
    570
    def children(self) -> list[LayoutElement]:
        """Return the children of the group layout.
        These are the self children of the group layout (returned by the `self_children` method) and the other children of the group layout (given by the `layout_elements` attribute)
        """
        return self.self_children() + list(self.layout_elements)

#### `` contains

    contains(other: LayoutElement) -> bool

Return `true` if another layout element is a descendant of the layout element, `false` otherwise

Source code in `src/momapy/core.py`

    119
    120
    121
    def contains(self, other: "LayoutElement") -> bool:
        """Return `true` if another layout element is a descendant of the layout element, `false` otherwise"""
        return other in self.descendants()

#### `` descendants

    descendants() -> list[LayoutElement]

Return the descendants of the layout element

Source code in `src/momapy/core.py`

    90
    91
    92
    93
    94
    95
    96
    def descendants(self) -> list["LayoutElement"]:
        """Return the descendants of the layout element"""
        descendants = []
        for child in self.children():
            descendants.append(child)
            descendants += child.descendants()
        return descendants

#### `` drawing_elements

    drawing_elements() -> list[DrawingElement]

Return the drawing elements of the group layout. The returned drawing elements are a group drawing element formed of the self drawing elements of the group layout and the drawing elements of its children

Source code in `src/momapy/core.py`

    538
    539
    540
    541
    542
    543
    544
    545
    546
    547
    548
    549
    550
    551
    552
    553
    554
    555
    556
    557
    558
    559
    560
    561
    562
    563
    564
    def drawing_elements(self) -> list[momapy.drawing.DrawingElement]:
        """Return the drawing elements of the group layout.
        The returned drawing elements are a group drawing element formed of the self drawing elements of the group layout and the drawing elements of its children
        """
        drawing_elements = self.self_drawing_elements()
        for child in self.children():
            if child is not None:
                drawing_elements += child.drawing_elements()
        group = momapy.drawing.Group(
            class_=f"{type(self).__name__}_group",
            elements=tuple(drawing_elements),
            id_=f"{self.id_}_group",
            fill=self.group_fill,
            fill_rule=self.group_fill_rule,
            filter=self.group_filter,
            font_family=self.group_font_family,
            font_size=self.group_font_size,
            font_style=self.group_font_style,
            font_weight=self.group_font_weight,
            stroke=self.group_stroke,
            stroke_dasharray=self.group_stroke_dasharray,
            stroke_dashoffset=self.group_stroke_dashoffset,
            stroke_width=self.group_stroke_width,
            text_anchor=self.group_text_anchor,
            transform=self.group_transform,
        )
        return [group]

#### `` east

    east() -> Point

Return the east anchor of the node

Source code in `src/momapy/core.py`

    708
    709
    710
    def east(self) -> momapy.geometry.Point:
        """Return the east anchor of the node"""
        return self.self_angle(0)

#### `` east_north_east

    east_north_east() -> Point

Return the east north east anchor of the node

Source code in `src/momapy/core.py`

    700
    701
    702
    703
    704
    705
    706
    def east_north_east(self) -> momapy.geometry.Point:
        """Return the east north east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, -self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` east_south_east

    east_south_east() -> Point

Return the east south east west anchor of the node

Source code in `src/momapy/core.py`

    712
    713
    714
    715
    716
    717
    718
    def east_south_east(self) -> momapy.geometry.Point:
        """Return the east south east west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` equals

    equals(
        other: LayoutElement,
        flattened: bool = False,
        unordered: bool = False,
    ) -> bool

Return `true` if the layout element is equal to another layout element, `false` otherwise

Source code in `src/momapy/core.py`

    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    def equals(
        self, other: "LayoutElement", flattened: bool = False, unordered: bool = False
    ) -> bool:
        """Return `true` if the layout element is equal to another layout element, `false` otherwise"""
        if type(self) is type(other):
            if not flattened:
                return self == other
            else:
                if not unordered:
                    return self.flattened() == other.flattened()
                else:
                    return set(self.flattened()) == set(other.flattened())
        return False

#### `` flattened

    flattened() -> list[LayoutElement]

Return a list containing copy of the layout element with no children and all its descendants with no children

Source code in `src/momapy/core.py`

     98
     99
    100
    101
    102
    103
    def flattened(self) -> list["LayoutElement"]:
        """Return a list containing copy of the layout element with no children and all its descendants with no children"""
        flattened = [self.childless()]
        for child in self.children():
            flattened += child.flattened()
        return flattened

#### `` is_sublayout

    is_sublayout(other, flattened=False, unordered=False)

Return `true` if another given layout is a sublayout of the layout, `false` otherwise

Source code in `src/momapy/core.py`

    1545
    1546
    1547
    1548
    1549
    1550
    1551
    1552
    1553
    1554
    1555
    1556
    1557
    1558
    1559
    1560
    1561
    1562
    1563
    1564
    1565
    1566
    1567
    1568
    1569
    1570
    1571
    1572
    1573
    1574
    1575
    1576
    1577
    1578
    1579
    def is_sublayout(self, other, flattened=False, unordered=False):
        """Return `true` if another given layout is a sublayout of the layout, `false` otherwise"""

        def _is_sublist(list1, list2, unordered=False) -> bool:
            if not unordered:
                i = 0
                for elem1 in list1:
                    elem2 = list2[i]
                    while elem2 != elem1 and i < len(list2) - 1:
                        i += 1
                        elem2 = list2[i]
                    if not elem2 == elem1:
                        return False
                    i += 1
            else:
                dlist1 = collections.defaultdict(int)
                dlist2 = collections.defaultdict(int)
                for elem1 in list1:
                    dlist1[elem1] += 1
                for elem2 in list2:
                    dlist2[elem2] += 1
                for elem in dlist1:
                    if dlist1[elem] > dlist2[elem]:
                        return False
            return True

        if self.childless() != other.childless():
            return False
        if flattened:
            return _is_sublist(
                self.flattened()[1:],
                other.flattened()[1:],
                unordered=unordered,
            )
        return _is_sublist(self.children(), other.children(), unordered=unordered)

#### `` label_center

    label_center() -> Point

Return the label center anchor of the node

Source code in `src/momapy/core.py`

    780
    781
    782
    def label_center(self) -> momapy.geometry.Point:
        """Return the label center anchor of the node"""
        return self.position

#### `` north

    north() -> Point

Return the north anchor of the node

Source code in `src/momapy/core.py`

    680
    681
    682
    def north(self) -> momapy.geometry.Point:
        """Return the north anchor of the node"""
        return self.self_angle(90)

#### `` north_east

    north_east() -> Point

Return the north east anchor of the node

Source code in `src/momapy/core.py`

    692
    693
    694
    695
    696
    697
    698
    def north_east(self) -> momapy.geometry.Point:
        """Return the north east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, -self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` north_north_east

    north_north_east() -> Point

Return the north north east anchor of the node

Source code in `src/momapy/core.py`

    684
    685
    686
    687
    688
    689
    690
    def north_north_east(self) -> momapy.geometry.Point:
        """Return the north north east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 4, -self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` north_north_west

    north_north_west() -> Point

Return the north north west anchor of the node

Source code in `src/momapy/core.py`

    672
    673
    674
    675
    676
    677
    678
    def north_north_west(self) -> momapy.geometry.Point:
        """Return the north north west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() - (self.width / 4, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` north_west

    north_west() -> Point

Return the north west anchor of the node

Source code in `src/momapy/core.py`

    664
    665
    666
    667
    668
    669
    670
    def north_west(self) -> momapy.geometry.Point:
        """Return the north west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() - (self.width / 2, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` self_angle

    self_angle(
        angle: float,
        unit: Literal["degrees", "radians"] = "degrees",
    ) -> Point

Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.

Source code in `src/momapy/core.py`

    804
    805
    806
    807
    808
    809
    810
    811
    812
    813
    814
    815
    def self_angle(
        self,
        angle: float,
        unit: typing.Literal["degrees", "radians"] = "degrees",
    ) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal."""
        return momapy.drawing.get_drawing_elements_angle(
            drawing_elements=self.self_drawing_elements(),
            angle=angle,
            unit=unit,
            center=self.center(),
        )

#### `` self_bbox

    self_bbox() -> Bbox

Compute and return the bounding box of the self drawing element of the group layout

Source code in `src/momapy/core.py`

    499
    500
    501
    502
    def self_bbox(self) -> momapy.geometry.Bbox:
        """Compute and return the bounding box of the self drawing element of the group layout"""
        bounds = self.self_to_shapely().bounds
        return momapy.geometry.Bbox.from_bounds(bounds)

#### `` self_border

    self_border(point: Point) -> Point

Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point. When there are multiple intersection points, the one closest to the given point is returned

Source code in `src/momapy/core.py`

    784
    785
    786
    787
    788
    789
    790
    791
    792
    def self_border(self, point: momapy.geometry.Point) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point.
        When there are multiple intersection points, the one closest to the given point is returned
        """
        return momapy.drawing.get_drawing_elements_border(
            drawing_elements=self.self_drawing_elements(),
            point=point,
            center=self.center(),
        )

#### `` self_children

    self_children() -> list[LayoutElement]

Return the self children of the node. A node has unique child that is its label

Source code in `src/momapy/core.py`

    654
    655
    656
    657
    658
    def self_children(self) -> list[LayoutElement]:
        """Return the self children of the node. A node has unique child that is its label"""
        if self.label is not None:
            return [self.label]
        return []

#### `` self_drawing_elements

    self_drawing_elements() -> list[DrawingElement]

Return the node's own drawing elements

Source code in `src/momapy/core.py`

    637
    638
    639
    640
    641
    642
    643
    644
    645
    646
    647
    648
    649
    650
    651
    652
    def self_drawing_elements(self) -> list[momapy.drawing.DrawingElement]:
        """Return the node's own drawing elements"""
        drawing_elements = self._border_drawing_elements()
        group = momapy.drawing.Group(
            class_=type(self).__name__,
            elements=tuple(drawing_elements),
            fill=self.fill,
            filter=self.filter,
            id_=self.id_,
            stroke=self.stroke,
            stroke_dasharray=self.stroke_dasharray,
            stroke_dashoffset=self.stroke_dashoffset,
            stroke_width=self.stroke_width,
            transform=self.transform,
        )
        return [group]

#### `` self_to_shapely

    self_to_shapely() -> GeometryCollection

Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout

Source code in `src/momapy/core.py`

    495
    496
    497
    def self_to_shapely(self) -> shapely.GeometryCollection:
        """Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout"""
        return momapy.drawing.drawing_elements_to_shapely(self.drawing_elements())

#### `` size

    size() -> tuple[float, float]

Return the size of the node

Source code in `src/momapy/core.py`

    660
    661
    662
    def size(self) -> tuple[float, float]:
        """Return the size of the node"""
        return (self.width, self.height)

#### `` south

    south() -> Point

Return the south anchor of the node

Source code in `src/momapy/core.py`

    736
    737
    738
    def south(self) -> momapy.geometry.Point:
        """Return the south anchor of the node"""
        return self.self_angle(270)

#### `` south_east

    south_east() -> Point

Return the south east anchor of the node

Source code in `src/momapy/core.py`

    720
    721
    722
    723
    724
    725
    726
    def south_east(self) -> momapy.geometry.Point:
        """Return the south east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` south_south_east

    south_south_east() -> Point

Return the south south east anchor of the node

Source code in `src/momapy/core.py`

    728
    729
    730
    731
    732
    733
    734
    def south_south_east(self) -> momapy.geometry.Point:
        """Return the south south east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 4, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` south_south_west

    south_south_west() -> Point

Return the south south west anchor of the node

Source code in `src/momapy/core.py`

    740
    741
    742
    743
    744
    745
    746
    def south_south_west(self) -> momapy.geometry.Point:
        """Return the south south west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (-self.width / 4, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` south_west

    south_west() -> Point

Return the south west anchor of the node

Source code in `src/momapy/core.py`

    748
    749
    750
    751
    752
    753
    754
    def south_west(self) -> momapy.geometry.Point:
        """Return the south west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (-self.width / 2, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` to_shapely

    to_shapely(to_polygons: bool = False) -> GeometryCollection

Return a shapely collection of geometries reproducing the drawing elements of the layout element

Source code in `src/momapy/core.py`

    123
    124
    125
    126
    127
    128
    def to_shapely(self, to_polygons: bool = False) -> shapely.GeometryCollection:
        """Return a shapely collection of geometries reproducing the drawing elements of the layout element"""
        geom_collection = []
        for drawing_element in self.drawing_elements():
            geom_collection += drawing_element.to_shapely(to_polygons=to_polygons).geoms
        return shapely.GeometryCollection(geom_collection)

#### `` west

    west() -> Point

Return the west anchor of the node

Source code in `src/momapy/core.py`

    764
    765
    766
    def west(self) -> momapy.geometry.Point:
        """Return the west anchor of the node"""
        return self.self_angle(180)

#### `` west_north_west

    west_north_west() -> Point

Return the west north west anchor of the node

Source code in `src/momapy/core.py`

    768
    769
    770
    771
    772
    773
    774
    def west_north_west(self) -> momapy.geometry.Point:
        """Return the west north west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() - (self.width / 2, self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` west_south_west

    west_south_west() -> Point

Return the west south west anchor of the node

Source code in `src/momapy/core.py`

    756
    757
    758
    759
    760
    761
    762
    def west_south_west(self) -> momapy.geometry.Point:
        """Return the west south west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (-self.width / 2, self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` x `property`

    x: float

Return the x coordinate of the node

#### `` y `property`

    y: float

Return the y coordinate of the node

### `` SBGNPDLayoutBuilder `module-attribute`

    SBGNPDLayoutBuilder = get_or_make_builder_cls(SBGNPDLayout)

Class for SBGN-PD layout builders

### `` SBGNPDMap `dataclass`

    SBGNPDMap(
        *,
        id_: str = make_uuid4_as_str(),
        model: SBGNPDModel,
        layout: SBGNPDLayout,
        layout_model_mapping: LayoutModelMapping | None = None,
    )

Bases: `SBGNMap`

Class for SBGN-PD maps

Parameters:

Name | Type | Description | Default
--- | --- | --- | ---
`id_` | `str` | The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element | `'235f517d-651e-4960-87c7-119801ba99bb'`
`model` | `SBGNPDModel` |  | `None`
`layout` | `SBGNPDLayout` |  | `None`
`layout_model_mapping` | `LayoutModelMapping | None` | The layout model mapping of the map | `None`

Methods:

Name | Description
--- | ---
`get_mapping` | Return the layout elements mapped to the given model element
`is_submap` | Return `true` if another given map is a submap of the `Map`, `false` otherwise

#### `` get_mapping

    get_mapping(
        map_element: MapElement
        | tuple[ModelElement, ModelElement],
    )

Return the layout elements mapped to the given model element

Source code in `src/momapy/core.py`

    1627
    1628
    1629
    1630
    1631
    1632
    def get_mapping(
        self,
        map_element: MapElement | tuple[ModelElement, ModelElement],
    ):
        """Return the layout elements mapped to the given model element"""
        return self.layout_model_mapping.get_mapping(map_element)

#### `` is_submap

    is_submap(other)

Return `true` if another given map is a submap of the `Map`, `false` otherwise

Source code in `src/momapy/core.py`

    1613
    1614
    1615
    1616
    1617
    1618
    1619
    1620
    1621
    1622
    1623
    1624
    1625
    def is_submap(self, other):
        """Return `true` if another given map is a submap of the `Map`, `false` otherwise"""
        if (
            self.model is None
            or self.layout is None
            or self.layout_model_mapping is None
        ):
            return False
        return (
            self.model.is_submodel(other.model)
            and self.layout.is_sublayout(other.layout)
            and self.layout_model_mapping.is_submapping(other.layout_model_mapping)
        )

### `` SBGNPDMapBuilder `module-attribute`

    SBGNPDMapBuilder = get_or_make_builder_cls(
        SBGNPDMap,
        builder_namespace={
            "new_model": _sbgnpd_map_builder_new_model,
            "new_layout": _sbgnpd_map_builder_new_layout,
        },
    )

Class for SBGN-PD map builders

### `` SBGNPDModel `dataclass`

    SBGNPDModel(
        *,
        id_: str = make_uuid4_as_str(),
        entity_pools: frozenset[EntityPool] = frozenset(),
        processes: frozenset[Process] = frozenset(),
        compartments: frozenset[Compartment] = frozenset(),
        modulations: frozenset[Modulation] = frozenset(),
        logical_operators: frozenset[
            LogicalOperator
        ] = frozenset(),
        equivalence_operators: frozenset[
            EquivalenceOperator
        ] = frozenset(),
        submaps: frozenset[Submap] = frozenset(),
        tags: frozenset[Tag] = frozenset(),
    )

Bases: `SBGNModel`

Class for SBGN-PD models

Parameters:

Name | Type | Description | Default
--- | --- | --- | ---
`id_` | `str` | The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element | `'d3ed64f4-8270-476a-b4a6-04d0f2ee0c1b'`
`entity_pools` | `frozenset[EntityPool]` | The entity pools of the SBGN-PD model | `<class 'frozenset'>`
`processes` | `frozenset[Process]` | The processes of the SBGN-PD model | `<class 'frozenset'>`
`compartments` | `frozenset[Compartment]` | The compartments of the SBGN-PD model | `<class 'frozenset'>`
`modulations` | `frozenset[Modulation]` | The modulations of the SBGN-PD model | `<class 'frozenset'>`
`logical_operators` | `frozenset[LogicalOperator]` | The logical operators of the SBGN-PD model | `<class 'frozenset'>`
`equivalence_operators` | `frozenset[EquivalenceOperator]` | The equivalence operators of the SBGN-PD model | `<class 'frozenset'>`
`submaps` | `frozenset[Submap]` | The submaps of the SBGN-PD model | `<class 'frozenset'>`
`tags` | `frozenset[Tag]` | The tags of the SBGN-PD model | `<class 'frozenset'>`

Methods:

Name | Description
--- | ---
`is_ovav` | Return `true` if the SBGN-PD model respects the Once a Variable Always a Variable (OVAV) rule, `false` otherwise
`is_submodel` | Return `true` if another given SBGN-PD model is a submodel of the SBGN-PD model, `false` otherwise

#### `` is_ovav

    is_ovav() -> bool

Return `true` if the SBGN-PD model respects the Once a Variable Always a Variable (OVAV) rule, `false` otherwise

Source code in `src/momapy/sbgn/pd.py`

    632
    633
    634
    635
    636
    637
    638
    639
    640
    641
    642
    643
    644
    645
    646
    647
    648
    649
    650
    651
    652
    653
    654
    655
    656
    657
    658
    659
    660
    661
    662
    663
    664
    665
    666
    667
    668
    669
    670
    671
    672
    def is_ovav(self) -> bool:
        """Return `true` if the SBGN-PD model respects the Once a Variable Always a Variable (OVAV) rule, `false` otherwise"""
        subunit_cls_entity_pool_cls_mapping = {
            MacromoleculeSubunit: Macromolecule,
            NucleicAcidFeatureSubunit: NucleicAcidFeature,
            ComplexSubunit: Complex,
            SimpleChemicalSubunit: SimpleChemical,
            MacromoleculeMultimerSubunit: MacromoleculeMultimer,
            NucleicAcidFeatureMultimerSubunit: NucleicAcidFeatureMultimer,
            ComplexMultimerSubunit: ComplexMultimer,
            SimpleChemicalMultimerSubunit: SimpleChemicalMultimer,
        }

        def _check_entities(entities, entity_variables_mapping=None):
            if entity_variables_mapping is None:
                entity_variables_mapping = {}
            for entity in entities:
                if hasattr(entity, "state_variables"):
                    variables = set([sv.variable for sv in entity.state_variables])
                    attributes = []
                    for field in dataclasses.fields(entity):
                        if field.name != "state_variables":
                            attributes.append(field.name)
                    args = {attr: getattr(entity, attr) for attr in attributes}
                    if isinstance(entity, Subunit):
                        cls = subunit_cls_entity_pool_cls_mapping[type(entity)]
                    else:
                        cls = type(entity)
                    entity_no_svs = cls(**args)
                    if entity_no_svs not in entity_variables_mapping:
                        entity_variables_mapping[entity_no_svs] = variables
                    else:
                        if entity_variables_mapping[entity_no_svs] != variables:
                            return False
                if hasattr(entity, "subunits"):
                    is_ovav = _check_entities(entity.subunits, entity_variables_mapping)
                    if not is_ovav:
                        return False
            return True

        return _check_entities(self.entity_pools)

#### `` is_submodel

    is_submodel(other) -> bool

Return `true` if another given SBGN-PD model is a submodel of the SBGN-PD model, `false` otherwise

Source code in `src/momapy/sbgn/pd.py`

    674
    675
    676
    677
    678
    679
    680
    681
    682
    683
    684
    685
    def is_submodel(self, other) -> bool:
        """Return `true` if another given SBGN-PD model is a submodel of the SBGN-PD model, `false` otherwise"""
        return (
            self.entity_pools.issubset(other.entity_pools)
            and self.processes.issubset(other.processes)
            and self.compartments.issubset(other.compartments)
            and self.modulations.issubset(other.modulations)
            and self.logical_operators.issubset(other.logical_operators)
            and self.equivalence_operators.issubset(other.equivalence_operators)
            and self.submaps.issubset(other.submaps)
            and self.tags.issubset(other.tags)
        )

### `` SBGNPDModelBuilder `module-attribute`

    SBGNPDModelBuilder = get_or_make_builder_cls(SBGNPDModel)

Class for SBGN-PD model builders

### `` SimpleChemical `dataclass`

    SimpleChemical(
        *,
        id_: str = make_uuid4_as_str(),
        compartment: Compartment | None = None,
        label: str | None = None,
        state_variables: frozenset[StateVariable] = frozenset(),
        units_of_information: frozenset[
            UnitOfInformation
        ] = frozenset(),
    )

Bases: `EntityPool`

Class for simple chemical

Parameters:

Name | Type | Description | Default
--- | --- | --- | ---
`id_` | `str` | The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element | `'dfd214d2-f603-4d29-9d23-fabdeb40036e'`
`compartment` | `Compartment | None` | The compartment of the entity pool | `None`
`label` | `str | None` | The label of the simple chemical | `None`
`state_variables` | `frozenset[StateVariable]` | The state variables of the simple chemical | `<class 'frozenset'>`
`units_of_information` | `frozenset[UnitOfInformation]` | The units of information of the simple chemical | `<class 'frozenset'>`

### `` SimpleChemicalLayout `dataclass`

    SimpleChemicalLayout(
        fill: NoneValueType | Color | None = white,
        stroke: NoneValueType | Color | None = black,
        stroke_width: float | None = 1.25,
        *,
        id_: str = make_uuid4_as_str(),
        layout_elements: tuple[LayoutElement] = tuple(),
        group_fill: NoneValueType | Color | None = None,
        group_fill_rule: FillRule | None = None,
        group_filter: NoneValueType | Filter | None = None,
        group_font_family: str | None = None,
        group_font_size: float | None = None,
        group_font_style: FontStyle | None = None,
        group_font_weight: FontWeight | float | None = None,
        group_stroke: NoneValueType | Color | None = None,
        group_stroke_dasharray: tuple[float, ...] | None = None,
        group_stroke_dashoffset: float | None = None,
        group_stroke_width: float | None = None,
        group_text_anchor: TextAnchor | None = None,
        group_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        filter: NoneValueType | Filter | None = None,
        height: float = 30.0,
        label: TextLayout | None = None,
        position: Point,
        stroke_dasharray: tuple[float, ...] | None = None,
        stroke_dashoffset: float | None = None,
        transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        width: float = 30.0,
    )

Bases: `_SimpleMixin`, `SBGNNode`

Class for simple chemical layouts

Parameters:

Name | Type | Description | Default
--- | --- | --- | ---
`id_` | `str` | The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element | `'96f2cfad-3357-4484-8a7f-6be0dc077a02'`
`layout_elements` | `tuple[LayoutElement]` | The sub-layout elements of the group layout. These are part of the children of the group layout | `<dynamic>`
`group_fill` | `NoneValueType | Color | None` | The fill color of the group layout | `None`
`group_fill_rule` | `FillRule | None` | The fill rule of the group layout | `None`
`group_filter` | `NoneValueType | Filter | None` | The filter of the group layout | `None`
`group_font_family` | `str | None` | The font family of the group layout | `None`
`group_font_size` | `float | None` | The font size of the group layout | `None`
`group_font_style` | `FontStyle | None` | The font style of the group layout | `None`
`group_font_weight` | `FontWeight | float | None` | The font weight of the group layout | `None`
`group_stroke` | `NoneValueType | Color | None` | The stroke color of the group layout | `None`
`group_stroke_dasharray` | `tuple[float, ...] | None` | The stroke dasharray of the group layout | `None`
`group_stroke_dashoffset` | `float | None` | The stroke dashoffset of the group layout | `None`
`group_stroke_width` | `float | None` | The stroke width of the group layout | `None`
`group_text_anchor` | `TextAnchor | None` | The text anchor of the group layout | `None`
`group_transform` | `NoneValueType | tuple[Transformation] | None` | The transform of the group layout | `None`
`fill` | `NoneValueType | Color | None` |  | `Color(red=255, green=255, blue=255, alpha=1.0)`
`filter` | `NoneValueType | Filter | None` | The filter of the node | `None`
`height` | `float` |  | `30.0`
`label` | `TextLayout | None` | The label of the node | `None`
`position` | `Point` | The position of the node | required
`stroke` | `NoneValueType | Color | None` |  | `Color(red=0, green=0, blue=0, alpha=1.0)`
`stroke_dasharray` | `tuple[float, ...] | None` | The stroke dasharray of the node | `None`
`stroke_dashoffset` | `float | None` | The stroke dashoffset of the node | `None`
`stroke_width` | `float | None` |  | `1.25`
`transform` | `NoneValueType | tuple[Transformation] | None` | The transform of the node | `None`
`width` | `float` |  | `30.0`

Methods:

Name | Description
--- | ---
`anchor_point` | Return an anchor point of the layout element
`angle` | Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.
`bbox` | Compute and return the bounding box of the group layout element
`border` | Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point.
`center` | Return the center anchor of the node
`childless` | Return a copy of the node with no children
`children` | Return the children of the group layout.
`contains` | Return `true` if another layout element is a descendant of the layout element, `false` otherwise
`descendants` | Return the descendants of the layout element
`drawing_elements` | Return the drawing elements of the group layout.
`east` | Return the east anchor of the node
`east_north_east` | Return the east north east anchor of the node
`east_south_east` | Return the east south east west anchor of the node
`equals` | Return `true` if the layout element is equal to another layout element, `false` otherwise
`flattened` | Return a list containing copy of the layout element with no children and all its descendants with no children
`label_center` | Return the label center anchor of the node
`north` | Return the north anchor of the node
`north_east` | Return the north east anchor of the node
`north_north_east` | Return the north north east anchor of the node
`north_north_west` | Return the north north west anchor of the node
`north_west` | Return the north west anchor of the node
`self_angle` | Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.
`self_bbox` | Compute and return the bounding box of the self drawing element of the group layout
`self_border` | Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point.
`self_children` | Return the self children of the node. A node has unique child that is its label
`self_drawing_elements` | Return the node's own drawing elements
`self_to_shapely` | Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout
`size` | Return the size of the node
`south` | Return the south anchor of the node
`south_east` | Return the south east anchor of the node
`south_south_east` | Return the south south east anchor of the node
`south_south_west` | Return the south south west anchor of the node
`south_west` | Return the south west anchor of the node
`to_shapely` | Return a shapely collection of geometries reproducing the drawing elements of the layout element
`west` | Return the west anchor of the node
`west_north_west` | Return the west north west anchor of the node
`west_south_west` | Return the west south west anchor of the node

Attributes:

Name | Type | Description
--- | --- | ---
`x` | `float` | Return the x coordinate of the node
`y` | `float` | Return the y coordinate of the node

#### `` anchor_point

    anchor_point(anchor_name: str) -> Point

Return an anchor point of the layout element

Source code in `src/momapy/core.py`

    130
    131
    132
    def anchor_point(self, anchor_name: str) -> momapy.geometry.Point:
        """Return an anchor point of the layout element"""
        return getattr(self, anchor_name)()

#### `` angle

    angle(
        angle: float,
        unit: Literal["degrees", "radians"] = "degrees",
    ) -> Point

Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.

Source code in `src/momapy/core.py`

    817
    818
    819
    820
    821
    822
    823
    824
    825
    826
    827
    828
    def angle(
        self,
        angle: float,
        unit: typing.Literal["degrees", "radians"] = "degrees",
    ) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal."""
        return momapy.drawing.get_drawing_elements_angle(
            drawing_elements=self.drawing_elements(),
            angle=angle,
            unit=unit,
            center=self.center(),
        )

#### `` bbox

    bbox() -> Bbox

Compute and return the bounding box of the group layout element

Source code in `src/momapy/core.py`

    504
    505
    506
    507
    508
    509
    510
    511
    512
    513
    514
    515
    516
    517
    518
    519
    520
    521
    522
    523
    524
    525
    526
    def bbox(self) -> momapy.geometry.Bbox:
        """Compute and return the bounding box of the group layout element"""
        self_bbox = self.self_bbox()
        bboxes = [child.bbox() for child in self.children()]
        min_x = self_bbox.north_west().x
        min_y = self_bbox.north_west().y
        max_x = self_bbox.south_east().x
        max_y = self_bbox.south_east().y
        for bbox in bboxes:
            if bbox.north_west().x < min_x:
                min_x = bbox.north_west().x
            if bbox.north_west().y < min_y:
                min_y = bbox.north_west().y
            if bbox.south_east().x > max_x:
                max_x = bbox.south_east().x
            if bbox.south_east().y > max_y:
                max_y = bbox.south_east().y
        bbox = momapy.geometry.Bbox(
            momapy.geometry.Point(min_x / 2 + max_x / 2, min_y / 2 + max_y / 2),
            max_x - min_x,
            max_y - min_y,
        )
        return bbox

#### `` border

    border(point: Point) -> Point

Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point. When there are multiple intersection points, the one closest to the given point is returned

Source code in `src/momapy/core.py`

    794
    795
    796
    797
    798
    799
    800
    801
    802
    def border(self, point: momapy.geometry.Point) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point.
        When there are multiple intersection points, the one closest to the given point is returned
        """
        return momapy.drawing.get_drawing_elements_border(
            drawing_elements=self.drawing_elements(),
            point=point,
            center=self.center(),
        )

#### `` center

    center() -> Point

Return the center anchor of the node

Source code in `src/momapy/core.py`

    776
    777
    778
    def center(self) -> momapy.geometry.Point:
        """Return the center anchor of the node"""
        return self.position

#### `` childless

    childless() -> Self

Return a copy of the node with no children

Source code in `src/momapy/core.py`

    830
    831
    832
    def childless(self) -> typing.Self:
        """Return a copy of the node with no children"""
        return dataclasses.replace(self, label=None, layout_elements=tuple([]))

#### `` children

    children() -> list[LayoutElement]

Return the children of the group layout. These are the self children of the group layout (returned by the `self_children` method) and the other children of the group layout (given by the `layout_elements` attribute)

Source code in `src/momapy/core.py`

    566
    567
    568
    569
    570
    def children(self) -> list[LayoutElement]:
        """Return the children of the group layout.
        These are the self children of the group layout (returned by the `self_children` method) and the other children of the group layout (given by the `layout_elements` attribute)
        """
        return self.self_children() + list(self.layout_elements)

#### `` contains

    contains(other: LayoutElement) -> bool

Return `true` if another layout element is a descendant of the layout element, `false` otherwise

Source code in `src/momapy/core.py`

    119
    120
    121
    def contains(self, other: "LayoutElement") -> bool:
        """Return `true` if another layout element is a descendant of the layout element, `false` otherwise"""
        return other in self.descendants()

#### `` descendants

    descendants() -> list[LayoutElement]

Return the descendants of the layout element

Source code in `src/momapy/core.py`

    90
    91
    92
    93
    94
    95
    96
    def descendants(self) -> list["LayoutElement"]:
        """Return the descendants of the layout element"""
        descendants = []
        for child in self.children():
            descendants.append(child)
            descendants += child.descendants()
        return descendants

#### `` drawing_elements

    drawing_elements() -> list[DrawingElement]

Return the drawing elements of the group layout. The returned drawing elements are a group drawing element formed of the self drawing elements of the group layout and the drawing elements of its children

Source code in `src/momapy/core.py`

    538
    539
    540
    541
    542
    543
    544
    545
    546
    547
    548
    549
    550
    551
    552
    553
    554
    555
    556
    557
    558
    559
    560
    561
    562
    563
    564
    def drawing_elements(self) -> list[momapy.drawing.DrawingElement]:
        """Return the drawing elements of the group layout.
        The returned drawing elements are a group drawing element formed of the self drawing elements of the group layout and the drawing elements of its children
        """
        drawing_elements = self.self_drawing_elements()
        for child in self.children():
            if child is not None:
                drawing_elements += child.drawing_elements()
        group = momapy.drawing.Group(
            class_=f"{type(self).__name__}_group",
            elements=tuple(drawing_elements),
            id_=f"{self.id_}_group",
            fill=self.group_fill,
            fill_rule=self.group_fill_rule,
            filter=self.group_filter,
            font_family=self.group_font_family,
            font_size=self.group_font_size,
            font_style=self.group_font_style,
            font_weight=self.group_font_weight,
            stroke=self.group_stroke,
            stroke_dasharray=self.group_stroke_dasharray,
            stroke_dashoffset=self.group_stroke_dashoffset,
            stroke_width=self.group_stroke_width,
            text_anchor=self.group_text_anchor,
            transform=self.group_transform,
        )
        return [group]

#### `` east

    east() -> Point

Return the east anchor of the node

Source code in `src/momapy/core.py`

    708
    709
    710
    def east(self) -> momapy.geometry.Point:
        """Return the east anchor of the node"""
        return self.self_angle(0)

#### `` east_north_east

    east_north_east() -> Point

Return the east north east anchor of the node

Source code in `src/momapy/core.py`

    700
    701
    702
    703
    704
    705
    706
    def east_north_east(self) -> momapy.geometry.Point:
        """Return the east north east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, -self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` east_south_east

    east_south_east() -> Point

Return the east south east west anchor of the node

Source code in `src/momapy/core.py`

    712
    713
    714
    715
    716
    717
    718
    def east_south_east(self) -> momapy.geometry.Point:
        """Return the east south east west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` equals

    equals(
        other: LayoutElement,
        flattened: bool = False,
        unordered: bool = False,
    ) -> bool

Return `true` if the layout element is equal to another layout element, `false` otherwise

Source code in `src/momapy/core.py`

    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    def equals(
        self, other: "LayoutElement", flattened: bool = False, unordered: bool = False
    ) -> bool:
        """Return `true` if the layout element is equal to another layout element, `false` otherwise"""
        if type(self) is type(other):
            if not flattened:
                return self == other
            else:
                if not unordered:
                    return self.flattened() == other.flattened()
                else:
                    return set(self.flattened()) == set(other.flattened())
        return False

#### `` flattened

    flattened() -> list[LayoutElement]

Return a list containing copy of the layout element with no children and all its descendants with no children

Source code in `src/momapy/core.py`

     98
     99
    100
    101
    102
    103
    def flattened(self) -> list["LayoutElement"]:
        """Return a list containing copy of the layout element with no children and all its descendants with no children"""
        flattened = [self.childless()]
        for child in self.children():
            flattened += child.flattened()
        return flattened

#### `` label_center

    label_center() -> Point

Return the label center anchor of the node

Source code in `src/momapy/core.py`

    780
    781
    782
    def label_center(self) -> momapy.geometry.Point:
        """Return the label center anchor of the node"""
        return self.position

#### `` north

    north() -> Point

Return the north anchor of the node

Source code in `src/momapy/core.py`

    680
    681
    682
    def north(self) -> momapy.geometry.Point:
        """Return the north anchor of the node"""
        return self.self_angle(90)

#### `` north_east

    north_east() -> Point

Return the north east anchor of the node

Source code in `src/momapy/core.py`

    692
    693
    694
    695
    696
    697
    698
    def north_east(self) -> momapy.geometry.Point:
        """Return the north east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, -self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` north_north_east

    north_north_east() -> Point

Return the north north east anchor of the node

Source code in `src/momapy/core.py`

    684
    685
    686
    687
    688
    689
    690
    def north_north_east(self) -> momapy.geometry.Point:
        """Return the north north east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 4, -self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` north_north_west

    north_north_west() -> Point

Return the north north west anchor of the node

Source code in `src/momapy/core.py`

    672
    673
    674
    675
    676
    677
    678
    def north_north_west(self) -> momapy.geometry.Point:
        """Return the north north west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() - (self.width / 4, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` north_west

    north_west() -> Point

Return the north west anchor of the node

Source code in `src/momapy/core.py`

    664
    665
    666
    667
    668
    669
    670
    def north_west(self) -> momapy.geometry.Point:
        """Return the north west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() - (self.width / 2, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` self_angle

    self_angle(
        angle: float,
        unit: Literal["degrees", "radians"] = "degrees",
    ) -> Point

Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.

Source code in `src/momapy/core.py`

    804
    805
    806
    807
    808
    809
    810
    811
    812
    813
    814
    815
    def self_angle(
        self,
        angle: float,
        unit: typing.Literal["degrees", "radians"] = "degrees",
    ) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal."""
        return momapy.drawing.get_drawing_elements_angle(
            drawing_elements=self.self_drawing_elements(),
            angle=angle,
            unit=unit,
            center=self.center(),
        )

#### `` self_bbox

    self_bbox() -> Bbox

Compute and return the bounding box of the self drawing element of the group layout

Source code in `src/momapy/core.py`

    499
    500
    501
    502
    def self_bbox(self) -> momapy.geometry.Bbox:
        """Compute and return the bounding box of the self drawing element of the group layout"""
        bounds = self.self_to_shapely().bounds
        return momapy.geometry.Bbox.from_bounds(bounds)

#### `` self_border

    self_border(point: Point) -> Point

Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point. When there are multiple intersection points, the one closest to the given point is returned

Source code in `src/momapy/core.py`

    784
    785
    786
    787
    788
    789
    790
    791
    792
    def self_border(self, point: momapy.geometry.Point) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point.
        When there are multiple intersection points, the one closest to the given point is returned
        """
        return momapy.drawing.get_drawing_elements_border(
            drawing_elements=self.self_drawing_elements(),
            point=point,
            center=self.center(),
        )

#### `` self_children

    self_children() -> list[LayoutElement]

Return the self children of the node. A node has unique child that is its label

Source code in `src/momapy/core.py`

    654
    655
    656
    657
    658
    def self_children(self) -> list[LayoutElement]:
        """Return the self children of the node. A node has unique child that is its label"""
        if self.label is not None:
            return [self.label]
        return []

#### `` self_drawing_elements

    self_drawing_elements() -> list[DrawingElement]

Return the node's own drawing elements

Source code in `src/momapy/core.py`

    637
    638
    639
    640
    641
    642
    643
    644
    645
    646
    647
    648
    649
    650
    651
    652
    def self_drawing_elements(self) -> list[momapy.drawing.DrawingElement]:
        """Return the node's own drawing elements"""
        drawing_elements = self._border_drawing_elements()
        group = momapy.drawing.Group(
            class_=type(self).__name__,
            elements=tuple(drawing_elements),
            fill=self.fill,
            filter=self.filter,
            id_=self.id_,
            stroke=self.stroke,
            stroke_dasharray=self.stroke_dasharray,
            stroke_dashoffset=self.stroke_dashoffset,
            stroke_width=self.stroke_width,
            transform=self.transform,
        )
        return [group]

#### `` self_to_shapely

    self_to_shapely() -> GeometryCollection

Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout

Source code in `src/momapy/core.py`

    495
    496
    497
    def self_to_shapely(self) -> shapely.GeometryCollection:
        """Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout"""
        return momapy.drawing.drawing_elements_to_shapely(self.drawing_elements())

#### `` size

    size() -> tuple[float, float]

Return the size of the node

Source code in `src/momapy/core.py`

    660
    661
    662
    def size(self) -> tuple[float, float]:
        """Return the size of the node"""
        return (self.width, self.height)

#### `` south

    south() -> Point

Return the south anchor of the node

Source code in `src/momapy/core.py`

    736
    737
    738
    def south(self) -> momapy.geometry.Point:
        """Return the south anchor of the node"""
        return self.self_angle(270)

#### `` south_east

    south_east() -> Point

Return the south east anchor of the node

Source code in `src/momapy/core.py`

    720
    721
    722
    723
    724
    725
    726
    def south_east(self) -> momapy.geometry.Point:
        """Return the south east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` south_south_east

    south_south_east() -> Point

Return the south south east anchor of the node

Source code in `src/momapy/core.py`

    728
    729
    730
    731
    732
    733
    734
    def south_south_east(self) -> momapy.geometry.Point:
        """Return the south south east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 4, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` south_south_west

    south_south_west() -> Point

Return the south south west anchor of the node

Source code in `src/momapy/core.py`

    740
    741
    742
    743
    744
    745
    746
    def south_south_west(self) -> momapy.geometry.Point:
        """Return the south south west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (-self.width / 4, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` south_west

    south_west() -> Point

Return the south west anchor of the node

Source code in `src/momapy/core.py`

    748
    749
    750
    751
    752
    753
    754
    def south_west(self) -> momapy.geometry.Point:
        """Return the south west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (-self.width / 2, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` to_shapely

    to_shapely(to_polygons: bool = False) -> GeometryCollection

Return a shapely collection of geometries reproducing the drawing elements of the layout element

Source code in `src/momapy/core.py`

    123
    124
    125
    126
    127
    128
    def to_shapely(self, to_polygons: bool = False) -> shapely.GeometryCollection:
        """Return a shapely collection of geometries reproducing the drawing elements of the layout element"""
        geom_collection = []
        for drawing_element in self.drawing_elements():
            geom_collection += drawing_element.to_shapely(to_polygons=to_polygons).geoms
        return shapely.GeometryCollection(geom_collection)

#### `` west

    west() -> Point

Return the west anchor of the node

Source code in `src/momapy/core.py`

    764
    765
    766
    def west(self) -> momapy.geometry.Point:
        """Return the west anchor of the node"""
        return self.self_angle(180)

#### `` west_north_west

    west_north_west() -> Point

Return the west north west anchor of the node

Source code in `src/momapy/core.py`

    768
    769
    770
    771
    772
    773
    774
    def west_north_west(self) -> momapy.geometry.Point:
        """Return the west north west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() - (self.width / 2, self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` west_south_west

    west_south_west() -> Point

Return the west south west anchor of the node

Source code in `src/momapy/core.py`

    756
    757
    758
    759
    760
    761
    762
    def west_south_west(self) -> momapy.geometry.Point:
        """Return the west south west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (-self.width / 2, self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` x `property`

    x: float

Return the x coordinate of the node

#### `` y `property`

    y: float

Return the y coordinate of the node

### `` SimpleChemicalMultimer `dataclass`

    SimpleChemicalMultimer(
        *,
        id_: str = make_uuid4_as_str(),
        compartment: Compartment | None = None,
        label: str | None = None,
        state_variables: frozenset[StateVariable] = frozenset(),
        units_of_information: frozenset[
            UnitOfInformation
        ] = frozenset(),
        subunits: frozenset[Subunit] = frozenset(),
        cardinality: int | None = None,
    )

Bases: `Multimer`

Class for simple chemical multimers

Parameters:

Name | Type | Description | Default
--- | --- | --- | ---
`id_` | `str` | The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element | `'b17f8cd4-2b99-40c1-b4c6-adae8033a2f7'`
`compartment` | `Compartment | None` | The compartment of the entity pool | `None`
`label` | `str | None` | The label of the complex | `None`
`state_variables` | `frozenset[StateVariable]` | The state variables of the complex | `<class 'frozenset'>`
`units_of_information` | `frozenset[UnitOfInformation]` | The units of information of the complex | `<class 'frozenset'>`
`subunits` | `frozenset[Subunit]` | The subunits of the complex | `<class 'frozenset'>`
`cardinality` | `int | None` | The cardinality of the multimer | `None`

### `` SimpleChemicalMultimerLayout `dataclass`

    SimpleChemicalMultimerLayout(
        fill: NoneValueType | Color | None = white,
        stroke: NoneValueType | Color | None = black,
        stroke_width: float | None = 1.25,
        offset: float = 3.0,
        subunits_stroke: tuple[NoneValueType | Color]
        | None = None,
        subunits_stroke_width: tuple[NoneValueType | float]
        | None = None,
        subunits_stroke_dasharray: tuple[
            NoneValueType | tuple[float]
        ]
        | None = None,
        subunits_stroke_dashoffset: tuple[float] | None = None,
        subunits_fill: tuple[NoneValueType | Color]
        | None = None,
        subunits_transform: tuple[
            NoneValueType | tuple[Transformation]
        ]
        | None = None,
        subunits_filter: tuple[NoneValueType | Filter]
        | None = None,
        *,
        id_: str = make_uuid4_as_str(),
        layout_elements: tuple[LayoutElement] = tuple(),
        group_fill: NoneValueType | Color | None = None,
        group_fill_rule: FillRule | None = None,
        group_filter: NoneValueType | Filter | None = None,
        group_font_family: str | None = None,
        group_font_size: float | None = None,
        group_font_style: FontStyle | None = None,
        group_font_weight: FontWeight | float | None = None,
        group_stroke: NoneValueType | Color | None = None,
        group_stroke_dasharray: tuple[float, ...] | None = None,
        group_stroke_dashoffset: float | None = None,
        group_stroke_width: float | None = None,
        group_text_anchor: TextAnchor | None = None,
        group_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        filter: NoneValueType | Filter | None = None,
        height: float = 30.0,
        label: TextLayout | None = None,
        position: Point,
        stroke_dasharray: tuple[float, ...] | None = None,
        stroke_dashoffset: float | None = None,
        transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        width: float = 30.0,
    )

Bases: `_MultiMixin`, `SBGNNode`

Class for simple chemical multimer layouts

Parameters:

Name | Type | Description | Default
--- | --- | --- | ---
`id_` | `str` | The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element | `'8912c228-dd50-4e14-a7f4-a31f0f9be58c'`
`layout_elements` | `tuple[LayoutElement]` | The sub-layout elements of the group layout. These are part of the children of the group layout | `<dynamic>`
`group_fill` | `NoneValueType | Color | None` | The fill color of the group layout | `None`
`group_fill_rule` | `FillRule | None` | The fill rule of the group layout | `None`
`group_filter` | `NoneValueType | Filter | None` | The filter of the group layout | `None`
`group_font_family` | `str | None` | The font family of the group layout | `None`
`group_font_size` | `float | None` | The font size of the group layout | `None`
`group_font_style` | `FontStyle | None` | The font style of the group layout | `None`
`group_font_weight` | `FontWeight | float | None` | The font weight of the group layout | `None`
`group_stroke` | `NoneValueType | Color | None` | The stroke color of the group layout | `None`
`group_stroke_dasharray` | `tuple[float, ...] | None` | The stroke dasharray of the group layout | `None`
`group_stroke_dashoffset` | `float | None` | The stroke dashoffset of the group layout | `None`
`group_stroke_width` | `float | None` | The stroke width of the group layout | `None`
`group_text_anchor` | `TextAnchor | None` | The text anchor of the group layout | `None`
`group_transform` | `NoneValueType | tuple[Transformation] | None` | The transform of the group layout | `None`
`fill` | `NoneValueType | Color | None` |  | `Color(red=255, green=255, blue=255, alpha=1.0)`
`filter` | `NoneValueType | Filter | None` | The filter of the node | `None`
`height` | `float` |  | `30.0`
`label` | `TextLayout | None` | The label of the node | `None`
`position` | `Point` | The position of the node | required
`stroke` | `NoneValueType | Color | None` |  | `Color(red=0, green=0, blue=0, alpha=1.0)`
`stroke_dasharray` | `tuple[float, ...] | None` | The stroke dasharray of the node | `None`
`stroke_dashoffset` | `float | None` | The stroke dashoffset of the node | `None`
`stroke_width` | `float | None` |  | `1.25`
`transform` | `NoneValueType | tuple[Transformation] | None` | The transform of the node | `None`
`width` | `float` |  | `30.0`
`offset` | `float` |  | `3.0`
`subunits_stroke` | `tuple[Union[NoneValueType, Color]] | None` |  | `None`
`subunits_stroke_width` | `tuple[Union[NoneValueType, float]] | None` |  | `None`
`subunits_stroke_dasharray` | `tuple[Union[NoneValueType, tuple[float]]] | None` |  | `None`
`subunits_stroke_dashoffset` | `tuple[float] | None` |  | `None`
`subunits_fill` | `tuple[Union[NoneValueType, Color]] | None` |  | `None`
`subunits_transform` | `tuple[Union[NoneValueType, tuple[Transformation]]] | None` |  | `None`
`subunits_filter` | `tuple[Union[NoneValueType, Filter]] | None` |  | `None`

Methods:

Name | Description
--- | ---
`anchor_point` | Return an anchor point of the layout element
`angle` | Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.
`bbox` | Compute and return the bounding box of the group layout element
`border` | Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point.
`center` | Return the center anchor of the node
`childless` | Return a copy of the node with no children
`children` | Return the children of the group layout.
`contains` | Return `true` if another layout element is a descendant of the layout element, `false` otherwise
`descendants` | Return the descendants of the layout element
`drawing_elements` | Return the drawing elements of the group layout.
`east` | Return the east anchor of the node
`east_north_east` | Return the east north east anchor of the node
`east_south_east` | Return the east south east west anchor of the node
`equals` | Return `true` if the layout element is equal to another layout element, `false` otherwise
`flattened` | Return a list containing copy of the layout element with no children and all its descendants with no children
`north` | Return the north anchor of the node
`north_east` | Return the north east anchor of the node
`north_north_east` | Return the north north east anchor of the node
`north_north_west` | Return the north north west anchor of the node
`north_west` | Return the north west anchor of the node
`self_angle` | Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.
`self_bbox` | Compute and return the bounding box of the self drawing element of the group layout
`self_border` | Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point.
`self_children` | Return the self children of the node. A node has unique child that is its label
`self_drawing_elements` | Return the node's own drawing elements
`self_to_shapely` | Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout
`size` | Return the size of the node
`south` | Return the south anchor of the node
`south_east` | Return the south east anchor of the node
`south_south_east` | Return the south south east anchor of the node
`south_south_west` | Return the south south west anchor of the node
`south_west` | Return the south west anchor of the node
`to_shapely` | Return a shapely collection of geometries reproducing the drawing elements of the layout element
`west` | Return the west anchor of the node
`west_north_west` | Return the west north west anchor of the node
`west_south_west` | Return the west south west anchor of the node

Attributes:

Name | Type | Description
--- | --- | ---
`x` | `float` | Return the x coordinate of the node
`y` | `float` | Return the y coordinate of the node

#### `` anchor_point

    anchor_point(anchor_name: str) -> Point

Return an anchor point of the layout element

Source code in `src/momapy/core.py`

    130
    131
    132
    def anchor_point(self, anchor_name: str) -> momapy.geometry.Point:
        """Return an anchor point of the layout element"""
        return getattr(self, anchor_name)()

#### `` angle

    angle(
        angle: float,
        unit: Literal["degrees", "radians"] = "degrees",
    ) -> Point

Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.

Source code in `src/momapy/core.py`

    817
    818
    819
    820
    821
    822
    823
    824
    825
    826
    827
    828
    def angle(
        self,
        angle: float,
        unit: typing.Literal["degrees", "radians"] = "degrees",
    ) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal."""
        return momapy.drawing.get_drawing_elements_angle(
            drawing_elements=self.drawing_elements(),
            angle=angle,
            unit=unit,
            center=self.center(),
        )

#### `` bbox

    bbox() -> Bbox

Compute and return the bounding box of the group layout element

Source code in `src/momapy/core.py`

    504
    505
    506
    507
    508
    509
    510
    511
    512
    513
    514
    515
    516
    517
    518
    519
    520
    521
    522
    523
    524
    525
    526
    def bbox(self) -> momapy.geometry.Bbox:
        """Compute and return the bounding box of the group layout element"""
        self_bbox = self.self_bbox()
        bboxes = [child.bbox() for child in self.children()]
        min_x = self_bbox.north_west().x
        min_y = self_bbox.north_west().y
        max_x = self_bbox.south_east().x
        max_y = self_bbox.south_east().y
        for bbox in bboxes:
            if bbox.north_west().x < min_x:
                min_x = bbox.north_west().x
            if bbox.north_west().y < min_y:
                min_y = bbox.north_west().y
            if bbox.south_east().x > max_x:
                max_x = bbox.south_east().x
            if bbox.south_east().y > max_y:
                max_y = bbox.south_east().y
        bbox = momapy.geometry.Bbox(
            momapy.geometry.Point(min_x / 2 + max_x / 2, min_y / 2 + max_y / 2),
            max_x - min_x,
            max_y - min_y,
        )
        return bbox

#### `` border

    border(point: Point) -> Point

Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point. When there are multiple intersection points, the one closest to the given point is returned

Source code in `src/momapy/core.py`

    794
    795
    796
    797
    798
    799
    800
    801
    802
    def border(self, point: momapy.geometry.Point) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point.
        When there are multiple intersection points, the one closest to the given point is returned
        """
        return momapy.drawing.get_drawing_elements_border(
            drawing_elements=self.drawing_elements(),
            point=point,
            center=self.center(),
        )

#### `` center

    center() -> Point

Return the center anchor of the node

Source code in `src/momapy/core.py`

    776
    777
    778
    def center(self) -> momapy.geometry.Point:
        """Return the center anchor of the node"""
        return self.position

#### `` childless

    childless() -> Self

Return a copy of the node with no children

Source code in `src/momapy/core.py`

    830
    831
    832
    def childless(self) -> typing.Self:
        """Return a copy of the node with no children"""
        return dataclasses.replace(self, label=None, layout_elements=tuple([]))

#### `` children

    children() -> list[LayoutElement]

Return the children of the group layout. These are the self children of the group layout (returned by the `self_children` method) and the other children of the group layout (given by the `layout_elements` attribute)

Source code in `src/momapy/core.py`

    566
    567
    568
    569
    570
    def children(self) -> list[LayoutElement]:
        """Return the children of the group layout.
        These are the self children of the group layout (returned by the `self_children` method) and the other children of the group layout (given by the `layout_elements` attribute)
        """
        return self.self_children() + list(self.layout_elements)

#### `` contains

    contains(other: LayoutElement) -> bool

Return `true` if another layout element is a descendant of the layout element, `false` otherwise

Source code in `src/momapy/core.py`

    119
    120
    121
    def contains(self, other: "LayoutElement") -> bool:
        """Return `true` if another layout element is a descendant of the layout element, `false` otherwise"""
        return other in self.descendants()

#### `` descendants

    descendants() -> list[LayoutElement]

Return the descendants of the layout element

Source code in `src/momapy/core.py`

    90
    91
    92
    93
    94
    95
    96
    def descendants(self) -> list["LayoutElement"]:
        """Return the descendants of the layout element"""
        descendants = []
        for child in self.children():
            descendants.append(child)
            descendants += child.descendants()
        return descendants

#### `` drawing_elements

    drawing_elements() -> list[DrawingElement]

Return the drawing elements of the group layout. The returned drawing elements are a group drawing element formed of the self drawing elements of the group layout and the drawing elements of its children

Source code in `src/momapy/core.py`

    538
    539
    540
    541
    542
    543
    544
    545
    546
    547
    548
    549
    550
    551
    552
    553
    554
    555
    556
    557
    558
    559
    560
    561
    562
    563
    564
    def drawing_elements(self) -> list[momapy.drawing.DrawingElement]:
        """Return the drawing elements of the group layout.
        The returned drawing elements are a group drawing element formed of the self drawing elements of the group layout and the drawing elements of its children
        """
        drawing_elements = self.self_drawing_elements()
        for child in self.children():
            if child is not None:
                drawing_elements += child.drawing_elements()
        group = momapy.drawing.Group(
            class_=f"{type(self).__name__}_group",
            elements=tuple(drawing_elements),
            id_=f"{self.id_}_group",
            fill=self.group_fill,
            fill_rule=self.group_fill_rule,
            filter=self.group_filter,
            font_family=self.group_font_family,
            font_size=self.group_font_size,
            font_style=self.group_font_style,
            font_weight=self.group_font_weight,
            stroke=self.group_stroke,
            stroke_dasharray=self.group_stroke_dasharray,
            stroke_dashoffset=self.group_stroke_dashoffset,
            stroke_width=self.group_stroke_width,
            text_anchor=self.group_text_anchor,
            transform=self.group_transform,
        )
        return [group]

#### `` east

    east() -> Point

Return the east anchor of the node

Source code in `src/momapy/core.py`

    708
    709
    710
    def east(self) -> momapy.geometry.Point:
        """Return the east anchor of the node"""
        return self.self_angle(0)

#### `` east_north_east

    east_north_east() -> Point

Return the east north east anchor of the node

Source code in `src/momapy/core.py`

    700
    701
    702
    703
    704
    705
    706
    def east_north_east(self) -> momapy.geometry.Point:
        """Return the east north east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, -self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` east_south_east

    east_south_east() -> Point

Return the east south east west anchor of the node

Source code in `src/momapy/core.py`

    712
    713
    714
    715
    716
    717
    718
    def east_south_east(self) -> momapy.geometry.Point:
        """Return the east south east west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` equals

    equals(
        other: LayoutElement,
        flattened: bool = False,
        unordered: bool = False,
    ) -> bool

Return `true` if the layout element is equal to another layout element, `false` otherwise

Source code in `src/momapy/core.py`

    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    def equals(
        self, other: "LayoutElement", flattened: bool = False, unordered: bool = False
    ) -> bool:
        """Return `true` if the layout element is equal to another layout element, `false` otherwise"""
        if type(self) is type(other):
            if not flattened:
                return self == other
            else:
                if not unordered:
                    return self.flattened() == other.flattened()
                else:
                    return set(self.flattened()) == set(other.flattened())
        return False

#### `` flattened

    flattened() -> list[LayoutElement]

Return a list containing copy of the layout element with no children and all its descendants with no children

Source code in `src/momapy/core.py`

     98
     99
    100
    101
    102
    103
    def flattened(self) -> list["LayoutElement"]:
        """Return a list containing copy of the layout element with no children and all its descendants with no children"""
        flattened = [self.childless()]
        for child in self.children():
            flattened += child.flattened()
        return flattened

#### `` north

    north() -> Point

Return the north anchor of the node

Source code in `src/momapy/core.py`

    680
    681
    682
    def north(self) -> momapy.geometry.Point:
        """Return the north anchor of the node"""
        return self.self_angle(90)

#### `` north_east

    north_east() -> Point

Return the north east anchor of the node

Source code in `src/momapy/core.py`

    692
    693
    694
    695
    696
    697
    698
    def north_east(self) -> momapy.geometry.Point:
        """Return the north east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, -self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` north_north_east

    north_north_east() -> Point

Return the north north east anchor of the node

Source code in `src/momapy/core.py`

    684
    685
    686
    687
    688
    689
    690
    def north_north_east(self) -> momapy.geometry.Point:
        """Return the north north east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 4, -self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` north_north_west

    north_north_west() -> Point

Return the north north west anchor of the node

Source code in `src/momapy/core.py`

    672
    673
    674
    675
    676
    677
    678
    def north_north_west(self) -> momapy.geometry.Point:
        """Return the north north west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() - (self.width / 4, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` north_west

    north_west() -> Point

Return the north west anchor of the node

Source code in `src/momapy/core.py`

    664
    665
    666
    667
    668
    669
    670
    def north_west(self) -> momapy.geometry.Point:
        """Return the north west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() - (self.width / 2, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` self_angle

    self_angle(
        angle: float,
        unit: Literal["degrees", "radians"] = "degrees",
    ) -> Point

Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.

Source code in `src/momapy/core.py`

    804
    805
    806
    807
    808
    809
    810
    811
    812
    813
    814
    815
    def self_angle(
        self,
        angle: float,
        unit: typing.Literal["degrees", "radians"] = "degrees",
    ) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal."""
        return momapy.drawing.get_drawing_elements_angle(
            drawing_elements=self.self_drawing_elements(),
            angle=angle,
            unit=unit,
            center=self.center(),
        )

#### `` self_bbox

    self_bbox() -> Bbox

Compute and return the bounding box of the self drawing element of the group layout

Source code in `src/momapy/core.py`

    499
    500
    501
    502
    def self_bbox(self) -> momapy.geometry.Bbox:
        """Compute and return the bounding box of the self drawing element of the group layout"""
        bounds = self.self_to_shapely().bounds
        return momapy.geometry.Bbox.from_bounds(bounds)

#### `` self_border

    self_border(point: Point) -> Point

Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point. When there are multiple intersection points, the one closest to the given point is returned

Source code in `src/momapy/core.py`

    784
    785
    786
    787
    788
    789
    790
    791
    792
    def self_border(self, point: momapy.geometry.Point) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point.
        When there are multiple intersection points, the one closest to the given point is returned
        """
        return momapy.drawing.get_drawing_elements_border(
            drawing_elements=self.self_drawing_elements(),
            point=point,
            center=self.center(),
        )

#### `` self_children

    self_children() -> list[LayoutElement]

Return the self children of the node. A node has unique child that is its label

Source code in `src/momapy/core.py`

    654
    655
    656
    657
    658
    def self_children(self) -> list[LayoutElement]:
        """Return the self children of the node. A node has unique child that is its label"""
        if self.label is not None:
            return [self.label]
        return []

#### `` self_drawing_elements

    self_drawing_elements() -> list[DrawingElement]

Return the node's own drawing elements

Source code in `src/momapy/core.py`

    637
    638
    639
    640
    641
    642
    643
    644
    645
    646
    647
    648
    649
    650
    651
    652
    def self_drawing_elements(self) -> list[momapy.drawing.DrawingElement]:
        """Return the node's own drawing elements"""
        drawing_elements = self._border_drawing_elements()
        group = momapy.drawing.Group(
            class_=type(self).__name__,
            elements=tuple(drawing_elements),
            fill=self.fill,
            filter=self.filter,
            id_=self.id_,
            stroke=self.stroke,
            stroke_dasharray=self.stroke_dasharray,
            stroke_dashoffset=self.stroke_dashoffset,
            stroke_width=self.stroke_width,
            transform=self.transform,
        )
        return [group]

#### `` self_to_shapely

    self_to_shapely() -> GeometryCollection

Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout

Source code in `src/momapy/core.py`

    495
    496
    497
    def self_to_shapely(self) -> shapely.GeometryCollection:
        """Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout"""
        return momapy.drawing.drawing_elements_to_shapely(self.drawing_elements())

#### `` size

    size() -> tuple[float, float]

Return the size of the node

Source code in `src/momapy/core.py`

    660
    661
    662
    def size(self) -> tuple[float, float]:
        """Return the size of the node"""
        return (self.width, self.height)

#### `` south

    south() -> Point

Return the south anchor of the node

Source code in `src/momapy/core.py`

    736
    737
    738
    def south(self) -> momapy.geometry.Point:
        """Return the south anchor of the node"""
        return self.self_angle(270)

#### `` south_east

    south_east() -> Point

Return the south east anchor of the node

Source code in `src/momapy/core.py`

    720
    721
    722
    723
    724
    725
    726
    def south_east(self) -> momapy.geometry.Point:
        """Return the south east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` south_south_east

    south_south_east() -> Point

Return the south south east anchor of the node

Source code in `src/momapy/core.py`

    728
    729
    730
    731
    732
    733
    734
    def south_south_east(self) -> momapy.geometry.Point:
        """Return the south south east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 4, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` south_south_west

    south_south_west() -> Point

Return the south south west anchor of the node

Source code in `src/momapy/core.py`

    740
    741
    742
    743
    744
    745
    746
    def south_south_west(self) -> momapy.geometry.Point:
        """Return the south south west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (-self.width / 4, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` south_west

    south_west() -> Point

Return the south west anchor of the node

Source code in `src/momapy/core.py`

    748
    749
    750
    751
    752
    753
    754
    def south_west(self) -> momapy.geometry.Point:
        """Return the south west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (-self.width / 2, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` to_shapely

    to_shapely(to_polygons: bool = False) -> GeometryCollection

Return a shapely collection of geometries reproducing the drawing elements of the layout element

Source code in `src/momapy/core.py`

    123
    124
    125
    126
    127
    128
    def to_shapely(self, to_polygons: bool = False) -> shapely.GeometryCollection:
        """Return a shapely collection of geometries reproducing the drawing elements of the layout element"""
        geom_collection = []
        for drawing_element in self.drawing_elements():
            geom_collection += drawing_element.to_shapely(to_polygons=to_polygons).geoms
        return shapely.GeometryCollection(geom_collection)

#### `` west

    west() -> Point

Return the west anchor of the node

Source code in `src/momapy/core.py`

    764
    765
    766
    def west(self) -> momapy.geometry.Point:
        """Return the west anchor of the node"""
        return self.self_angle(180)

#### `` west_north_west

    west_north_west() -> Point

Return the west north west anchor of the node

Source code in `src/momapy/core.py`

    768
    769
    770
    771
    772
    773
    774
    def west_north_west(self) -> momapy.geometry.Point:
        """Return the west north west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() - (self.width / 2, self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` west_south_west

    west_south_west() -> Point

Return the west south west anchor of the node

Source code in `src/momapy/core.py`

    756
    757
    758
    759
    760
    761
    762
    def west_south_west(self) -> momapy.geometry.Point:
        """Return the west south west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (-self.width / 2, self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` x `property`

    x: float

Return the x coordinate of the node

#### `` y `property`

    y: float

Return the y coordinate of the node

### `` SimpleChemicalMultimerSubunit `dataclass`

    SimpleChemicalMultimerSubunit(
        *,
        id_: str = make_uuid4_as_str(),
        label: str | None = None,
        state_variables: frozenset[StateVariable] = frozenset(),
        units_of_information: frozenset[
            UnitOfInformation
        ] = frozenset(),
        subunits: frozenset[Subunit] = frozenset(),
        cardinality: int | None = None,
    )

Bases: `MultimerSubunit`

Class for simple chemical multimer subunits

Parameters:

Name | Type | Description | Default
--- | --- | --- | ---
`id_` | `str` | The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element | `'f7a0c640-a4a6-4b3f-8d2c-f584db38c8c0'`
`label` | `str | None` | The label of the subunit | `None`
`state_variables` | `frozenset[StateVariable]` | The state variables of the complex subunit | `<class 'frozenset'>`
`units_of_information` | `frozenset[UnitOfInformation]` | The units of information of the complex subunit | `<class 'frozenset'>`
`subunits` | `frozenset[Subunit]` | The subunits of the complex subunit | `<class 'frozenset'>`
`cardinality` | `int | None` | The cardinality of the multimer subunit | `None`

### `` SimpleChemicalMultimerSubunitLayout `dataclass`

    SimpleChemicalMultimerSubunitLayout(
        fill: NoneValueType | Color | None = white,
        stroke: NoneValueType | Color | None = black,
        stroke_width: float | None = 1.25,
        offset: float = 3.0,
        subunits_stroke: tuple[NoneValueType | Color]
        | None = None,
        subunits_stroke_width: tuple[NoneValueType | float]
        | None = None,
        subunits_stroke_dasharray: tuple[
            NoneValueType | tuple[float]
        ]
        | None = None,
        subunits_stroke_dashoffset: tuple[float] | None = None,
        subunits_fill: tuple[NoneValueType | Color]
        | None = None,
        subunits_transform: tuple[
            NoneValueType | tuple[Transformation]
        ]
        | None = None,
        subunits_filter: tuple[NoneValueType | Filter]
        | None = None,
        *,
        id_: str = make_uuid4_as_str(),
        layout_elements: tuple[LayoutElement] = tuple(),
        group_fill: NoneValueType | Color | None = None,
        group_fill_rule: FillRule | None = None,
        group_filter: NoneValueType | Filter | None = None,
        group_font_family: str | None = None,
        group_font_size: float | None = None,
        group_font_style: FontStyle | None = None,
        group_font_weight: FontWeight | float | None = None,
        group_stroke: NoneValueType | Color | None = None,
        group_stroke_dasharray: tuple[float, ...] | None = None,
        group_stroke_dashoffset: float | None = None,
        group_stroke_width: float | None = None,
        group_text_anchor: TextAnchor | None = None,
        group_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        filter: NoneValueType | Filter | None = None,
        height: float = 30.0,
        label: TextLayout | None = None,
        position: Point,
        stroke_dasharray: tuple[float, ...] | None = None,
        stroke_dashoffset: float | None = None,
        transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        width: float = 60.0,
    )

Bases: `_MultiMixin`, `SBGNNode`

Class for simple chemical multimer subunit layouts

Parameters:

Name | Type | Description | Default
--- | --- | --- | ---
`id_` | `str` | The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element | `'7046d14d-5de9-462a-9d94-1809640815c9'`
`layout_elements` | `tuple[LayoutElement]` | The sub-layout elements of the group layout. These are part of the children of the group layout | `<dynamic>`
`group_fill` | `NoneValueType | Color | None` | The fill color of the group layout | `None`
`group_fill_rule` | `FillRule | None` | The fill rule of the group layout | `None`
`group_filter` | `NoneValueType | Filter | None` | The filter of the group layout | `None`
`group_font_family` | `str | None` | The font family of the group layout | `None`
`group_font_size` | `float | None` | The font size of the group layout | `None`
`group_font_style` | `FontStyle | None` | The font style of the group layout | `None`
`group_font_weight` | `FontWeight | float | None` | The font weight of the group layout | `None`
`group_stroke` | `NoneValueType | Color | None` | The stroke color of the group layout | `None`
`group_stroke_dasharray` | `tuple[float, ...] | None` | The stroke dasharray of the group layout | `None`
`group_stroke_dashoffset` | `float | None` | The stroke dashoffset of the group layout | `None`
`group_stroke_width` | `float | None` | The stroke width of the group layout | `None`
`group_text_anchor` | `TextAnchor | None` | The text anchor of the group layout | `None`
`group_transform` | `NoneValueType | tuple[Transformation] | None` | The transform of the group layout | `None`
`fill` | `NoneValueType | Color | None` |  | `Color(red=255, green=255, blue=255, alpha=1.0)`
`filter` | `NoneValueType | Filter | None` | The filter of the node | `None`
`height` | `float` |  | `30.0`
`label` | `TextLayout | None` | The label of the node | `None`
`position` | `Point` | The position of the node | required
`stroke` | `NoneValueType | Color | None` |  | `Color(red=0, green=0, blue=0, alpha=1.0)`
`stroke_dasharray` | `tuple[float, ...] | None` | The stroke dasharray of the node | `None`
`stroke_dashoffset` | `float | None` | The stroke dashoffset of the node | `None`
`stroke_width` | `float | None` |  | `1.25`
`transform` | `NoneValueType | tuple[Transformation] | None` | The transform of the node | `None`
`width` | `float` |  | `60.0`
`offset` | `float` |  | `3.0`
`subunits_stroke` | `tuple[Union[NoneValueType, Color]] | None` |  | `None`
`subunits_stroke_width` | `tuple[Union[NoneValueType, float]] | None` |  | `None`
`subunits_stroke_dasharray` | `tuple[Union[NoneValueType, tuple[float]]] | None` |  | `None`
`subunits_stroke_dashoffset` | `tuple[float] | None` |  | `None`
`subunits_fill` | `tuple[Union[NoneValueType, Color]] | None` |  | `None`
`subunits_transform` | `tuple[Union[NoneValueType, tuple[Transformation]]] | None` |  | `None`
`subunits_filter` | `tuple[Union[NoneValueType, Filter]] | None` |  | `None`

Methods:

Name | Description
--- | ---
`anchor_point` | Return an anchor point of the layout element
`angle` | Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.
`bbox` | Compute and return the bounding box of the group layout element
`border` | Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point.
`center` | Return the center anchor of the node
`childless` | Return a copy of the node with no children
`children` | Return the children of the group layout.
`contains` | Return `true` if another layout element is a descendant of the layout element, `false` otherwise
`descendants` | Return the descendants of the layout element
`drawing_elements` | Return the drawing elements of the group layout.
`east` | Return the east anchor of the node
`east_north_east` | Return the east north east anchor of the node
`east_south_east` | Return the east south east west anchor of the node
`equals` | Return `true` if the layout element is equal to another layout element, `false` otherwise
`flattened` | Return a list containing copy of the layout element with no children and all its descendants with no children
`north` | Return the north anchor of the node
`north_east` | Return the north east anchor of the node
`north_north_east` | Return the north north east anchor of the node
`north_north_west` | Return the north north west anchor of the node
`north_west` | Return the north west anchor of the node
`self_angle` | Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.
`self_bbox` | Compute and return the bounding box of the self drawing element of the group layout
`self_border` | Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point.
`self_children` | Return the self children of the node. A node has unique child that is its label
`self_drawing_elements` | Return the node's own drawing elements
`self_to_shapely` | Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout
`size` | Return the size of the node
`south` | Return the south anchor of the node
`south_east` | Return the south east anchor of the node
`south_south_east` | Return the south south east anchor of the node
`south_south_west` | Return the south south west anchor of the node
`south_west` | Return the south west anchor of the node
`to_shapely` | Return a shapely collection of geometries reproducing the drawing elements of the layout element
`west` | Return the west anchor of the node
`west_north_west` | Return the west north west anchor of the node
`west_south_west` | Return the west south west anchor of the node

Attributes:

Name | Type | Description
--- | --- | ---
`x` | `float` | Return the x coordinate of the node
`y` | `float` | Return the y coordinate of the node

#### `` anchor_point

    anchor_point(anchor_name: str) -> Point

Return an anchor point of the layout element

Source code in `src/momapy/core.py`

    130
    131
    132
    def anchor_point(self, anchor_name: str) -> momapy.geometry.Point:
        """Return an anchor point of the layout element"""
        return getattr(self, anchor_name)()

#### `` angle

    angle(
        angle: float,
        unit: Literal["degrees", "radians"] = "degrees",
    ) -> Point

Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.

Source code in `src/momapy/core.py`

    817
    818
    819
    820
    821
    822
    823
    824
    825
    826
    827
    828
    def angle(
        self,
        angle: float,
        unit: typing.Literal["degrees", "radians"] = "degrees",
    ) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal."""
        return momapy.drawing.get_drawing_elements_angle(
            drawing_elements=self.drawing_elements(),
            angle=angle,
            unit=unit,
            center=self.center(),
        )

#### `` bbox

    bbox() -> Bbox

Compute and return the bounding box of the group layout element

Source code in `src/momapy/core.py`

    504
    505
    506
    507
    508
    509
    510
    511
    512
    513
    514
    515
    516
    517
    518
    519
    520
    521
    522
    523
    524
    525
    526
    def bbox(self) -> momapy.geometry.Bbox:
        """Compute and return the bounding box of the group layout element"""
        self_bbox = self.self_bbox()
        bboxes = [child.bbox() for child in self.children()]
        min_x = self_bbox.north_west().x
        min_y = self_bbox.north_west().y
        max_x = self_bbox.south_east().x
        max_y = self_bbox.south_east().y
        for bbox in bboxes:
            if bbox.north_west().x < min_x:
                min_x = bbox.north_west().x
            if bbox.north_west().y < min_y:
                min_y = bbox.north_west().y
            if bbox.south_east().x > max_x:
                max_x = bbox.south_east().x
            if bbox.south_east().y > max_y:
                max_y = bbox.south_east().y
        bbox = momapy.geometry.Bbox(
            momapy.geometry.Point(min_x / 2 + max_x / 2, min_y / 2 + max_y / 2),
            max_x - min_x,
            max_y - min_y,
        )
        return bbox

#### `` border

    border(point: Point) -> Point

Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point. When there are multiple intersection points, the one closest to the given point is returned

Source code in `src/momapy/core.py`

    794
    795
    796
    797
    798
    799
    800
    801
    802
    def border(self, point: momapy.geometry.Point) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point.
        When there are multiple intersection points, the one closest to the given point is returned
        """
        return momapy.drawing.get_drawing_elements_border(
            drawing_elements=self.drawing_elements(),
            point=point,
            center=self.center(),
        )

#### `` center

    center() -> Point

Return the center anchor of the node

Source code in `src/momapy/core.py`

    776
    777
    778
    def center(self) -> momapy.geometry.Point:
        """Return the center anchor of the node"""
        return self.position

#### `` childless

    childless() -> Self

Return a copy of the node with no children

Source code in `src/momapy/core.py`

    830
    831
    832
    def childless(self) -> typing.Self:
        """Return a copy of the node with no children"""
        return dataclasses.replace(self, label=None, layout_elements=tuple([]))

#### `` children

    children() -> list[LayoutElement]

Return the children of the group layout. These are the self children of the group layout (returned by the `self_children` method) and the other children of the group layout (given by the `layout_elements` attribute)

Source code in `src/momapy/core.py`

    566
    567
    568
    569
    570
    def children(self) -> list[LayoutElement]:
        """Return the children of the group layout.
        These are the self children of the group layout (returned by the `self_children` method) and the other children of the group layout (given by the `layout_elements` attribute)
        """
        return self.self_children() + list(self.layout_elements)

#### `` contains

    contains(other: LayoutElement) -> bool

Return `true` if another layout element is a descendant of the layout element, `false` otherwise

Source code in `src/momapy/core.py`

    119
    120
    121
    def contains(self, other: "LayoutElement") -> bool:
        """Return `true` if another layout element is a descendant of the layout element, `false` otherwise"""
        return other in self.descendants()

#### `` descendants

    descendants() -> list[LayoutElement]

Return the descendants of the layout element

Source code in `src/momapy/core.py`

    90
    91
    92
    93
    94
    95
    96
    def descendants(self) -> list["LayoutElement"]:
        """Return the descendants of the layout element"""
        descendants = []
        for child in self.children():
            descendants.append(child)
            descendants += child.descendants()
        return descendants

#### `` drawing_elements

    drawing_elements() -> list[DrawingElement]

Return the drawing elements of the group layout. The returned drawing elements are a group drawing element formed of the self drawing elements of the group layout and the drawing elements of its children

Source code in `src/momapy/core.py`

    538
    539
    540
    541
    542
    543
    544
    545
    546
    547
    548
    549
    550
    551
    552
    553
    554
    555
    556
    557
    558
    559
    560
    561
    562
    563
    564
    def drawing_elements(self) -> list[momapy.drawing.DrawingElement]:
        """Return the drawing elements of the group layout.
        The returned drawing elements are a group drawing element formed of the self drawing elements of the group layout and the drawing elements of its children
        """
        drawing_elements = self.self_drawing_elements()
        for child in self.children():
            if child is not None:
                drawing_elements += child.drawing_elements()
        group = momapy.drawing.Group(
            class_=f"{type(self).__name__}_group",
            elements=tuple(drawing_elements),
            id_=f"{self.id_}_group",
            fill=self.group_fill,
            fill_rule=self.group_fill_rule,
            filter=self.group_filter,
            font_family=self.group_font_family,
            font_size=self.group_font_size,
            font_style=self.group_font_style,
            font_weight=self.group_font_weight,
            stroke=self.group_stroke,
            stroke_dasharray=self.group_stroke_dasharray,
            stroke_dashoffset=self.group_stroke_dashoffset,
            stroke_width=self.group_stroke_width,
            text_anchor=self.group_text_anchor,
            transform=self.group_transform,
        )
        return [group]

#### `` east

    east() -> Point

Return the east anchor of the node

Source code in `src/momapy/core.py`

    708
    709
    710
    def east(self) -> momapy.geometry.Point:
        """Return the east anchor of the node"""
        return self.self_angle(0)

#### `` east_north_east

    east_north_east() -> Point

Return the east north east anchor of the node

Source code in `src/momapy/core.py`

    700
    701
    702
    703
    704
    705
    706
    def east_north_east(self) -> momapy.geometry.Point:
        """Return the east north east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, -self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` east_south_east

    east_south_east() -> Point

Return the east south east west anchor of the node

Source code in `src/momapy/core.py`

    712
    713
    714
    715
    716
    717
    718
    def east_south_east(self) -> momapy.geometry.Point:
        """Return the east south east west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` equals

    equals(
        other: LayoutElement,
        flattened: bool = False,
        unordered: bool = False,
    ) -> bool

Return `true` if the layout element is equal to another layout element, `false` otherwise

Source code in `src/momapy/core.py`

    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    def equals(
        self, other: "LayoutElement", flattened: bool = False, unordered: bool = False
    ) -> bool:
        """Return `true` if the layout element is equal to another layout element, `false` otherwise"""
        if type(self) is type(other):
            if not flattened:
                return self == other
            else:
                if not unordered:
                    return self.flattened() == other.flattened()
                else:
                    return set(self.flattened()) == set(other.flattened())
        return False

#### `` flattened

    flattened() -> list[LayoutElement]

Return a list containing copy of the layout element with no children and all its descendants with no children

Source code in `src/momapy/core.py`

     98
     99
    100
    101
    102
    103
    def flattened(self) -> list["LayoutElement"]:
        """Return a list containing copy of the layout element with no children and all its descendants with no children"""
        flattened = [self.childless()]
        for child in self.children():
            flattened += child.flattened()
        return flattened

#### `` north

    north() -> Point

Return the north anchor of the node

Source code in `src/momapy/core.py`

    680
    681
    682
    def north(self) -> momapy.geometry.Point:
        """Return the north anchor of the node"""
        return self.self_angle(90)

#### `` north_east

    north_east() -> Point

Return the north east anchor of the node

Source code in `src/momapy/core.py`

    692
    693
    694
    695
    696
    697
    698
    def north_east(self) -> momapy.geometry.Point:
        """Return the north east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, -self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` north_north_east

    north_north_east() -> Point

Return the north north east anchor of the node

Source code in `src/momapy/core.py`

    684
    685
    686
    687
    688
    689
    690
    def north_north_east(self) -> momapy.geometry.Point:
        """Return the north north east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 4, -self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` north_north_west

    north_north_west() -> Point

Return the north north west anchor of the node

Source code in `src/momapy/core.py`

    672
    673
    674
    675
    676
    677
    678
    def north_north_west(self) -> momapy.geometry.Point:
        """Return the north north west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() - (self.width / 4, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` north_west

    north_west() -> Point

Return the north west anchor of the node

Source code in `src/momapy/core.py`

    664
    665
    666
    667
    668
    669
    670
    def north_west(self) -> momapy.geometry.Point:
        """Return the north west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() - (self.width / 2, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` self_angle

    self_angle(
        angle: float,
        unit: Literal["degrees", "radians"] = "degrees",
    ) -> Point

Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.

Source code in `src/momapy/core.py`

    804
    805
    806
    807
    808
    809
    810
    811
    812
    813
    814
    815
    def self_angle(
        self,
        angle: float,
        unit: typing.Literal["degrees", "radians"] = "degrees",
    ) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal."""
        return momapy.drawing.get_drawing_elements_angle(
            drawing_elements=self.self_drawing_elements(),
            angle=angle,
            unit=unit,
            center=self.center(),
        )

#### `` self_bbox

    self_bbox() -> Bbox

Compute and return the bounding box of the self drawing element of the group layout

Source code in `src/momapy/core.py`

    499
    500
    501
    502
    def self_bbox(self) -> momapy.geometry.Bbox:
        """Compute and return the bounding box of the self drawing element of the group layout"""
        bounds = self.self_to_shapely().bounds
        return momapy.geometry.Bbox.from_bounds(bounds)

#### `` self_border

    self_border(point: Point) -> Point

Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point. When there are multiple intersection points, the one closest to the given point is returned

Source code in `src/momapy/core.py`

    784
    785
    786
    787
    788
    789
    790
    791
    792
    def self_border(self, point: momapy.geometry.Point) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point.
        When there are multiple intersection points, the one closest to the given point is returned
        """
        return momapy.drawing.get_drawing_elements_border(
            drawing_elements=self.self_drawing_elements(),
            point=point,
            center=self.center(),
        )

#### `` self_children

    self_children() -> list[LayoutElement]

Return the self children of the node. A node has unique child that is its label

Source code in `src/momapy/core.py`

    654
    655
    656
    657
    658
    def self_children(self) -> list[LayoutElement]:
        """Return the self children of the node. A node has unique child that is its label"""
        if self.label is not None:
            return [self.label]
        return []

#### `` self_drawing_elements

    self_drawing_elements() -> list[DrawingElement]

Return the node's own drawing elements

Source code in `src/momapy/core.py`

    637
    638
    639
    640
    641
    642
    643
    644
    645
    646
    647
    648
    649
    650
    651
    652
    def self_drawing_elements(self) -> list[momapy.drawing.DrawingElement]:
        """Return the node's own drawing elements"""
        drawing_elements = self._border_drawing_elements()
        group = momapy.drawing.Group(
            class_=type(self).__name__,
            elements=tuple(drawing_elements),
            fill=self.fill,
            filter=self.filter,
            id_=self.id_,
            stroke=self.stroke,
            stroke_dasharray=self.stroke_dasharray,
            stroke_dashoffset=self.stroke_dashoffset,
            stroke_width=self.stroke_width,
            transform=self.transform,
        )
        return [group]

#### `` self_to_shapely

    self_to_shapely() -> GeometryCollection

Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout

Source code in `src/momapy/core.py`

    495
    496
    497
    def self_to_shapely(self) -> shapely.GeometryCollection:
        """Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout"""
        return momapy.drawing.drawing_elements_to_shapely(self.drawing_elements())

#### `` size

    size() -> tuple[float, float]

Return the size of the node

Source code in `src/momapy/core.py`

    660
    661
    662
    def size(self) -> tuple[float, float]:
        """Return the size of the node"""
        return (self.width, self.height)

#### `` south

    south() -> Point

Return the south anchor of the node

Source code in `src/momapy/core.py`

    736
    737
    738
    def south(self) -> momapy.geometry.Point:
        """Return the south anchor of the node"""
        return self.self_angle(270)

#### `` south_east

    south_east() -> Point

Return the south east anchor of the node

Source code in `src/momapy/core.py`

    720
    721
    722
    723
    724
    725
    726
    def south_east(self) -> momapy.geometry.Point:
        """Return the south east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` south_south_east

    south_south_east() -> Point

Return the south south east anchor of the node

Source code in `src/momapy/core.py`

    728
    729
    730
    731
    732
    733
    734
    def south_south_east(self) -> momapy.geometry.Point:
        """Return the south south east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 4, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` south_south_west

    south_south_west() -> Point

Return the south south west anchor of the node

Source code in `src/momapy/core.py`

    740
    741
    742
    743
    744
    745
    746
    def south_south_west(self) -> momapy.geometry.Point:
        """Return the south south west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (-self.width / 4, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` south_west

    south_west() -> Point

Return the south west anchor of the node

Source code in `src/momapy/core.py`

    748
    749
    750
    751
    752
    753
    754
    def south_west(self) -> momapy.geometry.Point:
        """Return the south west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (-self.width / 2, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` to_shapely

    to_shapely(to_polygons: bool = False) -> GeometryCollection

Return a shapely collection of geometries reproducing the drawing elements of the layout element

Source code in `src/momapy/core.py`

    123
    124
    125
    126
    127
    128
    def to_shapely(self, to_polygons: bool = False) -> shapely.GeometryCollection:
        """Return a shapely collection of geometries reproducing the drawing elements of the layout element"""
        geom_collection = []
        for drawing_element in self.drawing_elements():
            geom_collection += drawing_element.to_shapely(to_polygons=to_polygons).geoms
        return shapely.GeometryCollection(geom_collection)

#### `` west

    west() -> Point

Return the west anchor of the node

Source code in `src/momapy/core.py`

    764
    765
    766
    def west(self) -> momapy.geometry.Point:
        """Return the west anchor of the node"""
        return self.self_angle(180)

#### `` west_north_west

    west_north_west() -> Point

Return the west north west anchor of the node

Source code in `src/momapy/core.py`

    768
    769
    770
    771
    772
    773
    774
    def west_north_west(self) -> momapy.geometry.Point:
        """Return the west north west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() - (self.width / 2, self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` west_south_west

    west_south_west() -> Point

Return the west south west anchor of the node

Source code in `src/momapy/core.py`

    756
    757
    758
    759
    760
    761
    762
    def west_south_west(self) -> momapy.geometry.Point:
        """Return the west south west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (-self.width / 2, self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` x `property`

    x: float

Return the x coordinate of the node

#### `` y `property`

    y: float

Return the y coordinate of the node

### `` SimpleChemicalSubunit `dataclass`

    SimpleChemicalSubunit(
        *,
        id_: str = make_uuid4_as_str(),
        label: str | None = None,
        state_variables: frozenset[StateVariable] = frozenset(),
        units_of_information: frozenset[
            UnitOfInformation
        ] = frozenset(),
    )

Bases: `Subunit`

Class for simple chemical subunits

Parameters:

Name | Type | Description | Default
--- | --- | --- | ---
`id_` | `str` | The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element | `'5bdac51b-343a-41f1-ae37-3a92393bd400'`
`label` | `str | None` | The label of the subunit | `None`
`state_variables` | `frozenset[StateVariable]` | The state variables of the simple chemical subunit | `<class 'frozenset'>`
`units_of_information` | `frozenset[UnitOfInformation]` | The units of information of the simple chemical subunit | `<class 'frozenset'>`

### `` SimpleChemicalSubunitLayout `dataclass`

    SimpleChemicalSubunitLayout(
        fill: NoneValueType | Color | None = white,
        stroke: NoneValueType | Color | None = black,
        stroke_width: float | None = 1.25,
        *,
        id_: str = make_uuid4_as_str(),
        layout_elements: tuple[LayoutElement] = tuple(),
        group_fill: NoneValueType | Color | None = None,
        group_fill_rule: FillRule | None = None,
        group_filter: NoneValueType | Filter | None = None,
        group_font_family: str | None = None,
        group_font_size: float | None = None,
        group_font_style: FontStyle | None = None,
        group_font_weight: FontWeight | float | None = None,
        group_stroke: NoneValueType | Color | None = None,
        group_stroke_dasharray: tuple[float, ...] | None = None,
        group_stroke_dashoffset: float | None = None,
        group_stroke_width: float | None = None,
        group_text_anchor: TextAnchor | None = None,
        group_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        filter: NoneValueType | Filter | None = None,
        height: float = 30.0,
        label: TextLayout | None = None,
        position: Point,
        stroke_dasharray: tuple[float, ...] | None = None,
        stroke_dashoffset: float | None = None,
        transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        width: float = 30.0,
    )

Bases: `_SimpleMixin`, `SBGNNode`

Class for simple chemical subunit layouts

Parameters:

Name | Type | Description | Default
--- | --- | --- | ---
`id_` | `str` | The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element | `'e52a4a77-be83-4a03-9fe8-7057fe13c8a2'`
`layout_elements` | `tuple[LayoutElement]` | The sub-layout elements of the group layout. These are part of the children of the group layout | `<dynamic>`
`group_fill` | `NoneValueType | Color | None` | The fill color of the group layout | `None`
`group_fill_rule` | `FillRule | None` | The fill rule of the group layout | `None`
`group_filter` | `NoneValueType | Filter | None` | The filter of the group layout | `None`
`group_font_family` | `str | None` | The font family of the group layout | `None`
`group_font_size` | `float | None` | The font size of the group layout | `None`
`group_font_style` | `FontStyle | None` | The font style of the group layout | `None`
`group_font_weight` | `FontWeight | float | None` | The font weight of the group layout | `None`
`group_stroke` | `NoneValueType | Color | None` | The stroke color of the group layout | `None`
`group_stroke_dasharray` | `tuple[float, ...] | None` | The stroke dasharray of the group layout | `None`
`group_stroke_dashoffset` | `float | None` | The stroke dashoffset of the group layout | `None`
`group_stroke_width` | `float | None` | The stroke width of the group layout | `None`
`group_text_anchor` | `TextAnchor | None` | The text anchor of the group layout | `None`
`group_transform` | `NoneValueType | tuple[Transformation] | None` | The transform of the group layout | `None`
`fill` | `NoneValueType | Color | None` |  | `Color(red=255, green=255, blue=255, alpha=1.0)`
`filter` | `NoneValueType | Filter | None` | The filter of the node | `None`
`height` | `float` |  | `30.0`
`label` | `TextLayout | None` | The label of the node | `None`
`position` | `Point` | The position of the node | required
`stroke` | `NoneValueType | Color | None` |  | `Color(red=0, green=0, blue=0, alpha=1.0)`
`stroke_dasharray` | `tuple[float, ...] | None` | The stroke dasharray of the node | `None`
`stroke_dashoffset` | `float | None` | The stroke dashoffset of the node | `None`
`stroke_width` | `float | None` |  | `1.25`
`transform` | `NoneValueType | tuple[Transformation] | None` | The transform of the node | `None`
`width` | `float` |  | `30.0`

Methods:

Name | Description
--- | ---
`anchor_point` | Return an anchor point of the layout element
`angle` | Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.
`bbox` | Compute and return the bounding box of the group layout element
`border` | Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point.
`center` | Return the center anchor of the node
`childless` | Return a copy of the node with no children
`children` | Return the children of the group layout.
`contains` | Return `true` if another layout element is a descendant of the layout element, `false` otherwise
`descendants` | Return the descendants of the layout element
`drawing_elements` | Return the drawing elements of the group layout.
`east` | Return the east anchor of the node
`east_north_east` | Return the east north east anchor of the node
`east_south_east` | Return the east south east west anchor of the node
`equals` | Return `true` if the layout element is equal to another layout element, `false` otherwise
`flattened` | Return a list containing copy of the layout element with no children and all its descendants with no children
`label_center` | Return the label center anchor of the node
`north` | Return the north anchor of the node
`north_east` | Return the north east anchor of the node
`north_north_east` | Return the north north east anchor of the node
`north_north_west` | Return the north north west anchor of the node
`north_west` | Return the north west anchor of the node
`self_angle` | Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.
`self_bbox` | Compute and return the bounding box of the self drawing element of the group layout
`self_border` | Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point.
`self_children` | Return the self children of the node. A node has unique child that is its label
`self_drawing_elements` | Return the node's own drawing elements
`self_to_shapely` | Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout
`size` | Return the size of the node
`south` | Return the south anchor of the node
`south_east` | Return the south east anchor of the node
`south_south_east` | Return the south south east anchor of the node
`south_south_west` | Return the south south west anchor of the node
`south_west` | Return the south west anchor of the node
`to_shapely` | Return a shapely collection of geometries reproducing the drawing elements of the layout element
`west` | Return the west anchor of the node
`west_north_west` | Return the west north west anchor of the node
`west_south_west` | Return the west south west anchor of the node

Attributes:

Name | Type | Description
--- | --- | ---
`x` | `float` | Return the x coordinate of the node
`y` | `float` | Return the y coordinate of the node

#### `` anchor_point

    anchor_point(anchor_name: str) -> Point

Return an anchor point of the layout element

Source code in `src/momapy/core.py`

    130
    131
    132
    def anchor_point(self, anchor_name: str) -> momapy.geometry.Point:
        """Return an anchor point of the layout element"""
        return getattr(self, anchor_name)()

#### `` angle

    angle(
        angle: float,
        unit: Literal["degrees", "radians"] = "degrees",
    ) -> Point

Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.

Source code in `src/momapy/core.py`

    817
    818
    819
    820
    821
    822
    823
    824
    825
    826
    827
    828
    def angle(
        self,
        angle: float,
        unit: typing.Literal["degrees", "radians"] = "degrees",
    ) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal."""
        return momapy.drawing.get_drawing_elements_angle(
            drawing_elements=self.drawing_elements(),
            angle=angle,
            unit=unit,
            center=self.center(),
        )

#### `` bbox

    bbox() -> Bbox

Compute and return the bounding box of the group layout element

Source code in `src/momapy/core.py`

    504
    505
    506
    507
    508
    509
    510
    511
    512
    513
    514
    515
    516
    517
    518
    519
    520
    521
    522
    523
    524
    525
    526
    def bbox(self) -> momapy.geometry.Bbox:
        """Compute and return the bounding box of the group layout element"""
        self_bbox = self.self_bbox()
        bboxes = [child.bbox() for child in self.children()]
        min_x = self_bbox.north_west().x
        min_y = self_bbox.north_west().y
        max_x = self_bbox.south_east().x
        max_y = self_bbox.south_east().y
        for bbox in bboxes:
            if bbox.north_west().x < min_x:
                min_x = bbox.north_west().x
            if bbox.north_west().y < min_y:
                min_y = bbox.north_west().y
            if bbox.south_east().x > max_x:
                max_x = bbox.south_east().x
            if bbox.south_east().y > max_y:
                max_y = bbox.south_east().y
        bbox = momapy.geometry.Bbox(
            momapy.geometry.Point(min_x / 2 + max_x / 2, min_y / 2 + max_y / 2),
            max_x - min_x,
            max_y - min_y,
        )
        return bbox

#### `` border

    border(point: Point) -> Point

Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point. When there are multiple intersection points, the one closest to the given point is returned

Source code in `src/momapy/core.py`

    794
    795
    796
    797
    798
    799
    800
    801
    802
    def border(self, point: momapy.geometry.Point) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point.
        When there are multiple intersection points, the one closest to the given point is returned
        """
        return momapy.drawing.get_drawing_elements_border(
            drawing_elements=self.drawing_elements(),
            point=point,
            center=self.center(),
        )

#### `` center

    center() -> Point

Return the center anchor of the node

Source code in `src/momapy/core.py`

    776
    777
    778
    def center(self) -> momapy.geometry.Point:
        """Return the center anchor of the node"""
        return self.position

#### `` childless

    childless() -> Self

Return a copy of the node with no children

Source code in `src/momapy/core.py`

    830
    831
    832
    def childless(self) -> typing.Self:
        """Return a copy of the node with no children"""
        return dataclasses.replace(self, label=None, layout_elements=tuple([]))

#### `` children

    children() -> list[LayoutElement]

Return the children of the group layout. These are the self children of the group layout (returned by the `self_children` method) and the other children of the group layout (given by the `layout_elements` attribute)

Source code in `src/momapy/core.py`

    566
    567
    568
    569
    570
    def children(self) -> list[LayoutElement]:
        """Return the children of the group layout.
        These are the self children of the group layout (returned by the `self_children` method) and the other children of the group layout (given by the `layout_elements` attribute)
        """
        return self.self_children() + list(self.layout_elements)

#### `` contains

    contains(other: LayoutElement) -> bool

Return `true` if another layout element is a descendant of the layout element, `false` otherwise

Source code in `src/momapy/core.py`

    119
    120
    121
    def contains(self, other: "LayoutElement") -> bool:
        """Return `true` if another layout element is a descendant of the layout element, `false` otherwise"""
        return other in self.descendants()

#### `` descendants

    descendants() -> list[LayoutElement]

Return the descendants of the layout element

Source code in `src/momapy/core.py`

    90
    91
    92
    93
    94
    95
    96
    def descendants(self) -> list["LayoutElement"]:
        """Return the descendants of the layout element"""
        descendants = []
        for child in self.children():
            descendants.append(child)
            descendants += child.descendants()
        return descendants

#### `` drawing_elements

    drawing_elements() -> list[DrawingElement]

Return the drawing elements of the group layout. The returned drawing elements are a group drawing element formed of the self drawing elements of the group layout and the drawing elements of its children

Source code in `src/momapy/core.py`

    538
    539
    540
    541
    542
    543
    544
    545
    546
    547
    548
    549
    550
    551
    552
    553
    554
    555
    556
    557
    558
    559
    560
    561
    562
    563
    564
    def drawing_elements(self) -> list[momapy.drawing.DrawingElement]:
        """Return the drawing elements of the group layout.
        The returned drawing elements are a group drawing element formed of the self drawing elements of the group layout and the drawing elements of its children
        """
        drawing_elements = self.self_drawing_elements()
        for child in self.children():
            if child is not None:
                drawing_elements += child.drawing_elements()
        group = momapy.drawing.Group(
            class_=f"{type(self).__name__}_group",
            elements=tuple(drawing_elements),
            id_=f"{self.id_}_group",
            fill=self.group_fill,
            fill_rule=self.group_fill_rule,
            filter=self.group_filter,
            font_family=self.group_font_family,
            font_size=self.group_font_size,
            font_style=self.group_font_style,
            font_weight=self.group_font_weight,
            stroke=self.group_stroke,
            stroke_dasharray=self.group_stroke_dasharray,
            stroke_dashoffset=self.group_stroke_dashoffset,
            stroke_width=self.group_stroke_width,
            text_anchor=self.group_text_anchor,
            transform=self.group_transform,
        )
        return [group]

#### `` east

    east() -> Point

Return the east anchor of the node

Source code in `src/momapy/core.py`

    708
    709
    710
    def east(self) -> momapy.geometry.Point:
        """Return the east anchor of the node"""
        return self.self_angle(0)

#### `` east_north_east

    east_north_east() -> Point

Return the east north east anchor of the node

Source code in `src/momapy/core.py`

    700
    701
    702
    703
    704
    705
    706
    def east_north_east(self) -> momapy.geometry.Point:
        """Return the east north east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, -self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` east_south_east

    east_south_east() -> Point

Return the east south east west anchor of the node

Source code in `src/momapy/core.py`

    712
    713
    714
    715
    716
    717
    718
    def east_south_east(self) -> momapy.geometry.Point:
        """Return the east south east west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` equals

    equals(
        other: LayoutElement,
        flattened: bool = False,
        unordered: bool = False,
    ) -> bool

Return `true` if the layout element is equal to another layout element, `false` otherwise

Source code in `src/momapy/core.py`

    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    def equals(
        self, other: "LayoutElement", flattened: bool = False, unordered: bool = False
    ) -> bool:
        """Return `true` if the layout element is equal to another layout element, `false` otherwise"""
        if type(self) is type(other):
            if not flattened:
                return self == other
            else:
                if not unordered:
                    return self.flattened() == other.flattened()
                else:
                    return set(self.flattened()) == set(other.flattened())
        return False

#### `` flattened

    flattened() -> list[LayoutElement]

Return a list containing copy of the layout element with no children and all its descendants with no children

Source code in `src/momapy/core.py`

     98
     99
    100
    101
    102
    103
    def flattened(self) -> list["LayoutElement"]:
        """Return a list containing copy of the layout element with no children and all its descendants with no children"""
        flattened = [self.childless()]
        for child in self.children():
            flattened += child.flattened()
        return flattened

#### `` label_center

    label_center() -> Point

Return the label center anchor of the node

Source code in `src/momapy/core.py`

    780
    781
    782
    def label_center(self) -> momapy.geometry.Point:
        """Return the label center anchor of the node"""
        return self.position

#### `` north

    north() -> Point

Return the north anchor of the node

Source code in `src/momapy/core.py`

    680
    681
    682
    def north(self) -> momapy.geometry.Point:
        """Return the north anchor of the node"""
        return self.self_angle(90)

#### `` north_east

    north_east() -> Point

Return the north east anchor of the node

Source code in `src/momapy/core.py`

    692
    693
    694
    695
    696
    697
    698
    def north_east(self) -> momapy.geometry.Point:
        """Return the north east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, -self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` north_north_east

    north_north_east() -> Point

Return the north north east anchor of the node

Source code in `src/momapy/core.py`

    684
    685
    686
    687
    688
    689
    690
    def north_north_east(self) -> momapy.geometry.Point:
        """Return the north north east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 4, -self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` north_north_west

    north_north_west() -> Point

Return the north north west anchor of the node

Source code in `src/momapy/core.py`

    672
    673
    674
    675
    676
    677
    678
    def north_north_west(self) -> momapy.geometry.Point:
        """Return the north north west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() - (self.width / 4, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` north_west

    north_west() -> Point

Return the north west anchor of the node

Source code in `src/momapy/core.py`

    664
    665
    666
    667
    668
    669
    670
    def north_west(self) -> momapy.geometry.Point:
        """Return the north west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() - (self.width / 2, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` self_angle

    self_angle(
        angle: float,
        unit: Literal["degrees", "radians"] = "degrees",
    ) -> Point

Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.

Source code in `src/momapy/core.py`

    804
    805
    806
    807
    808
    809
    810
    811
    812
    813
    814
    815
    def self_angle(
        self,
        angle: float,
        unit: typing.Literal["degrees", "radians"] = "degrees",
    ) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal."""
        return momapy.drawing.get_drawing_elements_angle(
            drawing_elements=self.self_drawing_elements(),
            angle=angle,
            unit=unit,
            center=self.center(),
        )

#### `` self_bbox

    self_bbox() -> Bbox

Compute and return the bounding box of the self drawing element of the group layout

Source code in `src/momapy/core.py`

    499
    500
    501
    502
    def self_bbox(self) -> momapy.geometry.Bbox:
        """Compute and return the bounding box of the self drawing element of the group layout"""
        bounds = self.self_to_shapely().bounds
        return momapy.geometry.Bbox.from_bounds(bounds)

#### `` self_border

    self_border(point: Point) -> Point

Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point. When there are multiple intersection points, the one closest to the given point is returned

Source code in `src/momapy/core.py`

    784
    785
    786
    787
    788
    789
    790
    791
    792
    def self_border(self, point: momapy.geometry.Point) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point.
        When there are multiple intersection points, the one closest to the given point is returned
        """
        return momapy.drawing.get_drawing_elements_border(
            drawing_elements=self.self_drawing_elements(),
            point=point,
            center=self.center(),
        )

#### `` self_children

    self_children() -> list[LayoutElement]

Return the self children of the node. A node has unique child that is its label

Source code in `src/momapy/core.py`

    654
    655
    656
    657
    658
    def self_children(self) -> list[LayoutElement]:
        """Return the self children of the node. A node has unique child that is its label"""
        if self.label is not None:
            return [self.label]
        return []

#### `` self_drawing_elements

    self_drawing_elements() -> list[DrawingElement]

Return the node's own drawing elements

Source code in `src/momapy/core.py`

    637
    638
    639
    640
    641
    642
    643
    644
    645
    646
    647
    648
    649
    650
    651
    652
    def self_drawing_elements(self) -> list[momapy.drawing.DrawingElement]:
        """Return the node's own drawing elements"""
        drawing_elements = self._border_drawing_elements()
        group = momapy.drawing.Group(
            class_=type(self).__name__,
            elements=tuple(drawing_elements),
            fill=self.fill,
            filter=self.filter,
            id_=self.id_,
            stroke=self.stroke,
            stroke_dasharray=self.stroke_dasharray,
            stroke_dashoffset=self.stroke_dashoffset,
            stroke_width=self.stroke_width,
            transform=self.transform,
        )
        return [group]

#### `` self_to_shapely

    self_to_shapely() -> GeometryCollection

Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout

Source code in `src/momapy/core.py`

    495
    496
    497
    def self_to_shapely(self) -> shapely.GeometryCollection:
        """Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout"""
        return momapy.drawing.drawing_elements_to_shapely(self.drawing_elements())

#### `` size

    size() -> tuple[float, float]

Return the size of the node

Source code in `src/momapy/core.py`

    660
    661
    662
    def size(self) -> tuple[float, float]:
        """Return the size of the node"""
        return (self.width, self.height)

#### `` south

    south() -> Point

Return the south anchor of the node

Source code in `src/momapy/core.py`

    736
    737
    738
    def south(self) -> momapy.geometry.Point:
        """Return the south anchor of the node"""
        return self.self_angle(270)

#### `` south_east

    south_east() -> Point

Return the south east anchor of the node

Source code in `src/momapy/core.py`

    720
    721
    722
    723
    724
    725
    726
    def south_east(self) -> momapy.geometry.Point:
        """Return the south east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` south_south_east

    south_south_east() -> Point

Return the south south east anchor of the node

Source code in `src/momapy/core.py`

    728
    729
    730
    731
    732
    733
    734
    def south_south_east(self) -> momapy.geometry.Point:
        """Return the south south east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 4, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` south_south_west

    south_south_west() -> Point

Return the south south west anchor of the node

Source code in `src/momapy/core.py`

    740
    741
    742
    743
    744
    745
    746
    def south_south_west(self) -> momapy.geometry.Point:
        """Return the south south west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (-self.width / 4, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` south_west

    south_west() -> Point

Return the south west anchor of the node

Source code in `src/momapy/core.py`

    748
    749
    750
    751
    752
    753
    754
    def south_west(self) -> momapy.geometry.Point:
        """Return the south west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (-self.width / 2, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` to_shapely

    to_shapely(to_polygons: bool = False) -> GeometryCollection

Return a shapely collection of geometries reproducing the drawing elements of the layout element

Source code in `src/momapy/core.py`

    123
    124
    125
    126
    127
    128
    def to_shapely(self, to_polygons: bool = False) -> shapely.GeometryCollection:
        """Return a shapely collection of geometries reproducing the drawing elements of the layout element"""
        geom_collection = []
        for drawing_element in self.drawing_elements():
            geom_collection += drawing_element.to_shapely(to_polygons=to_polygons).geoms
        return shapely.GeometryCollection(geom_collection)

#### `` west

    west() -> Point

Return the west anchor of the node

Source code in `src/momapy/core.py`

    764
    765
    766
    def west(self) -> momapy.geometry.Point:
        """Return the west anchor of the node"""
        return self.self_angle(180)

#### `` west_north_west

    west_north_west() -> Point

Return the west north west anchor of the node

Source code in `src/momapy/core.py`

    768
    769
    770
    771
    772
    773
    774
    def west_north_west(self) -> momapy.geometry.Point:
        """Return the west north west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() - (self.width / 2, self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` west_south_west

    west_south_west() -> Point

Return the west south west anchor of the node

Source code in `src/momapy/core.py`

    756
    757
    758
    759
    760
    761
    762
    def west_south_west(self) -> momapy.geometry.Point:
        """Return the west south west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (-self.width / 2, self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` x `property`

    x: float

Return the x coordinate of the node

#### `` y `property`

    y: float

Return the y coordinate of the node

### `` StateVariable `dataclass`

    StateVariable(
        *,
        id_: str = make_uuid4_as_str(),
        variable: str | None = None,
        value: str | None = None,
        order: int | None = None,
    )

Bases: `SBGNAuxiliaryUnit`

Class for state variables

Parameters:

Name | Type | Description | Default
--- | --- | --- | ---
`id_` | `str` | The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element | `'3f9907fa-8802-4291-b81c-4fb5685cc6a4'`
`variable` | `str | None` | The variable of the state variable | `None`
`value` | `str | None` | The value of the state variable | `None`
`order` | `int | None` | The order of the state variable. This is used to distinguish between two or more state variables with undefined variable (i.e., set to `None`) | `None`

### `` StateVariableLayout `dataclass`

    StateVariableLayout(
        fill: NoneValueType | Color | None = white,
        stroke: NoneValueType | Color | None = black,
        stroke_width: float | None = 1.25,
        *,
        id_: str = make_uuid4_as_str(),
        layout_elements: tuple[LayoutElement] = tuple(),
        group_fill: NoneValueType | Color | None = None,
        group_fill_rule: FillRule | None = None,
        group_filter: NoneValueType | Filter | None = None,
        group_font_family: str | None = None,
        group_font_size: float | None = None,
        group_font_style: FontStyle | None = None,
        group_font_weight: FontWeight | float | None = None,
        group_stroke: NoneValueType | Color | None = None,
        group_stroke_dasharray: tuple[float, ...] | None = None,
        group_stroke_dashoffset: float | None = None,
        group_stroke_width: float | None = None,
        group_text_anchor: TextAnchor | None = None,
        group_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        filter: NoneValueType | Filter | None = None,
        height: float = 12.0,
        label: TextLayout | None = None,
        position: Point,
        stroke_dasharray: tuple[float, ...] | None = None,
        stroke_dashoffset: float | None = None,
        transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        width: float = 12.0,
    )

Bases: `_SimpleMixin`, `SBGNNode`

Class for state variable layouts

Parameters:

Name | Type | Description | Default
--- | --- | --- | ---
`id_` | `str` | The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element | `'fbe05282-0089-4cfa-bf5a-6e6926d77a16'`
`layout_elements` | `tuple[LayoutElement]` | The sub-layout elements of the group layout. These are part of the children of the group layout | `<dynamic>`
`group_fill` | `NoneValueType | Color | None` | The fill color of the group layout | `None`
`group_fill_rule` | `FillRule | None` | The fill rule of the group layout | `None`
`group_filter` | `NoneValueType | Filter | None` | The filter of the group layout | `None`
`group_font_family` | `str | None` | The font family of the group layout | `None`
`group_font_size` | `float | None` | The font size of the group layout | `None`
`group_font_style` | `FontStyle | None` | The font style of the group layout | `None`
`group_font_weight` | `FontWeight | float | None` | The font weight of the group layout | `None`
`group_stroke` | `NoneValueType | Color | None` | The stroke color of the group layout | `None`
`group_stroke_dasharray` | `tuple[float, ...] | None` | The stroke dasharray of the group layout | `None`
`group_stroke_dashoffset` | `float | None` | The stroke dashoffset of the group layout | `None`
`group_stroke_width` | `float | None` | The stroke width of the group layout | `None`
`group_text_anchor` | `TextAnchor | None` | The text anchor of the group layout | `None`
`group_transform` | `NoneValueType | tuple[Transformation] | None` | The transform of the group layout | `None`
`fill` | `NoneValueType | Color | None` |  | `Color(red=255, green=255, blue=255, alpha=1.0)`
`filter` | `NoneValueType | Filter | None` | The filter of the node | `None`
`height` | `float` | The height of the state variable layout | `12.0`
`label` | `TextLayout | None` | The label of the node | `None`
`position` | `Point` | The position of the node | required
`stroke` | `NoneValueType | Color | None` |  | `Color(red=0, green=0, blue=0, alpha=1.0)`
`stroke_dasharray` | `tuple[float, ...] | None` | The stroke dasharray of the node | `None`
`stroke_dashoffset` | `float | None` | The stroke dashoffset of the node | `None`
`stroke_width` | `float | None` |  | `1.25`
`transform` | `NoneValueType | tuple[Transformation] | None` | The transform of the node | `None`
`width` | `float` | The width of the state variable layout | `12.0`

Methods:

Name | Description
--- | ---
`anchor_point` | Return an anchor point of the layout element
`angle` | Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.
`bbox` | Compute and return the bounding box of the group layout element
`border` | Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point.
`center` | Return the center anchor of the node
`childless` | Return a copy of the node with no children
`children` | Return the children of the group layout.
`contains` | Return `true` if another layout element is a descendant of the layout element, `false` otherwise
`descendants` | Return the descendants of the layout element
`drawing_elements` | Return the drawing elements of the group layout.
`east` | Return the east anchor of the node
`east_north_east` | Return the east north east anchor of the node
`east_south_east` | Return the east south east west anchor of the node
`equals` | Return `true` if the layout element is equal to another layout element, `false` otherwise
`flattened` | Return a list containing copy of the layout element with no children and all its descendants with no children
`label_center` | Return the label center anchor of the node
`north` | Return the north anchor of the node
`north_east` | Return the north east anchor of the node
`north_north_east` | Return the north north east anchor of the node
`north_north_west` | Return the north north west anchor of the node
`north_west` | Return the north west anchor of the node
`self_angle` | Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.
`self_bbox` | Compute and return the bounding box of the self drawing element of the group layout
`self_border` | Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point.
`self_children` | Return the self children of the node. A node has unique child that is its label
`self_drawing_elements` | Return the node's own drawing elements
`self_to_shapely` | Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout
`size` | Return the size of the node
`south` | Return the south anchor of the node
`south_east` | Return the south east anchor of the node
`south_south_east` | Return the south south east anchor of the node
`south_south_west` | Return the south south west anchor of the node
`south_west` | Return the south west anchor of the node
`to_shapely` | Return a shapely collection of geometries reproducing the drawing elements of the layout element
`west` | Return the west anchor of the node
`west_north_west` | Return the west north west anchor of the node
`west_south_west` | Return the west south west anchor of the node

Attributes:

Name | Type | Description
--- | --- | ---
`x` | `float` | Return the x coordinate of the node
`y` | `float` | Return the y coordinate of the node

#### `` anchor_point

    anchor_point(anchor_name: str) -> Point

Return an anchor point of the layout element

Source code in `src/momapy/core.py`

    130
    131
    132
    def anchor_point(self, anchor_name: str) -> momapy.geometry.Point:
        """Return an anchor point of the layout element"""
        return getattr(self, anchor_name)()

#### `` angle

    angle(
        angle: float,
        unit: Literal["degrees", "radians"] = "degrees",
    ) -> Point

Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.

Source code in `src/momapy/core.py`

    817
    818
    819
    820
    821
    822
    823
    824
    825
    826
    827
    828
    def angle(
        self,
        angle: float,
        unit: typing.Literal["degrees", "radians"] = "degrees",
    ) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal."""
        return momapy.drawing.get_drawing_elements_angle(
            drawing_elements=self.drawing_elements(),
            angle=angle,
            unit=unit,
            center=self.center(),
        )

#### `` bbox

    bbox() -> Bbox

Compute and return the bounding box of the group layout element

Source code in `src/momapy/core.py`

    504
    505
    506
    507
    508
    509
    510
    511
    512
    513
    514
    515
    516
    517
    518
    519
    520
    521
    522
    523
    524
    525
    526
    def bbox(self) -> momapy.geometry.Bbox:
        """Compute and return the bounding box of the group layout element"""
        self_bbox = self.self_bbox()
        bboxes = [child.bbox() for child in self.children()]
        min_x = self_bbox.north_west().x
        min_y = self_bbox.north_west().y
        max_x = self_bbox.south_east().x
        max_y = self_bbox.south_east().y
        for bbox in bboxes:
            if bbox.north_west().x < min_x:
                min_x = bbox.north_west().x
            if bbox.north_west().y < min_y:
                min_y = bbox.north_west().y
            if bbox.south_east().x > max_x:
                max_x = bbox.south_east().x
            if bbox.south_east().y > max_y:
                max_y = bbox.south_east().y
        bbox = momapy.geometry.Bbox(
            momapy.geometry.Point(min_x / 2 + max_x / 2, min_y / 2 + max_y / 2),
            max_x - min_x,
            max_y - min_y,
        )
        return bbox

#### `` border

    border(point: Point) -> Point

Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point. When there are multiple intersection points, the one closest to the given point is returned

Source code in `src/momapy/core.py`

    794
    795
    796
    797
    798
    799
    800
    801
    802
    def border(self, point: momapy.geometry.Point) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point.
        When there are multiple intersection points, the one closest to the given point is returned
        """
        return momapy.drawing.get_drawing_elements_border(
            drawing_elements=self.drawing_elements(),
            point=point,
            center=self.center(),
        )

#### `` center

    center() -> Point

Return the center anchor of the node

Source code in `src/momapy/core.py`

    776
    777
    778
    def center(self) -> momapy.geometry.Point:
        """Return the center anchor of the node"""
        return self.position

#### `` childless

    childless() -> Self

Return a copy of the node with no children

Source code in `src/momapy/core.py`

    830
    831
    832
    def childless(self) -> typing.Self:
        """Return a copy of the node with no children"""
        return dataclasses.replace(self, label=None, layout_elements=tuple([]))

#### `` children

    children() -> list[LayoutElement]

Return the children of the group layout. These are the self children of the group layout (returned by the `self_children` method) and the other children of the group layout (given by the `layout_elements` attribute)

Source code in `src/momapy/core.py`

    566
    567
    568
    569
    570
    def children(self) -> list[LayoutElement]:
        """Return the children of the group layout.
        These are the self children of the group layout (returned by the `self_children` method) and the other children of the group layout (given by the `layout_elements` attribute)
        """
        return self.self_children() + list(self.layout_elements)

#### `` contains

    contains(other: LayoutElement) -> bool

Return `true` if another layout element is a descendant of the layout element, `false` otherwise

Source code in `src/momapy/core.py`

    119
    120
    121
    def contains(self, other: "LayoutElement") -> bool:
        """Return `true` if another layout element is a descendant of the layout element, `false` otherwise"""
        return other in self.descendants()

#### `` descendants

    descendants() -> list[LayoutElement]

Return the descendants of the layout element

Source code in `src/momapy/core.py`

    90
    91
    92
    93
    94
    95
    96
    def descendants(self) -> list["LayoutElement"]:
        """Return the descendants of the layout element"""
        descendants = []
        for child in self.children():
            descendants.append(child)
            descendants += child.descendants()
        return descendants

#### `` drawing_elements

    drawing_elements() -> list[DrawingElement]

Return the drawing elements of the group layout. The returned drawing elements are a group drawing element formed of the self drawing elements of the group layout and the drawing elements of its children

Source code in `src/momapy/core.py`

    538
    539
    540
    541
    542
    543
    544
    545
    546
    547
    548
    549
    550
    551
    552
    553
    554
    555
    556
    557
    558
    559
    560
    561
    562
    563
    564
    def drawing_elements(self) -> list[momapy.drawing.DrawingElement]:
        """Return the drawing elements of the group layout.
        The returned drawing elements are a group drawing element formed of the self drawing elements of the group layout and the drawing elements of its children
        """
        drawing_elements = self.self_drawing_elements()
        for child in self.children():
            if child is not None:
                drawing_elements += child.drawing_elements()
        group = momapy.drawing.Group(
            class_=f"{type(self).__name__}_group",
            elements=tuple(drawing_elements),
            id_=f"{self.id_}_group",
            fill=self.group_fill,
            fill_rule=self.group_fill_rule,
            filter=self.group_filter,
            font_family=self.group_font_family,
            font_size=self.group_font_size,
            font_style=self.group_font_style,
            font_weight=self.group_font_weight,
            stroke=self.group_stroke,
            stroke_dasharray=self.group_stroke_dasharray,
            stroke_dashoffset=self.group_stroke_dashoffset,
            stroke_width=self.group_stroke_width,
            text_anchor=self.group_text_anchor,
            transform=self.group_transform,
        )
        return [group]

#### `` east

    east() -> Point

Return the east anchor of the node

Source code in `src/momapy/core.py`

    708
    709
    710
    def east(self) -> momapy.geometry.Point:
        """Return the east anchor of the node"""
        return self.self_angle(0)

#### `` east_north_east

    east_north_east() -> Point

Return the east north east anchor of the node

Source code in `src/momapy/core.py`

    700
    701
    702
    703
    704
    705
    706
    def east_north_east(self) -> momapy.geometry.Point:
        """Return the east north east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, -self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` east_south_east

    east_south_east() -> Point

Return the east south east west anchor of the node

Source code in `src/momapy/core.py`

    712
    713
    714
    715
    716
    717
    718
    def east_south_east(self) -> momapy.geometry.Point:
        """Return the east south east west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` equals

    equals(
        other: LayoutElement,
        flattened: bool = False,
        unordered: bool = False,
    ) -> bool

Return `true` if the layout element is equal to another layout element, `false` otherwise

Source code in `src/momapy/core.py`

    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    def equals(
        self, other: "LayoutElement", flattened: bool = False, unordered: bool = False
    ) -> bool:
        """Return `true` if the layout element is equal to another layout element, `false` otherwise"""
        if type(self) is type(other):
            if not flattened:
                return self == other
            else:
                if not unordered:
                    return self.flattened() == other.flattened()
                else:
                    return set(self.flattened()) == set(other.flattened())
        return False

#### `` flattened

    flattened() -> list[LayoutElement]

Return a list containing copy of the layout element with no children and all its descendants with no children

Source code in `src/momapy/core.py`

     98
     99
    100
    101
    102
    103
    def flattened(self) -> list["LayoutElement"]:
        """Return a list containing copy of the layout element with no children and all its descendants with no children"""
        flattened = [self.childless()]
        for child in self.children():
            flattened += child.flattened()
        return flattened

#### `` label_center

    label_center() -> Point

Return the label center anchor of the node

Source code in `src/momapy/core.py`

    780
    781
    782
    def label_center(self) -> momapy.geometry.Point:
        """Return the label center anchor of the node"""
        return self.position

#### `` north

    north() -> Point

Return the north anchor of the node

Source code in `src/momapy/core.py`

    680
    681
    682
    def north(self) -> momapy.geometry.Point:
        """Return the north anchor of the node"""
        return self.self_angle(90)

#### `` north_east

    north_east() -> Point

Return the north east anchor of the node

Source code in `src/momapy/core.py`

    692
    693
    694
    695
    696
    697
    698
    def north_east(self) -> momapy.geometry.Point:
        """Return the north east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, -self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` north_north_east

    north_north_east() -> Point

Return the north north east anchor of the node

Source code in `src/momapy/core.py`

    684
    685
    686
    687
    688
    689
    690
    def north_north_east(self) -> momapy.geometry.Point:
        """Return the north north east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 4, -self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` north_north_west

    north_north_west() -> Point

Return the north north west anchor of the node

Source code in `src/momapy/core.py`

    672
    673
    674
    675
    676
    677
    678
    def north_north_west(self) -> momapy.geometry.Point:
        """Return the north north west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() - (self.width / 4, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` north_west

    north_west() -> Point

Return the north west anchor of the node

Source code in `src/momapy/core.py`

    664
    665
    666
    667
    668
    669
    670
    def north_west(self) -> momapy.geometry.Point:
        """Return the north west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() - (self.width / 2, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` self_angle

    self_angle(
        angle: float,
        unit: Literal["degrees", "radians"] = "degrees",
    ) -> Point

Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.

Source code in `src/momapy/core.py`

    804
    805
    806
    807
    808
    809
    810
    811
    812
    813
    814
    815
    def self_angle(
        self,
        angle: float,
        unit: typing.Literal["degrees", "radians"] = "degrees",
    ) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal."""
        return momapy.drawing.get_drawing_elements_angle(
            drawing_elements=self.self_drawing_elements(),
            angle=angle,
            unit=unit,
            center=self.center(),
        )

#### `` self_bbox

    self_bbox() -> Bbox

Compute and return the bounding box of the self drawing element of the group layout

Source code in `src/momapy/core.py`

    499
    500
    501
    502
    def self_bbox(self) -> momapy.geometry.Bbox:
        """Compute and return the bounding box of the self drawing element of the group layout"""
        bounds = self.self_to_shapely().bounds
        return momapy.geometry.Bbox.from_bounds(bounds)

#### `` self_border

    self_border(point: Point) -> Point

Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point. When there are multiple intersection points, the one closest to the given point is returned

Source code in `src/momapy/core.py`

    784
    785
    786
    787
    788
    789
    790
    791
    792
    def self_border(self, point: momapy.geometry.Point) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point.
        When there are multiple intersection points, the one closest to the given point is returned
        """
        return momapy.drawing.get_drawing_elements_border(
            drawing_elements=self.self_drawing_elements(),
            point=point,
            center=self.center(),
        )

#### `` self_children

    self_children() -> list[LayoutElement]

Return the self children of the node. A node has unique child that is its label

Source code in `src/momapy/core.py`

    654
    655
    656
    657
    658
    def self_children(self) -> list[LayoutElement]:
        """Return the self children of the node. A node has unique child that is its label"""
        if self.label is not None:
            return [self.label]
        return []

#### `` self_drawing_elements

    self_drawing_elements() -> list[DrawingElement]

Return the node's own drawing elements

Source code in `src/momapy/core.py`

    637
    638
    639
    640
    641
    642
    643
    644
    645
    646
    647
    648
    649
    650
    651
    652
    def self_drawing_elements(self) -> list[momapy.drawing.DrawingElement]:
        """Return the node's own drawing elements"""
        drawing_elements = self._border_drawing_elements()
        group = momapy.drawing.Group(
            class_=type(self).__name__,
            elements=tuple(drawing_elements),
            fill=self.fill,
            filter=self.filter,
            id_=self.id_,
            stroke=self.stroke,
            stroke_dasharray=self.stroke_dasharray,
            stroke_dashoffset=self.stroke_dashoffset,
            stroke_width=self.stroke_width,
            transform=self.transform,
        )
        return [group]

#### `` self_to_shapely

    self_to_shapely() -> GeometryCollection

Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout

Source code in `src/momapy/core.py`

    495
    496
    497
    def self_to_shapely(self) -> shapely.GeometryCollection:
        """Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout"""
        return momapy.drawing.drawing_elements_to_shapely(self.drawing_elements())

#### `` size

    size() -> tuple[float, float]

Return the size of the node

Source code in `src/momapy/core.py`

    660
    661
    662
    def size(self) -> tuple[float, float]:
        """Return the size of the node"""
        return (self.width, self.height)

#### `` south

    south() -> Point

Return the south anchor of the node

Source code in `src/momapy/core.py`

    736
    737
    738
    def south(self) -> momapy.geometry.Point:
        """Return the south anchor of the node"""
        return self.self_angle(270)

#### `` south_east

    south_east() -> Point

Return the south east anchor of the node

Source code in `src/momapy/core.py`

    720
    721
    722
    723
    724
    725
    726
    def south_east(self) -> momapy.geometry.Point:
        """Return the south east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` south_south_east

    south_south_east() -> Point

Return the south south east anchor of the node

Source code in `src/momapy/core.py`

    728
    729
    730
    731
    732
    733
    734
    def south_south_east(self) -> momapy.geometry.Point:
        """Return the south south east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 4, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` south_south_west

    south_south_west() -> Point

Return the south south west anchor of the node

Source code in `src/momapy/core.py`

    740
    741
    742
    743
    744
    745
    746
    def south_south_west(self) -> momapy.geometry.Point:
        """Return the south south west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (-self.width / 4, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` south_west

    south_west() -> Point

Return the south west anchor of the node

Source code in `src/momapy/core.py`

    748
    749
    750
    751
    752
    753
    754
    def south_west(self) -> momapy.geometry.Point:
        """Return the south west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (-self.width / 2, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` to_shapely

    to_shapely(to_polygons: bool = False) -> GeometryCollection

Return a shapely collection of geometries reproducing the drawing elements of the layout element

Source code in `src/momapy/core.py`

    123
    124
    125
    126
    127
    128
    def to_shapely(self, to_polygons: bool = False) -> shapely.GeometryCollection:
        """Return a shapely collection of geometries reproducing the drawing elements of the layout element"""
        geom_collection = []
        for drawing_element in self.drawing_elements():
            geom_collection += drawing_element.to_shapely(to_polygons=to_polygons).geoms
        return shapely.GeometryCollection(geom_collection)

#### `` west

    west() -> Point

Return the west anchor of the node

Source code in `src/momapy/core.py`

    764
    765
    766
    def west(self) -> momapy.geometry.Point:
        """Return the west anchor of the node"""
        return self.self_angle(180)

#### `` west_north_west

    west_north_west() -> Point

Return the west north west anchor of the node

Source code in `src/momapy/core.py`

    768
    769
    770
    771
    772
    773
    774
    def west_north_west(self) -> momapy.geometry.Point:
        """Return the west north west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() - (self.width / 2, self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` west_south_west

    west_south_west() -> Point

Return the west south west anchor of the node

Source code in `src/momapy/core.py`

    756
    757
    758
    759
    760
    761
    762
    def west_south_west(self) -> momapy.geometry.Point:
        """Return the west south west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (-self.width / 2, self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` x `property`

    x: float

Return the x coordinate of the node

#### `` y `property`

    y: float

Return the y coordinate of the node

### `` Stimulation `dataclass`

    Stimulation(
        *,
        id_: str = make_uuid4_as_str(),
        source: EntityPool | LogicalOperator,
        target: Process,
    )

Bases: `Modulation`

Class for stimulations

Parameters:

Name | Type | Description | Default
--- | --- | --- | ---
`id_` | `str` | The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element | `'4e92e189-5cb1-4cc6-b47b-88159e1dc653'`
`source` | `EntityPool | LogicalOperator` | The source of the modulation | required
`target` | `Process` | The target of the modulation | required

### `` StimulationLayout `dataclass`

    StimulationLayout(
        path_fill: NoneValueType | Color | None = NoneValue,
        path_stroke: NoneValueType | Color | None = black,
        path_stroke_width: float | None = 1.25,
        arrowhead_fill: NoneValueType | Color | None = white,
        arrowhead_stroke: NoneValueType | Color | None = black,
        arrowhead_stroke_width: float | None = 1.25,
        *,
        id_: str = make_uuid4_as_str(),
        layout_elements: tuple[LayoutElement] = tuple(),
        group_fill: NoneValueType | Color | None = None,
        group_fill_rule: FillRule | None = None,
        group_filter: NoneValueType | Filter | None = None,
        group_font_family: str | None = None,
        group_font_size: float | None = None,
        group_font_style: FontStyle | None = None,
        group_font_weight: FontWeight | float | None = None,
        group_stroke: NoneValueType | Color | None = None,
        group_stroke_dasharray: tuple[float, ...] | None = None,
        group_stroke_dashoffset: float | None = None,
        group_stroke_width: float | None = None,
        group_text_anchor: TextAnchor | None = None,
        group_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        end_shorten: float = 0.0,
        fill: NoneValueType | Color | None = None,
        filter: NoneValueType | Filter | None = None,
        path_filter: NoneValueType | Filter | None = None,
        path_stroke_dasharray: tuple[float, ...] | None = None,
        path_stroke_dashoffset: float | None = None,
        path_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        stroke: NoneValueType | Color | None = None,
        stroke_dasharray: NoneValueType
        | tuple[float]
        | None = None,
        stroke_dashoffset: float | None = None,
        stroke_width: float | None = None,
        segments: tuple[
            Segment | BezierCurve | EllipticalArc
        ] = tuple(),
        source: LayoutElement | None = None,
        start_shorten: float = 0.0,
        target: LayoutElement | None = None,
        transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        arrowhead_filter: NoneValueType | Filter | None = None,
        arrowhead_stroke_dasharray: tuple[float, ...]
        | None = None,
        arrowhead_stroke_dashoffset: float | None = None,
        arrowhead_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        arrowhead_height: float = 10.0,
        arrowhead_width: float = 10.0,
    )

Bases: `SBGNSingleHeadedArc`

Class for stimulation layouts

Parameters:

Name | Type | Description | Default
--- | --- | --- | ---
`id_` | `str` | The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element | `'38117caf-9585-4f56-80fb-69506a45aa29'`
`layout_elements` | `tuple[LayoutElement]` | The sub-layout elements of the group layout. These are part of the children of the group layout | `<dynamic>`
`group_fill` | `NoneValueType | Color | None` | The fill color of the group layout | `None`
`group_fill_rule` | `FillRule | None` | The fill rule of the group layout | `None`
`group_filter` | `NoneValueType | Filter | None` | The filter of the group layout | `None`
`group_font_family` | `str | None` | The font family of the group layout | `None`
`group_font_size` | `float | None` | The font size of the group layout | `None`
`group_font_style` | `FontStyle | None` | The font style of the group layout | `None`
`group_font_weight` | `FontWeight | float | None` | The font weight of the group layout | `None`
`group_stroke` | `NoneValueType | Color | None` | The stroke color of the group layout | `None`
`group_stroke_dasharray` | `tuple[float, ...] | None` | The stroke dasharray of the group layout | `None`
`group_stroke_dashoffset` | `float | None` | The stroke dashoffset of the group layout | `None`
`group_stroke_width` | `float | None` | The stroke width of the group layout | `None`
`group_text_anchor` | `TextAnchor | None` | The text anchor of the group layout | `None`
`group_transform` | `NoneValueType | tuple[Transformation] | None` | The transform of the group layout | `None`
`end_shorten` | `float` | The length the end of the arc will be shorten by | `0.0`
`fill` | `NoneValueType | Color | None` | The fill color of the arc | `None`
`filter` | `NoneValueType | Filter | None` | The fill filter of the arc | `None`
`path_fill` | `NoneValueType | Color | None` |  | `<momapy.drawing.NoneValueType object at 0x7fb32ae9f1d0>`
`path_filter` | `NoneValueType | Filter | None` | The path filter of the arc | `None`
`path_stroke` | `NoneValueType | Color | None` |  | `Color(red=0, green=0, blue=0, alpha=1.0)`
`path_stroke_dasharray` | `tuple[float, ...] | None` | The path stroke dasharray of the arc | `None`
`path_stroke_dashoffset` | `float | None` | The path stroke dashoffset of the arc | `None`
`path_stroke_width` | `float | None` |  | `1.25`
`path_transform` | `NoneValueType | tuple[Transformation] | None` | The path transform of the arc | `None`
`stroke` | `NoneValueType | Color | None` | The stroke color of the arc | `None`
`stroke_dasharray` | `NoneValueType | tuple[float] | None` | The stroke dasharray of the arc | `None`
`stroke_dashoffset` | `float | None` | The stroke dashoffset of the arc | `None`
`stroke_width` | `float | None` | The stroke width of the arc | `None`
`segments` | `tuple[Union[Segment, BezierCurve, EllipticalArc]]` | The path segments of the arc | `<dynamic>`
`source` | `LayoutElement | None` | The source of the arc | `None`
`start_shorten` | `float` | The length the start of the arc will be shorten by | `0.0`
`target` | `LayoutElement | None` | The target of the arc | `None`
`transform` | `NoneValueType | tuple[Transformation] | None` | The transform of the arc | `None`
`arrowhead_fill` | `NoneValueType | Color | None` |  | `Color(red=255, green=255, blue=255, alpha=1.0)`
`arrowhead_filter` | `NoneValueType | Filter | None` | The arrowhead filter of the arc | `None`
`arrowhead_stroke` | `NoneValueType | Color | None` |  | `Color(red=0, green=0, blue=0, alpha=1.0)`
`arrowhead_stroke_dasharray` | `tuple[float, ...] | None` | The arrowhead stroke dasharray of the arc | `None`
`arrowhead_stroke_dashoffset` | `float | None` | The arrowhead stroke dashoffset of the arc | `None`
`arrowhead_stroke_width` | `float | None` |  | `1.25`
`arrowhead_transform` | `NoneValueType | tuple[Transformation] | None` | The arrowhead transform of the arc | `None`
`arrowhead_height` | `float` |  | `10.0`
`arrowhead_width` | `float` |  | `10.0`

Methods:

Name | Description
--- | ---
`anchor_point` | Return an anchor point of the layout element
`arrowhead_base` | Return the arrowhead base anchor point of the single-headed arc
`arrowhead_bbox` | Return the bounding box of the single-headed arc arrowhead
`arrowhead_border` | Return the point at the intersection of the drawing elements of the single-headed arc arrowhead and the line going through the center of these drawing elements and the given point.
`arrowhead_drawing_elements` | Return the drawing elements of the single-headed arc arrowhead
`arrowhead_length` | Return the length of the single-headed arc arrowhead
`arrowhead_tip` | Return the arrowhead tip anchor point of the single-headed arc
`bbox` | Compute and return the bounding box of the group layout element
`childless` | Return a copy of the arc with no children
`children` | Return the children of the group layout.
`contains` | Return `true` if another layout element is a descendant of the layout element, `false` otherwise
`descendants` | Return the descendants of the layout element
`drawing_elements` | Return the drawing elements of the group layout.
`end_point` | Return the ending point of the arc
`equals` | Return `true` if the layout element is equal to another layout element, `false` otherwise
`flattened` | Return a list containing copy of the layout element with no children and all its descendants with no children
`fraction` | Return the position and angle on the arc at a given fraction (of the total arc length)
`length` | Return the total length of the arc path
`path_drawing_elements` | Return the drawing elements of the single-headed arc path
`points` | Return the points of the arc path
`self_bbox` | Compute and return the bounding box of the self drawing element of the group layout
`self_children` | Return the self children of the arc
`self_drawing_elements` | Return the self drawing elements of the single-headed arc
`self_to_shapely` | Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout
`start_point` | Return the starting point of the arc
`to_shapely` | Return a shapely collection of geometries reproducing the drawing elements of the layout element

#### `` anchor_point

    anchor_point(anchor_name: str) -> Point

Return an anchor point of the layout element

Source code in `src/momapy/core.py`

    130
    131
    132
    def anchor_point(self, anchor_name: str) -> momapy.geometry.Point:
        """Return an anchor point of the layout element"""
        return getattr(self, anchor_name)()

#### `` arrowhead_base

    arrowhead_base() -> Point

Return the arrowhead base anchor point of the single-headed arc

Source code in `src/momapy/core.py`

    1058
    1059
    1060
    1061
    1062
    1063
    1064
    1065
    1066
    def arrowhead_base(self) -> momapy.geometry.Point:
        """Return the arrowhead base anchor point of the single-headed arc"""
        arrowhead_length = self.arrowhead_length()
        segment = self.segments[-1]
        segment_length = segment.length()
        if segment_length == 0:
            return self.arrowhead_tip() - (arrowhead_length, 0)
        fraction = 1 - (arrowhead_length + self.end_shorten) / segment_length
        return segment.get_position_at_fraction(fraction)

#### `` arrowhead_bbox

    arrowhead_bbox() -> Bbox

Return the bounding box of the single-headed arc arrowhead

Source code in `src/momapy/core.py`

    1068
    1069
    1070
    1071
    1072
    def arrowhead_bbox(self) -> momapy.geometry.Bbox:
        """Return the bounding box of the single-headed arc arrowhead"""
        return momapy.drawing.get_drawing_elements_bbox(
            self.arrowhead_drawing_elements()
        )

#### `` arrowhead_border

    arrowhead_border(point) -> Point

Return the point at the intersection of the drawing elements of the single-headed arc arrowhead and the line going through the center of these drawing elements and the given point. When there are multiple intersection points, the one closest to the given point is returned

Source code in `src/momapy/core.py`

    1074
    1075
    1076
    1077
    1078
    1079
    1080
    1081
    1082
    1083
    1084
    def arrowhead_border(self, point) -> momapy.geometry.Point:
        """Return the point at the intersection of the drawing elements of the single-headed arc arrowhead and the line going through the center of these drawing elements and the given point.
        When there are multiple intersection points, the one closest to the given point is returned
        """

        point = momapy.drawing.get_drawing_elements_border(
            self.arrowhead_drawing_elements(), point
        )
        if point is None:
            return self.arrowhead_tip()
        return point

#### `` arrowhead_drawing_elements

    arrowhead_drawing_elements() -> list[DrawingElement]

Return the drawing elements of the single-headed arc arrowhead

Source code in `src/momapy/core.py`

    1108
    1109
    1110
    1111
    1112
    1113
    1114
    1115
    1116
    1117
    1118
    1119
    1120
    1121
    1122
    1123
    1124
    1125
    1126
    1127
    def arrowhead_drawing_elements(
        self,
    ) -> list[momapy.drawing.DrawingElement]:
        """Return the drawing elements of the single-headed arc arrowhead"""
        drawing_elements = self._arrowhead_border_drawing_elements()
        group = momapy.drawing.Group(
            class_=f"{type(self).__name__}_arrowhead",
            elements=tuple(drawing_elements),
            fill=self.arrowhead_fill,
            filter=self.arrowhead_filter,
            id_=f"{self.id_}_arrowhead",
            stroke=self.arrowhead_stroke,
            stroke_dasharray=self.arrowhead_stroke_dasharray,
            stroke_dashoffset=self.arrowhead_stroke_dashoffset,
            stroke_width=self.arrowhead_stroke_width,
            transform=self.arrowhead_transform,
        )
        transformation = self._get_arrowhead_transformation()
        group = group.transformed(transformation)
        return [group]

#### `` arrowhead_length

    arrowhead_length() -> float

Return the length of the single-headed arc arrowhead

Source code in `src/momapy/core.py`

    1040
    1041
    1042
    1043
    1044
    1045
    1046
    1047
    def arrowhead_length(self) -> float:
        """Return the length of the single-headed arc arrowhead"""
        bbox = momapy.drawing.get_drawing_elements_bbox(
            self._arrowhead_border_drawing_elements()
        )
        if math.isnan(bbox.width):
            return 0.0
        return bbox.east().x

#### `` arrowhead_tip

    arrowhead_tip() -> Point

Return the arrowhead tip anchor point of the single-headed arc

Source code in `src/momapy/core.py`

    1049
    1050
    1051
    1052
    1053
    1054
    1055
    1056
    def arrowhead_tip(self) -> momapy.geometry.Point:
        """Return the arrowhead tip anchor point of the single-headed arc"""
        segment = self.segments[-1]
        segment_length = segment.length()
        if segment_length == 0:
            return segment.p2
        fraction = 1 - self.end_shorten / segment_length
        return segment.get_position_at_fraction(fraction)

#### `` bbox

    bbox() -> Bbox

Compute and return the bounding box of the group layout element

Source code in `src/momapy/core.py`

    504
    505
    506
    507
    508
    509
    510
    511
    512
    513
    514
    515
    516
    517
    518
    519
    520
    521
    522
    523
    524
    525
    526
    def bbox(self) -> momapy.geometry.Bbox:
        """Compute and return the bounding box of the group layout element"""
        self_bbox = self.self_bbox()
        bboxes = [child.bbox() for child in self.children()]
        min_x = self_bbox.north_west().x
        min_y = self_bbox.north_west().y
        max_x = self_bbox.south_east().x
        max_y = self_bbox.south_east().y
        for bbox in bboxes:
            if bbox.north_west().x < min_x:
                min_x = bbox.north_west().x
            if bbox.north_west().y < min_y:
                min_y = bbox.north_west().y
            if bbox.south_east().x > max_x:
                max_x = bbox.south_east().x
            if bbox.south_east().y > max_y:
                max_y = bbox.south_east().y
        bbox = momapy.geometry.Bbox(
            momapy.geometry.Point(min_x / 2 + max_x / 2, min_y / 2 + max_y / 2),
            max_x - min_x,
            max_y - min_y,
        )
        return bbox

#### `` childless

    childless() -> Self

Return a copy of the arc with no children

Source code in `src/momapy/core.py`

    955
    956
    957
    def childless(self) -> typing.Self:
        """Return a copy of the arc with no children"""
        return dataclasses.replace(self, layout_elements=tuple([]))

#### `` children

    children() -> list[LayoutElement]

Return the children of the group layout. These are the self children of the group layout (returned by the `self_children` method) and the other children of the group layout (given by the `layout_elements` attribute)

Source code in `src/momapy/core.py`

    566
    567
    568
    569
    570
    def children(self) -> list[LayoutElement]:
        """Return the children of the group layout.
        These are the self children of the group layout (returned by the `self_children` method) and the other children of the group layout (given by the `layout_elements` attribute)
        """
        return self.self_children() + list(self.layout_elements)

#### `` contains

    contains(other: LayoutElement) -> bool

Return `true` if another layout element is a descendant of the layout element, `false` otherwise

Source code in `src/momapy/core.py`

    119
    120
    121
    def contains(self, other: "LayoutElement") -> bool:
        """Return `true` if another layout element is a descendant of the layout element, `false` otherwise"""
        return other in self.descendants()

#### `` descendants

    descendants() -> list[LayoutElement]

Return the descendants of the layout element

Source code in `src/momapy/core.py`

    90
    91
    92
    93
    94
    95
    96
    def descendants(self) -> list["LayoutElement"]:
        """Return the descendants of the layout element"""
        descendants = []
        for child in self.children():
            descendants.append(child)
            descendants += child.descendants()
        return descendants

#### `` drawing_elements

    drawing_elements() -> list[DrawingElement]

Return the drawing elements of the group layout. The returned drawing elements are a group drawing element formed of the self drawing elements of the group layout and the drawing elements of its children

Source code in `src/momapy/core.py`

    538
    539
    540
    541
    542
    543
    544
    545
    546
    547
    548
    549
    550
    551
    552
    553
    554
    555
    556
    557
    558
    559
    560
    561
    562
    563
    564
    def drawing_elements(self) -> list[momapy.drawing.DrawingElement]:
        """Return the drawing elements of the group layout.
        The returned drawing elements are a group drawing element formed of the self drawing elements of the group layout and the drawing elements of its children
        """
        drawing_elements = self.self_drawing_elements()
        for child in self.children():
            if child is not None:
                drawing_elements += child.drawing_elements()
        group = momapy.drawing.Group(
            class_=f"{type(self).__name__}_group",
            elements=tuple(drawing_elements),
            id_=f"{self.id_}_group",
            fill=self.group_fill,
            fill_rule=self.group_fill_rule,
            filter=self.group_filter,
            font_family=self.group_font_family,
            font_size=self.group_font_size,
            font_style=self.group_font_style,
            font_weight=self.group_font_weight,
            stroke=self.group_stroke,
            stroke_dasharray=self.group_stroke_dasharray,
            stroke_dashoffset=self.group_stroke_dashoffset,
            stroke_width=self.group_stroke_width,
            text_anchor=self.group_text_anchor,
            transform=self.group_transform,
        )
        return [group]

#### `` end_point

    end_point() -> Point

Return the ending point of the arc

Source code in `src/momapy/core.py`

    951
    952
    953
    def end_point(self) -> momapy.geometry.Point:
        """Return the ending point of the arc"""
        return self.points()[-1]

#### `` equals

    equals(
        other: LayoutElement,
        flattened: bool = False,
        unordered: bool = False,
    ) -> bool

Return `true` if the layout element is equal to another layout element, `false` otherwise

Source code in `src/momapy/core.py`

    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    def equals(
        self, other: "LayoutElement", flattened: bool = False, unordered: bool = False
    ) -> bool:
        """Return `true` if the layout element is equal to another layout element, `false` otherwise"""
        if type(self) is type(other):
            if not flattened:
                return self == other
            else:
                if not unordered:
                    return self.flattened() == other.flattened()
                else:
                    return set(self.flattened()) == set(other.flattened())
        return False

#### `` flattened

    flattened() -> list[LayoutElement]

Return a list containing copy of the layout element with no children and all its descendants with no children

Source code in `src/momapy/core.py`

     98
     99
    100
    101
    102
    103
    def flattened(self) -> list["LayoutElement"]:
        """Return a list containing copy of the layout element with no children and all its descendants with no children"""
        flattened = [self.childless()]
        for child in self.children():
            flattened += child.flattened()
        return flattened

#### `` fraction

    fraction(fraction: float) -> tuple[Point, float]

Return the position and angle on the arc at a given fraction (of the total arc length)

Source code in `src/momapy/core.py`

    959
    960
    961
    962
    963
    964
    965
    966
    967
    968
    def fraction(self, fraction: float) -> tuple[momapy.geometry.Point, float]:
        """Return the position and angle on the arc at a given fraction (of the total arc length)"""
        current_length = 0
        length_to_reach = fraction * self.length()
        for segment in self.segments:
            current_length += segment.length()
            if current_length >= length_to_reach:
                break
        position, angle = segment.get_position_and_angle_at_fraction(fraction)
        return position, angle

#### `` length

    length()

Return the total length of the arc path

Source code in `src/momapy/core.py`

    943
    944
    945
    def length(self):
        """Return the total length of the arc path"""
        return sum([segment.length() for segment in self.segments])

#### `` path_drawing_elements

    path_drawing_elements() -> list[Path]

Return the drawing elements of the single-headed arc path

Source code in `src/momapy/core.py`

    1129
    1130
    1131
    1132
    1133
    1134
    1135
    1136
    1137
    1138
    1139
    1140
    1141
    1142
    1143
    1144
    1145
    1146
    1147
    1148
    1149
    1150
    1151
    1152
    1153
    1154
    1155
    1156
    1157
    1158
    1159
    1160
    1161
    1162
    1163
    1164
    1165
    1166
    1167
    def path_drawing_elements(self) -> list[momapy.drawing.Path]:
        """Return the drawing elements of the single-headed arc path"""
        arrowhead_length = self.arrowhead_length()
        if len(self.segments) == 1:
            segment = (
                self.segments[0]
                .shortened(self.start_shorten, "start")
                .shortened(self.end_shorten + arrowhead_length, "end")
            )
            actions = [
                momapy.drawing.MoveTo(segment.p1),
                self._make_path_action_from_segment(segment),
            ]
        else:
            first_segment = self.segments[0].shortened(self.start_shorten, "start")
            last_segment = self.segments[-1].shortened(
                self.end_shorten + arrowhead_length, "end"
            )
            actions = [
                momapy.drawing.MoveTo(first_segment.p1),
                self._make_path_action_from_segment(first_segment),
            ]
            for segment in self.segments[1:-1]:
                action = self._make_path_action_from_segment(segment)
                actions.append(action)
            actions.append(self._make_path_action_from_segment(last_segment))
        path = momapy.drawing.Path(
            actions=tuple(actions),
            class_=f"{type(self).__name__}_path",
            fill=self.path_fill,
            filter=self.path_filter,
            id_=f"{self.id_}_path",
            stroke=self.path_stroke,
            stroke_dasharray=self.path_stroke_dasharray,
            stroke_dashoffset=self.path_stroke_dashoffset,
            stroke_width=self.path_stroke_width,
            transform=self.path_transform,
        )
        return [path]

#### `` points

    points() -> list[Point]

Return the points of the arc path

Source code in `src/momapy/core.py`

    935
    936
    937
    938
    939
    940
    941
    def points(self) -> list[momapy.geometry.Point]:
        """Return the points of the arc path"""
        points = []
        for segment in self.segments:
            points.append(segment.p1)
        points.append(segment.p2)
        return points

#### `` self_bbox

    self_bbox() -> Bbox

Compute and return the bounding box of the self drawing element of the group layout

Source code in `src/momapy/core.py`

    499
    500
    501
    502
    def self_bbox(self) -> momapy.geometry.Bbox:
        """Compute and return the bounding box of the self drawing element of the group layout"""
        bounds = self.self_to_shapely().bounds
        return momapy.geometry.Bbox.from_bounds(bounds)

#### `` self_children

    self_children() -> list[LayoutElement]

Return the self children of the arc

Source code in `src/momapy/core.py`

    931
    932
    933
    def self_children(self) -> list[LayoutElement]:
        """Return the self children of the arc"""
        return []

#### `` self_drawing_elements

    self_drawing_elements() -> list[DrawingElement]

Return the self drawing elements of the single-headed arc

Source code in `src/momapy/core.py`

    1169
    1170
    1171
    1172
    1173
    1174
    1175
    1176
    1177
    1178
    1179
    1180
    1181
    1182
    1183
    1184
    1185
    1186
    def self_drawing_elements(self) -> list[momapy.drawing.DrawingElement]:
        """Return the self drawing elements of the single-headed arc"""
        drawing_elements = (
            self.path_drawing_elements() + self.arrowhead_drawing_elements()
        )
        group = momapy.drawing.Group(
            class_=type(self).__name__,
            elements=tuple(drawing_elements),
            fill=self.fill,
            filter=self.filter,
            id_=self.id_,
            stroke=self.stroke,
            stroke_dasharray=self.stroke_dasharray,
            stroke_dashoffset=self.stroke_dashoffset,
            stroke_width=self.stroke_width,
            transform=self.transform,
        )
        return [group]

#### `` self_to_shapely

    self_to_shapely() -> GeometryCollection

Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout

Source code in `src/momapy/core.py`

    495
    496
    497
    def self_to_shapely(self) -> shapely.GeometryCollection:
        """Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout"""
        return momapy.drawing.drawing_elements_to_shapely(self.drawing_elements())

#### `` start_point

    start_point() -> Point

Return the starting point of the arc

Source code in `src/momapy/core.py`

    947
    948
    949
    def start_point(self) -> momapy.geometry.Point:
        """Return the starting point of the arc"""
        return self.points()[0]

#### `` to_shapely

    to_shapely(to_polygons: bool = False) -> GeometryCollection

Return a shapely collection of geometries reproducing the drawing elements of the layout element

Source code in `src/momapy/core.py`

    123
    124
    125
    126
    127
    128
    def to_shapely(self, to_polygons: bool = False) -> shapely.GeometryCollection:
        """Return a shapely collection of geometries reproducing the drawing elements of the layout element"""
        geom_collection = []
        for drawing_element in self.drawing_elements():
            geom_collection += drawing_element.to_shapely(to_polygons=to_polygons).geoms
        return shapely.GeometryCollection(geom_collection)

### `` StoichiometricProcess `dataclass`

    StoichiometricProcess(
        *,
        id_: str = make_uuid4_as_str(),
        reactants: frozenset[Reactant] = frozenset(),
        products: frozenset[Product] = frozenset(),
        reversible: bool = False,
    )

Bases: `Process`

Base class for stoichiometric processes

Parameters:

Name | Type | Description | Default
--- | --- | --- | ---
`id_` | `str` | The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element | `'33c1c6ad-4da5-4ff7-98b1-4fe3257d3b47'`
`reactants` | `frozenset[Reactant]` | The reactants of the stoichiometric process | `<class 'frozenset'>`
`products` | `frozenset[Product]` | The products of the stoichiometric process | `<class 'frozenset'>`
`reversible` | `bool` | Whether the stoichiometric process is reversible or not | `False`

### `` Submap `dataclass`

    Submap(
        *,
        id_: str = make_uuid4_as_str(),
        label: str | None = None,
        terminals: frozenset[Terminal] = frozenset(),
    )

Bases: `SBGNModelElement`

Class for submaps

Parameters:

Name | Type | Description | Default
--- | --- | --- | ---
`id_` | `str` | The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element | `'bab3cada-3d5b-422f-b7c3-4bbdec194488'`
`label` | `str | None` | The label of the submap | `None`
`terminals` | `frozenset[Terminal]` | The terminals of the submap | `<class 'frozenset'>`

### `` SubmapLayout `dataclass`

    SubmapLayout(
        fill: NoneValueType | Color | None = white,
        stroke: NoneValueType | Color | None = black,
        *,
        id_: str = make_uuid4_as_str(),
        layout_elements: tuple[LayoutElement] = tuple(),
        group_fill: NoneValueType | Color | None = None,
        group_fill_rule: FillRule | None = None,
        group_filter: NoneValueType | Filter | None = None,
        group_font_family: str | None = None,
        group_font_size: float | None = None,
        group_font_style: FontStyle | None = None,
        group_font_weight: FontWeight | float | None = None,
        group_stroke: NoneValueType | Color | None = None,
        group_stroke_dasharray: tuple[float, ...] | None = None,
        group_stroke_dashoffset: float | None = None,
        group_stroke_width: float | None = None,
        group_text_anchor: TextAnchor | None = None,
        group_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        filter: NoneValueType | Filter | None = None,
        height: float = 80.0,
        label: TextLayout | None = None,
        position: Point,
        stroke_dasharray: tuple[float, ...] | None = None,
        stroke_dashoffset: float | None = None,
        stroke_width: float = 2.25,
        transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        width: float = 80.0,
    )

Bases: `_SimpleMixin`, `SBGNNode`

Class for submap layouts

Parameters:

Name | Type | Description | Default
--- | --- | --- | ---
`id_` | `str` | The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element | `'6995381a-0476-41d5-9b59-ac41fe1c9a43'`
`layout_elements` | `tuple[LayoutElement]` | The sub-layout elements of the group layout. These are part of the children of the group layout | `<dynamic>`
`group_fill` | `NoneValueType | Color | None` | The fill color of the group layout | `None`
`group_fill_rule` | `FillRule | None` | The fill rule of the group layout | `None`
`group_filter` | `NoneValueType | Filter | None` | The filter of the group layout | `None`
`group_font_family` | `str | None` | The font family of the group layout | `None`
`group_font_size` | `float | None` | The font size of the group layout | `None`
`group_font_style` | `FontStyle | None` | The font style of the group layout | `None`
`group_font_weight` | `FontWeight | float | None` | The font weight of the group layout | `None`
`group_stroke` | `NoneValueType | Color | None` | The stroke color of the group layout | `None`
`group_stroke_dasharray` | `tuple[float, ...] | None` | The stroke dasharray of the group layout | `None`
`group_stroke_dashoffset` | `float | None` | The stroke dashoffset of the group layout | `None`
`group_stroke_width` | `float | None` | The stroke width of the group layout | `None`
`group_text_anchor` | `TextAnchor | None` | The text anchor of the group layout | `None`
`group_transform` | `NoneValueType | tuple[Transformation] | None` | The transform of the group layout | `None`
`fill` | `NoneValueType | Color | None` |  | `Color(red=255, green=255, blue=255, alpha=1.0)`
`filter` | `NoneValueType | Filter | None` | The filter of the node | `None`
`height` | `float` |  | `80.0`
`label` | `TextLayout | None` | The label of the node | `None`
`position` | `Point` | The position of the node | required
`stroke` | `NoneValueType | Color | None` |  | `Color(red=0, green=0, blue=0, alpha=1.0)`
`stroke_dasharray` | `tuple[float, ...] | None` | The stroke dasharray of the node | `None`
`stroke_dashoffset` | `float | None` | The stroke dashoffset of the node | `None`
`stroke_width` | `float` |  | `2.25`
`transform` | `NoneValueType | tuple[Transformation] | None` | The transform of the node | `None`
`width` | `float` |  | `80.0`

Methods:

Name | Description
--- | ---
`anchor_point` | Return an anchor point of the layout element
`angle` | Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.
`bbox` | Compute and return the bounding box of the group layout element
`border` | Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point.
`center` | Return the center anchor of the node
`childless` | Return a copy of the node with no children
`children` | Return the children of the group layout.
`contains` | Return `true` if another layout element is a descendant of the layout element, `false` otherwise
`descendants` | Return the descendants of the layout element
`drawing_elements` | Return the drawing elements of the group layout.
`east` | Return the east anchor of the node
`east_north_east` | Return the east north east anchor of the node
`east_south_east` | Return the east south east west anchor of the node
`equals` | Return `true` if the layout element is equal to another layout element, `false` otherwise
`flattened` | Return a list containing copy of the layout element with no children and all its descendants with no children
`label_center` | Return the label center anchor of the node
`north` | Return the north anchor of the node
`north_east` | Return the north east anchor of the node
`north_north_east` | Return the north north east anchor of the node
`north_north_west` | Return the north north west anchor of the node
`north_west` | Return the north west anchor of the node
`self_angle` | Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.
`self_bbox` | Compute and return the bounding box of the self drawing element of the group layout
`self_border` | Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point.
`self_children` | Return the self children of the node. A node has unique child that is its label
`self_drawing_elements` | Return the node's own drawing elements
`self_to_shapely` | Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout
`size` | Return the size of the node
`south` | Return the south anchor of the node
`south_east` | Return the south east anchor of the node
`south_south_east` | Return the south south east anchor of the node
`south_south_west` | Return the south south west anchor of the node
`south_west` | Return the south west anchor of the node
`to_shapely` | Return a shapely collection of geometries reproducing the drawing elements of the layout element
`west` | Return the west anchor of the node
`west_north_west` | Return the west north west anchor of the node
`west_south_west` | Return the west south west anchor of the node

Attributes:

Name | Type | Description
--- | --- | ---
`x` | `float` | Return the x coordinate of the node
`y` | `float` | Return the y coordinate of the node

#### `` anchor_point

    anchor_point(anchor_name: str) -> Point

Return an anchor point of the layout element

Source code in `src/momapy/core.py`

    130
    131
    132
    def anchor_point(self, anchor_name: str) -> momapy.geometry.Point:
        """Return an anchor point of the layout element"""
        return getattr(self, anchor_name)()

#### `` angle

    angle(
        angle: float,
        unit: Literal["degrees", "radians"] = "degrees",
    ) -> Point

Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.

Source code in `src/momapy/core.py`

    817
    818
    819
    820
    821
    822
    823
    824
    825
    826
    827
    828
    def angle(
        self,
        angle: float,
        unit: typing.Literal["degrees", "radians"] = "degrees",
    ) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal."""
        return momapy.drawing.get_drawing_elements_angle(
            drawing_elements=self.drawing_elements(),
            angle=angle,
            unit=unit,
            center=self.center(),
        )

#### `` bbox

    bbox() -> Bbox

Compute and return the bounding box of the group layout element

Source code in `src/momapy/core.py`

    504
    505
    506
    507
    508
    509
    510
    511
    512
    513
    514
    515
    516
    517
    518
    519
    520
    521
    522
    523
    524
    525
    526
    def bbox(self) -> momapy.geometry.Bbox:
        """Compute and return the bounding box of the group layout element"""
        self_bbox = self.self_bbox()
        bboxes = [child.bbox() for child in self.children()]
        min_x = self_bbox.north_west().x
        min_y = self_bbox.north_west().y
        max_x = self_bbox.south_east().x
        max_y = self_bbox.south_east().y
        for bbox in bboxes:
            if bbox.north_west().x < min_x:
                min_x = bbox.north_west().x
            if bbox.north_west().y < min_y:
                min_y = bbox.north_west().y
            if bbox.south_east().x > max_x:
                max_x = bbox.south_east().x
            if bbox.south_east().y > max_y:
                max_y = bbox.south_east().y
        bbox = momapy.geometry.Bbox(
            momapy.geometry.Point(min_x / 2 + max_x / 2, min_y / 2 + max_y / 2),
            max_x - min_x,
            max_y - min_y,
        )
        return bbox

#### `` border

    border(point: Point) -> Point

Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point. When there are multiple intersection points, the one closest to the given point is returned

Source code in `src/momapy/core.py`

    794
    795
    796
    797
    798
    799
    800
    801
    802
    def border(self, point: momapy.geometry.Point) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point.
        When there are multiple intersection points, the one closest to the given point is returned
        """
        return momapy.drawing.get_drawing_elements_border(
            drawing_elements=self.drawing_elements(),
            point=point,
            center=self.center(),
        )

#### `` center

    center() -> Point

Return the center anchor of the node

Source code in `src/momapy/core.py`

    776
    777
    778
    def center(self) -> momapy.geometry.Point:
        """Return the center anchor of the node"""
        return self.position

#### `` childless

    childless() -> Self

Return a copy of the node with no children

Source code in `src/momapy/core.py`

    830
    831
    832
    def childless(self) -> typing.Self:
        """Return a copy of the node with no children"""
        return dataclasses.replace(self, label=None, layout_elements=tuple([]))

#### `` children

    children() -> list[LayoutElement]

Return the children of the group layout. These are the self children of the group layout (returned by the `self_children` method) and the other children of the group layout (given by the `layout_elements` attribute)

Source code in `src/momapy/core.py`

    566
    567
    568
    569
    570
    def children(self) -> list[LayoutElement]:
        """Return the children of the group layout.
        These are the self children of the group layout (returned by the `self_children` method) and the other children of the group layout (given by the `layout_elements` attribute)
        """
        return self.self_children() + list(self.layout_elements)

#### `` contains

    contains(other: LayoutElement) -> bool

Return `true` if another layout element is a descendant of the layout element, `false` otherwise

Source code in `src/momapy/core.py`

    119
    120
    121
    def contains(self, other: "LayoutElement") -> bool:
        """Return `true` if another layout element is a descendant of the layout element, `false` otherwise"""
        return other in self.descendants()

#### `` descendants

    descendants() -> list[LayoutElement]

Return the descendants of the layout element

Source code in `src/momapy/core.py`

    90
    91
    92
    93
    94
    95
    96
    def descendants(self) -> list["LayoutElement"]:
        """Return the descendants of the layout element"""
        descendants = []
        for child in self.children():
            descendants.append(child)
            descendants += child.descendants()
        return descendants

#### `` drawing_elements

    drawing_elements() -> list[DrawingElement]

Return the drawing elements of the group layout. The returned drawing elements are a group drawing element formed of the self drawing elements of the group layout and the drawing elements of its children

Source code in `src/momapy/core.py`

    538
    539
    540
    541
    542
    543
    544
    545
    546
    547
    548
    549
    550
    551
    552
    553
    554
    555
    556
    557
    558
    559
    560
    561
    562
    563
    564
    def drawing_elements(self) -> list[momapy.drawing.DrawingElement]:
        """Return the drawing elements of the group layout.
        The returned drawing elements are a group drawing element formed of the self drawing elements of the group layout and the drawing elements of its children
        """
        drawing_elements = self.self_drawing_elements()
        for child in self.children():
            if child is not None:
                drawing_elements += child.drawing_elements()
        group = momapy.drawing.Group(
            class_=f"{type(self).__name__}_group",
            elements=tuple(drawing_elements),
            id_=f"{self.id_}_group",
            fill=self.group_fill,
            fill_rule=self.group_fill_rule,
            filter=self.group_filter,
            font_family=self.group_font_family,
            font_size=self.group_font_size,
            font_style=self.group_font_style,
            font_weight=self.group_font_weight,
            stroke=self.group_stroke,
            stroke_dasharray=self.group_stroke_dasharray,
            stroke_dashoffset=self.group_stroke_dashoffset,
            stroke_width=self.group_stroke_width,
            text_anchor=self.group_text_anchor,
            transform=self.group_transform,
        )
        return [group]

#### `` east

    east() -> Point

Return the east anchor of the node

Source code in `src/momapy/core.py`

    708
    709
    710
    def east(self) -> momapy.geometry.Point:
        """Return the east anchor of the node"""
        return self.self_angle(0)

#### `` east_north_east

    east_north_east() -> Point

Return the east north east anchor of the node

Source code in `src/momapy/core.py`

    700
    701
    702
    703
    704
    705
    706
    def east_north_east(self) -> momapy.geometry.Point:
        """Return the east north east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, -self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` east_south_east

    east_south_east() -> Point

Return the east south east west anchor of the node

Source code in `src/momapy/core.py`

    712
    713
    714
    715
    716
    717
    718
    def east_south_east(self) -> momapy.geometry.Point:
        """Return the east south east west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` equals

    equals(
        other: LayoutElement,
        flattened: bool = False,
        unordered: bool = False,
    ) -> bool

Return `true` if the layout element is equal to another layout element, `false` otherwise

Source code in `src/momapy/core.py`

    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    def equals(
        self, other: "LayoutElement", flattened: bool = False, unordered: bool = False
    ) -> bool:
        """Return `true` if the layout element is equal to another layout element, `false` otherwise"""
        if type(self) is type(other):
            if not flattened:
                return self == other
            else:
                if not unordered:
                    return self.flattened() == other.flattened()
                else:
                    return set(self.flattened()) == set(other.flattened())
        return False

#### `` flattened

    flattened() -> list[LayoutElement]

Return a list containing copy of the layout element with no children and all its descendants with no children

Source code in `src/momapy/core.py`

     98
     99
    100
    101
    102
    103
    def flattened(self) -> list["LayoutElement"]:
        """Return a list containing copy of the layout element with no children and all its descendants with no children"""
        flattened = [self.childless()]
        for child in self.children():
            flattened += child.flattened()
        return flattened

#### `` label_center

    label_center() -> Point

Return the label center anchor of the node

Source code in `src/momapy/core.py`

    780
    781
    782
    def label_center(self) -> momapy.geometry.Point:
        """Return the label center anchor of the node"""
        return self.position

#### `` north

    north() -> Point

Return the north anchor of the node

Source code in `src/momapy/core.py`

    680
    681
    682
    def north(self) -> momapy.geometry.Point:
        """Return the north anchor of the node"""
        return self.self_angle(90)

#### `` north_east

    north_east() -> Point

Return the north east anchor of the node

Source code in `src/momapy/core.py`

    692
    693
    694
    695
    696
    697
    698
    def north_east(self) -> momapy.geometry.Point:
        """Return the north east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, -self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` north_north_east

    north_north_east() -> Point

Return the north north east anchor of the node

Source code in `src/momapy/core.py`

    684
    685
    686
    687
    688
    689
    690
    def north_north_east(self) -> momapy.geometry.Point:
        """Return the north north east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 4, -self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` north_north_west

    north_north_west() -> Point

Return the north north west anchor of the node

Source code in `src/momapy/core.py`

    672
    673
    674
    675
    676
    677
    678
    def north_north_west(self) -> momapy.geometry.Point:
        """Return the north north west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() - (self.width / 4, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` north_west

    north_west() -> Point

Return the north west anchor of the node

Source code in `src/momapy/core.py`

    664
    665
    666
    667
    668
    669
    670
    def north_west(self) -> momapy.geometry.Point:
        """Return the north west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() - (self.width / 2, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` self_angle

    self_angle(
        angle: float,
        unit: Literal["degrees", "radians"] = "degrees",
    ) -> Point

Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.

Source code in `src/momapy/core.py`

    804
    805
    806
    807
    808
    809
    810
    811
    812
    813
    814
    815
    def self_angle(
        self,
        angle: float,
        unit: typing.Literal["degrees", "radians"] = "degrees",
    ) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal."""
        return momapy.drawing.get_drawing_elements_angle(
            drawing_elements=self.self_drawing_elements(),
            angle=angle,
            unit=unit,
            center=self.center(),
        )

#### `` self_bbox

    self_bbox() -> Bbox

Compute and return the bounding box of the self drawing element of the group layout

Source code in `src/momapy/core.py`

    499
    500
    501
    502
    def self_bbox(self) -> momapy.geometry.Bbox:
        """Compute and return the bounding box of the self drawing element of the group layout"""
        bounds = self.self_to_shapely().bounds
        return momapy.geometry.Bbox.from_bounds(bounds)

#### `` self_border

    self_border(point: Point) -> Point

Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point. When there are multiple intersection points, the one closest to the given point is returned

Source code in `src/momapy/core.py`

    784
    785
    786
    787
    788
    789
    790
    791
    792
    def self_border(self, point: momapy.geometry.Point) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point.
        When there are multiple intersection points, the one closest to the given point is returned
        """
        return momapy.drawing.get_drawing_elements_border(
            drawing_elements=self.self_drawing_elements(),
            point=point,
            center=self.center(),
        )

#### `` self_children

    self_children() -> list[LayoutElement]

Return the self children of the node. A node has unique child that is its label

Source code in `src/momapy/core.py`

    654
    655
    656
    657
    658
    def self_children(self) -> list[LayoutElement]:
        """Return the self children of the node. A node has unique child that is its label"""
        if self.label is not None:
            return [self.label]
        return []

#### `` self_drawing_elements

    self_drawing_elements() -> list[DrawingElement]

Return the node's own drawing elements

Source code in `src/momapy/core.py`

    637
    638
    639
    640
    641
    642
    643
    644
    645
    646
    647
    648
    649
    650
    651
    652
    def self_drawing_elements(self) -> list[momapy.drawing.DrawingElement]:
        """Return the node's own drawing elements"""
        drawing_elements = self._border_drawing_elements()
        group = momapy.drawing.Group(
            class_=type(self).__name__,
            elements=tuple(drawing_elements),
            fill=self.fill,
            filter=self.filter,
            id_=self.id_,
            stroke=self.stroke,
            stroke_dasharray=self.stroke_dasharray,
            stroke_dashoffset=self.stroke_dashoffset,
            stroke_width=self.stroke_width,
            transform=self.transform,
        )
        return [group]

#### `` self_to_shapely

    self_to_shapely() -> GeometryCollection

Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout

Source code in `src/momapy/core.py`

    495
    496
    497
    def self_to_shapely(self) -> shapely.GeometryCollection:
        """Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout"""
        return momapy.drawing.drawing_elements_to_shapely(self.drawing_elements())

#### `` size

    size() -> tuple[float, float]

Return the size of the node

Source code in `src/momapy/core.py`

    660
    661
    662
    def size(self) -> tuple[float, float]:
        """Return the size of the node"""
        return (self.width, self.height)

#### `` south

    south() -> Point

Return the south anchor of the node

Source code in `src/momapy/core.py`

    736
    737
    738
    def south(self) -> momapy.geometry.Point:
        """Return the south anchor of the node"""
        return self.self_angle(270)

#### `` south_east

    south_east() -> Point

Return the south east anchor of the node

Source code in `src/momapy/core.py`

    720
    721
    722
    723
    724
    725
    726
    def south_east(self) -> momapy.geometry.Point:
        """Return the south east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` south_south_east

    south_south_east() -> Point

Return the south south east anchor of the node

Source code in `src/momapy/core.py`

    728
    729
    730
    731
    732
    733
    734
    def south_south_east(self) -> momapy.geometry.Point:
        """Return the south south east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 4, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` south_south_west

    south_south_west() -> Point

Return the south south west anchor of the node

Source code in `src/momapy/core.py`

    740
    741
    742
    743
    744
    745
    746
    def south_south_west(self) -> momapy.geometry.Point:
        """Return the south south west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (-self.width / 4, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` south_west

    south_west() -> Point

Return the south west anchor of the node

Source code in `src/momapy/core.py`

    748
    749
    750
    751
    752
    753
    754
    def south_west(self) -> momapy.geometry.Point:
        """Return the south west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (-self.width / 2, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` to_shapely

    to_shapely(to_polygons: bool = False) -> GeometryCollection

Return a shapely collection of geometries reproducing the drawing elements of the layout element

Source code in `src/momapy/core.py`

    123
    124
    125
    126
    127
    128
    def to_shapely(self, to_polygons: bool = False) -> shapely.GeometryCollection:
        """Return a shapely collection of geometries reproducing the drawing elements of the layout element"""
        geom_collection = []
        for drawing_element in self.drawing_elements():
            geom_collection += drawing_element.to_shapely(to_polygons=to_polygons).geoms
        return shapely.GeometryCollection(geom_collection)

#### `` west

    west() -> Point

Return the west anchor of the node

Source code in `src/momapy/core.py`

    764
    765
    766
    def west(self) -> momapy.geometry.Point:
        """Return the west anchor of the node"""
        return self.self_angle(180)

#### `` west_north_west

    west_north_west() -> Point

Return the west north west anchor of the node

Source code in `src/momapy/core.py`

    768
    769
    770
    771
    772
    773
    774
    def west_north_west(self) -> momapy.geometry.Point:
        """Return the west north west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() - (self.width / 2, self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` west_south_west

    west_south_west() -> Point

Return the west south west anchor of the node

Source code in `src/momapy/core.py`

    756
    757
    758
    759
    760
    761
    762
    def west_south_west(self) -> momapy.geometry.Point:
        """Return the west south west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (-self.width / 2, self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` x `property`

    x: float

Return the x coordinate of the node

#### `` y `property`

    y: float

Return the y coordinate of the node

### `` Subunit `dataclass`

    Subunit(
        *,
        id_: str = make_uuid4_as_str(),
        label: str | None = None,
    )

Bases: `SBGNAuxiliaryUnit`

Base class for subunits

Parameters:

Name | Type | Description | Default
--- | --- | --- | ---
`id_` | `str` | The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element | `'c1739a74-8d1e-4ba0-85c8-3ea58a838657'`
`label` | `str | None` | The label of the subunit | `None`

### `` Tag `dataclass`

    Tag(
        *,
        id_: str = make_uuid4_as_str(),
        label: str | None = None,
        reference: TagReference | None = None,
    )

Bases: `SBGNModelElement`

Class for tags

Parameters:

Name | Type | Description | Default
--- | --- | --- | ---
`id_` | `str` | The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element | `'980b82c6-b9d8-482d-a33a-033451358b9a'`
`label` | `str | None` | The label of the tag | `None`
`reference` | `TagReference | None` | The reference of the tag | `None`

### `` TagLayout `dataclass`

    TagLayout(
        fill: NoneValueType | Color | None = white,
        stroke: NoneValueType | Color | None = black,
        stroke_width: float | None = 1.25,
        *,
        id_: str = make_uuid4_as_str(),
        layout_elements: tuple[LayoutElement] = tuple(),
        group_fill: NoneValueType | Color | None = None,
        group_fill_rule: FillRule | None = None,
        group_filter: NoneValueType | Filter | None = None,
        group_font_family: str | None = None,
        group_font_size: float | None = None,
        group_font_style: FontStyle | None = None,
        group_font_weight: FontWeight | float | None = None,
        group_stroke: NoneValueType | Color | None = None,
        group_stroke_dasharray: tuple[float, ...] | None = None,
        group_stroke_dashoffset: float | None = None,
        group_stroke_width: float | None = None,
        group_text_anchor: TextAnchor | None = None,
        group_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        filter: NoneValueType | Filter | None = None,
        height: float = 35.0,
        label: TextLayout | None = None,
        position: Point,
        stroke_dasharray: tuple[float, ...] | None = None,
        stroke_dashoffset: float | None = None,
        transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        width: float = 35.0,
        direction: Direction = RIGHT,
        angle: float = 70.0,
    )

Bases: `_SimpleMixin`, `SBGNNode`

Class for tag layouts

Parameters:

Name | Type | Description | Default
--- | --- | --- | ---
`id_` | `str` | The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element | `'c691a0b9-43d3-4718-8c34-83dce630556d'`
`layout_elements` | `tuple[LayoutElement]` | The sub-layout elements of the group layout. These are part of the children of the group layout | `<dynamic>`
`group_fill` | `NoneValueType | Color | None` | The fill color of the group layout | `None`
`group_fill_rule` | `FillRule | None` | The fill rule of the group layout | `None`
`group_filter` | `NoneValueType | Filter | None` | The filter of the group layout | `None`
`group_font_family` | `str | None` | The font family of the group layout | `None`
`group_font_size` | `float | None` | The font size of the group layout | `None`
`group_font_style` | `FontStyle | None` | The font style of the group layout | `None`
`group_font_weight` | `FontWeight | float | None` | The font weight of the group layout | `None`
`group_stroke` | `NoneValueType | Color | None` | The stroke color of the group layout | `None`
`group_stroke_dasharray` | `tuple[float, ...] | None` | The stroke dasharray of the group layout | `None`
`group_stroke_dashoffset` | `float | None` | The stroke dashoffset of the group layout | `None`
`group_stroke_width` | `float | None` | The stroke width of the group layout | `None`
`group_text_anchor` | `TextAnchor | None` | The text anchor of the group layout | `None`
`group_transform` | `NoneValueType | tuple[Transformation] | None` | The transform of the group layout | `None`
`fill` | `NoneValueType | Color | None` |  | `Color(red=255, green=255, blue=255, alpha=1.0)`
`filter` | `NoneValueType | Filter | None` | The filter of the node | `None`
`height` | `float` |  | `35.0`
`label` | `TextLayout | None` | The label of the node | `None`
`position` | `Point` | The position of the node | required
`stroke` | `NoneValueType | Color | None` |  | `Color(red=0, green=0, blue=0, alpha=1.0)`
`stroke_dasharray` | `tuple[float, ...] | None` | The stroke dasharray of the node | `None`
`stroke_dashoffset` | `float | None` | The stroke dashoffset of the node | `None`
`stroke_width` | `float | None` |  | `1.25`
`transform` | `NoneValueType | tuple[Transformation] | None` | The transform of the node | `None`
`width` | `float` |  | `35.0`
`direction` | `Direction` |  | `<Direction.RIGHT: 4>`
`angle` | `float` |  | `70.0`

Methods:

Name | Description
--- | ---
`anchor_point` | Return an anchor point of the layout element
`bbox` | Compute and return the bounding box of the group layout element
`border` | Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point.
`center` | Return the center anchor of the node
`childless` | Return a copy of the node with no children
`children` | Return the children of the group layout.
`contains` | Return `true` if another layout element is a descendant of the layout element, `false` otherwise
`descendants` | Return the descendants of the layout element
`drawing_elements` | Return the drawing elements of the group layout.
`east` | Return the east anchor of the node
`east_north_east` | Return the east north east anchor of the node
`east_south_east` | Return the east south east west anchor of the node
`equals` | Return `true` if the layout element is equal to another layout element, `false` otherwise
`flattened` | Return a list containing copy of the layout element with no children and all its descendants with no children
`label_center` | Return the label center anchor of the node
`north` | Return the north anchor of the node
`north_east` | Return the north east anchor of the node
`north_north_east` | Return the north north east anchor of the node
`north_north_west` | Return the north north west anchor of the node
`north_west` | Return the north west anchor of the node
`self_angle` | Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.
`self_bbox` | Compute and return the bounding box of the self drawing element of the group layout
`self_border` | Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point.
`self_children` | Return the self children of the node. A node has unique child that is its label
`self_drawing_elements` | Return the node's own drawing elements
`self_to_shapely` | Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout
`size` | Return the size of the node
`south` | Return the south anchor of the node
`south_east` | Return the south east anchor of the node
`south_south_east` | Return the south south east anchor of the node
`south_south_west` | Return the south south west anchor of the node
`south_west` | Return the south west anchor of the node
`to_shapely` | Return a shapely collection of geometries reproducing the drawing elements of the layout element
`west` | Return the west anchor of the node
`west_north_west` | Return the west north west anchor of the node
`west_south_west` | Return the west south west anchor of the node

Attributes:

Name | Type | Description
--- | --- | ---
`angle` | `float` | Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.
`x` | `float` | Return the x coordinate of the node
`y` | `float` | Return the y coordinate of the node

#### `` anchor_point

    anchor_point(anchor_name: str) -> Point

Return an anchor point of the layout element

Source code in `src/momapy/core.py`

    130
    131
    132
    def anchor_point(self, anchor_name: str) -> momapy.geometry.Point:
        """Return an anchor point of the layout element"""
        return getattr(self, anchor_name)()

#### `` angle `class-attribute` `instance-attribute`

    angle: float = 70.0

Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.

#### `` bbox

    bbox() -> Bbox

Compute and return the bounding box of the group layout element

Source code in `src/momapy/core.py`

    504
    505
    506
    507
    508
    509
    510
    511
    512
    513
    514
    515
    516
    517
    518
    519
    520
    521
    522
    523
    524
    525
    526
    def bbox(self) -> momapy.geometry.Bbox:
        """Compute and return the bounding box of the group layout element"""
        self_bbox = self.self_bbox()
        bboxes = [child.bbox() for child in self.children()]
        min_x = self_bbox.north_west().x
        min_y = self_bbox.north_west().y
        max_x = self_bbox.south_east().x
        max_y = self_bbox.south_east().y
        for bbox in bboxes:
            if bbox.north_west().x < min_x:
                min_x = bbox.north_west().x
            if bbox.north_west().y < min_y:
                min_y = bbox.north_west().y
            if bbox.south_east().x > max_x:
                max_x = bbox.south_east().x
            if bbox.south_east().y > max_y:
                max_y = bbox.south_east().y
        bbox = momapy.geometry.Bbox(
            momapy.geometry.Point(min_x / 2 + max_x / 2, min_y / 2 + max_y / 2),
            max_x - min_x,
            max_y - min_y,
        )
        return bbox

#### `` border

    border(point: Point) -> Point

Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point. When there are multiple intersection points, the one closest to the given point is returned

Source code in `src/momapy/core.py`

    794
    795
    796
    797
    798
    799
    800
    801
    802
    def border(self, point: momapy.geometry.Point) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point.
        When there are multiple intersection points, the one closest to the given point is returned
        """
        return momapy.drawing.get_drawing_elements_border(
            drawing_elements=self.drawing_elements(),
            point=point,
            center=self.center(),
        )

#### `` center

    center() -> Point

Return the center anchor of the node

Source code in `src/momapy/core.py`

    776
    777
    778
    def center(self) -> momapy.geometry.Point:
        """Return the center anchor of the node"""
        return self.position

#### `` childless

    childless() -> Self

Return a copy of the node with no children

Source code in `src/momapy/core.py`

    830
    831
    832
    def childless(self) -> typing.Self:
        """Return a copy of the node with no children"""
        return dataclasses.replace(self, label=None, layout_elements=tuple([]))

#### `` children

    children() -> list[LayoutElement]

Return the children of the group layout. These are the self children of the group layout (returned by the `self_children` method) and the other children of the group layout (given by the `layout_elements` attribute)

Source code in `src/momapy/core.py`

    566
    567
    568
    569
    570
    def children(self) -> list[LayoutElement]:
        """Return the children of the group layout.
        These are the self children of the group layout (returned by the `self_children` method) and the other children of the group layout (given by the `layout_elements` attribute)
        """
        return self.self_children() + list(self.layout_elements)

#### `` contains

    contains(other: LayoutElement) -> bool

Return `true` if another layout element is a descendant of the layout element, `false` otherwise

Source code in `src/momapy/core.py`

    119
    120
    121
    def contains(self, other: "LayoutElement") -> bool:
        """Return `true` if another layout element is a descendant of the layout element, `false` otherwise"""
        return other in self.descendants()

#### `` descendants

    descendants() -> list[LayoutElement]

Return the descendants of the layout element

Source code in `src/momapy/core.py`

    90
    91
    92
    93
    94
    95
    96
    def descendants(self) -> list["LayoutElement"]:
        """Return the descendants of the layout element"""
        descendants = []
        for child in self.children():
            descendants.append(child)
            descendants += child.descendants()
        return descendants

#### `` drawing_elements

    drawing_elements() -> list[DrawingElement]

Return the drawing elements of the group layout. The returned drawing elements are a group drawing element formed of the self drawing elements of the group layout and the drawing elements of its children

Source code in `src/momapy/core.py`

    538
    539
    540
    541
    542
    543
    544
    545
    546
    547
    548
    549
    550
    551
    552
    553
    554
    555
    556
    557
    558
    559
    560
    561
    562
    563
    564
    def drawing_elements(self) -> list[momapy.drawing.DrawingElement]:
        """Return the drawing elements of the group layout.
        The returned drawing elements are a group drawing element formed of the self drawing elements of the group layout and the drawing elements of its children
        """
        drawing_elements = self.self_drawing_elements()
        for child in self.children():
            if child is not None:
                drawing_elements += child.drawing_elements()
        group = momapy.drawing.Group(
            class_=f"{type(self).__name__}_group",
            elements=tuple(drawing_elements),
            id_=f"{self.id_}_group",
            fill=self.group_fill,
            fill_rule=self.group_fill_rule,
            filter=self.group_filter,
            font_family=self.group_font_family,
            font_size=self.group_font_size,
            font_style=self.group_font_style,
            font_weight=self.group_font_weight,
            stroke=self.group_stroke,
            stroke_dasharray=self.group_stroke_dasharray,
            stroke_dashoffset=self.group_stroke_dashoffset,
            stroke_width=self.group_stroke_width,
            text_anchor=self.group_text_anchor,
            transform=self.group_transform,
        )
        return [group]

#### `` east

    east() -> Point

Return the east anchor of the node

Source code in `src/momapy/core.py`

    708
    709
    710
    def east(self) -> momapy.geometry.Point:
        """Return the east anchor of the node"""
        return self.self_angle(0)

#### `` east_north_east

    east_north_east() -> Point

Return the east north east anchor of the node

Source code in `src/momapy/core.py`

    700
    701
    702
    703
    704
    705
    706
    def east_north_east(self) -> momapy.geometry.Point:
        """Return the east north east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, -self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` east_south_east

    east_south_east() -> Point

Return the east south east west anchor of the node

Source code in `src/momapy/core.py`

    712
    713
    714
    715
    716
    717
    718
    def east_south_east(self) -> momapy.geometry.Point:
        """Return the east south east west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` equals

    equals(
        other: LayoutElement,
        flattened: bool = False,
        unordered: bool = False,
    ) -> bool

Return `true` if the layout element is equal to another layout element, `false` otherwise

Source code in `src/momapy/core.py`

    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    def equals(
        self, other: "LayoutElement", flattened: bool = False, unordered: bool = False
    ) -> bool:
        """Return `true` if the layout element is equal to another layout element, `false` otherwise"""
        if type(self) is type(other):
            if not flattened:
                return self == other
            else:
                if not unordered:
                    return self.flattened() == other.flattened()
                else:
                    return set(self.flattened()) == set(other.flattened())
        return False

#### `` flattened

    flattened() -> list[LayoutElement]

Return a list containing copy of the layout element with no children and all its descendants with no children

Source code in `src/momapy/core.py`

     98
     99
    100
    101
    102
    103
    def flattened(self) -> list["LayoutElement"]:
        """Return a list containing copy of the layout element with no children and all its descendants with no children"""
        flattened = [self.childless()]
        for child in self.children():
            flattened += child.flattened()
        return flattened

#### `` label_center

    label_center() -> Point

Return the label center anchor of the node

Source code in `src/momapy/core.py`

    780
    781
    782
    def label_center(self) -> momapy.geometry.Point:
        """Return the label center anchor of the node"""
        return self.position

#### `` north

    north() -> Point

Return the north anchor of the node

Source code in `src/momapy/core.py`

    680
    681
    682
    def north(self) -> momapy.geometry.Point:
        """Return the north anchor of the node"""
        return self.self_angle(90)

#### `` north_east

    north_east() -> Point

Return the north east anchor of the node

Source code in `src/momapy/core.py`

    692
    693
    694
    695
    696
    697
    698
    def north_east(self) -> momapy.geometry.Point:
        """Return the north east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, -self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` north_north_east

    north_north_east() -> Point

Return the north north east anchor of the node

Source code in `src/momapy/core.py`

    684
    685
    686
    687
    688
    689
    690
    def north_north_east(self) -> momapy.geometry.Point:
        """Return the north north east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 4, -self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` north_north_west

    north_north_west() -> Point

Return the north north west anchor of the node

Source code in `src/momapy/core.py`

    672
    673
    674
    675
    676
    677
    678
    def north_north_west(self) -> momapy.geometry.Point:
        """Return the north north west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() - (self.width / 4, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` north_west

    north_west() -> Point

Return the north west anchor of the node

Source code in `src/momapy/core.py`

    664
    665
    666
    667
    668
    669
    670
    def north_west(self) -> momapy.geometry.Point:
        """Return the north west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() - (self.width / 2, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` self_angle

    self_angle(
        angle: float,
        unit: Literal["degrees", "radians"] = "degrees",
    ) -> Point

Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.

Source code in `src/momapy/core.py`

    804
    805
    806
    807
    808
    809
    810
    811
    812
    813
    814
    815
    def self_angle(
        self,
        angle: float,
        unit: typing.Literal["degrees", "radians"] = "degrees",
    ) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal."""
        return momapy.drawing.get_drawing_elements_angle(
            drawing_elements=self.self_drawing_elements(),
            angle=angle,
            unit=unit,
            center=self.center(),
        )

#### `` self_bbox

    self_bbox() -> Bbox

Compute and return the bounding box of the self drawing element of the group layout

Source code in `src/momapy/core.py`

    499
    500
    501
    502
    def self_bbox(self) -> momapy.geometry.Bbox:
        """Compute and return the bounding box of the self drawing element of the group layout"""
        bounds = self.self_to_shapely().bounds
        return momapy.geometry.Bbox.from_bounds(bounds)

#### `` self_border

    self_border(point: Point) -> Point

Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point. When there are multiple intersection points, the one closest to the given point is returned

Source code in `src/momapy/core.py`

    784
    785
    786
    787
    788
    789
    790
    791
    792
    def self_border(self, point: momapy.geometry.Point) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point.
        When there are multiple intersection points, the one closest to the given point is returned
        """
        return momapy.drawing.get_drawing_elements_border(
            drawing_elements=self.self_drawing_elements(),
            point=point,
            center=self.center(),
        )

#### `` self_children

    self_children() -> list[LayoutElement]

Return the self children of the node. A node has unique child that is its label

Source code in `src/momapy/core.py`

    654
    655
    656
    657
    658
    def self_children(self) -> list[LayoutElement]:
        """Return the self children of the node. A node has unique child that is its label"""
        if self.label is not None:
            return [self.label]
        return []

#### `` self_drawing_elements

    self_drawing_elements() -> list[DrawingElement]

Return the node's own drawing elements

Source code in `src/momapy/core.py`

    637
    638
    639
    640
    641
    642
    643
    644
    645
    646
    647
    648
    649
    650
    651
    652
    def self_drawing_elements(self) -> list[momapy.drawing.DrawingElement]:
        """Return the node's own drawing elements"""
        drawing_elements = self._border_drawing_elements()
        group = momapy.drawing.Group(
            class_=type(self).__name__,
            elements=tuple(drawing_elements),
            fill=self.fill,
            filter=self.filter,
            id_=self.id_,
            stroke=self.stroke,
            stroke_dasharray=self.stroke_dasharray,
            stroke_dashoffset=self.stroke_dashoffset,
            stroke_width=self.stroke_width,
            transform=self.transform,
        )
        return [group]

#### `` self_to_shapely

    self_to_shapely() -> GeometryCollection

Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout

Source code in `src/momapy/core.py`

    495
    496
    497
    def self_to_shapely(self) -> shapely.GeometryCollection:
        """Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout"""
        return momapy.drawing.drawing_elements_to_shapely(self.drawing_elements())

#### `` size

    size() -> tuple[float, float]

Return the size of the node

Source code in `src/momapy/core.py`

    660
    661
    662
    def size(self) -> tuple[float, float]:
        """Return the size of the node"""
        return (self.width, self.height)

#### `` south

    south() -> Point

Return the south anchor of the node

Source code in `src/momapy/core.py`

    736
    737
    738
    def south(self) -> momapy.geometry.Point:
        """Return the south anchor of the node"""
        return self.self_angle(270)

#### `` south_east

    south_east() -> Point

Return the south east anchor of the node

Source code in `src/momapy/core.py`

    720
    721
    722
    723
    724
    725
    726
    def south_east(self) -> momapy.geometry.Point:
        """Return the south east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` south_south_east

    south_south_east() -> Point

Return the south south east anchor of the node

Source code in `src/momapy/core.py`

    728
    729
    730
    731
    732
    733
    734
    def south_south_east(self) -> momapy.geometry.Point:
        """Return the south south east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 4, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` south_south_west

    south_south_west() -> Point

Return the south south west anchor of the node

Source code in `src/momapy/core.py`

    740
    741
    742
    743
    744
    745
    746
    def south_south_west(self) -> momapy.geometry.Point:
        """Return the south south west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (-self.width / 4, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` south_west

    south_west() -> Point

Return the south west anchor of the node

Source code in `src/momapy/core.py`

    748
    749
    750
    751
    752
    753
    754
    def south_west(self) -> momapy.geometry.Point:
        """Return the south west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (-self.width / 2, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` to_shapely

    to_shapely(to_polygons: bool = False) -> GeometryCollection

Return a shapely collection of geometries reproducing the drawing elements of the layout element

Source code in `src/momapy/core.py`

    123
    124
    125
    126
    127
    128
    def to_shapely(self, to_polygons: bool = False) -> shapely.GeometryCollection:
        """Return a shapely collection of geometries reproducing the drawing elements of the layout element"""
        geom_collection = []
        for drawing_element in self.drawing_elements():
            geom_collection += drawing_element.to_shapely(to_polygons=to_polygons).geoms
        return shapely.GeometryCollection(geom_collection)

#### `` west

    west() -> Point

Return the west anchor of the node

Source code in `src/momapy/core.py`

    764
    765
    766
    def west(self) -> momapy.geometry.Point:
        """Return the west anchor of the node"""
        return self.self_angle(180)

#### `` west_north_west

    west_north_west() -> Point

Return the west north west anchor of the node

Source code in `src/momapy/core.py`

    768
    769
    770
    771
    772
    773
    774
    def west_north_west(self) -> momapy.geometry.Point:
        """Return the west north west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() - (self.width / 2, self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` west_south_west

    west_south_west() -> Point

Return the west south west anchor of the node

Source code in `src/momapy/core.py`

    756
    757
    758
    759
    760
    761
    762
    def west_south_west(self) -> momapy.geometry.Point:
        """Return the west south west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (-self.width / 2, self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` x `property`

    x: float

Return the x coordinate of the node

#### `` y `property`

    y: float

Return the y coordinate of the node

### `` TagReference `dataclass`

    TagReference(
        *,
        id_: str = make_uuid4_as_str(),
        element: EntityPool | Compartment,
    )

Bases: `SBGNRole`

Class for tag references

Parameters:

Name | Type | Description | Default
--- | --- | --- | ---
`id_` | `str` | The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element | `'afc099af-5294-4c32-96a0-9399287853a3'`
`element` | `EntityPool | Compartment` | The element of the tag reference | required

### `` Terminal `dataclass`

    Terminal(
        *,
        id_: str = make_uuid4_as_str(),
        label: str | None = None,
        reference: TerminalReference | None = None,
    )

Bases: `SBGNAuxiliaryUnit`

Class for terminals

Parameters:

Name | Type | Description | Default
--- | --- | --- | ---
`id_` | `str` | The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element | `'06cfe038-1673-4a09-8312-1f581fe049be'`
`label` | `str | None` | The label of the terminal | `None`
`reference` | `TerminalReference | None` | The reference of the terminal | `None`

### `` TerminalLayout `dataclass`

    TerminalLayout(
        fill: NoneValueType | Color | None = white,
        stroke: NoneValueType | Color | None = black,
        stroke_width: float | None = 1.25,
        *,
        id_: str = make_uuid4_as_str(),
        layout_elements: tuple[LayoutElement] = tuple(),
        group_fill: NoneValueType | Color | None = None,
        group_fill_rule: FillRule | None = None,
        group_filter: NoneValueType | Filter | None = None,
        group_font_family: str | None = None,
        group_font_size: float | None = None,
        group_font_style: FontStyle | None = None,
        group_font_weight: FontWeight | float | None = None,
        group_stroke: NoneValueType | Color | None = None,
        group_stroke_dasharray: tuple[float, ...] | None = None,
        group_stroke_dashoffset: float | None = None,
        group_stroke_width: float | None = None,
        group_text_anchor: TextAnchor | None = None,
        group_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        filter: NoneValueType | Filter | None = None,
        height: float = 35.0,
        label: TextLayout | None = None,
        position: Point,
        stroke_dasharray: tuple[float, ...] | None = None,
        stroke_dashoffset: float | None = None,
        transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        width: float = 35.0,
        direction: Direction = RIGHT,
        angle: float = 70.0,
    )

Bases: `_SimpleMixin`, `SBGNNode`

Class for terminal layouts

Parameters:

Name | Type | Description | Default
--- | --- | --- | ---
`id_` | `str` | The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element | `'1ac2bf6c-d7c0-4ddd-93fc-47331958ddd6'`
`layout_elements` | `tuple[LayoutElement]` | The sub-layout elements of the group layout. These are part of the children of the group layout | `<dynamic>`
`group_fill` | `NoneValueType | Color | None` | The fill color of the group layout | `None`
`group_fill_rule` | `FillRule | None` | The fill rule of the group layout | `None`
`group_filter` | `NoneValueType | Filter | None` | The filter of the group layout | `None`
`group_font_family` | `str | None` | The font family of the group layout | `None`
`group_font_size` | `float | None` | The font size of the group layout | `None`
`group_font_style` | `FontStyle | None` | The font style of the group layout | `None`
`group_font_weight` | `FontWeight | float | None` | The font weight of the group layout | `None`
`group_stroke` | `NoneValueType | Color | None` | The stroke color of the group layout | `None`
`group_stroke_dasharray` | `tuple[float, ...] | None` | The stroke dasharray of the group layout | `None`
`group_stroke_dashoffset` | `float | None` | The stroke dashoffset of the group layout | `None`
`group_stroke_width` | `float | None` | The stroke width of the group layout | `None`
`group_text_anchor` | `TextAnchor | None` | The text anchor of the group layout | `None`
`group_transform` | `NoneValueType | tuple[Transformation] | None` | The transform of the group layout | `None`
`fill` | `NoneValueType | Color | None` |  | `Color(red=255, green=255, blue=255, alpha=1.0)`
`filter` | `NoneValueType | Filter | None` | The filter of the node | `None`
`height` | `float` |  | `35.0`
`label` | `TextLayout | None` | The label of the node | `None`
`position` | `Point` | The position of the node | required
`stroke` | `NoneValueType | Color | None` |  | `Color(red=0, green=0, blue=0, alpha=1.0)`
`stroke_dasharray` | `tuple[float, ...] | None` | The stroke dasharray of the node | `None`
`stroke_dashoffset` | `float | None` | The stroke dashoffset of the node | `None`
`stroke_width` | `float | None` |  | `1.25`
`transform` | `NoneValueType | tuple[Transformation] | None` | The transform of the node | `None`
`width` | `float` |  | `35.0`
`direction` | `Direction` |  | `<Direction.RIGHT: 4>`
`angle` | `float` |  | `70.0`

Methods:

Name | Description
--- | ---
`anchor_point` | Return an anchor point of the layout element
`bbox` | Compute and return the bounding box of the group layout element
`border` | Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point.
`center` | Return the center anchor of the node
`childless` | Return a copy of the node with no children
`children` | Return the children of the group layout.
`contains` | Return `true` if another layout element is a descendant of the layout element, `false` otherwise
`descendants` | Return the descendants of the layout element
`drawing_elements` | Return the drawing elements of the group layout.
`east` | Return the east anchor of the node
`east_north_east` | Return the east north east anchor of the node
`east_south_east` | Return the east south east west anchor of the node
`equals` | Return `true` if the layout element is equal to another layout element, `false` otherwise
`flattened` | Return a list containing copy of the layout element with no children and all its descendants with no children
`label_center` | Return the label center anchor of the node
`north` | Return the north anchor of the node
`north_east` | Return the north east anchor of the node
`north_north_east` | Return the north north east anchor of the node
`north_north_west` | Return the north north west anchor of the node
`north_west` | Return the north west anchor of the node
`self_angle` | Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.
`self_bbox` | Compute and return the bounding box of the self drawing element of the group layout
`self_border` | Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point.
`self_children` | Return the self children of the node. A node has unique child that is its label
`self_drawing_elements` | Return the node's own drawing elements
`self_to_shapely` | Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout
`size` | Return the size of the node
`south` | Return the south anchor of the node
`south_east` | Return the south east anchor of the node
`south_south_east` | Return the south south east anchor of the node
`south_south_west` | Return the south south west anchor of the node
`south_west` | Return the south west anchor of the node
`to_shapely` | Return a shapely collection of geometries reproducing the drawing elements of the layout element
`west` | Return the west anchor of the node
`west_north_west` | Return the west north west anchor of the node
`west_south_west` | Return the west south west anchor of the node

Attributes:

Name | Type | Description
--- | --- | ---
`angle` | `float` | Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.
`x` | `float` | Return the x coordinate of the node
`y` | `float` | Return the y coordinate of the node

#### `` anchor_point

    anchor_point(anchor_name: str) -> Point

Return an anchor point of the layout element

Source code in `src/momapy/core.py`

    130
    131
    132
    def anchor_point(self, anchor_name: str) -> momapy.geometry.Point:
        """Return an anchor point of the layout element"""
        return getattr(self, anchor_name)()

#### `` angle `class-attribute` `instance-attribute`

    angle: float = 70.0

Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.

#### `` bbox

    bbox() -> Bbox

Compute and return the bounding box of the group layout element

Source code in `src/momapy/core.py`

    504
    505
    506
    507
    508
    509
    510
    511
    512
    513
    514
    515
    516
    517
    518
    519
    520
    521
    522
    523
    524
    525
    526
    def bbox(self) -> momapy.geometry.Bbox:
        """Compute and return the bounding box of the group layout element"""
        self_bbox = self.self_bbox()
        bboxes = [child.bbox() for child in self.children()]
        min_x = self_bbox.north_west().x
        min_y = self_bbox.north_west().y
        max_x = self_bbox.south_east().x
        max_y = self_bbox.south_east().y
        for bbox in bboxes:
            if bbox.north_west().x < min_x:
                min_x = bbox.north_west().x
            if bbox.north_west().y < min_y:
                min_y = bbox.north_west().y
            if bbox.south_east().x > max_x:
                max_x = bbox.south_east().x
            if bbox.south_east().y > max_y:
                max_y = bbox.south_east().y
        bbox = momapy.geometry.Bbox(
            momapy.geometry.Point(min_x / 2 + max_x / 2, min_y / 2 + max_y / 2),
            max_x - min_x,
            max_y - min_y,
        )
        return bbox

#### `` border

    border(point: Point) -> Point

Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point. When there are multiple intersection points, the one closest to the given point is returned

Source code in `src/momapy/core.py`

    794
    795
    796
    797
    798
    799
    800
    801
    802
    def border(self, point: momapy.geometry.Point) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point.
        When there are multiple intersection points, the one closest to the given point is returned
        """
        return momapy.drawing.get_drawing_elements_border(
            drawing_elements=self.drawing_elements(),
            point=point,
            center=self.center(),
        )

#### `` center

    center() -> Point

Return the center anchor of the node

Source code in `src/momapy/core.py`

    776
    777
    778
    def center(self) -> momapy.geometry.Point:
        """Return the center anchor of the node"""
        return self.position

#### `` childless

    childless() -> Self

Return a copy of the node with no children

Source code in `src/momapy/core.py`

    830
    831
    832
    def childless(self) -> typing.Self:
        """Return a copy of the node with no children"""
        return dataclasses.replace(self, label=None, layout_elements=tuple([]))

#### `` children

    children() -> list[LayoutElement]

Return the children of the group layout. These are the self children of the group layout (returned by the `self_children` method) and the other children of the group layout (given by the `layout_elements` attribute)

Source code in `src/momapy/core.py`

    566
    567
    568
    569
    570
    def children(self) -> list[LayoutElement]:
        """Return the children of the group layout.
        These are the self children of the group layout (returned by the `self_children` method) and the other children of the group layout (given by the `layout_elements` attribute)
        """
        return self.self_children() + list(self.layout_elements)

#### `` contains

    contains(other: LayoutElement) -> bool

Return `true` if another layout element is a descendant of the layout element, `false` otherwise

Source code in `src/momapy/core.py`

    119
    120
    121
    def contains(self, other: "LayoutElement") -> bool:
        """Return `true` if another layout element is a descendant of the layout element, `false` otherwise"""
        return other in self.descendants()

#### `` descendants

    descendants() -> list[LayoutElement]

Return the descendants of the layout element

Source code in `src/momapy/core.py`

    90
    91
    92
    93
    94
    95
    96
    def descendants(self) -> list["LayoutElement"]:
        """Return the descendants of the layout element"""
        descendants = []
        for child in self.children():
            descendants.append(child)
            descendants += child.descendants()
        return descendants

#### `` drawing_elements

    drawing_elements() -> list[DrawingElement]

Return the drawing elements of the group layout. The returned drawing elements are a group drawing element formed of the self drawing elements of the group layout and the drawing elements of its children

Source code in `src/momapy/core.py`

    538
    539
    540
    541
    542
    543
    544
    545
    546
    547
    548
    549
    550
    551
    552
    553
    554
    555
    556
    557
    558
    559
    560
    561
    562
    563
    564
    def drawing_elements(self) -> list[momapy.drawing.DrawingElement]:
        """Return the drawing elements of the group layout.
        The returned drawing elements are a group drawing element formed of the self drawing elements of the group layout and the drawing elements of its children
        """
        drawing_elements = self.self_drawing_elements()
        for child in self.children():
            if child is not None:
                drawing_elements += child.drawing_elements()
        group = momapy.drawing.Group(
            class_=f"{type(self).__name__}_group",
            elements=tuple(drawing_elements),
            id_=f"{self.id_}_group",
            fill=self.group_fill,
            fill_rule=self.group_fill_rule,
            filter=self.group_filter,
            font_family=self.group_font_family,
            font_size=self.group_font_size,
            font_style=self.group_font_style,
            font_weight=self.group_font_weight,
            stroke=self.group_stroke,
            stroke_dasharray=self.group_stroke_dasharray,
            stroke_dashoffset=self.group_stroke_dashoffset,
            stroke_width=self.group_stroke_width,
            text_anchor=self.group_text_anchor,
            transform=self.group_transform,
        )
        return [group]

#### `` east

    east() -> Point

Return the east anchor of the node

Source code in `src/momapy/core.py`

    708
    709
    710
    def east(self) -> momapy.geometry.Point:
        """Return the east anchor of the node"""
        return self.self_angle(0)

#### `` east_north_east

    east_north_east() -> Point

Return the east north east anchor of the node

Source code in `src/momapy/core.py`

    700
    701
    702
    703
    704
    705
    706
    def east_north_east(self) -> momapy.geometry.Point:
        """Return the east north east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, -self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` east_south_east

    east_south_east() -> Point

Return the east south east west anchor of the node

Source code in `src/momapy/core.py`

    712
    713
    714
    715
    716
    717
    718
    def east_south_east(self) -> momapy.geometry.Point:
        """Return the east south east west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` equals

    equals(
        other: LayoutElement,
        flattened: bool = False,
        unordered: bool = False,
    ) -> bool

Return `true` if the layout element is equal to another layout element, `false` otherwise

Source code in `src/momapy/core.py`

    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    def equals(
        self, other: "LayoutElement", flattened: bool = False, unordered: bool = False
    ) -> bool:
        """Return `true` if the layout element is equal to another layout element, `false` otherwise"""
        if type(self) is type(other):
            if not flattened:
                return self == other
            else:
                if not unordered:
                    return self.flattened() == other.flattened()
                else:
                    return set(self.flattened()) == set(other.flattened())
        return False

#### `` flattened

    flattened() -> list[LayoutElement]

Return a list containing copy of the layout element with no children and all its descendants with no children

Source code in `src/momapy/core.py`

     98
     99
    100
    101
    102
    103
    def flattened(self) -> list["LayoutElement"]:
        """Return a list containing copy of the layout element with no children and all its descendants with no children"""
        flattened = [self.childless()]
        for child in self.children():
            flattened += child.flattened()
        return flattened

#### `` label_center

    label_center() -> Point

Return the label center anchor of the node

Source code in `src/momapy/core.py`

    780
    781
    782
    def label_center(self) -> momapy.geometry.Point:
        """Return the label center anchor of the node"""
        return self.position

#### `` north

    north() -> Point

Return the north anchor of the node

Source code in `src/momapy/core.py`

    680
    681
    682
    def north(self) -> momapy.geometry.Point:
        """Return the north anchor of the node"""
        return self.self_angle(90)

#### `` north_east

    north_east() -> Point

Return the north east anchor of the node

Source code in `src/momapy/core.py`

    692
    693
    694
    695
    696
    697
    698
    def north_east(self) -> momapy.geometry.Point:
        """Return the north east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, -self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` north_north_east

    north_north_east() -> Point

Return the north north east anchor of the node

Source code in `src/momapy/core.py`

    684
    685
    686
    687
    688
    689
    690
    def north_north_east(self) -> momapy.geometry.Point:
        """Return the north north east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 4, -self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` north_north_west

    north_north_west() -> Point

Return the north north west anchor of the node

Source code in `src/momapy/core.py`

    672
    673
    674
    675
    676
    677
    678
    def north_north_west(self) -> momapy.geometry.Point:
        """Return the north north west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() - (self.width / 4, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` north_west

    north_west() -> Point

Return the north west anchor of the node

Source code in `src/momapy/core.py`

    664
    665
    666
    667
    668
    669
    670
    def north_west(self) -> momapy.geometry.Point:
        """Return the north west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() - (self.width / 2, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` self_angle

    self_angle(
        angle: float,
        unit: Literal["degrees", "radians"] = "degrees",
    ) -> Point

Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.

Source code in `src/momapy/core.py`

    804
    805
    806
    807
    808
    809
    810
    811
    812
    813
    814
    815
    def self_angle(
        self,
        angle: float,
        unit: typing.Literal["degrees", "radians"] = "degrees",
    ) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal."""
        return momapy.drawing.get_drawing_elements_angle(
            drawing_elements=self.self_drawing_elements(),
            angle=angle,
            unit=unit,
            center=self.center(),
        )

#### `` self_bbox

    self_bbox() -> Bbox

Compute and return the bounding box of the self drawing element of the group layout

Source code in `src/momapy/core.py`

    499
    500
    501
    502
    def self_bbox(self) -> momapy.geometry.Bbox:
        """Compute and return the bounding box of the self drawing element of the group layout"""
        bounds = self.self_to_shapely().bounds
        return momapy.geometry.Bbox.from_bounds(bounds)

#### `` self_border

    self_border(point: Point) -> Point

Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point. When there are multiple intersection points, the one closest to the given point is returned

Source code in `src/momapy/core.py`

    784
    785
    786
    787
    788
    789
    790
    791
    792
    def self_border(self, point: momapy.geometry.Point) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point.
        When there are multiple intersection points, the one closest to the given point is returned
        """
        return momapy.drawing.get_drawing_elements_border(
            drawing_elements=self.self_drawing_elements(),
            point=point,
            center=self.center(),
        )

#### `` self_children

    self_children() -> list[LayoutElement]

Return the self children of the node. A node has unique child that is its label

Source code in `src/momapy/core.py`

    654
    655
    656
    657
    658
    def self_children(self) -> list[LayoutElement]:
        """Return the self children of the node. A node has unique child that is its label"""
        if self.label is not None:
            return [self.label]
        return []

#### `` self_drawing_elements

    self_drawing_elements() -> list[DrawingElement]

Return the node's own drawing elements

Source code in `src/momapy/core.py`

    637
    638
    639
    640
    641
    642
    643
    644
    645
    646
    647
    648
    649
    650
    651
    652
    def self_drawing_elements(self) -> list[momapy.drawing.DrawingElement]:
        """Return the node's own drawing elements"""
        drawing_elements = self._border_drawing_elements()
        group = momapy.drawing.Group(
            class_=type(self).__name__,
            elements=tuple(drawing_elements),
            fill=self.fill,
            filter=self.filter,
            id_=self.id_,
            stroke=self.stroke,
            stroke_dasharray=self.stroke_dasharray,
            stroke_dashoffset=self.stroke_dashoffset,
            stroke_width=self.stroke_width,
            transform=self.transform,
        )
        return [group]

#### `` self_to_shapely

    self_to_shapely() -> GeometryCollection

Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout

Source code in `src/momapy/core.py`

    495
    496
    497
    def self_to_shapely(self) -> shapely.GeometryCollection:
        """Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout"""
        return momapy.drawing.drawing_elements_to_shapely(self.drawing_elements())

#### `` size

    size() -> tuple[float, float]

Return the size of the node

Source code in `src/momapy/core.py`

    660
    661
    662
    def size(self) -> tuple[float, float]:
        """Return the size of the node"""
        return (self.width, self.height)

#### `` south

    south() -> Point

Return the south anchor of the node

Source code in `src/momapy/core.py`

    736
    737
    738
    def south(self) -> momapy.geometry.Point:
        """Return the south anchor of the node"""
        return self.self_angle(270)

#### `` south_east

    south_east() -> Point

Return the south east anchor of the node

Source code in `src/momapy/core.py`

    720
    721
    722
    723
    724
    725
    726
    def south_east(self) -> momapy.geometry.Point:
        """Return the south east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` south_south_east

    south_south_east() -> Point

Return the south south east anchor of the node

Source code in `src/momapy/core.py`

    728
    729
    730
    731
    732
    733
    734
    def south_south_east(self) -> momapy.geometry.Point:
        """Return the south south east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 4, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` south_south_west

    south_south_west() -> Point

Return the south south west anchor of the node

Source code in `src/momapy/core.py`

    740
    741
    742
    743
    744
    745
    746
    def south_south_west(self) -> momapy.geometry.Point:
        """Return the south south west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (-self.width / 4, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` south_west

    south_west() -> Point

Return the south west anchor of the node

Source code in `src/momapy/core.py`

    748
    749
    750
    751
    752
    753
    754
    def south_west(self) -> momapy.geometry.Point:
        """Return the south west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (-self.width / 2, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` to_shapely

    to_shapely(to_polygons: bool = False) -> GeometryCollection

Return a shapely collection of geometries reproducing the drawing elements of the layout element

Source code in `src/momapy/core.py`

    123
    124
    125
    126
    127
    128
    def to_shapely(self, to_polygons: bool = False) -> shapely.GeometryCollection:
        """Return a shapely collection of geometries reproducing the drawing elements of the layout element"""
        geom_collection = []
        for drawing_element in self.drawing_elements():
            geom_collection += drawing_element.to_shapely(to_polygons=to_polygons).geoms
        return shapely.GeometryCollection(geom_collection)

#### `` west

    west() -> Point

Return the west anchor of the node

Source code in `src/momapy/core.py`

    764
    765
    766
    def west(self) -> momapy.geometry.Point:
        """Return the west anchor of the node"""
        return self.self_angle(180)

#### `` west_north_west

    west_north_west() -> Point

Return the west north west anchor of the node

Source code in `src/momapy/core.py`

    768
    769
    770
    771
    772
    773
    774
    def west_north_west(self) -> momapy.geometry.Point:
        """Return the west north west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() - (self.width / 2, self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` west_south_west

    west_south_west() -> Point

Return the west south west anchor of the node

Source code in `src/momapy/core.py`

    756
    757
    758
    759
    760
    761
    762
    def west_south_west(self) -> momapy.geometry.Point:
        """Return the west south west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (-self.width / 2, self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` x `property`

    x: float

Return the x coordinate of the node

#### `` y `property`

    y: float

Return the y coordinate of the node

### `` TerminalReference `dataclass`

    TerminalReference(
        *,
        id_: str = make_uuid4_as_str(),
        element: EntityPool | Compartment,
    )

Bases: `SBGNRole`

Class for terminal references

Parameters:

Name | Type | Description | Default
--- | --- | --- | ---
`id_` | `str` | The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element | `'20a3f288-2af5-4866-b242-74b6769ae1d5'`
`element` | `EntityPool | Compartment` | The element of the terminal reference | required

### `` UncertainProcess `dataclass`

    UncertainProcess(
        *,
        id_: str = make_uuid4_as_str(),
        reactants: frozenset[Reactant] = frozenset(),
        products: frozenset[Product] = frozenset(),
        reversible: bool = False,
    )

Bases: `StoichiometricProcess`

Class for uncertain processes

Parameters:

Name | Type | Description | Default
--- | --- | --- | ---
`id_` | `str` | The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element | `'9f84baf0-418f-41a2-910e-a8a9e8ee5ab0'`
`reactants` | `frozenset[Reactant]` | The reactants of the stoichiometric process | `<class 'frozenset'>`
`products` | `frozenset[Product]` | The products of the stoichiometric process | `<class 'frozenset'>`
`reversible` | `bool` | Whether the stoichiometric process is reversible or not | `False`

### `` UncertainProcessLayout `dataclass`

    UncertainProcessLayout(
        fill: NoneValueType | Color | None = white,
        stroke: NoneValueType | Color | None = black,
        stroke_width: float | None = 1.25,
        *,
        id_: str = make_uuid4_as_str(),
        layout_elements: tuple[LayoutElement] = tuple(),
        group_fill: NoneValueType | Color | None = None,
        group_fill_rule: FillRule | None = None,
        group_filter: NoneValueType | Filter | None = None,
        group_font_family: str | None = None,
        group_font_size: float | None = None,
        group_font_style: FontStyle | None = None,
        group_font_weight: FontWeight | float | None = None,
        group_stroke: NoneValueType | Color | None = None,
        group_stroke_dasharray: tuple[float, ...] | None = None,
        group_stroke_dashoffset: float | None = None,
        group_stroke_width: float | None = None,
        group_text_anchor: TextAnchor | None = None,
        group_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        filter: NoneValueType | Filter | None = None,
        height: float = 20.0,
        label: TextLayout | None = None,
        position: Point,
        stroke_dasharray: tuple[float, ...] | None = None,
        stroke_dashoffset: float | None = None,
        transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        width: float = 20.0,
        direction: Direction = HORIZONTAL,
        left_to_right: bool = True,
        left_connector_length: float = 10.0,
        right_connector_length: float = 10.0,
        left_connector_stroke: NoneValueType
        | Color
        | None = None,
        left_connector_stroke_width: float | None = None,
        left_connector_stroke_dasharray: NoneValueType
        | tuple[float]
        | None = None,
        left_connector_stroke_dashoffset: float | None = None,
        left_connector_fill: NoneValueType
        | Color
        | None = None,
        left_connector_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        left_connector_filter: NoneValueType
        | Filter
        | None = None,
        right_connector_stroke: NoneValueType
        | Color
        | None = None,
        right_connector_stroke_width: float | None = None,
        right_connector_stroke_dasharray: NoneValueType
        | tuple[float]
        | None = None,
        right_connector_stroke_dashoffset: float | None = None,
        right_connector_fill: NoneValueType
        | Color
        | None = None,
        right_connector_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        right_connector_filter: NoneValueType
        | Filter
        | None = None,
    )

Bases: `_ConnectorsMixin`, `_SimpleMixin`, `_TextMixin`, `SBGNNode`

Class for uncertain process layouts

Parameters:

Name | Type | Description | Default
--- | --- | --- | ---
`id_` | `str` | The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element | `'b37f888c-fefe-429d-87b5-d810f4e77646'`
`layout_elements` | `tuple[LayoutElement]` | The sub-layout elements of the group layout. These are part of the children of the group layout | `<dynamic>`
`group_fill` | `NoneValueType | Color | None` | The fill color of the group layout | `None`
`group_fill_rule` | `FillRule | None` | The fill rule of the group layout | `None`
`group_filter` | `NoneValueType | Filter | None` | The filter of the group layout | `None`
`group_font_family` | `str | None` | The font family of the group layout | `None`
`group_font_size` | `float | None` | The font size of the group layout | `None`
`group_font_style` | `FontStyle | None` | The font style of the group layout | `None`
`group_font_weight` | `FontWeight | float | None` | The font weight of the group layout | `None`
`group_stroke` | `NoneValueType | Color | None` | The stroke color of the group layout | `None`
`group_stroke_dasharray` | `tuple[float, ...] | None` | The stroke dasharray of the group layout | `None`
`group_stroke_dashoffset` | `float | None` | The stroke dashoffset of the group layout | `None`
`group_stroke_width` | `float | None` | The stroke width of the group layout | `None`
`group_text_anchor` | `TextAnchor | None` | The text anchor of the group layout | `None`
`group_transform` | `NoneValueType | tuple[Transformation] | None` | The transform of the group layout | `None`
`fill` | `NoneValueType | Color | None` |  | `Color(red=255, green=255, blue=255, alpha=1.0)`
`filter` | `NoneValueType | Filter | None` | The filter of the node | `None`
`height` | `float` |  | `20.0`
`label` | `TextLayout | None` | The label of the node | `None`
`position` | `Point` | The position of the node | required
`stroke` | `NoneValueType | Color | None` |  | `Color(red=0, green=0, blue=0, alpha=1.0)`
`stroke_dasharray` | `tuple[float, ...] | None` | The stroke dasharray of the node | `None`
`stroke_dashoffset` | `float | None` | The stroke dashoffset of the node | `None`
`stroke_width` | `float | None` |  | `1.25`
`transform` | `NoneValueType | tuple[Transformation] | None` | The transform of the node | `None`
`width` | `float` |  | `20.0`
`direction` | `Direction` |  | `<Direction.HORIZONTAL: 1>`
`left_to_right` | `bool` |  | `True`
`left_connector_length` | `float` |  | `10.0`
`right_connector_length` | `float` |  | `10.0`
`left_connector_stroke` | `NoneValueType | Color | None` |  | `None`
`left_connector_stroke_width` | `float | None` |  | `None`
`left_connector_stroke_dasharray` | `NoneValueType | tuple[float] | None` |  | `None`
`left_connector_stroke_dashoffset` | `float | None` |  | `None`
`left_connector_fill` | `NoneValueType | Color | None` |  | `None`
`left_connector_transform` | `NoneValueType | tuple[Transformation] | None` |  | `None`
`left_connector_filter` | `NoneValueType | Filter | None` |  | `None`
`right_connector_stroke` | `NoneValueType | Color | None` |  | `None`
`right_connector_stroke_width` | `float | None` |  | `None`
`right_connector_stroke_dasharray` | `NoneValueType | tuple[float] | None` |  | `None`
`right_connector_stroke_dashoffset` | `float | None` |  | `None`
`right_connector_fill` | `NoneValueType | Color | None` |  | `None`
`right_connector_transform` | `NoneValueType | tuple[Transformation] | None` |  | `None`
`right_connector_filter` | `NoneValueType | Filter | None` |  | `None`

Methods:

Name | Description
--- | ---
`anchor_point` | Return an anchor point of the layout element
`angle` | Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.
`bbox` | Compute and return the bounding box of the group layout element
`border` | Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point.
`center` | Return the center anchor of the node
`childless` | Return a copy of the node with no children
`children` | Return the children of the group layout.
`contains` | Return `true` if another layout element is a descendant of the layout element, `false` otherwise
`descendants` | Return the descendants of the layout element
`drawing_elements` | Return the drawing elements of the group layout.
`east_north_east` | Return the east north east anchor of the node
`east_south_east` | Return the east south east west anchor of the node
`equals` | Return `true` if the layout element is equal to another layout element, `false` otherwise
`flattened` | Return a list containing copy of the layout element with no children and all its descendants with no children
`label_center` | Return the label center anchor of the node
`north_east` | Return the north east anchor of the node
`north_north_east` | Return the north north east anchor of the node
`north_north_west` | Return the north north west anchor of the node
`north_west` | Return the north west anchor of the node
`self_angle` | Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.
`self_bbox` | Compute and return the bounding box of the self drawing element of the group layout
`self_border` | Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point.
`self_children` | Return the self children of the node. A node has unique child that is its label
`self_drawing_elements` | Return the node's own drawing elements
`self_to_shapely` | Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout
`size` | Return the size of the node
`south_east` | Return the south east anchor of the node
`south_south_east` | Return the south south east anchor of the node
`south_south_west` | Return the south south west anchor of the node
`south_west` | Return the south west anchor of the node
`to_shapely` | Return a shapely collection of geometries reproducing the drawing elements of the layout element
`west_north_west` | Return the west north west anchor of the node
`west_south_west` | Return the west south west anchor of the node

Attributes:

Name | Type | Description
--- | --- | ---
`x` | `float` | Return the x coordinate of the node
`y` | `float` | Return the y coordinate of the node

#### `` anchor_point

    anchor_point(anchor_name: str) -> Point

Return an anchor point of the layout element

Source code in `src/momapy/core.py`

    130
    131
    132
    def anchor_point(self, anchor_name: str) -> momapy.geometry.Point:
        """Return an anchor point of the layout element"""
        return getattr(self, anchor_name)()

#### `` angle

    angle(
        angle: float,
        unit: Literal["degrees", "radians"] = "degrees",
    ) -> Point

Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.

Source code in `src/momapy/core.py`

    817
    818
    819
    820
    821
    822
    823
    824
    825
    826
    827
    828
    def angle(
        self,
        angle: float,
        unit: typing.Literal["degrees", "radians"] = "degrees",
    ) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal."""
        return momapy.drawing.get_drawing_elements_angle(
            drawing_elements=self.drawing_elements(),
            angle=angle,
            unit=unit,
            center=self.center(),
        )

#### `` bbox

    bbox() -> Bbox

Compute and return the bounding box of the group layout element

Source code in `src/momapy/core.py`

    504
    505
    506
    507
    508
    509
    510
    511
    512
    513
    514
    515
    516
    517
    518
    519
    520
    521
    522
    523
    524
    525
    526
    def bbox(self) -> momapy.geometry.Bbox:
        """Compute and return the bounding box of the group layout element"""
        self_bbox = self.self_bbox()
        bboxes = [child.bbox() for child in self.children()]
        min_x = self_bbox.north_west().x
        min_y = self_bbox.north_west().y
        max_x = self_bbox.south_east().x
        max_y = self_bbox.south_east().y
        for bbox in bboxes:
            if bbox.north_west().x < min_x:
                min_x = bbox.north_west().x
            if bbox.north_west().y < min_y:
                min_y = bbox.north_west().y
            if bbox.south_east().x > max_x:
                max_x = bbox.south_east().x
            if bbox.south_east().y > max_y:
                max_y = bbox.south_east().y
        bbox = momapy.geometry.Bbox(
            momapy.geometry.Point(min_x / 2 + max_x / 2, min_y / 2 + max_y / 2),
            max_x - min_x,
            max_y - min_y,
        )
        return bbox

#### `` border

    border(point: Point) -> Point

Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point. When there are multiple intersection points, the one closest to the given point is returned

Source code in `src/momapy/core.py`

    794
    795
    796
    797
    798
    799
    800
    801
    802
    def border(self, point: momapy.geometry.Point) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point.
        When there are multiple intersection points, the one closest to the given point is returned
        """
        return momapy.drawing.get_drawing_elements_border(
            drawing_elements=self.drawing_elements(),
            point=point,
            center=self.center(),
        )

#### `` center

    center() -> Point

Return the center anchor of the node

Source code in `src/momapy/core.py`

    776
    777
    778
    def center(self) -> momapy.geometry.Point:
        """Return the center anchor of the node"""
        return self.position

#### `` childless

    childless() -> Self

Return a copy of the node with no children

Source code in `src/momapy/core.py`

    830
    831
    832
    def childless(self) -> typing.Self:
        """Return a copy of the node with no children"""
        return dataclasses.replace(self, label=None, layout_elements=tuple([]))

#### `` children

    children() -> list[LayoutElement]

Return the children of the group layout. These are the self children of the group layout (returned by the `self_children` method) and the other children of the group layout (given by the `layout_elements` attribute)

Source code in `src/momapy/core.py`

    566
    567
    568
    569
    570
    def children(self) -> list[LayoutElement]:
        """Return the children of the group layout.
        These are the self children of the group layout (returned by the `self_children` method) and the other children of the group layout (given by the `layout_elements` attribute)
        """
        return self.self_children() + list(self.layout_elements)

#### `` contains

    contains(other: LayoutElement) -> bool

Return `true` if another layout element is a descendant of the layout element, `false` otherwise

Source code in `src/momapy/core.py`

    119
    120
    121
    def contains(self, other: "LayoutElement") -> bool:
        """Return `true` if another layout element is a descendant of the layout element, `false` otherwise"""
        return other in self.descendants()

#### `` descendants

    descendants() -> list[LayoutElement]

Return the descendants of the layout element

Source code in `src/momapy/core.py`

    90
    91
    92
    93
    94
    95
    96
    def descendants(self) -> list["LayoutElement"]:
        """Return the descendants of the layout element"""
        descendants = []
        for child in self.children():
            descendants.append(child)
            descendants += child.descendants()
        return descendants

#### `` drawing_elements

    drawing_elements() -> list[DrawingElement]

Return the drawing elements of the group layout. The returned drawing elements are a group drawing element formed of the self drawing elements of the group layout and the drawing elements of its children

Source code in `src/momapy/core.py`

    538
    539
    540
    541
    542
    543
    544
    545
    546
    547
    548
    549
    550
    551
    552
    553
    554
    555
    556
    557
    558
    559
    560
    561
    562
    563
    564
    def drawing_elements(self) -> list[momapy.drawing.DrawingElement]:
        """Return the drawing elements of the group layout.
        The returned drawing elements are a group drawing element formed of the self drawing elements of the group layout and the drawing elements of its children
        """
        drawing_elements = self.self_drawing_elements()
        for child in self.children():
            if child is not None:
                drawing_elements += child.drawing_elements()
        group = momapy.drawing.Group(
            class_=f"{type(self).__name__}_group",
            elements=tuple(drawing_elements),
            id_=f"{self.id_}_group",
            fill=self.group_fill,
            fill_rule=self.group_fill_rule,
            filter=self.group_filter,
            font_family=self.group_font_family,
            font_size=self.group_font_size,
            font_style=self.group_font_style,
            font_weight=self.group_font_weight,
            stroke=self.group_stroke,
            stroke_dasharray=self.group_stroke_dasharray,
            stroke_dashoffset=self.group_stroke_dashoffset,
            stroke_width=self.group_stroke_width,
            text_anchor=self.group_text_anchor,
            transform=self.group_transform,
        )
        return [group]

#### `` east_north_east

    east_north_east() -> Point

Return the east north east anchor of the node

Source code in `src/momapy/core.py`

    700
    701
    702
    703
    704
    705
    706
    def east_north_east(self) -> momapy.geometry.Point:
        """Return the east north east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, -self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` east_south_east

    east_south_east() -> Point

Return the east south east west anchor of the node

Source code in `src/momapy/core.py`

    712
    713
    714
    715
    716
    717
    718
    def east_south_east(self) -> momapy.geometry.Point:
        """Return the east south east west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` equals

    equals(
        other: LayoutElement,
        flattened: bool = False,
        unordered: bool = False,
    ) -> bool

Return `true` if the layout element is equal to another layout element, `false` otherwise

Source code in `src/momapy/core.py`

    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    def equals(
        self, other: "LayoutElement", flattened: bool = False, unordered: bool = False
    ) -> bool:
        """Return `true` if the layout element is equal to another layout element, `false` otherwise"""
        if type(self) is type(other):
            if not flattened:
                return self == other
            else:
                if not unordered:
                    return self.flattened() == other.flattened()
                else:
                    return set(self.flattened()) == set(other.flattened())
        return False

#### `` flattened

    flattened() -> list[LayoutElement]

Return a list containing copy of the layout element with no children and all its descendants with no children

Source code in `src/momapy/core.py`

     98
     99
    100
    101
    102
    103
    def flattened(self) -> list["LayoutElement"]:
        """Return a list containing copy of the layout element with no children and all its descendants with no children"""
        flattened = [self.childless()]
        for child in self.children():
            flattened += child.flattened()
        return flattened

#### `` label_center

    label_center() -> Point

Return the label center anchor of the node

Source code in `src/momapy/core.py`

    780
    781
    782
    def label_center(self) -> momapy.geometry.Point:
        """Return the label center anchor of the node"""
        return self.position

#### `` north_east

    north_east() -> Point

Return the north east anchor of the node

Source code in `src/momapy/core.py`

    692
    693
    694
    695
    696
    697
    698
    def north_east(self) -> momapy.geometry.Point:
        """Return the north east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, -self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` north_north_east

    north_north_east() -> Point

Return the north north east anchor of the node

Source code in `src/momapy/core.py`

    684
    685
    686
    687
    688
    689
    690
    def north_north_east(self) -> momapy.geometry.Point:
        """Return the north north east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 4, -self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` north_north_west

    north_north_west() -> Point

Return the north north west anchor of the node

Source code in `src/momapy/core.py`

    672
    673
    674
    675
    676
    677
    678
    def north_north_west(self) -> momapy.geometry.Point:
        """Return the north north west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() - (self.width / 4, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` north_west

    north_west() -> Point

Return the north west anchor of the node

Source code in `src/momapy/core.py`

    664
    665
    666
    667
    668
    669
    670
    def north_west(self) -> momapy.geometry.Point:
        """Return the north west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() - (self.width / 2, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` self_angle

    self_angle(
        angle: float,
        unit: Literal["degrees", "radians"] = "degrees",
    ) -> Point

Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.

Source code in `src/momapy/core.py`

    804
    805
    806
    807
    808
    809
    810
    811
    812
    813
    814
    815
    def self_angle(
        self,
        angle: float,
        unit: typing.Literal["degrees", "radians"] = "degrees",
    ) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal."""
        return momapy.drawing.get_drawing_elements_angle(
            drawing_elements=self.self_drawing_elements(),
            angle=angle,
            unit=unit,
            center=self.center(),
        )

#### `` self_bbox

    self_bbox() -> Bbox

Compute and return the bounding box of the self drawing element of the group layout

Source code in `src/momapy/core.py`

    499
    500
    501
    502
    def self_bbox(self) -> momapy.geometry.Bbox:
        """Compute and return the bounding box of the self drawing element of the group layout"""
        bounds = self.self_to_shapely().bounds
        return momapy.geometry.Bbox.from_bounds(bounds)

#### `` self_border

    self_border(point: Point) -> Point

Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point. When there are multiple intersection points, the one closest to the given point is returned

Source code in `src/momapy/core.py`

    784
    785
    786
    787
    788
    789
    790
    791
    792
    def self_border(self, point: momapy.geometry.Point) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point.
        When there are multiple intersection points, the one closest to the given point is returned
        """
        return momapy.drawing.get_drawing_elements_border(
            drawing_elements=self.self_drawing_elements(),
            point=point,
            center=self.center(),
        )

#### `` self_children

    self_children() -> list[LayoutElement]

Return the self children of the node. A node has unique child that is its label

Source code in `src/momapy/core.py`

    654
    655
    656
    657
    658
    def self_children(self) -> list[LayoutElement]:
        """Return the self children of the node. A node has unique child that is its label"""
        if self.label is not None:
            return [self.label]
        return []

#### `` self_drawing_elements

    self_drawing_elements() -> list[DrawingElement]

Return the node's own drawing elements

Source code in `src/momapy/core.py`

    637
    638
    639
    640
    641
    642
    643
    644
    645
    646
    647
    648
    649
    650
    651
    652
    def self_drawing_elements(self) -> list[momapy.drawing.DrawingElement]:
        """Return the node's own drawing elements"""
        drawing_elements = self._border_drawing_elements()
        group = momapy.drawing.Group(
            class_=type(self).__name__,
            elements=tuple(drawing_elements),
            fill=self.fill,
            filter=self.filter,
            id_=self.id_,
            stroke=self.stroke,
            stroke_dasharray=self.stroke_dasharray,
            stroke_dashoffset=self.stroke_dashoffset,
            stroke_width=self.stroke_width,
            transform=self.transform,
        )
        return [group]

#### `` self_to_shapely

    self_to_shapely() -> GeometryCollection

Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout

Source code in `src/momapy/core.py`

    495
    496
    497
    def self_to_shapely(self) -> shapely.GeometryCollection:
        """Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout"""
        return momapy.drawing.drawing_elements_to_shapely(self.drawing_elements())

#### `` size

    size() -> tuple[float, float]

Return the size of the node

Source code in `src/momapy/core.py`

    660
    661
    662
    def size(self) -> tuple[float, float]:
        """Return the size of the node"""
        return (self.width, self.height)

#### `` south_east

    south_east() -> Point

Return the south east anchor of the node

Source code in `src/momapy/core.py`

    720
    721
    722
    723
    724
    725
    726
    def south_east(self) -> momapy.geometry.Point:
        """Return the south east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` south_south_east

    south_south_east() -> Point

Return the south south east anchor of the node

Source code in `src/momapy/core.py`

    728
    729
    730
    731
    732
    733
    734
    def south_south_east(self) -> momapy.geometry.Point:
        """Return the south south east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 4, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` south_south_west

    south_south_west() -> Point

Return the south south west anchor of the node

Source code in `src/momapy/core.py`

    740
    741
    742
    743
    744
    745
    746
    def south_south_west(self) -> momapy.geometry.Point:
        """Return the south south west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (-self.width / 4, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` south_west

    south_west() -> Point

Return the south west anchor of the node

Source code in `src/momapy/core.py`

    748
    749
    750
    751
    752
    753
    754
    def south_west(self) -> momapy.geometry.Point:
        """Return the south west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (-self.width / 2, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` to_shapely

    to_shapely(to_polygons: bool = False) -> GeometryCollection

Return a shapely collection of geometries reproducing the drawing elements of the layout element

Source code in `src/momapy/core.py`

    123
    124
    125
    126
    127
    128
    def to_shapely(self, to_polygons: bool = False) -> shapely.GeometryCollection:
        """Return a shapely collection of geometries reproducing the drawing elements of the layout element"""
        geom_collection = []
        for drawing_element in self.drawing_elements():
            geom_collection += drawing_element.to_shapely(to_polygons=to_polygons).geoms
        return shapely.GeometryCollection(geom_collection)

#### `` west_north_west

    west_north_west() -> Point

Return the west north west anchor of the node

Source code in `src/momapy/core.py`

    768
    769
    770
    771
    772
    773
    774
    def west_north_west(self) -> momapy.geometry.Point:
        """Return the west north west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() - (self.width / 2, self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` west_south_west

    west_south_west() -> Point

Return the west south west anchor of the node

Source code in `src/momapy/core.py`

    756
    757
    758
    759
    760
    761
    762
    def west_south_west(self) -> momapy.geometry.Point:
        """Return the west south west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (-self.width / 2, self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` x `property`

    x: float

Return the x coordinate of the node

#### `` y `property`

    y: float

Return the y coordinate of the node

### `` UnitOfInformation `dataclass`

    UnitOfInformation(
        *,
        id_: str = make_uuid4_as_str(),
        value: str,
        prefix: str | None = None,
    )

Bases: `SBGNAuxiliaryUnit`

Class for units of information

Parameters:

Name | Type | Description | Default
--- | --- | --- | ---
`id_` | `str` | The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element | `'e15325a8-587a-4420-875c-9b466eba5745'`
`value` | `str` | The value of the unit of information | required
`prefix` | `str | None` | The prefix of the unit of information | `None`

### `` UnitOfInformationLayout `dataclass`

    UnitOfInformationLayout(
        fill: NoneValueType | Color | None = white,
        stroke: NoneValueType | Color | None = black,
        stroke_width: float | None = 1.25,
        *,
        id_: str = make_uuid4_as_str(),
        layout_elements: tuple[LayoutElement] = tuple(),
        group_fill: NoneValueType | Color | None = None,
        group_fill_rule: FillRule | None = None,
        group_filter: NoneValueType | Filter | None = None,
        group_font_family: str | None = None,
        group_font_size: float | None = None,
        group_font_style: FontStyle | None = None,
        group_font_weight: FontWeight | float | None = None,
        group_stroke: NoneValueType | Color | None = None,
        group_stroke_dasharray: tuple[float, ...] | None = None,
        group_stroke_dashoffset: float | None = None,
        group_stroke_width: float | None = None,
        group_text_anchor: TextAnchor | None = None,
        group_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        filter: NoneValueType | Filter | None = None,
        height: float = 12.0,
        label: TextLayout | None = None,
        position: Point,
        stroke_dasharray: tuple[float, ...] | None = None,
        stroke_dashoffset: float | None = None,
        transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        width: float = 12.0,
    )

Bases: `_SimpleMixin`, `SBGNNode`

Class for unit of information layouts

Parameters:

Name | Type | Description | Default
--- | --- | --- | ---
`id_` | `str` | The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element | `'bcef63fb-1697-4d6a-9ef5-7ee15da8fde2'`
`layout_elements` | `tuple[LayoutElement]` | The sub-layout elements of the group layout. These are part of the children of the group layout | `<dynamic>`
`group_fill` | `NoneValueType | Color | None` | The fill color of the group layout | `None`
`group_fill_rule` | `FillRule | None` | The fill rule of the group layout | `None`
`group_filter` | `NoneValueType | Filter | None` | The filter of the group layout | `None`
`group_font_family` | `str | None` | The font family of the group layout | `None`
`group_font_size` | `float | None` | The font size of the group layout | `None`
`group_font_style` | `FontStyle | None` | The font style of the group layout | `None`
`group_font_weight` | `FontWeight | float | None` | The font weight of the group layout | `None`
`group_stroke` | `NoneValueType | Color | None` | The stroke color of the group layout | `None`
`group_stroke_dasharray` | `tuple[float, ...] | None` | The stroke dasharray of the group layout | `None`
`group_stroke_dashoffset` | `float | None` | The stroke dashoffset of the group layout | `None`
`group_stroke_width` | `float | None` | The stroke width of the group layout | `None`
`group_text_anchor` | `TextAnchor | None` | The text anchor of the group layout | `None`
`group_transform` | `NoneValueType | tuple[Transformation] | None` | The transform of the group layout | `None`
`fill` | `NoneValueType | Color | None` |  | `Color(red=255, green=255, blue=255, alpha=1.0)`
`filter` | `NoneValueType | Filter | None` | The filter of the node | `None`
`height` | `float` |  | `12.0`
`label` | `TextLayout | None` | The label of the node | `None`
`position` | `Point` | The position of the node | required
`stroke` | `NoneValueType | Color | None` |  | `Color(red=0, green=0, blue=0, alpha=1.0)`
`stroke_dasharray` | `tuple[float, ...] | None` | The stroke dasharray of the node | `None`
`stroke_dashoffset` | `float | None` | The stroke dashoffset of the node | `None`
`stroke_width` | `float | None` |  | `1.25`
`transform` | `NoneValueType | tuple[Transformation] | None` | The transform of the node | `None`
`width` | `float` |  | `12.0`

Methods:

Name | Description
--- | ---
`anchor_point` | Return an anchor point of the layout element
`angle` | Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.
`bbox` | Compute and return the bounding box of the group layout element
`border` | Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point.
`center` | Return the center anchor of the node
`childless` | Return a copy of the node with no children
`children` | Return the children of the group layout.
`contains` | Return `true` if another layout element is a descendant of the layout element, `false` otherwise
`descendants` | Return the descendants of the layout element
`drawing_elements` | Return the drawing elements of the group layout.
`east` | Return the east anchor of the node
`east_north_east` | Return the east north east anchor of the node
`east_south_east` | Return the east south east west anchor of the node
`equals` | Return `true` if the layout element is equal to another layout element, `false` otherwise
`flattened` | Return a list containing copy of the layout element with no children and all its descendants with no children
`label_center` | Return the label center anchor of the node
`north` | Return the north anchor of the node
`north_east` | Return the north east anchor of the node
`north_north_east` | Return the north north east anchor of the node
`north_north_west` | Return the north north west anchor of the node
`north_west` | Return the north west anchor of the node
`self_angle` | Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.
`self_bbox` | Compute and return the bounding box of the self drawing element of the group layout
`self_border` | Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point.
`self_children` | Return the self children of the node. A node has unique child that is its label
`self_drawing_elements` | Return the node's own drawing elements
`self_to_shapely` | Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout
`size` | Return the size of the node
`south` | Return the south anchor of the node
`south_east` | Return the south east anchor of the node
`south_south_east` | Return the south south east anchor of the node
`south_south_west` | Return the south south west anchor of the node
`south_west` | Return the south west anchor of the node
`to_shapely` | Return a shapely collection of geometries reproducing the drawing elements of the layout element
`west` | Return the west anchor of the node
`west_north_west` | Return the west north west anchor of the node
`west_south_west` | Return the west south west anchor of the node

Attributes:

Name | Type | Description
--- | --- | ---
`x` | `float` | Return the x coordinate of the node
`y` | `float` | Return the y coordinate of the node

#### `` anchor_point

    anchor_point(anchor_name: str) -> Point

Return an anchor point of the layout element

Source code in `src/momapy/core.py`

    130
    131
    132
    def anchor_point(self, anchor_name: str) -> momapy.geometry.Point:
        """Return an anchor point of the layout element"""
        return getattr(self, anchor_name)()

#### `` angle

    angle(
        angle: float,
        unit: Literal["degrees", "radians"] = "degrees",
    ) -> Point

Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.

Source code in `src/momapy/core.py`

    817
    818
    819
    820
    821
    822
    823
    824
    825
    826
    827
    828
    def angle(
        self,
        angle: float,
        unit: typing.Literal["degrees", "radians"] = "degrees",
    ) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal."""
        return momapy.drawing.get_drawing_elements_angle(
            drawing_elements=self.drawing_elements(),
            angle=angle,
            unit=unit,
            center=self.center(),
        )

#### `` bbox

    bbox() -> Bbox

Compute and return the bounding box of the group layout element

Source code in `src/momapy/core.py`

    504
    505
    506
    507
    508
    509
    510
    511
    512
    513
    514
    515
    516
    517
    518
    519
    520
    521
    522
    523
    524
    525
    526
    def bbox(self) -> momapy.geometry.Bbox:
        """Compute and return the bounding box of the group layout element"""
        self_bbox = self.self_bbox()
        bboxes = [child.bbox() for child in self.children()]
        min_x = self_bbox.north_west().x
        min_y = self_bbox.north_west().y
        max_x = self_bbox.south_east().x
        max_y = self_bbox.south_east().y
        for bbox in bboxes:
            if bbox.north_west().x < min_x:
                min_x = bbox.north_west().x
            if bbox.north_west().y < min_y:
                min_y = bbox.north_west().y
            if bbox.south_east().x > max_x:
                max_x = bbox.south_east().x
            if bbox.south_east().y > max_y:
                max_y = bbox.south_east().y
        bbox = momapy.geometry.Bbox(
            momapy.geometry.Point(min_x / 2 + max_x / 2, min_y / 2 + max_y / 2),
            max_x - min_x,
            max_y - min_y,
        )
        return bbox

#### `` border

    border(point: Point) -> Point

Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point. When there are multiple intersection points, the one closest to the given point is returned

Source code in `src/momapy/core.py`

    794
    795
    796
    797
    798
    799
    800
    801
    802
    def border(self, point: momapy.geometry.Point) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point.
        When there are multiple intersection points, the one closest to the given point is returned
        """
        return momapy.drawing.get_drawing_elements_border(
            drawing_elements=self.drawing_elements(),
            point=point,
            center=self.center(),
        )

#### `` center

    center() -> Point

Return the center anchor of the node

Source code in `src/momapy/core.py`

    776
    777
    778
    def center(self) -> momapy.geometry.Point:
        """Return the center anchor of the node"""
        return self.position

#### `` childless

    childless() -> Self

Return a copy of the node with no children

Source code in `src/momapy/core.py`

    830
    831
    832
    def childless(self) -> typing.Self:
        """Return a copy of the node with no children"""
        return dataclasses.replace(self, label=None, layout_elements=tuple([]))

#### `` children

    children() -> list[LayoutElement]

Return the children of the group layout. These are the self children of the group layout (returned by the `self_children` method) and the other children of the group layout (given by the `layout_elements` attribute)

Source code in `src/momapy/core.py`

    566
    567
    568
    569
    570
    def children(self) -> list[LayoutElement]:
        """Return the children of the group layout.
        These are the self children of the group layout (returned by the `self_children` method) and the other children of the group layout (given by the `layout_elements` attribute)
        """
        return self.self_children() + list(self.layout_elements)

#### `` contains

    contains(other: LayoutElement) -> bool

Return `true` if another layout element is a descendant of the layout element, `false` otherwise

Source code in `src/momapy/core.py`

    119
    120
    121
    def contains(self, other: "LayoutElement") -> bool:
        """Return `true` if another layout element is a descendant of the layout element, `false` otherwise"""
        return other in self.descendants()

#### `` descendants

    descendants() -> list[LayoutElement]

Return the descendants of the layout element

Source code in `src/momapy/core.py`

    90
    91
    92
    93
    94
    95
    96
    def descendants(self) -> list["LayoutElement"]:
        """Return the descendants of the layout element"""
        descendants = []
        for child in self.children():
            descendants.append(child)
            descendants += child.descendants()
        return descendants

#### `` drawing_elements

    drawing_elements() -> list[DrawingElement]

Return the drawing elements of the group layout. The returned drawing elements are a group drawing element formed of the self drawing elements of the group layout and the drawing elements of its children

Source code in `src/momapy/core.py`

    538
    539
    540
    541
    542
    543
    544
    545
    546
    547
    548
    549
    550
    551
    552
    553
    554
    555
    556
    557
    558
    559
    560
    561
    562
    563
    564
    def drawing_elements(self) -> list[momapy.drawing.DrawingElement]:
        """Return the drawing elements of the group layout.
        The returned drawing elements are a group drawing element formed of the self drawing elements of the group layout and the drawing elements of its children
        """
        drawing_elements = self.self_drawing_elements()
        for child in self.children():
            if child is not None:
                drawing_elements += child.drawing_elements()
        group = momapy.drawing.Group(
            class_=f"{type(self).__name__}_group",
            elements=tuple(drawing_elements),
            id_=f"{self.id_}_group",
            fill=self.group_fill,
            fill_rule=self.group_fill_rule,
            filter=self.group_filter,
            font_family=self.group_font_family,
            font_size=self.group_font_size,
            font_style=self.group_font_style,
            font_weight=self.group_font_weight,
            stroke=self.group_stroke,
            stroke_dasharray=self.group_stroke_dasharray,
            stroke_dashoffset=self.group_stroke_dashoffset,
            stroke_width=self.group_stroke_width,
            text_anchor=self.group_text_anchor,
            transform=self.group_transform,
        )
        return [group]

#### `` east

    east() -> Point

Return the east anchor of the node

Source code in `src/momapy/core.py`

    708
    709
    710
    def east(self) -> momapy.geometry.Point:
        """Return the east anchor of the node"""
        return self.self_angle(0)

#### `` east_north_east

    east_north_east() -> Point

Return the east north east anchor of the node

Source code in `src/momapy/core.py`

    700
    701
    702
    703
    704
    705
    706
    def east_north_east(self) -> momapy.geometry.Point:
        """Return the east north east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, -self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` east_south_east

    east_south_east() -> Point

Return the east south east west anchor of the node

Source code in `src/momapy/core.py`

    712
    713
    714
    715
    716
    717
    718
    def east_south_east(self) -> momapy.geometry.Point:
        """Return the east south east west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` equals

    equals(
        other: LayoutElement,
        flattened: bool = False,
        unordered: bool = False,
    ) -> bool

Return `true` if the layout element is equal to another layout element, `false` otherwise

Source code in `src/momapy/core.py`

    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    def equals(
        self, other: "LayoutElement", flattened: bool = False, unordered: bool = False
    ) -> bool:
        """Return `true` if the layout element is equal to another layout element, `false` otherwise"""
        if type(self) is type(other):
            if not flattened:
                return self == other
            else:
                if not unordered:
                    return self.flattened() == other.flattened()
                else:
                    return set(self.flattened()) == set(other.flattened())
        return False

#### `` flattened

    flattened() -> list[LayoutElement]

Return a list containing copy of the layout element with no children and all its descendants with no children

Source code in `src/momapy/core.py`

     98
     99
    100
    101
    102
    103
    def flattened(self) -> list["LayoutElement"]:
        """Return a list containing copy of the layout element with no children and all its descendants with no children"""
        flattened = [self.childless()]
        for child in self.children():
            flattened += child.flattened()
        return flattened

#### `` label_center

    label_center() -> Point

Return the label center anchor of the node

Source code in `src/momapy/core.py`

    780
    781
    782
    def label_center(self) -> momapy.geometry.Point:
        """Return the label center anchor of the node"""
        return self.position

#### `` north

    north() -> Point

Return the north anchor of the node

Source code in `src/momapy/core.py`

    680
    681
    682
    def north(self) -> momapy.geometry.Point:
        """Return the north anchor of the node"""
        return self.self_angle(90)

#### `` north_east

    north_east() -> Point

Return the north east anchor of the node

Source code in `src/momapy/core.py`

    692
    693
    694
    695
    696
    697
    698
    def north_east(self) -> momapy.geometry.Point:
        """Return the north east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, -self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` north_north_east

    north_north_east() -> Point

Return the north north east anchor of the node

Source code in `src/momapy/core.py`

    684
    685
    686
    687
    688
    689
    690
    def north_north_east(self) -> momapy.geometry.Point:
        """Return the north north east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 4, -self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` north_north_west

    north_north_west() -> Point

Return the north north west anchor of the node

Source code in `src/momapy/core.py`

    672
    673
    674
    675
    676
    677
    678
    def north_north_west(self) -> momapy.geometry.Point:
        """Return the north north west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() - (self.width / 4, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` north_west

    north_west() -> Point

Return the north west anchor of the node

Source code in `src/momapy/core.py`

    664
    665
    666
    667
    668
    669
    670
    def north_west(self) -> momapy.geometry.Point:
        """Return the north west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() - (self.width / 2, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` self_angle

    self_angle(
        angle: float,
        unit: Literal["degrees", "radians"] = "degrees",
    ) -> Point

Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.

Source code in `src/momapy/core.py`

    804
    805
    806
    807
    808
    809
    810
    811
    812
    813
    814
    815
    def self_angle(
        self,
        angle: float,
        unit: typing.Literal["degrees", "radians"] = "degrees",
    ) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal."""
        return momapy.drawing.get_drawing_elements_angle(
            drawing_elements=self.self_drawing_elements(),
            angle=angle,
            unit=unit,
            center=self.center(),
        )

#### `` self_bbox

    self_bbox() -> Bbox

Compute and return the bounding box of the self drawing element of the group layout

Source code in `src/momapy/core.py`

    499
    500
    501
    502
    def self_bbox(self) -> momapy.geometry.Bbox:
        """Compute and return the bounding box of the self drawing element of the group layout"""
        bounds = self.self_to_shapely().bounds
        return momapy.geometry.Bbox.from_bounds(bounds)

#### `` self_border

    self_border(point: Point) -> Point

Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point. When there are multiple intersection points, the one closest to the given point is returned

Source code in `src/momapy/core.py`

    784
    785
    786
    787
    788
    789
    790
    791
    792
    def self_border(self, point: momapy.geometry.Point) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point.
        When there are multiple intersection points, the one closest to the given point is returned
        """
        return momapy.drawing.get_drawing_elements_border(
            drawing_elements=self.self_drawing_elements(),
            point=point,
            center=self.center(),
        )

#### `` self_children

    self_children() -> list[LayoutElement]

Return the self children of the node. A node has unique child that is its label

Source code in `src/momapy/core.py`

    654
    655
    656
    657
    658
    def self_children(self) -> list[LayoutElement]:
        """Return the self children of the node. A node has unique child that is its label"""
        if self.label is not None:
            return [self.label]
        return []

#### `` self_drawing_elements

    self_drawing_elements() -> list[DrawingElement]

Return the node's own drawing elements

Source code in `src/momapy/core.py`

    637
    638
    639
    640
    641
    642
    643
    644
    645
    646
    647
    648
    649
    650
    651
    652
    def self_drawing_elements(self) -> list[momapy.drawing.DrawingElement]:
        """Return the node's own drawing elements"""
        drawing_elements = self._border_drawing_elements()
        group = momapy.drawing.Group(
            class_=type(self).__name__,
            elements=tuple(drawing_elements),
            fill=self.fill,
            filter=self.filter,
            id_=self.id_,
            stroke=self.stroke,
            stroke_dasharray=self.stroke_dasharray,
            stroke_dashoffset=self.stroke_dashoffset,
            stroke_width=self.stroke_width,
            transform=self.transform,
        )
        return [group]

#### `` self_to_shapely

    self_to_shapely() -> GeometryCollection

Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout

Source code in `src/momapy/core.py`

    495
    496
    497
    def self_to_shapely(self) -> shapely.GeometryCollection:
        """Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout"""
        return momapy.drawing.drawing_elements_to_shapely(self.drawing_elements())

#### `` size

    size() -> tuple[float, float]

Return the size of the node

Source code in `src/momapy/core.py`

    660
    661
    662
    def size(self) -> tuple[float, float]:
        """Return the size of the node"""
        return (self.width, self.height)

#### `` south

    south() -> Point

Return the south anchor of the node

Source code in `src/momapy/core.py`

    736
    737
    738
    def south(self) -> momapy.geometry.Point:
        """Return the south anchor of the node"""
        return self.self_angle(270)

#### `` south_east

    south_east() -> Point

Return the south east anchor of the node

Source code in `src/momapy/core.py`

    720
    721
    722
    723
    724
    725
    726
    def south_east(self) -> momapy.geometry.Point:
        """Return the south east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` south_south_east

    south_south_east() -> Point

Return the south south east anchor of the node

Source code in `src/momapy/core.py`

    728
    729
    730
    731
    732
    733
    734
    def south_south_east(self) -> momapy.geometry.Point:
        """Return the south south east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 4, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` south_south_west

    south_south_west() -> Point

Return the south south west anchor of the node

Source code in `src/momapy/core.py`

    740
    741
    742
    743
    744
    745
    746
    def south_south_west(self) -> momapy.geometry.Point:
        """Return the south south west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (-self.width / 4, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` south_west

    south_west() -> Point

Return the south west anchor of the node

Source code in `src/momapy/core.py`

    748
    749
    750
    751
    752
    753
    754
    def south_west(self) -> momapy.geometry.Point:
        """Return the south west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (-self.width / 2, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` to_shapely

    to_shapely(to_polygons: bool = False) -> GeometryCollection

Return a shapely collection of geometries reproducing the drawing elements of the layout element

Source code in `src/momapy/core.py`

    123
    124
    125
    126
    127
    128
    def to_shapely(self, to_polygons: bool = False) -> shapely.GeometryCollection:
        """Return a shapely collection of geometries reproducing the drawing elements of the layout element"""
        geom_collection = []
        for drawing_element in self.drawing_elements():
            geom_collection += drawing_element.to_shapely(to_polygons=to_polygons).geoms
        return shapely.GeometryCollection(geom_collection)

#### `` west

    west() -> Point

Return the west anchor of the node

Source code in `src/momapy/core.py`

    764
    765
    766
    def west(self) -> momapy.geometry.Point:
        """Return the west anchor of the node"""
        return self.self_angle(180)

#### `` west_north_west

    west_north_west() -> Point

Return the west north west anchor of the node

Source code in `src/momapy/core.py`

    768
    769
    770
    771
    772
    773
    774
    def west_north_west(self) -> momapy.geometry.Point:
        """Return the west north west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() - (self.width / 2, self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` west_south_west

    west_south_west() -> Point

Return the west south west anchor of the node

Source code in `src/momapy/core.py`

    756
    757
    758
    759
    760
    761
    762
    def west_south_west(self) -> momapy.geometry.Point:
        """Return the west south west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (-self.width / 2, self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` x `property`

    x: float

Return the x coordinate of the node

#### `` y `property`

    y: float

Return the y coordinate of the node

### `` UnspecifiedEntity `dataclass`

    UnspecifiedEntity(
        *,
        id_: str = make_uuid4_as_str(),
        compartment: Compartment | None = None,
        label: str | None = None,
    )

Bases: `EntityPool`

Class for unspecified entities

Parameters:

Name | Type | Description | Default
--- | --- | --- | ---
`id_` | `str` | The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element | `'becc232d-3b26-41d1-8984-e0595883b395'`
`compartment` | `Compartment | None` | The compartment of the entity pool | `None`
`label` | `str | None` | The label of the unspecified entity | `None`

### `` UnspecifiedEntityLayout `dataclass`

    UnspecifiedEntityLayout(
        fill: NoneValueType | Color | None = white,
        stroke: NoneValueType | Color | None = black,
        stroke_width: float | None = 1.25,
        *,
        id_: str = make_uuid4_as_str(),
        layout_elements: tuple[LayoutElement] = tuple(),
        group_fill: NoneValueType | Color | None = None,
        group_fill_rule: FillRule | None = None,
        group_filter: NoneValueType | Filter | None = None,
        group_font_family: str | None = None,
        group_font_size: float | None = None,
        group_font_style: FontStyle | None = None,
        group_font_weight: FontWeight | float | None = None,
        group_stroke: NoneValueType | Color | None = None,
        group_stroke_dasharray: tuple[float, ...] | None = None,
        group_stroke_dashoffset: float | None = None,
        group_stroke_width: float | None = None,
        group_text_anchor: TextAnchor | None = None,
        group_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        filter: NoneValueType | Filter | None = None,
        height: float = 30.0,
        label: TextLayout | None = None,
        position: Point,
        stroke_dasharray: tuple[float, ...] | None = None,
        stroke_dashoffset: float | None = None,
        transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        width: float = 60.0,
    )

Bases: `_SimpleMixin`, `SBGNNode`

Class for unspecified entity layouts

Parameters:

Name | Type | Description | Default
--- | --- | --- | ---
`id_` | `str` | The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element | `'f8cb6dd2-15b2-4be6-bea5-4f688ef00a1b'`
`layout_elements` | `tuple[LayoutElement]` | The sub-layout elements of the group layout. These are part of the children of the group layout | `<dynamic>`
`group_fill` | `NoneValueType | Color | None` | The fill color of the group layout | `None`
`group_fill_rule` | `FillRule | None` | The fill rule of the group layout | `None`
`group_filter` | `NoneValueType | Filter | None` | The filter of the group layout | `None`
`group_font_family` | `str | None` | The font family of the group layout | `None`
`group_font_size` | `float | None` | The font size of the group layout | `None`
`group_font_style` | `FontStyle | None` | The font style of the group layout | `None`
`group_font_weight` | `FontWeight | float | None` | The font weight of the group layout | `None`
`group_stroke` | `NoneValueType | Color | None` | The stroke color of the group layout | `None`
`group_stroke_dasharray` | `tuple[float, ...] | None` | The stroke dasharray of the group layout | `None`
`group_stroke_dashoffset` | `float | None` | The stroke dashoffset of the group layout | `None`
`group_stroke_width` | `float | None` | The stroke width of the group layout | `None`
`group_text_anchor` | `TextAnchor | None` | The text anchor of the group layout | `None`
`group_transform` | `NoneValueType | tuple[Transformation] | None` | The transform of the group layout | `None`
`fill` | `NoneValueType | Color | None` |  | `Color(red=255, green=255, blue=255, alpha=1.0)`
`filter` | `NoneValueType | Filter | None` | The filter of the node | `None`
`height` | `float` |  | `30.0`
`label` | `TextLayout | None` | The label of the node | `None`
`position` | `Point` | The position of the node | required
`stroke` | `NoneValueType | Color | None` |  | `Color(red=0, green=0, blue=0, alpha=1.0)`
`stroke_dasharray` | `tuple[float, ...] | None` | The stroke dasharray of the node | `None`
`stroke_dashoffset` | `float | None` | The stroke dashoffset of the node | `None`
`stroke_width` | `float | None` |  | `1.25`
`transform` | `NoneValueType | tuple[Transformation] | None` | The transform of the node | `None`
`width` | `float` |  | `60.0`

Methods:

Name | Description
--- | ---
`anchor_point` | Return an anchor point of the layout element
`angle` | Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.
`bbox` | Compute and return the bounding box of the group layout element
`border` | Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point.
`center` | Return the center anchor of the node
`childless` | Return a copy of the node with no children
`children` | Return the children of the group layout.
`contains` | Return `true` if another layout element is a descendant of the layout element, `false` otherwise
`descendants` | Return the descendants of the layout element
`drawing_elements` | Return the drawing elements of the group layout.
`east` | Return the east anchor of the node
`east_north_east` | Return the east north east anchor of the node
`east_south_east` | Return the east south east west anchor of the node
`equals` | Return `true` if the layout element is equal to another layout element, `false` otherwise
`flattened` | Return a list containing copy of the layout element with no children and all its descendants with no children
`label_center` | Return the label center anchor of the node
`north` | Return the north anchor of the node
`north_east` | Return the north east anchor of the node
`north_north_east` | Return the north north east anchor of the node
`north_north_west` | Return the north north west anchor of the node
`north_west` | Return the north west anchor of the node
`self_angle` | Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.
`self_bbox` | Compute and return the bounding box of the self drawing element of the group layout
`self_border` | Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point.
`self_children` | Return the self children of the node. A node has unique child that is its label
`self_drawing_elements` | Return the node's own drawing elements
`self_to_shapely` | Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout
`size` | Return the size of the node
`south` | Return the south anchor of the node
`south_east` | Return the south east anchor of the node
`south_south_east` | Return the south south east anchor of the node
`south_south_west` | Return the south south west anchor of the node
`south_west` | Return the south west anchor of the node
`to_shapely` | Return a shapely collection of geometries reproducing the drawing elements of the layout element
`west` | Return the west anchor of the node
`west_north_west` | Return the west north west anchor of the node
`west_south_west` | Return the west south west anchor of the node

Attributes:

Name | Type | Description
--- | --- | ---
`x` | `float` | Return the x coordinate of the node
`y` | `float` | Return the y coordinate of the node

#### `` anchor_point

    anchor_point(anchor_name: str) -> Point

Return an anchor point of the layout element

Source code in `src/momapy/core.py`

    130
    131
    132
    def anchor_point(self, anchor_name: str) -> momapy.geometry.Point:
        """Return an anchor point of the layout element"""
        return getattr(self, anchor_name)()

#### `` angle

    angle(
        angle: float,
        unit: Literal["degrees", "radians"] = "degrees",
    ) -> Point

Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.

Source code in `src/momapy/core.py`

    817
    818
    819
    820
    821
    822
    823
    824
    825
    826
    827
    828
    def angle(
        self,
        angle: float,
        unit: typing.Literal["degrees", "radians"] = "degrees",
    ) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal."""
        return momapy.drawing.get_drawing_elements_angle(
            drawing_elements=self.drawing_elements(),
            angle=angle,
            unit=unit,
            center=self.center(),
        )

#### `` bbox

    bbox() -> Bbox

Compute and return the bounding box of the group layout element

Source code in `src/momapy/core.py`

    504
    505
    506
    507
    508
    509
    510
    511
    512
    513
    514
    515
    516
    517
    518
    519
    520
    521
    522
    523
    524
    525
    526
    def bbox(self) -> momapy.geometry.Bbox:
        """Compute and return the bounding box of the group layout element"""
        self_bbox = self.self_bbox()
        bboxes = [child.bbox() for child in self.children()]
        min_x = self_bbox.north_west().x
        min_y = self_bbox.north_west().y
        max_x = self_bbox.south_east().x
        max_y = self_bbox.south_east().y
        for bbox in bboxes:
            if bbox.north_west().x < min_x:
                min_x = bbox.north_west().x
            if bbox.north_west().y < min_y:
                min_y = bbox.north_west().y
            if bbox.south_east().x > max_x:
                max_x = bbox.south_east().x
            if bbox.south_east().y > max_y:
                max_y = bbox.south_east().y
        bbox = momapy.geometry.Bbox(
            momapy.geometry.Point(min_x / 2 + max_x / 2, min_y / 2 + max_y / 2),
            max_x - min_x,
            max_y - min_y,
        )
        return bbox

#### `` border

    border(point: Point) -> Point

Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point. When there are multiple intersection points, the one closest to the given point is returned

Source code in `src/momapy/core.py`

    794
    795
    796
    797
    798
    799
    800
    801
    802
    def border(self, point: momapy.geometry.Point) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point.
        When there are multiple intersection points, the one closest to the given point is returned
        """
        return momapy.drawing.get_drawing_elements_border(
            drawing_elements=self.drawing_elements(),
            point=point,
            center=self.center(),
        )

#### `` center

    center() -> Point

Return the center anchor of the node

Source code in `src/momapy/core.py`

    776
    777
    778
    def center(self) -> momapy.geometry.Point:
        """Return the center anchor of the node"""
        return self.position

#### `` childless

    childless() -> Self

Return a copy of the node with no children

Source code in `src/momapy/core.py`

    830
    831
    832
    def childless(self) -> typing.Self:
        """Return a copy of the node with no children"""
        return dataclasses.replace(self, label=None, layout_elements=tuple([]))

#### `` children

    children() -> list[LayoutElement]

Return the children of the group layout. These are the self children of the group layout (returned by the `self_children` method) and the other children of the group layout (given by the `layout_elements` attribute)

Source code in `src/momapy/core.py`

    566
    567
    568
    569
    570
    def children(self) -> list[LayoutElement]:
        """Return the children of the group layout.
        These are the self children of the group layout (returned by the `self_children` method) and the other children of the group layout (given by the `layout_elements` attribute)
        """
        return self.self_children() + list(self.layout_elements)

#### `` contains

    contains(other: LayoutElement) -> bool

Return `true` if another layout element is a descendant of the layout element, `false` otherwise

Source code in `src/momapy/core.py`

    119
    120
    121
    def contains(self, other: "LayoutElement") -> bool:
        """Return `true` if another layout element is a descendant of the layout element, `false` otherwise"""
        return other in self.descendants()

#### `` descendants

    descendants() -> list[LayoutElement]

Return the descendants of the layout element

Source code in `src/momapy/core.py`

    90
    91
    92
    93
    94
    95
    96
    def descendants(self) -> list["LayoutElement"]:
        """Return the descendants of the layout element"""
        descendants = []
        for child in self.children():
            descendants.append(child)
            descendants += child.descendants()
        return descendants

#### `` drawing_elements

    drawing_elements() -> list[DrawingElement]

Return the drawing elements of the group layout. The returned drawing elements are a group drawing element formed of the self drawing elements of the group layout and the drawing elements of its children

Source code in `src/momapy/core.py`

    538
    539
    540
    541
    542
    543
    544
    545
    546
    547
    548
    549
    550
    551
    552
    553
    554
    555
    556
    557
    558
    559
    560
    561
    562
    563
    564
    def drawing_elements(self) -> list[momapy.drawing.DrawingElement]:
        """Return the drawing elements of the group layout.
        The returned drawing elements are a group drawing element formed of the self drawing elements of the group layout and the drawing elements of its children
        """
        drawing_elements = self.self_drawing_elements()
        for child in self.children():
            if child is not None:
                drawing_elements += child.drawing_elements()
        group = momapy.drawing.Group(
            class_=f"{type(self).__name__}_group",
            elements=tuple(drawing_elements),
            id_=f"{self.id_}_group",
            fill=self.group_fill,
            fill_rule=self.group_fill_rule,
            filter=self.group_filter,
            font_family=self.group_font_family,
            font_size=self.group_font_size,
            font_style=self.group_font_style,
            font_weight=self.group_font_weight,
            stroke=self.group_stroke,
            stroke_dasharray=self.group_stroke_dasharray,
            stroke_dashoffset=self.group_stroke_dashoffset,
            stroke_width=self.group_stroke_width,
            text_anchor=self.group_text_anchor,
            transform=self.group_transform,
        )
        return [group]

#### `` east

    east() -> Point

Return the east anchor of the node

Source code in `src/momapy/core.py`

    708
    709
    710
    def east(self) -> momapy.geometry.Point:
        """Return the east anchor of the node"""
        return self.self_angle(0)

#### `` east_north_east

    east_north_east() -> Point

Return the east north east anchor of the node

Source code in `src/momapy/core.py`

    700
    701
    702
    703
    704
    705
    706
    def east_north_east(self) -> momapy.geometry.Point:
        """Return the east north east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, -self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` east_south_east

    east_south_east() -> Point

Return the east south east west anchor of the node

Source code in `src/momapy/core.py`

    712
    713
    714
    715
    716
    717
    718
    def east_south_east(self) -> momapy.geometry.Point:
        """Return the east south east west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` equals

    equals(
        other: LayoutElement,
        flattened: bool = False,
        unordered: bool = False,
    ) -> bool

Return `true` if the layout element is equal to another layout element, `false` otherwise

Source code in `src/momapy/core.py`

    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    def equals(
        self, other: "LayoutElement", flattened: bool = False, unordered: bool = False
    ) -> bool:
        """Return `true` if the layout element is equal to another layout element, `false` otherwise"""
        if type(self) is type(other):
            if not flattened:
                return self == other
            else:
                if not unordered:
                    return self.flattened() == other.flattened()
                else:
                    return set(self.flattened()) == set(other.flattened())
        return False

#### `` flattened

    flattened() -> list[LayoutElement]

Return a list containing copy of the layout element with no children and all its descendants with no children

Source code in `src/momapy/core.py`

     98
     99
    100
    101
    102
    103
    def flattened(self) -> list["LayoutElement"]:
        """Return a list containing copy of the layout element with no children and all its descendants with no children"""
        flattened = [self.childless()]
        for child in self.children():
            flattened += child.flattened()
        return flattened

#### `` label_center

    label_center() -> Point

Return the label center anchor of the node

Source code in `src/momapy/core.py`

    780
    781
    782
    def label_center(self) -> momapy.geometry.Point:
        """Return the label center anchor of the node"""
        return self.position

#### `` north

    north() -> Point

Return the north anchor of the node

Source code in `src/momapy/core.py`

    680
    681
    682
    def north(self) -> momapy.geometry.Point:
        """Return the north anchor of the node"""
        return self.self_angle(90)

#### `` north_east

    north_east() -> Point

Return the north east anchor of the node

Source code in `src/momapy/core.py`

    692
    693
    694
    695
    696
    697
    698
    def north_east(self) -> momapy.geometry.Point:
        """Return the north east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, -self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` north_north_east

    north_north_east() -> Point

Return the north north east anchor of the node

Source code in `src/momapy/core.py`

    684
    685
    686
    687
    688
    689
    690
    def north_north_east(self) -> momapy.geometry.Point:
        """Return the north north east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 4, -self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` north_north_west

    north_north_west() -> Point

Return the north north west anchor of the node

Source code in `src/momapy/core.py`

    672
    673
    674
    675
    676
    677
    678
    def north_north_west(self) -> momapy.geometry.Point:
        """Return the north north west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() - (self.width / 4, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` north_west

    north_west() -> Point

Return the north west anchor of the node

Source code in `src/momapy/core.py`

    664
    665
    666
    667
    668
    669
    670
    def north_west(self) -> momapy.geometry.Point:
        """Return the north west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() - (self.width / 2, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` self_angle

    self_angle(
        angle: float,
        unit: Literal["degrees", "radians"] = "degrees",
    ) -> Point

Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.

Source code in `src/momapy/core.py`

    804
    805
    806
    807
    808
    809
    810
    811
    812
    813
    814
    815
    def self_angle(
        self,
        angle: float,
        unit: typing.Literal["degrees", "radians"] = "degrees",
    ) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal."""
        return momapy.drawing.get_drawing_elements_angle(
            drawing_elements=self.self_drawing_elements(),
            angle=angle,
            unit=unit,
            center=self.center(),
        )

#### `` self_bbox

    self_bbox() -> Bbox

Compute and return the bounding box of the self drawing element of the group layout

Source code in `src/momapy/core.py`

    499
    500
    501
    502
    def self_bbox(self) -> momapy.geometry.Bbox:
        """Compute and return the bounding box of the self drawing element of the group layout"""
        bounds = self.self_to_shapely().bounds
        return momapy.geometry.Bbox.from_bounds(bounds)

#### `` self_border

    self_border(point: Point) -> Point

Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point. When there are multiple intersection points, the one closest to the given point is returned

Source code in `src/momapy/core.py`

    784
    785
    786
    787
    788
    789
    790
    791
    792
    def self_border(self, point: momapy.geometry.Point) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point.
        When there are multiple intersection points, the one closest to the given point is returned
        """
        return momapy.drawing.get_drawing_elements_border(
            drawing_elements=self.self_drawing_elements(),
            point=point,
            center=self.center(),
        )

#### `` self_children

    self_children() -> list[LayoutElement]

Return the self children of the node. A node has unique child that is its label

Source code in `src/momapy/core.py`

    654
    655
    656
    657
    658
    def self_children(self) -> list[LayoutElement]:
        """Return the self children of the node. A node has unique child that is its label"""
        if self.label is not None:
            return [self.label]
        return []

#### `` self_drawing_elements

    self_drawing_elements() -> list[DrawingElement]

Return the node's own drawing elements

Source code in `src/momapy/core.py`

    637
    638
    639
    640
    641
    642
    643
    644
    645
    646
    647
    648
    649
    650
    651
    652
    def self_drawing_elements(self) -> list[momapy.drawing.DrawingElement]:
        """Return the node's own drawing elements"""
        drawing_elements = self._border_drawing_elements()
        group = momapy.drawing.Group(
            class_=type(self).__name__,
            elements=tuple(drawing_elements),
            fill=self.fill,
            filter=self.filter,
            id_=self.id_,
            stroke=self.stroke,
            stroke_dasharray=self.stroke_dasharray,
            stroke_dashoffset=self.stroke_dashoffset,
            stroke_width=self.stroke_width,
            transform=self.transform,
        )
        return [group]

#### `` self_to_shapely

    self_to_shapely() -> GeometryCollection

Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout

Source code in `src/momapy/core.py`

    495
    496
    497
    def self_to_shapely(self) -> shapely.GeometryCollection:
        """Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout"""
        return momapy.drawing.drawing_elements_to_shapely(self.drawing_elements())

#### `` size

    size() -> tuple[float, float]

Return the size of the node

Source code in `src/momapy/core.py`

    660
    661
    662
    def size(self) -> tuple[float, float]:
        """Return the size of the node"""
        return (self.width, self.height)

#### `` south

    south() -> Point

Return the south anchor of the node

Source code in `src/momapy/core.py`

    736
    737
    738
    def south(self) -> momapy.geometry.Point:
        """Return the south anchor of the node"""
        return self.self_angle(270)

#### `` south_east

    south_east() -> Point

Return the south east anchor of the node

Source code in `src/momapy/core.py`

    720
    721
    722
    723
    724
    725
    726
    def south_east(self) -> momapy.geometry.Point:
        """Return the south east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` south_south_east

    south_south_east() -> Point

Return the south south east anchor of the node

Source code in `src/momapy/core.py`

    728
    729
    730
    731
    732
    733
    734
    def south_south_east(self) -> momapy.geometry.Point:
        """Return the south south east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 4, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` south_south_west

    south_south_west() -> Point

Return the south south west anchor of the node

Source code in `src/momapy/core.py`

    740
    741
    742
    743
    744
    745
    746
    def south_south_west(self) -> momapy.geometry.Point:
        """Return the south south west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (-self.width / 4, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` south_west

    south_west() -> Point

Return the south west anchor of the node

Source code in `src/momapy/core.py`

    748
    749
    750
    751
    752
    753
    754
    def south_west(self) -> momapy.geometry.Point:
        """Return the south west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (-self.width / 2, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` to_shapely

    to_shapely(to_polygons: bool = False) -> GeometryCollection

Return a shapely collection of geometries reproducing the drawing elements of the layout element

Source code in `src/momapy/core.py`

    123
    124
    125
    126
    127
    128
    def to_shapely(self, to_polygons: bool = False) -> shapely.GeometryCollection:
        """Return a shapely collection of geometries reproducing the drawing elements of the layout element"""
        geom_collection = []
        for drawing_element in self.drawing_elements():
            geom_collection += drawing_element.to_shapely(to_polygons=to_polygons).geoms
        return shapely.GeometryCollection(geom_collection)

#### `` west

    west() -> Point

Return the west anchor of the node

Source code in `src/momapy/core.py`

    764
    765
    766
    def west(self) -> momapy.geometry.Point:
        """Return the west anchor of the node"""
        return self.self_angle(180)

#### `` west_north_west

    west_north_west() -> Point

Return the west north west anchor of the node

Source code in `src/momapy/core.py`

    768
    769
    770
    771
    772
    773
    774
    def west_north_west(self) -> momapy.geometry.Point:
        """Return the west north west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() - (self.width / 2, self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` west_south_west

    west_south_west() -> Point

Return the west south west anchor of the node

Source code in `src/momapy/core.py`

    756
    757
    758
    759
    760
    761
    762
    def west_south_west(self) -> momapy.geometry.Point:
        """Return the west south west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (-self.width / 2, self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` x `property`

    x: float

Return the x coordinate of the node

#### `` y `property`

    y: float

Return the y coordinate of the node

### `` UnspecifiedEntitySubunit `dataclass`

    UnspecifiedEntitySubunit(
        *,
        id_: str = make_uuid4_as_str(),
        label: str | None = None,
    )

Bases: `Subunit`

Class for unspecified entity subunits

Parameters:

Name | Type | Description | Default
--- | --- | --- | ---
`id_` | `str` | The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element | `'697eaa05-874b-4f40-8811-9b4c620320bc'`
`label` | `str | None` | The label of the subunit | `None`

### `` UnspecifiedEntitySubunitLayout `dataclass`

    UnspecifiedEntitySubunitLayout(
        fill: NoneValueType | Color | None = white,
        stroke: NoneValueType | Color | None = black,
        stroke_width: float | None = 1.25,
        *,
        id_: str = make_uuid4_as_str(),
        layout_elements: tuple[LayoutElement] = tuple(),
        group_fill: NoneValueType | Color | None = None,
        group_fill_rule: FillRule | None = None,
        group_filter: NoneValueType | Filter | None = None,
        group_font_family: str | None = None,
        group_font_size: float | None = None,
        group_font_style: FontStyle | None = None,
        group_font_weight: FontWeight | float | None = None,
        group_stroke: NoneValueType | Color | None = None,
        group_stroke_dasharray: tuple[float, ...] | None = None,
        group_stroke_dashoffset: float | None = None,
        group_stroke_width: float | None = None,
        group_text_anchor: TextAnchor | None = None,
        group_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        filter: NoneValueType | Filter | None = None,
        height: float = 30.0,
        label: TextLayout | None = None,
        position: Point,
        stroke_dasharray: tuple[float, ...] | None = None,
        stroke_dashoffset: float | None = None,
        transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        width: float = 60.0,
    )

Bases: `_SimpleMixin`, `SBGNNode`

Class for unspecified entity subunit layouts

Parameters:

Name | Type | Description | Default
--- | --- | --- | ---
`id_` | `str` | The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element | `'7fc224b7-6cf6-4356-8a2d-00a7980e62a7'`
`layout_elements` | `tuple[LayoutElement]` | The sub-layout elements of the group layout. These are part of the children of the group layout | `<dynamic>`
`group_fill` | `NoneValueType | Color | None` | The fill color of the group layout | `None`
`group_fill_rule` | `FillRule | None` | The fill rule of the group layout | `None`
`group_filter` | `NoneValueType | Filter | None` | The filter of the group layout | `None`
`group_font_family` | `str | None` | The font family of the group layout | `None`
`group_font_size` | `float | None` | The font size of the group layout | `None`
`group_font_style` | `FontStyle | None` | The font style of the group layout | `None`
`group_font_weight` | `FontWeight | float | None` | The font weight of the group layout | `None`
`group_stroke` | `NoneValueType | Color | None` | The stroke color of the group layout | `None`
`group_stroke_dasharray` | `tuple[float, ...] | None` | The stroke dasharray of the group layout | `None`
`group_stroke_dashoffset` | `float | None` | The stroke dashoffset of the group layout | `None`
`group_stroke_width` | `float | None` | The stroke width of the group layout | `None`
`group_text_anchor` | `TextAnchor | None` | The text anchor of the group layout | `None`
`group_transform` | `NoneValueType | tuple[Transformation] | None` | The transform of the group layout | `None`
`fill` | `NoneValueType | Color | None` |  | `Color(red=255, green=255, blue=255, alpha=1.0)`
`filter` | `NoneValueType | Filter | None` | The filter of the node | `None`
`height` | `float` |  | `30.0`
`label` | `TextLayout | None` | The label of the node | `None`
`position` | `Point` | The position of the node | required
`stroke` | `NoneValueType | Color | None` |  | `Color(red=0, green=0, blue=0, alpha=1.0)`
`stroke_dasharray` | `tuple[float, ...] | None` | The stroke dasharray of the node | `None`
`stroke_dashoffset` | `float | None` | The stroke dashoffset of the node | `None`
`stroke_width` | `float | None` |  | `1.25`
`transform` | `NoneValueType | tuple[Transformation] | None` | The transform of the node | `None`
`width` | `float` |  | `60.0`

Methods:

Name | Description
--- | ---
`anchor_point` | Return an anchor point of the layout element
`angle` | Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.
`bbox` | Compute and return the bounding box of the group layout element
`border` | Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point.
`center` | Return the center anchor of the node
`childless` | Return a copy of the node with no children
`children` | Return the children of the group layout.
`contains` | Return `true` if another layout element is a descendant of the layout element, `false` otherwise
`descendants` | Return the descendants of the layout element
`drawing_elements` | Return the drawing elements of the group layout.
`east` | Return the east anchor of the node
`east_north_east` | Return the east north east anchor of the node
`east_south_east` | Return the east south east west anchor of the node
`equals` | Return `true` if the layout element is equal to another layout element, `false` otherwise
`flattened` | Return a list containing copy of the layout element with no children and all its descendants with no children
`label_center` | Return the label center anchor of the node
`north` | Return the north anchor of the node
`north_east` | Return the north east anchor of the node
`north_north_east` | Return the north north east anchor of the node
`north_north_west` | Return the north north west anchor of the node
`north_west` | Return the north west anchor of the node
`self_angle` | Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.
`self_bbox` | Compute and return the bounding box of the self drawing element of the group layout
`self_border` | Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point.
`self_children` | Return the self children of the node. A node has unique child that is its label
`self_drawing_elements` | Return the node's own drawing elements
`self_to_shapely` | Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout
`size` | Return the size of the node
`south` | Return the south anchor of the node
`south_east` | Return the south east anchor of the node
`south_south_east` | Return the south south east anchor of the node
`south_south_west` | Return the south south west anchor of the node
`south_west` | Return the south west anchor of the node
`to_shapely` | Return a shapely collection of geometries reproducing the drawing elements of the layout element
`west` | Return the west anchor of the node
`west_north_west` | Return the west north west anchor of the node
`west_south_west` | Return the west south west anchor of the node

Attributes:

Name | Type | Description
--- | --- | ---
`x` | `float` | Return the x coordinate of the node
`y` | `float` | Return the y coordinate of the node

#### `` anchor_point

    anchor_point(anchor_name: str) -> Point

Return an anchor point of the layout element

Source code in `src/momapy/core.py`

    130
    131
    132
    def anchor_point(self, anchor_name: str) -> momapy.geometry.Point:
        """Return an anchor point of the layout element"""
        return getattr(self, anchor_name)()

#### `` angle

    angle(
        angle: float,
        unit: Literal["degrees", "radians"] = "degrees",
    ) -> Point

Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.

Source code in `src/momapy/core.py`

    817
    818
    819
    820
    821
    822
    823
    824
    825
    826
    827
    828
    def angle(
        self,
        angle: float,
        unit: typing.Literal["degrees", "radians"] = "degrees",
    ) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal."""
        return momapy.drawing.get_drawing_elements_angle(
            drawing_elements=self.drawing_elements(),
            angle=angle,
            unit=unit,
            center=self.center(),
        )

#### `` bbox

    bbox() -> Bbox

Compute and return the bounding box of the group layout element

Source code in `src/momapy/core.py`

    504
    505
    506
    507
    508
    509
    510
    511
    512
    513
    514
    515
    516
    517
    518
    519
    520
    521
    522
    523
    524
    525
    526
    def bbox(self) -> momapy.geometry.Bbox:
        """Compute and return the bounding box of the group layout element"""
        self_bbox = self.self_bbox()
        bboxes = [child.bbox() for child in self.children()]
        min_x = self_bbox.north_west().x
        min_y = self_bbox.north_west().y
        max_x = self_bbox.south_east().x
        max_y = self_bbox.south_east().y
        for bbox in bboxes:
            if bbox.north_west().x < min_x:
                min_x = bbox.north_west().x
            if bbox.north_west().y < min_y:
                min_y = bbox.north_west().y
            if bbox.south_east().x > max_x:
                max_x = bbox.south_east().x
            if bbox.south_east().y > max_y:
                max_y = bbox.south_east().y
        bbox = momapy.geometry.Bbox(
            momapy.geometry.Point(min_x / 2 + max_x / 2, min_y / 2 + max_y / 2),
            max_x - min_x,
            max_y - min_y,
        )
        return bbox

#### `` border

    border(point: Point) -> Point

Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point. When there are multiple intersection points, the one closest to the given point is returned

Source code in `src/momapy/core.py`

    794
    795
    796
    797
    798
    799
    800
    801
    802
    def border(self, point: momapy.geometry.Point) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point.
        When there are multiple intersection points, the one closest to the given point is returned
        """
        return momapy.drawing.get_drawing_elements_border(
            drawing_elements=self.drawing_elements(),
            point=point,
            center=self.center(),
        )

#### `` center

    center() -> Point

Return the center anchor of the node

Source code in `src/momapy/core.py`

    776
    777
    778
    def center(self) -> momapy.geometry.Point:
        """Return the center anchor of the node"""
        return self.position

#### `` childless

    childless() -> Self

Return a copy of the node with no children

Source code in `src/momapy/core.py`

    830
    831
    832
    def childless(self) -> typing.Self:
        """Return a copy of the node with no children"""
        return dataclasses.replace(self, label=None, layout_elements=tuple([]))

#### `` children

    children() -> list[LayoutElement]

Return the children of the group layout. These are the self children of the group layout (returned by the `self_children` method) and the other children of the group layout (given by the `layout_elements` attribute)

Source code in `src/momapy/core.py`

    566
    567
    568
    569
    570
    def children(self) -> list[LayoutElement]:
        """Return the children of the group layout.
        These are the self children of the group layout (returned by the `self_children` method) and the other children of the group layout (given by the `layout_elements` attribute)
        """
        return self.self_children() + list(self.layout_elements)

#### `` contains

    contains(other: LayoutElement) -> bool

Return `true` if another layout element is a descendant of the layout element, `false` otherwise

Source code in `src/momapy/core.py`

    119
    120
    121
    def contains(self, other: "LayoutElement") -> bool:
        """Return `true` if another layout element is a descendant of the layout element, `false` otherwise"""
        return other in self.descendants()

#### `` descendants

    descendants() -> list[LayoutElement]

Return the descendants of the layout element

Source code in `src/momapy/core.py`

    90
    91
    92
    93
    94
    95
    96
    def descendants(self) -> list["LayoutElement"]:
        """Return the descendants of the layout element"""
        descendants = []
        for child in self.children():
            descendants.append(child)
            descendants += child.descendants()
        return descendants

#### `` drawing_elements

    drawing_elements() -> list[DrawingElement]

Return the drawing elements of the group layout. The returned drawing elements are a group drawing element formed of the self drawing elements of the group layout and the drawing elements of its children

Source code in `src/momapy/core.py`

    538
    539
    540
    541
    542
    543
    544
    545
    546
    547
    548
    549
    550
    551
    552
    553
    554
    555
    556
    557
    558
    559
    560
    561
    562
    563
    564
    def drawing_elements(self) -> list[momapy.drawing.DrawingElement]:
        """Return the drawing elements of the group layout.
        The returned drawing elements are a group drawing element formed of the self drawing elements of the group layout and the drawing elements of its children
        """
        drawing_elements = self.self_drawing_elements()
        for child in self.children():
            if child is not None:
                drawing_elements += child.drawing_elements()
        group = momapy.drawing.Group(
            class_=f"{type(self).__name__}_group",
            elements=tuple(drawing_elements),
            id_=f"{self.id_}_group",
            fill=self.group_fill,
            fill_rule=self.group_fill_rule,
            filter=self.group_filter,
            font_family=self.group_font_family,
            font_size=self.group_font_size,
            font_style=self.group_font_style,
            font_weight=self.group_font_weight,
            stroke=self.group_stroke,
            stroke_dasharray=self.group_stroke_dasharray,
            stroke_dashoffset=self.group_stroke_dashoffset,
            stroke_width=self.group_stroke_width,
            text_anchor=self.group_text_anchor,
            transform=self.group_transform,
        )
        return [group]

#### `` east

    east() -> Point

Return the east anchor of the node

Source code in `src/momapy/core.py`

    708
    709
    710
    def east(self) -> momapy.geometry.Point:
        """Return the east anchor of the node"""
        return self.self_angle(0)

#### `` east_north_east

    east_north_east() -> Point

Return the east north east anchor of the node

Source code in `src/momapy/core.py`

    700
    701
    702
    703
    704
    705
    706
    def east_north_east(self) -> momapy.geometry.Point:
        """Return the east north east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, -self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` east_south_east

    east_south_east() -> Point

Return the east south east west anchor of the node

Source code in `src/momapy/core.py`

    712
    713
    714
    715
    716
    717
    718
    def east_south_east(self) -> momapy.geometry.Point:
        """Return the east south east west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` equals

    equals(
        other: LayoutElement,
        flattened: bool = False,
        unordered: bool = False,
    ) -> bool

Return `true` if the layout element is equal to another layout element, `false` otherwise

Source code in `src/momapy/core.py`

    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    def equals(
        self, other: "LayoutElement", flattened: bool = False, unordered: bool = False
    ) -> bool:
        """Return `true` if the layout element is equal to another layout element, `false` otherwise"""
        if type(self) is type(other):
            if not flattened:
                return self == other
            else:
                if not unordered:
                    return self.flattened() == other.flattened()
                else:
                    return set(self.flattened()) == set(other.flattened())
        return False

#### `` flattened

    flattened() -> list[LayoutElement]

Return a list containing copy of the layout element with no children and all its descendants with no children

Source code in `src/momapy/core.py`

     98
     99
    100
    101
    102
    103
    def flattened(self) -> list["LayoutElement"]:
        """Return a list containing copy of the layout element with no children and all its descendants with no children"""
        flattened = [self.childless()]
        for child in self.children():
            flattened += child.flattened()
        return flattened

#### `` label_center

    label_center() -> Point

Return the label center anchor of the node

Source code in `src/momapy/core.py`

    780
    781
    782
    def label_center(self) -> momapy.geometry.Point:
        """Return the label center anchor of the node"""
        return self.position

#### `` north

    north() -> Point

Return the north anchor of the node

Source code in `src/momapy/core.py`

    680
    681
    682
    def north(self) -> momapy.geometry.Point:
        """Return the north anchor of the node"""
        return self.self_angle(90)

#### `` north_east

    north_east() -> Point

Return the north east anchor of the node

Source code in `src/momapy/core.py`

    692
    693
    694
    695
    696
    697
    698
    def north_east(self) -> momapy.geometry.Point:
        """Return the north east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, -self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` north_north_east

    north_north_east() -> Point

Return the north north east anchor of the node

Source code in `src/momapy/core.py`

    684
    685
    686
    687
    688
    689
    690
    def north_north_east(self) -> momapy.geometry.Point:
        """Return the north north east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 4, -self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` north_north_west

    north_north_west() -> Point

Return the north north west anchor of the node

Source code in `src/momapy/core.py`

    672
    673
    674
    675
    676
    677
    678
    def north_north_west(self) -> momapy.geometry.Point:
        """Return the north north west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() - (self.width / 4, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` north_west

    north_west() -> Point

Return the north west anchor of the node

Source code in `src/momapy/core.py`

    664
    665
    666
    667
    668
    669
    670
    def north_west(self) -> momapy.geometry.Point:
        """Return the north west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() - (self.width / 2, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` self_angle

    self_angle(
        angle: float,
        unit: Literal["degrees", "radians"] = "degrees",
    ) -> Point

Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.

Source code in `src/momapy/core.py`

    804
    805
    806
    807
    808
    809
    810
    811
    812
    813
    814
    815
    def self_angle(
        self,
        angle: float,
        unit: typing.Literal["degrees", "radians"] = "degrees",
    ) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal."""
        return momapy.drawing.get_drawing_elements_angle(
            drawing_elements=self.self_drawing_elements(),
            angle=angle,
            unit=unit,
            center=self.center(),
        )

#### `` self_bbox

    self_bbox() -> Bbox

Compute and return the bounding box of the self drawing element of the group layout

Source code in `src/momapy/core.py`

    499
    500
    501
    502
    def self_bbox(self) -> momapy.geometry.Bbox:
        """Compute and return the bounding box of the self drawing element of the group layout"""
        bounds = self.self_to_shapely().bounds
        return momapy.geometry.Bbox.from_bounds(bounds)

#### `` self_border

    self_border(point: Point) -> Point

Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point. When there are multiple intersection points, the one closest to the given point is returned

Source code in `src/momapy/core.py`

    784
    785
    786
    787
    788
    789
    790
    791
    792
    def self_border(self, point: momapy.geometry.Point) -> momapy.geometry.Point:
        """Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point.
        When there are multiple intersection points, the one closest to the given point is returned
        """
        return momapy.drawing.get_drawing_elements_border(
            drawing_elements=self.self_drawing_elements(),
            point=point,
            center=self.center(),
        )

#### `` self_children

    self_children() -> list[LayoutElement]

Return the self children of the node. A node has unique child that is its label

Source code in `src/momapy/core.py`

    654
    655
    656
    657
    658
    def self_children(self) -> list[LayoutElement]:
        """Return the self children of the node. A node has unique child that is its label"""
        if self.label is not None:
            return [self.label]
        return []

#### `` self_drawing_elements

    self_drawing_elements() -> list[DrawingElement]

Return the node's own drawing elements

Source code in `src/momapy/core.py`

    637
    638
    639
    640
    641
    642
    643
    644
    645
    646
    647
    648
    649
    650
    651
    652
    def self_drawing_elements(self) -> list[momapy.drawing.DrawingElement]:
        """Return the node's own drawing elements"""
        drawing_elements = self._border_drawing_elements()
        group = momapy.drawing.Group(
            class_=type(self).__name__,
            elements=tuple(drawing_elements),
            fill=self.fill,
            filter=self.filter,
            id_=self.id_,
            stroke=self.stroke,
            stroke_dasharray=self.stroke_dasharray,
            stroke_dashoffset=self.stroke_dashoffset,
            stroke_width=self.stroke_width,
            transform=self.transform,
        )
        return [group]

#### `` self_to_shapely

    self_to_shapely() -> GeometryCollection

Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout

Source code in `src/momapy/core.py`

    495
    496
    497
    def self_to_shapely(self) -> shapely.GeometryCollection:
        """Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout"""
        return momapy.drawing.drawing_elements_to_shapely(self.drawing_elements())

#### `` size

    size() -> tuple[float, float]

Return the size of the node

Source code in `src/momapy/core.py`

    660
    661
    662
    def size(self) -> tuple[float, float]:
        """Return the size of the node"""
        return (self.width, self.height)

#### `` south

    south() -> Point

Return the south anchor of the node

Source code in `src/momapy/core.py`

    736
    737
    738
    def south(self) -> momapy.geometry.Point:
        """Return the south anchor of the node"""
        return self.self_angle(270)

#### `` south_east

    south_east() -> Point

Return the south east anchor of the node

Source code in `src/momapy/core.py`

    720
    721
    722
    723
    724
    725
    726
    def south_east(self) -> momapy.geometry.Point:
        """Return the south east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 2, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` south_south_east

    south_south_east() -> Point

Return the south south east anchor of the node

Source code in `src/momapy/core.py`

    728
    729
    730
    731
    732
    733
    734
    def south_south_east(self) -> momapy.geometry.Point:
        """Return the south south east anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (self.width / 4, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` south_south_west

    south_south_west() -> Point

Return the south south west anchor of the node

Source code in `src/momapy/core.py`

    740
    741
    742
    743
    744
    745
    746
    def south_south_west(self) -> momapy.geometry.Point:
        """Return the south south west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (-self.width / 4, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` south_west

    south_west() -> Point

Return the south west anchor of the node

Source code in `src/momapy/core.py`

    748
    749
    750
    751
    752
    753
    754
    def south_west(self) -> momapy.geometry.Point:
        """Return the south west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (-self.width / 2, self.height / 2)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` to_shapely

    to_shapely(to_polygons: bool = False) -> GeometryCollection

Return a shapely collection of geometries reproducing the drawing elements of the layout element

Source code in `src/momapy/core.py`

    123
    124
    125
    126
    127
    128
    def to_shapely(self, to_polygons: bool = False) -> shapely.GeometryCollection:
        """Return a shapely collection of geometries reproducing the drawing elements of the layout element"""
        geom_collection = []
        for drawing_element in self.drawing_elements():
            geom_collection += drawing_element.to_shapely(to_polygons=to_polygons).geoms
        return shapely.GeometryCollection(geom_collection)

#### `` west

    west() -> Point

Return the west anchor of the node

Source code in `src/momapy/core.py`

    764
    765
    766
    def west(self) -> momapy.geometry.Point:
        """Return the west anchor of the node"""
        return self.self_angle(180)

#### `` west_north_west

    west_north_west() -> Point

Return the west north west anchor of the node

Source code in `src/momapy/core.py`

    768
    769
    770
    771
    772
    773
    774
    def west_north_west(self) -> momapy.geometry.Point:
        """Return the west north west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() - (self.width / 2, self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` west_south_west

    west_south_west() -> Point

Return the west south west anchor of the node

Source code in `src/momapy/core.py`

    756
    757
    758
    759
    760
    761
    762
    def west_south_west(self) -> momapy.geometry.Point:
        """Return the west south west anchor of the node"""
        line = momapy.geometry.Line(
            self.center(), self.center() + (-self.width / 2, self.height / 4)
        )
        angle = -momapy.geometry.get_angle_to_horizontal_of_line(line)
        return self.self_angle(angle, unit="radians")

#### `` x `property`

    x: float

Return the x coordinate of the node

#### `` y `property`

    y: float

Return the y coordinate of the node