Core - momapy

Skip to content

# Core

## `` momapy.celldesigner.core

Classes for CellDesigner maps

Classes:

Name | Description
--- | ---
`AndGate` | Class for and gates
`AndGateLayout` | Class for and gate layouts
`AntisenseRNA` | Class for antisense RNAs
`AntisenseRNALayout` | Class for antisense RNA layouts
`AntisenseRNATemplate` | Class for antisense RNA templates
`BooleanLogicGate` | Base class for Boolean logic gates
`Catalysis` | Class for catalyses
`CatalysisLayout` | Class for catalysis layouts
`Catalyzer` | Class for catalyzers
`CellDesignerDoubleHeadedArc` | Base class for CellDesigner double-headed arcs
`CellDesignerLayout` | Class for CellDesigner layouts
`CellDesignerMap` | Class for CellDesigner maps
`CellDesignerModel` | Class for CellDesigner models
`CellDesignerModelElement` | Base class for CellDesigner model elements
`CellDesignerNode` | Base class for CellDesigner nodes
`CellDesignerSingleHeadedArc` | Base class for CellDesigner single-headed arcs
`CodingRegion` | Class for coding regions
`Compartment` | Class for compartments
`Complex` | Class for complexes
`ComplexLayout` | Class for complex layouts
`ConsumptionLayout` | Class for consumption layouts
`Degraded` | Class for degradeds
`DegradedLayout` | Class for degraded layouts
`Dissociation` | Class for dissociations
`DissociationLayout` | Class for dissociation layouts
`Drug` | Class for drugs
`DrugLayout` | Class for drug layouts
`Gene` | Class for genes
`GeneLayout` | Class for gene layouts
`GeneTemplate` | Class for gene templates
`GenericProtein` | Class for generic proteins
`GenericProteinLayout` | Class for generic protein layouts
`GenericProteinTemplate` | Class for generic protein templates
`HeterodimerAssociation` | Class for heterodimer associations
`HeterodimerAssociationLayout` | Class for heterodimer association layouts
`Inhibition` | Class for inhibitions
`InhibitionLayout` | Class for inhibition layouts
`Inhibitor` | Class for inhibitors
`Ion` | Class for ions
`IonChannel` | Class for ion channels
`IonChannelLayout` | Class for generic ion channel layouts
`IonChannelTemplate` | Class for ion channel templates
`IonLayout` | Class for ion layouts
`KnownOrUnknownModulation` | KnownOrUnknownModulation(*, id_: str = , source: momapy.celldesigner.core.Species | momapy.celldesigner.core.BooleanLogicGate, target: momapy.celldesigner.core.Species | None)
`KnownOrUnknownModulator` | Base class for know or unknown modulators
`KnownTransitionOmitted` | Class for known transitions omitted
`KnownTransitionOmittedLayout` | Class for known transition omitted layouts
`LogicArcLayout` | Class for logic arc layouts
`Modification` | Class for modifications
`ModificationLayout` | Class for modification layouts
`ModificationResidue` | Class for modification residues
`ModificationSite` | Class for modification sites
`ModificationState` | Class for modification states
`Modulation` | Class for modulations
`ModulationLayout` | Class for modulation layouts
`Modulator` | Class for modulators
`NegativeInfluence` | Class for negative influences
`NotGate` | Class for not gates
`NotGateLayout` | Class for not gate layouts
`OrGate` | Class for or gates
`OrGateLayout` | Class for or gate layouts
`OvalCompartmentLayout` | Class for oval compartment layouts
`Phenotype` | Class for phenotypes
`PhenotypeLayout` | Class for phenotype layouts
`PhysicalStimulation` | Class for physical stimulations
`PhysicalStimulationLayout` | Class for physical stimulation layouts
`PhysicalStimulator` | Class for physical stimulators
`PositiveInfluence` | Class for positive influences
`PositiveInfluenceLayout` | Class for positive influence layouts
`Product` | Class for products
`ProductionLayout` | Class for production layouts
`Protein` | Base class for proteins
`ProteinBindingDomain` | Class for protein binding domains
`ProteinTemplate` | Base class for protein templates
`RNA` | Class for RNAs
`RNALayout` | Class for RNA layouts
`RNATemplate` | Class for RNA templates
`Reactant` | Class for reactants
`Reaction` | Base class for reactions
`Receptor` | Class for receptors
`ReceptorLayout` | Class for receptor layouts
`ReceptorTemplate` | Class for receptor templates
`RectangleCompartmentLayout` | Class for rectangle compartment layouts
`Region` | Class for regions
`RegulatoryRegion` | Class for regulatory regions
`SimpleMolecule` | Class for simple molecules
`SimpleMoleculeLayout` | Class for simple chemical layouts
`Species` | Base class for species
`SpeciesTemplate` | Base class for species templates
`StateTransition` | Class for state transitions
`StateTransitionLayout` | Class for state transition layouts
`StructuralState` | Class for structural states
`StructuralStateLayout` | Class for structural states layouts
`Transcription` | Class for transcriptions
`TranscriptionLayout` | Class for transcription layouts
`TranscriptionStartingSiteL` | Class for left transcription starting sites
`TranscriptionStartingSiteR` | Class for right transcription starting sites
`Translation` | Class for translation
`TranslationLayout` | Class for translation layouts
`Transport` | Class for transports
`TransportLayout` | Class for transport layouts
`Trigger` | Class for triggers
`Triggering` | Class for triggerings
`TriggeringLayout` | Class for triggering layouts
`TruncatedProtein` | Class for truncated proteins
`TruncatedProteinLayout` | Class for truncated protein layouts
`TruncatedProteinTemplate` | Class for truncated protein templates
`Truncation` | Class for truncations
`TruncationLayout` | Class for truncation layouts
`Unknown` | Class for unknown species
`UnknownCatalysis` | Class for unknown catalyses
`UnknownCatalysisLayout` | Class for unknown catalysis layouts
`UnknownCatalyzer` | Class for unknown catalyzers
`UnknownGate` | Class for unknown gates
`UnknownGateLayout` | Class for unknown gate layouts
`UnknownInhibition` | Class for unknown inhibitions
`UnknownInhibitionLayout` | Class for unknown inhibition layouts
`UnknownInhibitor` | Class for unknown inhibitors
`UnknownLayout` | Class for unknown species layouts
`UnknownModulation` | Class for unknown modulations
`UnknownModulationLayout` | Class for unknown modulation layouts
`UnknownModulator` | Class for unknown modulators
`UnknownNegativeInfluence` | Class for unknown negative influences
`UnknownPhysicalStimulation` | Class for unknown physical stimulations
`UnknownPhysicalStimulationLayout` | Class for unknown physical stimulation layouts
`UnknownPositiveInfluence` | Class for unknown positive influences
`UnknownPositiveInfluenceLayout` | Class for unknown positive influence layouts
`UnknownTransition` | Class for unknown transitions
`UnknownTransitionLayout` | Class for unknown transition layouts
`UnknownTriggering` | Class for unknown triggerings
`UnknownTriggeringLayout` | Class for unknown triggering layouts

### `` AndGate `dataclass`

    AndGate(
        *,
        id_: str = make_uuid4_as_str(),
        inputs: frozenset[Species] = frozenset(),
    )

Bases: `BooleanLogicGate`

Class for and gates

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 | `'f6fd107c-afa3-48a4-b163-8212a98121ea'`
`inputs` | `frozenset[Species]` | The inputs of the Boolean logic gate | `<class 'frozenset'>`

### `` AndGateLayout `dataclass`

    AndGateLayout(
        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 = 15.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 = 15.0,
        active: bool = False,
        active_fill: NoneValueType | Color | None = NoneValue,
        active_filter: NoneValueType | Filter | None = None,
        active_sep: float = 4.0,
        active_stroke: NoneValueType | Color | None = black,
        active_stroke_dasharray: NoneValueType
        | tuple[float]
        | None = (4, 2),
        active_stroke_dashoffset: float | None = None,
        active_stroke_width: float | None = 1.0,
        active_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
    )

Bases: `_SimpleNodeMixin`, `_TextMixin`, `CellDesignerNode`

Class for and gate 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 | `'b140f9b4-1ad1-4085-a2a9-bd427ab1e79b'`
`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` |  | `15.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` |  | `15.0`
`active` | `bool` |  | `False`
`active_fill` | `NoneValueType | Color | None` |  | `<momapy.drawing.NoneValueType object at 0x7fb32ae9f1d0>`
`active_filter` | `NoneValueType | Filter | None` |  | `None`
`active_sep` | `float` |  | `4.0`
`active_stroke` | `NoneValueType | Color | None` |  | `Color(red=0, green=0, blue=0, alpha=1.0)`
`active_stroke_dasharray` | `NoneValueType | tuple[float] | None` |  | `(4, 2)`
`active_stroke_dashoffset` | `float | None` |  | `None`
`active_stroke_width` | `float | None` |  | `1.0`
`active_transform` | `NoneValueType | tuple[Transformation] | 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
`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

### `` AntisenseRNA `dataclass`

    AntisenseRNA(
        *,
        id_: str = make_uuid4_as_str(),
        name: str | None = None,
        sbo_term: SBOTerm | None = None,
        metaid: str | None = None,
        compartment: Compartment | None = None,
        hypothetical: bool = False,
        active: bool = False,
        homomultimer: int = 1,
        template: AntisenseRNATemplate,
        modifications: frozenset[Modification] = frozenset(),
    )

Bases: `Species`

Class for antisense RNAs

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 | `'c083ef91-63b7-4b25-bcf7-40c810d154a4'`
`name` | `str | None` |  | `None`
`sbo_term` | `SBOTerm | None` |  | `None`
`metaid` | `str | None` |  | `None`
`compartment` | `Compartment | None` |  | `None`
`hypothetical` | `bool` | Whether the species is hypothetical or not | `False`
`active` | `bool` | Whether the species is active or not | `False`
`homomultimer` | `int` | The number of subunits forming the species | `1`
`template` | `AntisenseRNATemplate` |  | required
`modifications` | `frozenset[Modification]` | frozenset() -> empty frozenset object frozenset(iterable) -> frozenset object Build an immutable unordered collection of unique elements. | `<class 'frozenset'>`

### `` AntisenseRNALayout `dataclass`

    AntisenseRNALayout(
        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,
        active: bool = False,
        active_fill: NoneValueType | Color | None = NoneValue,
        active_filter: NoneValueType | Filter | None = None,
        active_sep: float = 4.0,
        active_stroke: NoneValueType | Color | None = black,
        active_stroke_dasharray: NoneValueType
        | tuple[float]
        | None = (4, 2),
        active_stroke_dashoffset: float | None = None,
        active_stroke_width: float | None = 1.0,
        active_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        n: int = 1,
        angle: float = 45.0,
    )

Bases: `_MultiNodeMixin`, `CellDesignerNode`

Class for antisense RNA 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 | `'0a68891f-3858-4a2c-a658-065bbc6a81fa'`
`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`
`active` | `bool` |  | `False`
`active_fill` | `NoneValueType | Color | None` |  | `<momapy.drawing.NoneValueType object at 0x7fb32ae9f1d0>`
`active_filter` | `NoneValueType | Filter | None` |  | `None`
`active_sep` | `float` |  | `4.0`
`active_stroke` | `NoneValueType | Color | None` |  | `Color(red=0, green=0, blue=0, alpha=1.0)`
`active_stroke_dasharray` | `NoneValueType | tuple[float] | None` |  | `(4, 2)`
`active_stroke_dashoffset` | `float | None` |  | `None`
`active_stroke_width` | `float | None` |  | `1.0`
`active_transform` | `NoneValueType | tuple[Transformation] | None` |  | `None`
`n` | `int` |  | `1`
`angle` | `float` |  | `45.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
`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 = 45.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/celldesigner/core.py`

    1591
    1592
    1593
    1594
    1595
    1596
    1597
    1598
    1599
    def east(self) -> momapy.geometry.Point:
        width = self.width - self.offset * (self._n - 1)
        height = self.height - self.offset * (self._n - 1)
        position = self.position + (
            self.width / 2 - width / 2,
            self.height / 2 - height / 2,
        )
        shape = self._make_subunit_shape(position, width, height)
        return shape.joint3() / 2 + shape.joint2() / 2

#### `` east_north_east

    east_north_east() -> Point

Return the east north east anchor of the node

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

    1581
    1582
    1583
    1584
    1585
    1586
    1587
    1588
    1589
    def east_north_east(self) -> momapy.geometry.Point:
        width = self.width - self.offset * (self._n - 1)
        height = self.height - self.offset * (self._n - 1)
        position = self.position + (
            self.width / 2 - width / 2,
            self.height / 2 - height / 2,
        )
        shape = self._make_subunit_shape(position, width, height)
        return shape.joint3() * 0.25 + shape.joint2() * 0.75

#### `` east_south_east

    east_south_east() -> Point

Return the east south east west anchor of the node

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

    1601
    1602
    1603
    1604
    1605
    1606
    1607
    1608
    1609
    def east_south_east(self) -> momapy.geometry.Point:
        width = self.width - self.offset * (self._n - 1)
        height = self.height - self.offset * (self._n - 1)
        position = self.position + (
            self.width / 2 - width / 2,
            self.height / 2 - height / 2,
        )
        shape = self._make_subunit_shape(position, width, height)
        return shape.joint3() * 0.75 + shape.joint2() * 0.25

#### `` 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/celldesigner/core.py`

    1551
    1552
    1553
    1554
    1555
    1556
    1557
    1558
    1559
    def north(self) -> momapy.geometry.Point:
        width = self.width - self.offset * (self._n - 1)
        height = self.height - self.offset * (self._n - 1)
        position = self.position + (
            self.width / 2 - width / 2,
            self.height / 2 - height / 2,
        )
        shape = self._make_subunit_shape(position, width, height)
        return shape.joint1() / 2 + shape.joint2() / 2

#### `` north_east

    north_east() -> Point

Return the north east anchor of the node

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

    1571
    1572
    1573
    1574
    1575
    1576
    1577
    1578
    1579
    def north_east(self) -> momapy.geometry.Point:
        width = self.width - self.offset * (self._n - 1)
        height = self.height - self.offset * (self._n - 1)
        position = self.position + (
            self.width / 2 - width / 2,
            self.height / 2 - height / 2,
        )
        shape = self._make_subunit_shape(position, width, height)
        return shape.joint2()

#### `` north_north_east

    north_north_east() -> Point

Return the north north east anchor of the node

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

    1561
    1562
    1563
    1564
    1565
    1566
    1567
    1568
    1569
    def north_north_east(self) -> momapy.geometry.Point:
        width = self.width - self.offset * (self._n - 1)
        height = self.height - self.offset * (self._n - 1)
        position = self.position + (
            self.width / 2 - width / 2,
            self.height / 2 - height / 2,
        )
        shape = self._make_subunit_shape(position, width, height)
        return shape.joint1() * 0.25 + shape.joint2() * 0.75

#### `` north_north_west

    north_north_west() -> Point

Return the north north west anchor of the node

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

    1541
    1542
    1543
    1544
    1545
    1546
    1547
    1548
    1549
    def north_north_west(self) -> momapy.geometry.Point:
        width = self.width - self.offset * (self._n - 1)
        height = self.height - self.offset * (self._n - 1)
        position = self.position + (
            self.width / 2 - width / 2,
            self.height / 2 - height / 2,
        )
        shape = self._make_subunit_shape(position, width, height)
        return shape.joint1() * 0.75 + shape.joint2() * 0.25

#### `` north_west

    north_west() -> Point

Return the north west anchor of the node

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

    1531
    1532
    1533
    1534
    1535
    1536
    1537
    1538
    1539
    def north_west(self) -> momapy.geometry.Point:
        width = self.width - self.offset * (self._n - 1)
        height = self.height - self.offset * (self._n - 1)
        position = self.position + (
            self.width / 2 - width / 2,
            self.height / 2 - height / 2,
        )
        shape = self._make_subunit_shape(position, width, height)
        return shape.joint1()

#### `` 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/celldesigner/core.py`

    1631
    1632
    1633
    1634
    1635
    1636
    1637
    1638
    1639
    def south(self) -> momapy.geometry.Point:
        width = self.width - self.offset * (self._n - 1)
        height = self.height - self.offset * (self._n - 1)
        position = self.position + (
            self.width / 2 - width / 2,
            self.height / 2 - height / 2,
        )
        shape = self._make_subunit_shape(position, width, height)
        return shape.joint4() / 2 + shape.joint3() / 2

#### `` south_east

    south_east() -> Point

Return the south east anchor of the node

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

    1611
    1612
    1613
    1614
    1615
    1616
    1617
    1618
    1619
    def south_east(self) -> momapy.geometry.Point:
        width = self.width - self.offset * (self._n - 1)
        height = self.height - self.offset * (self._n - 1)
        position = self.position + (
            self.width / 2 - width / 2,
            self.height / 2 - height / 2,
        )
        shape = self._make_subunit_shape(position, width, height)
        return shape.joint3()

#### `` south_south_east

    south_south_east() -> Point

Return the south south east anchor of the node

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

    1621
    1622
    1623
    1624
    1625
    1626
    1627
    1628
    1629
    def south_south_east(self) -> momapy.geometry.Point:
        width = self.width - self.offset * (self._n - 1)
        height = self.height - self.offset * (self._n - 1)
        position = self.position + (
            self.width / 2 - width / 2,
            self.height / 2 - height / 2,
        )
        shape = self._make_subunit_shape(position, width, height)
        return shape.joint4() * 0.25 + shape.joint3() * 0.75

#### `` south_south_west

    south_south_west() -> Point

Return the south south west anchor of the node

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

    1641
    1642
    1643
    1644
    1645
    1646
    1647
    1648
    1649
    def south_south_west(self) -> momapy.geometry.Point:
        width = self.width - self.offset * (self._n - 1)
        height = self.height - self.offset * (self._n - 1)
        position = self.position + (
            self.width / 2 - width / 2,
            self.height / 2 - height / 2,
        )
        shape = self._make_subunit_shape(position, width, height)
        return shape.joint4() * 0.75 + shape.joint3() * 0.25

#### `` south_west

    south_west() -> Point

Return the south west anchor of the node

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

    1651
    1652
    1653
    1654
    1655
    1656
    1657
    1658
    1659
    def south_west(self) -> momapy.geometry.Point:
        width = self.width - self.offset * (self._n - 1)
        height = self.height - self.offset * (self._n - 1)
        position = self.position + (
            self.width / 2 - width / 2,
            self.height / 2 - height / 2,
        )
        shape = self._make_subunit_shape(position, width, height)
        return shape.joint4()

#### `` 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/celldesigner/core.py`

    1671
    1672
    1673
    1674
    1675
    1676
    1677
    1678
    1679
    def west(self) -> momapy.geometry.Point:
        width = self.width - self.offset * (self._n - 1)
        height = self.height - self.offset * (self._n - 1)
        position = self.position + (
            self.width / 2 - width / 2,
            self.height / 2 - height / 2,
        )
        shape = self._make_subunit_shape(position, width, height)
        return shape.joint4() / 2 + shape.joint1() / 2

#### `` west_north_west

    west_north_west() -> Point

Return the west north west anchor of the node

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

    1681
    1682
    1683
    1684
    1685
    1686
    1687
    1688
    1689
    def west_north_west(self) -> momapy.geometry.Point:
        width = self.width - self.offset * (self._n - 1)
        height = self.height - self.offset * (self._n - 1)
        position = self.position + (
            self.width / 2 - width / 2,
            self.height / 2 - height / 2,
        )
        shape = self._make_subunit_shape(position, width, height)
        return shape.joint4() * 0.25 + shape.joint1() * 0.75

#### `` west_south_west

    west_south_west() -> Point

Return the west south west anchor of the node

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

    1661
    1662
    1663
    1664
    1665
    1666
    1667
    1668
    1669
    def west_south_west(self) -> momapy.geometry.Point:
        width = self.width - self.offset * (self._n - 1)
        height = self.height - self.offset * (self._n - 1)
        position = self.position + (
            self.width / 2 - width / 2,
            self.height / 2 - height / 2,
        )
        shape = self._make_subunit_shape(position, width, height)
        return shape.joint4() * 0.75 + shape.joint1() * 0.25

#### `` x `property`

    x: float

Return the x coordinate of the node

#### `` y `property`

    y: float

Return the y coordinate of the node

### `` AntisenseRNATemplate `dataclass`

    AntisenseRNATemplate(
        *,
        id_: str = make_uuid4_as_str(),
        name: str,
        regions: frozenset[
            ModificationSite
            | CodingRegion
            | ProteinBindingDomain
        ] = frozenset(),
    )

Bases: `SpeciesTemplate`

Class for antisense RNA templates

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 | `'e551684d-3450-49cb-97f4-a25797791b44'`
`name` | `str` | The name of the species template | required
`regions` | `frozenset[Union[ModificationSite, CodingRegion, ProteinBindingDomain]]` | The regions of the antisense RNA template | `<class 'frozenset'>`

### `` BooleanLogicGate `dataclass`

    BooleanLogicGate(
        *,
        id_: str = make_uuid4_as_str(),
        inputs: frozenset[Species] = frozenset(),
    )

Bases: `CellDesignerModelElement`

Base class for Boolean logic gates

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 | `'1063b45c-c553-4804-aaa5-aa284e6c0bcd'`
`inputs` | `frozenset[Species]` | The inputs of the Boolean logic gate | `<class 'frozenset'>`

### `` Catalysis `dataclass`

    Catalysis(
        *,
        id_: str = make_uuid4_as_str(),
        source: Species | BooleanLogicGate,
        target: Species | None,
    )

Bases: `Modulation`

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 | `'894973fc-93a8-4c3a-ad6a-6c96adbc9069'`
`source` | `Species | BooleanLogicGate` | The source of the influence | required
`target` | `Species | None` | The target of the influence | required

### `` CatalysisLayout `dataclass`

    CatalysisLayout(
        *,
        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_fill: NoneValueType | Color | None = NoneValue,
        path_filter: NoneValueType | Filter | None = None,
        path_stroke: NoneValueType | Color | None = black,
        path_stroke_dasharray: tuple[float, ...] | None = None,
        path_stroke_dashoffset: float | None = None,
        path_stroke_width: float | None = 1.0,
        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: NoneValueType | Color | None = black,
        arrowhead_stroke_dasharray: tuple[float, ...]
        | None = None,
        arrowhead_stroke_dashoffset: float | None = None,
        arrowhead_stroke_width: float | None = 1.0,
        arrowhead_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        arrowhead_height: float = 7.0,
        arrowhead_width: float = 7.0,
    )

Bases: `CellDesignerSingleHeadedArc`

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 | `'d214b2a2-d06b-4b81-bcb3-4d68632510f5'`
`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.0`
`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.0`
`arrowhead_transform` | `NoneValueType | tuple[Transformation] | None` | The arrowhead transform of the arc | `None`
`arrowhead_height` | `float` |  | `7.0`
`arrowhead_width` | `float` |  | `7.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()

Return the self drawing elements of the single-headed arc

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

    754
    755
    756
    757
    758
    759
    760
    761
    762
    763
    764
    765
    766
    767
    def self_drawing_elements(self):
        drawing_elements = momapy.builder.super_or_builder(
            CellDesignerSingleHeadedArc, self
        ).self_drawing_elements()
        done_bases = []
        for base in type(self).__mro__:
            if (
                momapy.builder.issubclass_or_builder(base, momapy.sbgn.core._SBGNMixin)
                and base is not type(self)
                and not any([issubclass(done_base, base) for done_base in done_bases])
            ):
                drawing_elements += getattr(base, "_mixin_drawing_elements")(self)
                done_bases.append(base)
        return drawing_elements

#### `` 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)

### `` Catalyzer `dataclass`

    Catalyzer(
        *,
        id_: str = make_uuid4_as_str(),
        name: str | None = None,
        sbo_term: SBOTerm | None = None,
        metaid: str | None = None,
        referred_species: Species | BooleanLogicGate,
    )

Bases: `PhysicalStimulator`

Class for catalyzers

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 | `'a075a73d-136a-4ed2-8b78-bac4ca5fdd9a'`
`name` | `str | None` |  | `None`
`sbo_term` | `SBOTerm | None` |  | `None`
`metaid` | `str | None` |  | `None`
`referred_species` | `Species | BooleanLogicGate` | The species the modifier refers to | required

### `` CellDesignerDoubleHeadedArc `dataclass`

    CellDesignerDoubleHeadedArc(
        *,
        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_fill: NoneValueType | Color | None = NoneValue,
        path_filter: NoneValueType | Filter | None = None,
        path_stroke: NoneValueType | Color | None = black,
        path_stroke_dasharray: tuple[float, ...] | None = None,
        path_stroke_dashoffset: float | None = None,
        path_stroke_width: float | None = 1.0,
        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,
        end_arrowhead_fill: NoneValueType | Color | None = None,
        end_arrowhead_filter: NoneValueType
        | Filter
        | None = None,
        end_arrowhead_stroke: NoneValueType
        | Color
        | None = None,
        end_arrowhead_stroke_dasharray: tuple[float, ...]
        | None = None,
        end_arrowhead_stroke_dashoffset: float | None = None,
        end_arrowhead_stroke_width: float | None = None,
        end_arrowhead_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        start_arrowhead_fill: NoneValueType
        | Color
        | None = None,
        start_arrowhead_filter: NoneValueType
        | Filter
        | None = None,
        start_arrowhead_stroke: NoneValueType
        | Color
        | None = None,
        start_arrowhead_stroke_dasharray: tuple[float, ...]
        | None = None,
        start_arrowhead_stroke_dashoffset: float | None = None,
        start_arrowhead_stroke_width: float | None = None,
        start_arrowhead_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
    )

Bases: `DoubleHeadedArc`

Base class for CellDesigner double-headed arcs

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 | `'d8fc6e5b-9f7a-48fc-8e90-187e896aec03'`
`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.0`
`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`
`end_arrowhead_fill` | `NoneValueType | Color | None` | The end arrowhead fill color of the arc | `None`
`end_arrowhead_filter` | `NoneValueType | Filter | None` | The end arrowhead filter of the arc | `None`
`end_arrowhead_stroke` | `NoneValueType | Color | None` | The end arrowhead stroke color of the arc | `None`
`end_arrowhead_stroke_dasharray` | `tuple[float, ...] | None` | The end arrowhead stroke dasharray of the arc | `None`
`end_arrowhead_stroke_dashoffset` | `float | None` | The end arrowhead stroke dashoffset of the arc | `None`
`end_arrowhead_stroke_width` | `float | None` | The end arrowhead stroke width of the arc | `None`
`end_arrowhead_transform` | `NoneValueType | tuple[Transformation] | None` | The end arrowhead transform of the arc | `None`
`start_arrowhead_fill` | `NoneValueType | Color | None` | The start arrowhead fill color of the arc | `None`
`start_arrowhead_filter` | `NoneValueType | Filter | None` | The start arrowhead filter of the arc | `None`
`start_arrowhead_stroke` | `NoneValueType | Color | None` | The start arrowhead stroke color of the arc | `None`
`start_arrowhead_stroke_dasharray` | `tuple[float, ...] | None` | The start arrowhead stroke dasharray of the arc | `None`
`start_arrowhead_stroke_dashoffset` | `float | None` | The start arrowhead stroke dashoffset of the arc | `None`
`start_arrowhead_stroke_width` | `float | None` | The start arrowhead stroke width of the arc | `None`
`start_arrowhead_transform` | `NoneValueType | tuple[Transformation] | None` | The start arrowhead transform of the arc | `None`

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
`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_arrowhead_base` | Return the base anchor point of the double-headed arc end arrowhead
`end_arrowhead_bbox` | Return the bounding box of the double-headed arc start arrowhead
`end_arrowhead_border` | Return the point at the intersection of the drawing elements of the double-headed arc end arrowhead and the line going through the center of these drawing elements and the given point.
`end_arrowhead_length` | Return the length of the double-headed arc end arrowhead
`end_arrowhead_tip` | Return the tip anchor point of the double-headed arc end arrowhead
`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 double-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 double-headed arc. These include the drawing elements of the arc path, the start arrowhead, and the end arrowhead
`self_to_shapely` | Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout
`start_arrowhead_base` | Return the base anchor point of the double-headed arc start arrowhead
`start_arrowhead_bbox` | Return the bounding box of the double-headed arc start arrowhead
`start_arrowhead_border` | Return the point at the intersection of the drawing elements of the double-headed arc start arrowhead and the line going through the center of these drawing elements and the given point.
`start_arrowhead_drawing_elements` | Return the drawing elements of the double-headed arc start arrowhead
`start_arrowhead_length` | Return the length of the double-headed arc start arrowhead
`start_arrowhead_tip` | Return the tip anchor point of the double-headed arc start arrowhead
`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)()

#### `` 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_arrowhead_base

    end_arrowhead_base() -> Point

Return the base anchor point of the double-headed arc end arrowhead

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

    1333
    1334
    1335
    1336
    1337
    1338
    1339
    1340
    1341
    1342
    1343
    def end_arrowhead_base(self) -> momapy.geometry.Point:
        """Return the base anchor point of the double-headed arc end arrowhead"""
        arrowhead_length = self.end_arrowhead_length()
        if arrowhead_length == 0:
            return self.end_point()
        segment = self.segments[-1]
        segment_length = segment.length()
        if segment_length == 0:
            return self.end_arrowhead_tip() - (arrowhead_length, 0)
        fraction = 1 - (arrowhead_length + self.end_shorten) / segment_length
        return segment.get_position_at_fraction(fraction)

#### `` end_arrowhead_bbox

    end_arrowhead_bbox()

Return the bounding box of the double-headed arc start arrowhead

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

    1345
    1346
    1347
    1348
    1349
    def end_arrowhead_bbox(self):
        """Return the bounding box of the double-headed arc start arrowhead"""
        return momapy.drawing.get_drawing_elements_bbox(
            self.end_arrowhead_drawing_elements()
        )

#### `` end_arrowhead_border

    end_arrowhead_border(point)

Return the point at the intersection of the drawing elements of the double-headed arc end 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`

    1351
    1352
    1353
    1354
    1355
    1356
    1357
    1358
    1359
    1360
    1361
    def end_arrowhead_border(self, point):
        """Return the point at the intersection of the drawing elements of the double-headed arc end 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.end_arrowhead_drawing_elements(), point
        )
        if point.isnan():
            return self.end_arrowhead_tip()
        return point

#### `` end_arrowhead_length

    end_arrowhead_length() -> float

Return the length of the double-headed arc end arrowhead

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

    1315
    1316
    1317
    1318
    1319
    1320
    1321
    1322
    def end_arrowhead_length(self) -> float:
        """Return the length of the double-headed arc end arrowhead"""
        bbox = momapy.drawing.get_drawing_elements_bbox(
            self._end_arrowhead_border_drawing_elements()
        )
        if math.isnan(bbox.width):
            return 0.0
        return bbox.east().x

#### `` end_arrowhead_tip

    end_arrowhead_tip() -> Point

Return the tip anchor point of the double-headed arc end arrowhead

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

    1324
    1325
    1326
    1327
    1328
    1329
    1330
    1331
    def end_arrowhead_tip(self) -> momapy.geometry.Point:
        """Return the tip anchor point of the double-headed arc end arrowhead"""
        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)

#### `` 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 double-headed arc path

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

    1451
    1452
    1453
    1454
    1455
    1456
    1457
    1458
    1459
    1460
    1461
    1462
    1463
    1464
    1465
    1466
    1467
    1468
    1469
    1470
    1471
    1472
    1473
    1474
    1475
    1476
    1477
    1478
    1479
    1480
    1481
    1482
    1483
    1484
    1485
    1486
    1487
    1488
    1489
    1490
    1491
    1492
    def path_drawing_elements(self) -> list[momapy.drawing.Path]:
        """Return the drawing elements of the double-headed arc path"""
        start_arrowhead_length = self.start_arrowhead_length()
        end_arrowhead_length = self.end_arrowhead_length()
        if len(self.segments) == 1:
            segment = (
                self.segments[0]
                .shortened(self.start_shorten + start_arrowhead_length, "start")
                .shortened(self.end_shorten + end_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_arrowhead_length, "start"
            )
            last_segment = self.segments[-1].shortened(
                self.end_shorten + end_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()

Return the self drawing elements of the double-headed arc. These include the drawing elements of the arc path, the start arrowhead, and the end arrowhead

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

    782
    783
    784
    785
    786
    787
    788
    789
    790
    791
    792
    793
    794
    795
    def self_drawing_elements(self):
        drawing_elements = momapy.builder.super_or_builder(
            CellDesignerDoubleHeadedArc, self
        ).self_drawing_elements()
        done_bases = []
        for base in type(self).__mro__:
            if (
                momapy.builder.issubclass_or_builder(base, momapy.sbgn.core._SBGNMixin)
                and base is not type(self)
                and not any([issubclass(done_base, base) for done_base in done_bases])
            ):
                drawing_elements += getattr(base, "_mixin_drawing_elements")(self)
                done_bases.append(base)
        return drawing_elements

#### `` 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_arrowhead_base

    start_arrowhead_base() -> Point

Return the base anchor point of the double-headed arc start arrowhead

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

    1285
    1286
    1287
    1288
    1289
    1290
    1291
    1292
    1293
    1294
    1295
    1296
    def start_arrowhead_base(self) -> momapy.geometry.Point:
        """Return the base anchor point of the double-headed arc start arrowhead"""
        arrowhead_length = self.start_arrowhead_length()
        if arrowhead_length == 0:
            return self.start_point()
        segment = self.segments[0]
        segment = momapy.geometry.Segment(segment.p2, segment.p1)
        segment_length = segment.length()
        if segment_length == 0:
            return self.start_arrowhead_tip() + (arrowhead_length, 0)
        fraction = 1 - (arrowhead_length + self.start_shorten) / segment_length
        return segment.get_position_at_fraction(fraction)

#### `` start_arrowhead_bbox

    start_arrowhead_bbox() -> Bbox

Return the bounding box of the double-headed arc start arrowhead

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

    1298
    1299
    1300
    1301
    1302
    def start_arrowhead_bbox(self) -> momapy.geometry.Bbox:
        """Return the bounding box of the double-headed arc start arrowhead"""
        return momapy.drawing.get_drawing_elements_bbox(
            self.start_arrowhead_drawing_elements()
        )

#### `` start_arrowhead_border

    start_arrowhead_border(point) -> Point

Return the point at the intersection of the drawing elements of the double-headed arc start 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`

    1304
    1305
    1306
    1307
    1308
    1309
    1310
    1311
    1312
    1313
    def start_arrowhead_border(self, point) -> momapy.geometry.Point:
        """Return the point at the intersection of the drawing elements of the double-headed arc start 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.start_arrowhead_drawing_elements(), point
        )
        if point.isnan():
            return self.start_arrowhead_tip()
        return point

#### `` start_arrowhead_drawing_elements

    start_arrowhead_drawing_elements() -> list[DrawingElement]

Return the drawing elements of the double-headed arc start arrowhead

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

    1394
    1395
    1396
    1397
    1398
    1399
    1400
    1401
    1402
    1403
    1404
    1405
    1406
    1407
    1408
    1409
    1410
    1411
    1412
    1413
    def start_arrowhead_drawing_elements(
        self,
    ) -> list[momapy.drawing.DrawingElement]:
        """Return the drawing elements of the double-headed arc start arrowhead"""
        drawing_elements = self._start_arrowhead_border_drawing_elements()
        group = momapy.drawing.Group(
            class_=f"{type(self).__name__}_start_arrowhead",
            elements=tuple(drawing_elements),
            id_=f"{self.id_}_start_arrowhead",
            fill=self.start_arrowhead_fill,
            filter=self.start_arrowhead_filter,
            stroke=self.start_arrowhead_stroke,
            stroke_dasharray=self.start_arrowhead_stroke_dasharray,
            stroke_dashoffset=self.start_arrowhead_stroke_dashoffset,
            stroke_width=self.start_arrowhead_stroke_width,
            transform=self.start_arrowhead_transform,
        )
        transformation = self._get_start_arrowhead_transformation()
        group = group.transformed(transformation)
        return [group]

#### `` start_arrowhead_length

    start_arrowhead_length() -> float

Return the length of the double-headed arc start arrowhead

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

    1266
    1267
    1268
    1269
    1270
    1271
    1272
    1273
    def start_arrowhead_length(self) -> float:
        """Return the length of the double-headed arc start arrowhead"""
        bbox = momapy.drawing.get_drawing_elements_bbox(
            self._start_arrowhead_border_drawing_elements()
        )
        if math.isnan(bbox.width):
            return 0.0
        return abs(bbox.west().x)

#### `` start_arrowhead_tip

    start_arrowhead_tip() -> Point

Return the tip anchor point of the double-headed arc start arrowhead

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

    1275
    1276
    1277
    1278
    1279
    1280
    1281
    1282
    1283
    def start_arrowhead_tip(self) -> momapy.geometry.Point:
        """Return the tip anchor point of the double-headed arc start arrowhead"""
        segment = self.segments[0]
        segment = momapy.geometry.Segment(segment.p2, segment.p1)
        segment_length = segment.length()
        if segment_length == 0:
            return segment.p2
        fraction = 1 - self.start_shorten / segment_length
        return segment.get_position_at_fraction(fraction)

#### `` 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)

### `` CellDesignerLayout `dataclass`

    CellDesignerLayout(
        *,
        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 = NoneValue,
        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: `Layout`

Class for CellDesigner 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 | `'582308d8-048c-46f5-9d0b-6ee784141ca3'`
`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` |  | `<momapy.drawing.NoneValueType object at 0x7fb32ae9f1d0>`
`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

### `` CellDesignerMap `dataclass`

    CellDesignerMap(
        *,
        id_: str = make_uuid4_as_str(),
        model: CellDesignerModel | None = None,
        layout: CellDesignerLayout | None = None,
        layout_model_mapping: LayoutModelMapping | None = None,
    )

Bases: `Map`

Class for CellDesigner 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 | `'8f6a59f5-ebb7-41ec-ae60-b8934975f3af'`
`model` | `CellDesignerModel | None` |  | `None`
`layout` | `CellDesignerLayout | None` |  | `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)
        )

### `` CellDesignerModel `dataclass`

    CellDesignerModel(
        *,
        id_: str = make_uuid4_as_str(),
        name: str | None = None,
        sbo_term: SBOTerm | None = None,
        metaid: str | None = None,
        compartments: frozenset[Compartment] = frozenset(),
        species: frozenset[Species] = frozenset(),
        reactions: frozenset[Reaction] = frozenset(),
        species_templates: frozenset[
            SpeciesTemplate
        ] = frozenset(),
        boolean_logic_gates: frozenset[
            BooleanLogicGate
        ] = frozenset(),
        modulations: frozenset[
            Modulation | UnknownModulation
        ] = frozenset(),
    )

Bases: `Model`

Class for CellDesigner 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 | `'293ec8ad-922a-4614-bcbf-b52dc376c403'`
`name` | `str | None` |  | `None`
`sbo_term` | `SBOTerm | None` |  | `None`
`metaid` | `str | None` |  | `None`
`compartments` | `frozenset[Compartment]` | frozenset() -> empty frozenset object frozenset(iterable) -> frozenset object Build an immutable unordered collection of unique elements. | `<class 'frozenset'>`
`species` | `frozenset[Species]` | frozenset() -> empty frozenset object frozenset(iterable) -> frozenset object Build an immutable unordered collection of unique elements. | `<class 'frozenset'>`
`reactions` | `frozenset[Reaction]` | frozenset() -> empty frozenset object frozenset(iterable) -> frozenset object Build an immutable unordered collection of unique elements. | `<class 'frozenset'>`
`species_templates` | `frozenset[SpeciesTemplate]` | The species templates of the CellDesigner model | `<class 'frozenset'>`
`boolean_logic_gates` | `frozenset[BooleanLogicGate]` | The boolean logic gates of the CellDesigner model | `<class 'frozenset'>`
`modulations` | `frozenset[Union[Modulation, UnknownModulation]]` | The modulations of the CellDesigner model | `<class 'frozenset'>`

### `` CellDesignerModelElement `dataclass`

    CellDesignerModelElement(*, id_: str = make_uuid4_as_str())

Bases: `ModelElement`

Base class for CellDesigner model elements

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 | `'3c2816b0-bad4-4c1c-a22c-006609fe95dc'`

### `` CellDesignerNode `dataclass`

    CellDesignerNode(
        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,
        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,
    )

Bases: `SBGNNode`

Base class for CellDesigner nodes

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 | `'68dcb7e6-a286-4b30-b584-9f055f042eb4'`
`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` |  | `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 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
`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

### `` CellDesignerSingleHeadedArc `dataclass`

    CellDesignerSingleHeadedArc(
        *,
        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_fill: NoneValueType | Color | None = NoneValue,
        path_filter: NoneValueType | Filter | None = None,
        path_stroke: NoneValueType | Color | None = black,
        path_stroke_dasharray: tuple[float, ...] | None = None,
        path_stroke_dashoffset: float | None = None,
        path_stroke_width: float | None = 1.0,
        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 = None,
        arrowhead_filter: NoneValueType | Filter | None = None,
        arrowhead_stroke: NoneValueType | Color | None = black,
        arrowhead_stroke_dasharray: tuple[float, ...]
        | None = None,
        arrowhead_stroke_dashoffset: float | None = None,
        arrowhead_stroke_width: float | None = 1.0,
        arrowhead_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
    )

Bases: `SingleHeadedArc`

Base class for CellDesigner single-headed arcs

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 | `'b23b2c3c-9333-4c38-a585-b9c28df71f53'`
`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.0`
`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` | The arrowhead fill color of the arc | `None`
`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.0`
`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()

Return the self drawing elements of the single-headed arc

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

    754
    755
    756
    757
    758
    759
    760
    761
    762
    763
    764
    765
    766
    767
    def self_drawing_elements(self):
        drawing_elements = momapy.builder.super_or_builder(
            CellDesignerSingleHeadedArc, self
        ).self_drawing_elements()
        done_bases = []
        for base in type(self).__mro__:
            if (
                momapy.builder.issubclass_or_builder(base, momapy.sbgn.core._SBGNMixin)
                and base is not type(self)
                and not any([issubclass(done_base, base) for done_base in done_bases])
            ):
                drawing_elements += getattr(base, "_mixin_drawing_elements")(self)
                done_bases.append(base)
        return drawing_elements

#### `` 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)

### `` CodingRegion `dataclass`

    CodingRegion(
        *,
        id_: str = make_uuid4_as_str(),
        name: str | None = None,
        active: bool = False,
    )

Bases: `Region`

Class for coding regions

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 | `'65a470aa-8430-4d24-8bd9-b8bdd7d40831'`
`name` | `str | None` | The name of the region | `None`
`active` | `bool` | Whether the region is active or not | `False`

### `` Compartment `dataclass`

    Compartment(
        *,
        id_: str = make_uuid4_as_str(),
        name: str | None = None,
        sbo_term: SBOTerm | None = None,
        metaid: str | None = None,
        outside: Optional[
            ForwardRef(Compartment, module=core)
        ] = None,
    )

Bases: `Compartment`, `CellDesignerModelElement`

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 | `'280f0a65-cdf3-49e4-a73a-83d1dcbbbd44'`
`name` | `str | None` |  | `None`
`sbo_term` | `SBOTerm | None` |  | `None`
`metaid` | `str | None` |  | `None`
`outside` | `ForwardRef(Compartment, module=core) | None` |  | `None`

### `` Complex `dataclass`

    Complex(
        *,
        id_: str = make_uuid4_as_str(),
        name: str | None = None,
        sbo_term: SBOTerm | None = None,
        metaid: str | None = None,
        compartment: Compartment | None = None,
        hypothetical: bool = False,
        active: bool = False,
        homomultimer: int = 1,
        structural_states: frozenset[
            StructuralState
        ] = frozenset(),
        subunits: frozenset[Species] = frozenset(),
    )

Bases: `Species`

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 | `'c89874c1-72fe-40f8-9019-ce15f4ff2059'`
`name` | `str | None` |  | `None`
`sbo_term` | `SBOTerm | None` |  | `None`
`metaid` | `str | None` |  | `None`
`compartment` | `Compartment | None` |  | `None`
`hypothetical` | `bool` | Whether the species is hypothetical or not | `False`
`active` | `bool` | Whether the species is active or not | `False`
`homomultimer` | `int` | The number of subunits forming the species | `1`
`structural_states` | `frozenset[StructuralState]` | The structural states of the complex | `<class 'frozenset'>`
`subunits` | `frozenset[Species]` | 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,
        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,
        active: bool = False,
        active_fill: NoneValueType | Color | None = NoneValue,
        active_filter: NoneValueType | Filter | None = None,
        active_sep: float = 4.0,
        active_stroke: NoneValueType | Color | None = black,
        active_stroke_dasharray: NoneValueType
        | tuple[float]
        | None = (4, 2),
        active_stroke_dashoffset: float | None = None,
        active_stroke_width: float | None = 1.0,
        active_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        n: int = 1,
        cut_corners: float = 6.0,
    )

Bases: `_MultiNodeMixin`, `CellDesignerNode`

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 | `'374848fe-6aac-4173-85d2-5182a95223cb'`
`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`
`active` | `bool` |  | `False`
`active_fill` | `NoneValueType | Color | None` |  | `<momapy.drawing.NoneValueType object at 0x7fb32ae9f1d0>`
`active_filter` | `NoneValueType | Filter | None` |  | `None`
`active_sep` | `float` |  | `4.0`
`active_stroke` | `NoneValueType | Color | None` |  | `Color(red=0, green=0, blue=0, alpha=1.0)`
`active_stroke_dasharray` | `NoneValueType | tuple[float] | None` |  | `(4, 2)`
`active_stroke_dashoffset` | `float | None` |  | `None`
`active_stroke_width` | `float | None` |  | `1.0`
`active_transform` | `NoneValueType | tuple[Transformation] | None` |  | `None`
`n` | `int` |  | `1`
`cut_corners` | `float` |  | `6.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

### `` ConsumptionLayout `dataclass`

    ConsumptionLayout(
        *,
        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_fill: NoneValueType | Color | None = NoneValue,
        path_filter: NoneValueType | Filter | None = None,
        path_stroke: NoneValueType | Color | None = black,
        path_stroke_dasharray: tuple[float, ...] | None = None,
        path_stroke_dashoffset: float | None = None,
        path_stroke_width: float | None = 1.0,
        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 = None,
        arrowhead_filter: NoneValueType | Filter | None = None,
        arrowhead_stroke: NoneValueType | Color | None = black,
        arrowhead_stroke_dasharray: tuple[float, ...]
        | None = None,
        arrowhead_stroke_dashoffset: float | None = None,
        arrowhead_stroke_width: float | None = 1.0,
        arrowhead_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
    )

Bases: `CellDesignerSingleHeadedArc`

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 | `'c3e2ef9f-42a4-4def-a7f3-3fc7fa330578'`
`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.0`
`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` | The arrowhead fill color of the arc | `None`
`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.0`
`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()

Return the self drawing elements of the single-headed arc

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

    754
    755
    756
    757
    758
    759
    760
    761
    762
    763
    764
    765
    766
    767
    def self_drawing_elements(self):
        drawing_elements = momapy.builder.super_or_builder(
            CellDesignerSingleHeadedArc, self
        ).self_drawing_elements()
        done_bases = []
        for base in type(self).__mro__:
            if (
                momapy.builder.issubclass_or_builder(base, momapy.sbgn.core._SBGNMixin)
                and base is not type(self)
                and not any([issubclass(done_base, base) for done_base in done_bases])
            ):
                drawing_elements += getattr(base, "_mixin_drawing_elements")(self)
                done_bases.append(base)
        return drawing_elements

#### `` 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)

### `` Degraded `dataclass`

    Degraded(
        *,
        id_: str = make_uuid4_as_str(),
        name: str | None = None,
        sbo_term: SBOTerm | None = None,
        metaid: str | None = None,
        compartment: Compartment | None = None,
        hypothetical: bool = False,
        active: bool = False,
        homomultimer: int = 1,
    )

Bases: `Species`

Class for degradeds

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 | `'8d30015f-980d-4010-81c9-8d806953f945'`
`name` | `str | None` |  | `None`
`sbo_term` | `SBOTerm | None` |  | `None`
`metaid` | `str | None` |  | `None`
`compartment` | `Compartment | None` |  | `None`
`hypothetical` | `bool` | Whether the species is hypothetical or not | `False`
`active` | `bool` | Whether the species is active or not | `False`
`homomultimer` | `int` | The number of subunits forming the species | `1`

### `` DegradedLayout `dataclass`

    DegradedLayout(
        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,
        active: bool = False,
        active_fill: NoneValueType | Color | None = NoneValue,
        active_filter: NoneValueType | Filter | None = None,
        active_sep: float = 4.0,
        active_stroke: NoneValueType | Color | None = black,
        active_stroke_dasharray: NoneValueType
        | tuple[float]
        | None = (4, 2),
        active_stroke_dashoffset: float | None = None,
        active_stroke_width: float | None = 1.0,
        active_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        n: int = 1,
    )

Bases: `_MultiNodeMixin`, `CellDesignerNode`

Class for degraded 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 | `'e86a8df7-457d-4179-bf3e-2696c5574ef2'`
`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`
`active` | `bool` |  | `False`
`active_fill` | `NoneValueType | Color | None` |  | `<momapy.drawing.NoneValueType object at 0x7fb32ae9f1d0>`
`active_filter` | `NoneValueType | Filter | None` |  | `None`
`active_sep` | `float` |  | `4.0`
`active_stroke` | `NoneValueType | Color | None` |  | `Color(red=0, green=0, blue=0, alpha=1.0)`
`active_stroke_dasharray` | `NoneValueType | tuple[float] | None` |  | `(4, 2)`
`active_stroke_dashoffset` | `float | None` |  | `None`
`active_stroke_width` | `float | None` |  | `1.0`
`active_transform` | `NoneValueType | tuple[Transformation] | None` |  | `None`
`n` | `int` |  | `1`

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

### `` Dissociation `dataclass`

    Dissociation(
        *,
        id_: str = make_uuid4_as_str(),
        name: str | None = None,
        sbo_term: SBOTerm | None = None,
        metaid: str | None = None,
        reversible: bool,
        compartment: Compartment | None = None,
        reactants: frozenset[Reactant] = frozenset(),
        products: frozenset[Product] = frozenset(),
        modifiers: frozenset[
            KnownOrUnknownModulator
        ] = frozenset(),
    )

Bases: `Reaction`

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 | `'d96fcd20-4117-423a-a25f-7cbae7c342ad'`
`name` | `str | None` |  | `None`
`sbo_term` | `SBOTerm | None` |  | `None`
`metaid` | `str | None` |  | `None`
`reversible` | `bool` |  | required
`compartment` | `Compartment | None` |  | `None`
`reactants` | `frozenset[Reactant]` | The reactants of the reaction | `<class 'frozenset'>`
`products` | `frozenset[Product]` | The products of the reaction | `<class 'frozenset'>`
`modifiers` | `frozenset[KnownOrUnknownModulator]` | The modifiers of the reaction | `<class 'frozenset'>`

### `` DissociationLayout `dataclass`

    DissociationLayout(
        *,
        _left_connector_fraction: float = 0.4,
        _right_connector_fraction: float = 0.6,
        reaction_node_height: float = 10.0,
        reaction_node_width: float = 10.0,
        reaction_node_segment: int = 1,
        reaction_node_stroke: NoneValueType
        | Color
        | None = black,
        reaction_node_stroke_width: float | None = 1.0,
        reaction_node_stroke_dasharray: NoneValueType
        | tuple[float]
        | None = None,
        reaction_node_stroke_dashoffset: float | None = None,
        reaction_node_fill: NoneValueType
        | Color
        | None = white,
        reaction_node_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        reaction_node_filter: 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,
        end_shorten: float = 2.0,
        fill: NoneValueType | Color | None = None,
        filter: NoneValueType | Filter | None = None,
        path_fill: NoneValueType | Color | None = NoneValue,
        path_filter: NoneValueType | Filter | None = None,
        path_stroke: NoneValueType | Color | None = black,
        path_stroke_dasharray: tuple[float, ...] | None = None,
        path_stroke_dashoffset: float | None = None,
        path_stroke_width: float | None = 1.0,
        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 = 2.0,
        target: LayoutElement | None = None,
        transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        end_arrowhead_fill: NoneValueType
        | Color
        | None = white,
        end_arrowhead_filter: NoneValueType
        | Filter
        | None = None,
        end_arrowhead_stroke: NoneValueType
        | Color
        | None = black,
        end_arrowhead_stroke_dasharray: NoneValueType
        | tuple[float]
        | None = None,
        end_arrowhead_stroke_dashoffset: float | None = None,
        end_arrowhead_stroke_width: float | None = 1.0,
        end_arrowhead_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        start_arrowhead_fill: NoneValueType
        | Color
        | None = black,
        start_arrowhead_filter: NoneValueType
        | Filter
        | None = None,
        start_arrowhead_stroke: NoneValueType
        | Color
        | None = black,
        start_arrowhead_stroke_dasharray: NoneValueType
        | tuple[float]
        | None = None,
        start_arrowhead_stroke_dashoffset: float | None = None,
        start_arrowhead_stroke_width: float | None = 1.0,
        start_arrowhead_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        reversible: bool = False,
        end_arrowhead_height: float = 10.0,
        end_arrowhead_sep: float = 2.0,
        end_arrowhead_width: float = 10.0,
        start_arrowhead_height: float = 8.0,
        start_arrowhead_width: float = 15.0,
    )

Bases: `_ReactionLayout`, `_ReactionNodeMixin`

Class for dissociation layouts

Parameters:

Name | Type | Description | Default
--- | --- | --- | ---
`reaction_node_height` | `float` |  | `10.0`
`reaction_node_width` | `float` |  | `10.0`
`reaction_node_segment` | `int` |  | `1`
`reaction_node_stroke` | `NoneValueType | Color | None` |  | `Color(red=0, green=0, blue=0, alpha=1.0)`
`reaction_node_stroke_width` | `float | None` |  | `1.0`
`reaction_node_stroke_dasharray` | `NoneValueType | tuple[float] | None` |  | `None`
`reaction_node_stroke_dashoffset` | `float | None` |  | `None`
`reaction_node_fill` | `NoneValueType | Color | None` |  | `Color(red=255, green=255, blue=255, alpha=1.0)`
`reaction_node_transform` | `NoneValueType | tuple[Transformation] | None` |  | `None`
`reaction_node_filter` | `NoneValueType | Filter | None` |  | `None`
`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 | `'69773e19-4ad4-416c-9475-e50d27e4fbc5'`
`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` |  | `2.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.0`
`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` |  | `2.0`
`target` | `LayoutElement | None` | The target of the arc | `None`
`transform` | `NoneValueType | tuple[Transformation] | None` | The transform of the arc | `None`
`end_arrowhead_fill` | `NoneValueType | Color | None` |  | `Color(red=255, green=255, blue=255, alpha=1.0)`
`end_arrowhead_filter` | `NoneValueType | Filter | None` |  | `None`
`end_arrowhead_stroke` | `NoneValueType | Color | None` |  | `Color(red=0, green=0, blue=0, alpha=1.0)`
`end_arrowhead_stroke_dasharray` | `NoneValueType | tuple[float] | None` |  | `None`
`end_arrowhead_stroke_dashoffset` | `float | None` |  | `None`
`end_arrowhead_stroke_width` | `float | None` |  | `1.0`
`end_arrowhead_transform` | `NoneValueType | tuple[Transformation] | None` |  | `None`
`start_arrowhead_fill` | `NoneValueType | Color | None` |  | `Color(red=0, green=0, blue=0, alpha=1.0)`
`start_arrowhead_filter` | `NoneValueType | Filter | None` |  | `None`
`start_arrowhead_stroke` | `NoneValueType | Color | None` |  | `Color(red=0, green=0, blue=0, alpha=1.0)`
`start_arrowhead_stroke_dasharray` | `NoneValueType | tuple[float] | None` |  | `None`
`start_arrowhead_stroke_dashoffset` | `float | None` |  | `None`
`start_arrowhead_stroke_width` | `float | None` |  | `1.0`
`start_arrowhead_transform` | `NoneValueType | tuple[Transformation] | None` |  | `None`
`reversible` | `bool` |  | `False`
`end_arrowhead_height` | `float` |  | `10.0`
`end_arrowhead_sep` | `float` |  | `2.0`
`end_arrowhead_width` | `float` |  | `10.0`
`start_arrowhead_height` | `float` |  | `8.0`
`start_arrowhead_width` | `float` |  | `15.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
`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_arrowhead_base` | Return the base anchor point of the double-headed arc end arrowhead
`end_arrowhead_bbox` | Return the bounding box of the double-headed arc start arrowhead
`end_arrowhead_border` | Return the point at the intersection of the drawing elements of the double-headed arc end arrowhead and the line going through the center of these drawing elements and the given point.
`end_arrowhead_length` | Return the length of the double-headed arc end arrowhead
`end_arrowhead_tip` | Return the tip anchor point of the double-headed arc end arrowhead
`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 double-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 double-headed arc. These include the drawing elements of the arc path, the start arrowhead, and the end arrowhead
`self_to_shapely` | Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout
`start_arrowhead_base` | Return the base anchor point of the double-headed arc start arrowhead
`start_arrowhead_bbox` | Return the bounding box of the double-headed arc start arrowhead
`start_arrowhead_border` | Return the point at the intersection of the drawing elements of the double-headed arc start arrowhead and the line going through the center of these drawing elements and the given point.
`start_arrowhead_drawing_elements` | Return the drawing elements of the double-headed arc start arrowhead
`start_arrowhead_length` | Return the length of the double-headed arc start arrowhead
`start_arrowhead_tip` | Return the tip anchor point of the double-headed arc start arrowhead
`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)()

#### `` 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_arrowhead_base

    end_arrowhead_base() -> Point

Return the base anchor point of the double-headed arc end arrowhead

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

    1333
    1334
    1335
    1336
    1337
    1338
    1339
    1340
    1341
    1342
    1343
    def end_arrowhead_base(self) -> momapy.geometry.Point:
        """Return the base anchor point of the double-headed arc end arrowhead"""
        arrowhead_length = self.end_arrowhead_length()
        if arrowhead_length == 0:
            return self.end_point()
        segment = self.segments[-1]
        segment_length = segment.length()
        if segment_length == 0:
            return self.end_arrowhead_tip() - (arrowhead_length, 0)
        fraction = 1 - (arrowhead_length + self.end_shorten) / segment_length
        return segment.get_position_at_fraction(fraction)

#### `` end_arrowhead_bbox

    end_arrowhead_bbox()

Return the bounding box of the double-headed arc start arrowhead

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

    1345
    1346
    1347
    1348
    1349
    def end_arrowhead_bbox(self):
        """Return the bounding box of the double-headed arc start arrowhead"""
        return momapy.drawing.get_drawing_elements_bbox(
            self.end_arrowhead_drawing_elements()
        )

#### `` end_arrowhead_border

    end_arrowhead_border(point)

Return the point at the intersection of the drawing elements of the double-headed arc end 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`

    1351
    1352
    1353
    1354
    1355
    1356
    1357
    1358
    1359
    1360
    1361
    def end_arrowhead_border(self, point):
        """Return the point at the intersection of the drawing elements of the double-headed arc end 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.end_arrowhead_drawing_elements(), point
        )
        if point.isnan():
            return self.end_arrowhead_tip()
        return point

#### `` end_arrowhead_length

    end_arrowhead_length() -> float

Return the length of the double-headed arc end arrowhead

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

    1315
    1316
    1317
    1318
    1319
    1320
    1321
    1322
    def end_arrowhead_length(self) -> float:
        """Return the length of the double-headed arc end arrowhead"""
        bbox = momapy.drawing.get_drawing_elements_bbox(
            self._end_arrowhead_border_drawing_elements()
        )
        if math.isnan(bbox.width):
            return 0.0
        return bbox.east().x

#### `` end_arrowhead_tip

    end_arrowhead_tip() -> Point

Return the tip anchor point of the double-headed arc end arrowhead

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

    1324
    1325
    1326
    1327
    1328
    1329
    1330
    1331
    def end_arrowhead_tip(self) -> momapy.geometry.Point:
        """Return the tip anchor point of the double-headed arc end arrowhead"""
        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)

#### `` 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 double-headed arc path

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

    1451
    1452
    1453
    1454
    1455
    1456
    1457
    1458
    1459
    1460
    1461
    1462
    1463
    1464
    1465
    1466
    1467
    1468
    1469
    1470
    1471
    1472
    1473
    1474
    1475
    1476
    1477
    1478
    1479
    1480
    1481
    1482
    1483
    1484
    1485
    1486
    1487
    1488
    1489
    1490
    1491
    1492
    def path_drawing_elements(self) -> list[momapy.drawing.Path]:
        """Return the drawing elements of the double-headed arc path"""
        start_arrowhead_length = self.start_arrowhead_length()
        end_arrowhead_length = self.end_arrowhead_length()
        if len(self.segments) == 1:
            segment = (
                self.segments[0]
                .shortened(self.start_shorten + start_arrowhead_length, "start")
                .shortened(self.end_shorten + end_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_arrowhead_length, "start"
            )
            last_segment = self.segments[-1].shortened(
                self.end_shorten + end_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()

Return the self drawing elements of the double-headed arc. These include the drawing elements of the arc path, the start arrowhead, and the end arrowhead

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

    782
    783
    784
    785
    786
    787
    788
    789
    790
    791
    792
    793
    794
    795
    def self_drawing_elements(self):
        drawing_elements = momapy.builder.super_or_builder(
            CellDesignerDoubleHeadedArc, self
        ).self_drawing_elements()
        done_bases = []
        for base in type(self).__mro__:
            if (
                momapy.builder.issubclass_or_builder(base, momapy.sbgn.core._SBGNMixin)
                and base is not type(self)
                and not any([issubclass(done_base, base) for done_base in done_bases])
            ):
                drawing_elements += getattr(base, "_mixin_drawing_elements")(self)
                done_bases.append(base)
        return drawing_elements

#### `` 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_arrowhead_base

    start_arrowhead_base() -> Point

Return the base anchor point of the double-headed arc start arrowhead

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

    1285
    1286
    1287
    1288
    1289
    1290
    1291
    1292
    1293
    1294
    1295
    1296
    def start_arrowhead_base(self) -> momapy.geometry.Point:
        """Return the base anchor point of the double-headed arc start arrowhead"""
        arrowhead_length = self.start_arrowhead_length()
        if arrowhead_length == 0:
            return self.start_point()
        segment = self.segments[0]
        segment = momapy.geometry.Segment(segment.p2, segment.p1)
        segment_length = segment.length()
        if segment_length == 0:
            return self.start_arrowhead_tip() + (arrowhead_length, 0)
        fraction = 1 - (arrowhead_length + self.start_shorten) / segment_length
        return segment.get_position_at_fraction(fraction)

#### `` start_arrowhead_bbox

    start_arrowhead_bbox() -> Bbox

Return the bounding box of the double-headed arc start arrowhead

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

    1298
    1299
    1300
    1301
    1302
    def start_arrowhead_bbox(self) -> momapy.geometry.Bbox:
        """Return the bounding box of the double-headed arc start arrowhead"""
        return momapy.drawing.get_drawing_elements_bbox(
            self.start_arrowhead_drawing_elements()
        )

#### `` start_arrowhead_border

    start_arrowhead_border(point) -> Point

Return the point at the intersection of the drawing elements of the double-headed arc start 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`

    1304
    1305
    1306
    1307
    1308
    1309
    1310
    1311
    1312
    1313
    def start_arrowhead_border(self, point) -> momapy.geometry.Point:
        """Return the point at the intersection of the drawing elements of the double-headed arc start 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.start_arrowhead_drawing_elements(), point
        )
        if point.isnan():
            return self.start_arrowhead_tip()
        return point

#### `` start_arrowhead_drawing_elements

    start_arrowhead_drawing_elements() -> list[DrawingElement]

Return the drawing elements of the double-headed arc start arrowhead

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

    1394
    1395
    1396
    1397
    1398
    1399
    1400
    1401
    1402
    1403
    1404
    1405
    1406
    1407
    1408
    1409
    1410
    1411
    1412
    1413
    def start_arrowhead_drawing_elements(
        self,
    ) -> list[momapy.drawing.DrawingElement]:
        """Return the drawing elements of the double-headed arc start arrowhead"""
        drawing_elements = self._start_arrowhead_border_drawing_elements()
        group = momapy.drawing.Group(
            class_=f"{type(self).__name__}_start_arrowhead",
            elements=tuple(drawing_elements),
            id_=f"{self.id_}_start_arrowhead",
            fill=self.start_arrowhead_fill,
            filter=self.start_arrowhead_filter,
            stroke=self.start_arrowhead_stroke,
            stroke_dasharray=self.start_arrowhead_stroke_dasharray,
            stroke_dashoffset=self.start_arrowhead_stroke_dashoffset,
            stroke_width=self.start_arrowhead_stroke_width,
            transform=self.start_arrowhead_transform,
        )
        transformation = self._get_start_arrowhead_transformation()
        group = group.transformed(transformation)
        return [group]

#### `` start_arrowhead_length

    start_arrowhead_length() -> float

Return the length of the double-headed arc start arrowhead

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

    1266
    1267
    1268
    1269
    1270
    1271
    1272
    1273
    def start_arrowhead_length(self) -> float:
        """Return the length of the double-headed arc start arrowhead"""
        bbox = momapy.drawing.get_drawing_elements_bbox(
            self._start_arrowhead_border_drawing_elements()
        )
        if math.isnan(bbox.width):
            return 0.0
        return abs(bbox.west().x)

#### `` start_arrowhead_tip

    start_arrowhead_tip() -> Point

Return the tip anchor point of the double-headed arc start arrowhead

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

    1275
    1276
    1277
    1278
    1279
    1280
    1281
    1282
    1283
    def start_arrowhead_tip(self) -> momapy.geometry.Point:
        """Return the tip anchor point of the double-headed arc start arrowhead"""
        segment = self.segments[0]
        segment = momapy.geometry.Segment(segment.p2, segment.p1)
        segment_length = segment.length()
        if segment_length == 0:
            return segment.p2
        fraction = 1 - self.start_shorten / segment_length
        return segment.get_position_at_fraction(fraction)

#### `` 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)

### `` Drug `dataclass`

    Drug(
        *,
        id_: str = make_uuid4_as_str(),
        name: str | None = None,
        sbo_term: SBOTerm | None = None,
        metaid: str | None = None,
        compartment: Compartment | None = None,
        hypothetical: bool = False,
        active: bool = False,
        homomultimer: int = 1,
    )

Bases: `Species`

Class for drugs

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 | `'31892933-80d6-4b81-a803-91bf220eeb3c'`
`name` | `str | None` |  | `None`
`sbo_term` | `SBOTerm | None` |  | `None`
`metaid` | `str | None` |  | `None`
`compartment` | `Compartment | None` |  | `None`
`hypothetical` | `bool` | Whether the species is hypothetical or not | `False`
`active` | `bool` | Whether the species is active or not | `False`
`homomultimer` | `int` | The number of subunits forming the species | `1`

### `` DrugLayout `dataclass`

    DrugLayout(
        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,
        active: bool = False,
        active_fill: NoneValueType | Color | None = NoneValue,
        active_filter: NoneValueType | Filter | None = None,
        active_sep: float = 4.0,
        active_stroke: NoneValueType | Color | None = black,
        active_stroke_dasharray: NoneValueType
        | tuple[float]
        | None = (4, 2),
        active_stroke_dashoffset: float | None = None,
        active_stroke_width: float | None = 1.0,
        active_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        n: int = 1,
        horizontal_proportion: float = 0.2,
        sep: float = 4.0,
    )

Bases: `_MultiNodeMixin`, `CellDesignerNode`

Class for drug 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 | `'36f94b4b-064d-4d5f-850a-de55aec90a98'`
`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`
`active` | `bool` |  | `False`
`active_fill` | `NoneValueType | Color | None` |  | `<momapy.drawing.NoneValueType object at 0x7fb32ae9f1d0>`
`active_filter` | `NoneValueType | Filter | None` |  | `None`
`active_sep` | `float` |  | `4.0`
`active_stroke` | `NoneValueType | Color | None` |  | `Color(red=0, green=0, blue=0, alpha=1.0)`
`active_stroke_dasharray` | `NoneValueType | tuple[float] | None` |  | `(4, 2)`
`active_stroke_dashoffset` | `float | None` |  | `None`
`active_stroke_width` | `float | None` |  | `1.0`
`active_transform` | `NoneValueType | tuple[Transformation] | None` |  | `None`
`n` | `int` |  | `1`
`horizontal_proportion` | `float` |  | `0.2`
`sep` | `float` |  | `4.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

### `` Gene `dataclass`

    Gene(
        *,
        id_: str = make_uuid4_as_str(),
        name: str | None = None,
        sbo_term: SBOTerm | None = None,
        metaid: str | None = None,
        compartment: Compartment | None = None,
        hypothetical: bool = False,
        active: bool = False,
        homomultimer: int = 1,
        template: GeneTemplate,
        modifications: frozenset[Modification] = frozenset(),
    )

Bases: `Species`

Class for genes

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 | `'9cf15aaf-ce5d-4c2a-a619-bd4e0d4c7524'`
`name` | `str | None` |  | `None`
`sbo_term` | `SBOTerm | None` |  | `None`
`metaid` | `str | None` |  | `None`
`compartment` | `Compartment | None` |  | `None`
`hypothetical` | `bool` | Whether the species is hypothetical or not | `False`
`active` | `bool` | Whether the species is active or not | `False`
`homomultimer` | `int` | The number of subunits forming the species | `1`
`template` | `GeneTemplate` |  | required
`modifications` | `frozenset[Modification]` | frozenset() -> empty frozenset object frozenset(iterable) -> frozenset object Build an immutable unordered collection of unique elements. | `<class 'frozenset'>`

### `` GeneLayout `dataclass`

    GeneLayout(
        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,
        active: bool = False,
        active_fill: NoneValueType | Color | None = NoneValue,
        active_filter: NoneValueType | Filter | None = None,
        active_sep: float = 4.0,
        active_stroke: NoneValueType | Color | None = black,
        active_stroke_dasharray: NoneValueType
        | tuple[float]
        | None = (4, 2),
        active_stroke_dashoffset: float | None = None,
        active_stroke_width: float | None = 1.0,
        active_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        n: int = 1,
    )

Bases: `_MultiNodeMixin`, `CellDesignerNode`

Class for gene 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 | `'2adc4c5d-3505-4b3e-ae45-808b8ffa0dfb'`
`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`
`active` | `bool` |  | `False`
`active_fill` | `NoneValueType | Color | None` |  | `<momapy.drawing.NoneValueType object at 0x7fb32ae9f1d0>`
`active_filter` | `NoneValueType | Filter | None` |  | `None`
`active_sep` | `float` |  | `4.0`
`active_stroke` | `NoneValueType | Color | None` |  | `Color(red=0, green=0, blue=0, alpha=1.0)`
`active_stroke_dasharray` | `NoneValueType | tuple[float] | None` |  | `(4, 2)`
`active_stroke_dashoffset` | `float | None` |  | `None`
`active_stroke_width` | `float | None` |  | `1.0`
`active_transform` | `NoneValueType | tuple[Transformation] | None` |  | `None`
`n` | `int` |  | `1`

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

### `` GeneTemplate `dataclass`

    GeneTemplate(
        *,
        id_: str = make_uuid4_as_str(),
        name: str,
        regions: frozenset[
            ModificationSite
            | CodingRegion
            | RegulatoryRegion
            | TranscriptionStartingSiteL
            | TranscriptionStartingSiteR
        ] = frozenset(),
    )

Bases: `SpeciesTemplate`

Class for gene templates

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 | `'1fef8391-aca1-4411-8768-57c948363758'`
`name` | `str` | The name of the species template | required
`regions` | `frozenset[Union[ModificationSite, CodingRegion, RegulatoryRegion, TranscriptionStartingSiteL, TranscriptionStartingSiteR]]` | The regions of the gene template | `<class 'frozenset'>`

### `` GenericProtein `dataclass`

    GenericProtein(
        *,
        id_: str = make_uuid4_as_str(),
        name: str | None = None,
        sbo_term: SBOTerm | None = None,
        metaid: str | None = None,
        compartment: Compartment | None = None,
        hypothetical: bool = False,
        active: bool = False,
        homomultimer: int = 1,
        template: GenericProteinTemplate,
        modifications: frozenset[Modification] = frozenset(),
        structural_states: frozenset[
            StructuralState
        ] = frozenset(),
    )

Bases: `Protein`

Class for generic proteins

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 | `'33884128-3fe4-4d4a-99df-5a97b62d025b'`
`name` | `str | None` |  | `None`
`sbo_term` | `SBOTerm | None` |  | `None`
`metaid` | `str | None` |  | `None`
`compartment` | `Compartment | None` |  | `None`
`hypothetical` | `bool` | Whether the species is hypothetical or not | `False`
`active` | `bool` | Whether the species is active or not | `False`
`homomultimer` | `int` | The number of subunits forming the species | `1`
`template` | `GenericProteinTemplate` | The template of the generic protein | required
`modifications` | `frozenset[Modification]` | The modifications of the proteins | `<class 'frozenset'>`
`structural_states` | `frozenset[StructuralState]` | The structural states of the protein | `<class 'frozenset'>`

### `` GenericProteinLayout `dataclass`

    GenericProteinLayout(
        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,
        active: bool = False,
        active_fill: NoneValueType | Color | None = NoneValue,
        active_filter: NoneValueType | Filter | None = None,
        active_sep: float = 4.0,
        active_stroke: NoneValueType | Color | None = black,
        active_stroke_dasharray: NoneValueType
        | tuple[float]
        | None = (4, 2),
        active_stroke_dashoffset: float | None = None,
        active_stroke_width: float | None = 1.0,
        active_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        n: int = 1,
        rounded_corners: float = 5.0,
    )

Bases: `_MultiNodeMixin`, `CellDesignerNode`

Class for generic protein 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 | `'2b3f9028-dca7-4ec4-9b05-dc445a174272'`
`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`
`active` | `bool` |  | `False`
`active_fill` | `NoneValueType | Color | None` |  | `<momapy.drawing.NoneValueType object at 0x7fb32ae9f1d0>`
`active_filter` | `NoneValueType | Filter | None` |  | `None`
`active_sep` | `float` |  | `4.0`
`active_stroke` | `NoneValueType | Color | None` |  | `Color(red=0, green=0, blue=0, alpha=1.0)`
`active_stroke_dasharray` | `NoneValueType | tuple[float] | None` |  | `(4, 2)`
`active_stroke_dashoffset` | `float | None` |  | `None`
`active_stroke_width` | `float | None` |  | `1.0`
`active_transform` | `NoneValueType | tuple[Transformation] | None` |  | `None`
`n` | `int` |  | `1`
`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

### `` GenericProteinTemplate `dataclass`

    GenericProteinTemplate(
        *,
        id_: str = make_uuid4_as_str(),
        name: str,
        modification_residues: frozenset[
            ModificationResidue
        ] = frozenset(),
    )

Bases: `ProteinTemplate`

Class for generic protein templates

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 | `'8ed91c7e-6057-46d3-a275-825aaca41285'`
`name` | `str` | The name of the species template | required
`modification_residues` | `frozenset[ModificationResidue]` | The modification residues of the protein template | `<class 'frozenset'>`

### `` HeterodimerAssociation `dataclass`

    HeterodimerAssociation(
        *,
        id_: str = make_uuid4_as_str(),
        name: str | None = None,
        sbo_term: SBOTerm | None = None,
        metaid: str | None = None,
        reversible: bool,
        compartment: Compartment | None = None,
        reactants: frozenset[Reactant] = frozenset(),
        products: frozenset[Product] = frozenset(),
        modifiers: frozenset[
            KnownOrUnknownModulator
        ] = frozenset(),
    )

Bases: `Reaction`

Class for heterodimer 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 | `'3952ea00-c26e-4c73-9ed8-d53443c10a6b'`
`name` | `str | None` |  | `None`
`sbo_term` | `SBOTerm | None` |  | `None`
`metaid` | `str | None` |  | `None`
`reversible` | `bool` |  | required
`compartment` | `Compartment | None` |  | `None`
`reactants` | `frozenset[Reactant]` | The reactants of the reaction | `<class 'frozenset'>`
`products` | `frozenset[Product]` | The products of the reaction | `<class 'frozenset'>`
`modifiers` | `frozenset[KnownOrUnknownModulator]` | The modifiers of the reaction | `<class 'frozenset'>`

### `` HeterodimerAssociationLayout `dataclass`

    HeterodimerAssociationLayout(
        *,
        _left_connector_fraction: float = 0.4,
        _right_connector_fraction: float = 0.6,
        reaction_node_height: float = 10.0,
        reaction_node_width: float = 10.0,
        reaction_node_segment: int = 1,
        reaction_node_stroke: NoneValueType
        | Color
        | None = black,
        reaction_node_stroke_width: float | None = 1.0,
        reaction_node_stroke_dasharray: NoneValueType
        | tuple[float]
        | None = None,
        reaction_node_stroke_dashoffset: float | None = None,
        reaction_node_fill: NoneValueType
        | Color
        | None = white,
        reaction_node_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        reaction_node_filter: 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,
        end_shorten: float = 2.0,
        fill: NoneValueType | Color | None = None,
        filter: NoneValueType | Filter | None = None,
        path_fill: NoneValueType | Color | None = NoneValue,
        path_filter: NoneValueType | Filter | None = None,
        path_stroke: NoneValueType | Color | None = black,
        path_stroke_dasharray: tuple[float, ...] | None = None,
        path_stroke_dashoffset: float | None = None,
        path_stroke_width: float | None = 1.0,
        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 = 2.0,
        target: LayoutElement | None = None,
        transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        end_arrowhead_fill: NoneValueType
        | Color
        | None = black,
        end_arrowhead_filter: NoneValueType
        | Filter
        | None = None,
        end_arrowhead_stroke: NoneValueType
        | Color
        | None = black,
        end_arrowhead_stroke_dasharray: NoneValueType
        | tuple[float]
        | None = None,
        end_arrowhead_stroke_dashoffset: float | None = None,
        end_arrowhead_stroke_width: float | None = 1.0,
        end_arrowhead_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        start_arrowhead_fill: NoneValueType
        | Color
        | None = black,
        start_arrowhead_filter: NoneValueType
        | Filter
        | None = None,
        start_arrowhead_stroke: NoneValueType
        | Color
        | None = black,
        start_arrowhead_stroke_dasharray: NoneValueType
        | tuple[float]
        | None = None,
        start_arrowhead_stroke_dashoffset: float | None = None,
        start_arrowhead_stroke_width: float | None = 1.0,
        start_arrowhead_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        reversible: bool = False,
        end_arrowhead_height: float = 8.0,
        end_arrowhead_width: float = 15.0,
        start_arrowhead_height: float = 6.0,
        start_arrowhead_width: float = 6.0,
    )

Bases: `_ReactionLayout`, `_ReactionNodeMixin`

Class for heterodimer association layouts

Parameters:

Name | Type | Description | Default
--- | --- | --- | ---
`reaction_node_height` | `float` |  | `10.0`
`reaction_node_width` | `float` |  | `10.0`
`reaction_node_segment` | `int` |  | `1`
`reaction_node_stroke` | `NoneValueType | Color | None` |  | `Color(red=0, green=0, blue=0, alpha=1.0)`
`reaction_node_stroke_width` | `float | None` |  | `1.0`
`reaction_node_stroke_dasharray` | `NoneValueType | tuple[float] | None` |  | `None`
`reaction_node_stroke_dashoffset` | `float | None` |  | `None`
`reaction_node_fill` | `NoneValueType | Color | None` |  | `Color(red=255, green=255, blue=255, alpha=1.0)`
`reaction_node_transform` | `NoneValueType | tuple[Transformation] | None` |  | `None`
`reaction_node_filter` | `NoneValueType | Filter | None` |  | `None`
`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 | `'5fc006a7-9753-4095-995f-46c26a6e78b1'`
`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` |  | `2.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.0`
`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` |  | `2.0`
`target` | `LayoutElement | None` | The target of the arc | `None`
`transform` | `NoneValueType | tuple[Transformation] | None` | The transform of the arc | `None`
`end_arrowhead_fill` | `NoneValueType | Color | None` |  | `Color(red=0, green=0, blue=0, alpha=1.0)`
`end_arrowhead_filter` | `NoneValueType | Filter | None` |  | `None`
`end_arrowhead_stroke` | `NoneValueType | Color | None` |  | `Color(red=0, green=0, blue=0, alpha=1.0)`
`end_arrowhead_stroke_dasharray` | `NoneValueType | tuple[float] | None` |  | `None`
`end_arrowhead_stroke_dashoffset` | `float | None` |  | `None`
`end_arrowhead_stroke_width` | `float | None` |  | `1.0`
`end_arrowhead_transform` | `NoneValueType | tuple[Transformation] | None` |  | `None`
`start_arrowhead_fill` | `NoneValueType | Color | None` |  | `Color(red=0, green=0, blue=0, alpha=1.0)`
`start_arrowhead_filter` | `NoneValueType | Filter | None` |  | `None`
`start_arrowhead_stroke` | `NoneValueType | Color | None` |  | `Color(red=0, green=0, blue=0, alpha=1.0)`
`start_arrowhead_stroke_dasharray` | `NoneValueType | tuple[float] | None` |  | `None`
`start_arrowhead_stroke_dashoffset` | `float | None` |  | `None`
`start_arrowhead_stroke_width` | `float | None` |  | `1.0`
`start_arrowhead_transform` | `NoneValueType | tuple[Transformation] | None` |  | `None`
`reversible` | `bool` |  | `False`
`end_arrowhead_height` | `float` |  | `8.0`
`end_arrowhead_width` | `float` |  | `15.0`
`start_arrowhead_height` | `float` |  | `6.0`
`start_arrowhead_width` | `float` |  | `6.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
`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_arrowhead_base` | Return the base anchor point of the double-headed arc end arrowhead
`end_arrowhead_bbox` | Return the bounding box of the double-headed arc start arrowhead
`end_arrowhead_border` | Return the point at the intersection of the drawing elements of the double-headed arc end arrowhead and the line going through the center of these drawing elements and the given point.
`end_arrowhead_length` | Return the length of the double-headed arc end arrowhead
`end_arrowhead_tip` | Return the tip anchor point of the double-headed arc end arrowhead
`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 double-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 double-headed arc. These include the drawing elements of the arc path, the start arrowhead, and the end arrowhead
`self_to_shapely` | Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout
`start_arrowhead_base` | Return the base anchor point of the double-headed arc start arrowhead
`start_arrowhead_bbox` | Return the bounding box of the double-headed arc start arrowhead
`start_arrowhead_border` | Return the point at the intersection of the drawing elements of the double-headed arc start arrowhead and the line going through the center of these drawing elements and the given point.
`start_arrowhead_drawing_elements` | Return the drawing elements of the double-headed arc start arrowhead
`start_arrowhead_length` | Return the length of the double-headed arc start arrowhead
`start_arrowhead_tip` | Return the tip anchor point of the double-headed arc start arrowhead
`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)()

#### `` 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_arrowhead_base

    end_arrowhead_base() -> Point

Return the base anchor point of the double-headed arc end arrowhead

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

    1333
    1334
    1335
    1336
    1337
    1338
    1339
    1340
    1341
    1342
    1343
    def end_arrowhead_base(self) -> momapy.geometry.Point:
        """Return the base anchor point of the double-headed arc end arrowhead"""
        arrowhead_length = self.end_arrowhead_length()
        if arrowhead_length == 0:
            return self.end_point()
        segment = self.segments[-1]
        segment_length = segment.length()
        if segment_length == 0:
            return self.end_arrowhead_tip() - (arrowhead_length, 0)
        fraction = 1 - (arrowhead_length + self.end_shorten) / segment_length
        return segment.get_position_at_fraction(fraction)

#### `` end_arrowhead_bbox

    end_arrowhead_bbox()

Return the bounding box of the double-headed arc start arrowhead

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

    1345
    1346
    1347
    1348
    1349
    def end_arrowhead_bbox(self):
        """Return the bounding box of the double-headed arc start arrowhead"""
        return momapy.drawing.get_drawing_elements_bbox(
            self.end_arrowhead_drawing_elements()
        )

#### `` end_arrowhead_border

    end_arrowhead_border(point)

Return the point at the intersection of the drawing elements of the double-headed arc end 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`

    1351
    1352
    1353
    1354
    1355
    1356
    1357
    1358
    1359
    1360
    1361
    def end_arrowhead_border(self, point):
        """Return the point at the intersection of the drawing elements of the double-headed arc end 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.end_arrowhead_drawing_elements(), point
        )
        if point.isnan():
            return self.end_arrowhead_tip()
        return point

#### `` end_arrowhead_length

    end_arrowhead_length() -> float

Return the length of the double-headed arc end arrowhead

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

    1315
    1316
    1317
    1318
    1319
    1320
    1321
    1322
    def end_arrowhead_length(self) -> float:
        """Return the length of the double-headed arc end arrowhead"""
        bbox = momapy.drawing.get_drawing_elements_bbox(
            self._end_arrowhead_border_drawing_elements()
        )
        if math.isnan(bbox.width):
            return 0.0
        return bbox.east().x

#### `` end_arrowhead_tip

    end_arrowhead_tip() -> Point

Return the tip anchor point of the double-headed arc end arrowhead

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

    1324
    1325
    1326
    1327
    1328
    1329
    1330
    1331
    def end_arrowhead_tip(self) -> momapy.geometry.Point:
        """Return the tip anchor point of the double-headed arc end arrowhead"""
        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)

#### `` 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 double-headed arc path

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

    1451
    1452
    1453
    1454
    1455
    1456
    1457
    1458
    1459
    1460
    1461
    1462
    1463
    1464
    1465
    1466
    1467
    1468
    1469
    1470
    1471
    1472
    1473
    1474
    1475
    1476
    1477
    1478
    1479
    1480
    1481
    1482
    1483
    1484
    1485
    1486
    1487
    1488
    1489
    1490
    1491
    1492
    def path_drawing_elements(self) -> list[momapy.drawing.Path]:
        """Return the drawing elements of the double-headed arc path"""
        start_arrowhead_length = self.start_arrowhead_length()
        end_arrowhead_length = self.end_arrowhead_length()
        if len(self.segments) == 1:
            segment = (
                self.segments[0]
                .shortened(self.start_shorten + start_arrowhead_length, "start")
                .shortened(self.end_shorten + end_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_arrowhead_length, "start"
            )
            last_segment = self.segments[-1].shortened(
                self.end_shorten + end_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()

Return the self drawing elements of the double-headed arc. These include the drawing elements of the arc path, the start arrowhead, and the end arrowhead

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

    782
    783
    784
    785
    786
    787
    788
    789
    790
    791
    792
    793
    794
    795
    def self_drawing_elements(self):
        drawing_elements = momapy.builder.super_or_builder(
            CellDesignerDoubleHeadedArc, self
        ).self_drawing_elements()
        done_bases = []
        for base in type(self).__mro__:
            if (
                momapy.builder.issubclass_or_builder(base, momapy.sbgn.core._SBGNMixin)
                and base is not type(self)
                and not any([issubclass(done_base, base) for done_base in done_bases])
            ):
                drawing_elements += getattr(base, "_mixin_drawing_elements")(self)
                done_bases.append(base)
        return drawing_elements

#### `` 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_arrowhead_base

    start_arrowhead_base() -> Point

Return the base anchor point of the double-headed arc start arrowhead

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

    1285
    1286
    1287
    1288
    1289
    1290
    1291
    1292
    1293
    1294
    1295
    1296
    def start_arrowhead_base(self) -> momapy.geometry.Point:
        """Return the base anchor point of the double-headed arc start arrowhead"""
        arrowhead_length = self.start_arrowhead_length()
        if arrowhead_length == 0:
            return self.start_point()
        segment = self.segments[0]
        segment = momapy.geometry.Segment(segment.p2, segment.p1)
        segment_length = segment.length()
        if segment_length == 0:
            return self.start_arrowhead_tip() + (arrowhead_length, 0)
        fraction = 1 - (arrowhead_length + self.start_shorten) / segment_length
        return segment.get_position_at_fraction(fraction)

#### `` start_arrowhead_bbox

    start_arrowhead_bbox() -> Bbox

Return the bounding box of the double-headed arc start arrowhead

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

    1298
    1299
    1300
    1301
    1302
    def start_arrowhead_bbox(self) -> momapy.geometry.Bbox:
        """Return the bounding box of the double-headed arc start arrowhead"""
        return momapy.drawing.get_drawing_elements_bbox(
            self.start_arrowhead_drawing_elements()
        )

#### `` start_arrowhead_border

    start_arrowhead_border(point) -> Point

Return the point at the intersection of the drawing elements of the double-headed arc start 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`

    1304
    1305
    1306
    1307
    1308
    1309
    1310
    1311
    1312
    1313
    def start_arrowhead_border(self, point) -> momapy.geometry.Point:
        """Return the point at the intersection of the drawing elements of the double-headed arc start 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.start_arrowhead_drawing_elements(), point
        )
        if point.isnan():
            return self.start_arrowhead_tip()
        return point

#### `` start_arrowhead_drawing_elements

    start_arrowhead_drawing_elements() -> list[DrawingElement]

Return the drawing elements of the double-headed arc start arrowhead

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

    1394
    1395
    1396
    1397
    1398
    1399
    1400
    1401
    1402
    1403
    1404
    1405
    1406
    1407
    1408
    1409
    1410
    1411
    1412
    1413
    def start_arrowhead_drawing_elements(
        self,
    ) -> list[momapy.drawing.DrawingElement]:
        """Return the drawing elements of the double-headed arc start arrowhead"""
        drawing_elements = self._start_arrowhead_border_drawing_elements()
        group = momapy.drawing.Group(
            class_=f"{type(self).__name__}_start_arrowhead",
            elements=tuple(drawing_elements),
            id_=f"{self.id_}_start_arrowhead",
            fill=self.start_arrowhead_fill,
            filter=self.start_arrowhead_filter,
            stroke=self.start_arrowhead_stroke,
            stroke_dasharray=self.start_arrowhead_stroke_dasharray,
            stroke_dashoffset=self.start_arrowhead_stroke_dashoffset,
            stroke_width=self.start_arrowhead_stroke_width,
            transform=self.start_arrowhead_transform,
        )
        transformation = self._get_start_arrowhead_transformation()
        group = group.transformed(transformation)
        return [group]

#### `` start_arrowhead_length

    start_arrowhead_length() -> float

Return the length of the double-headed arc start arrowhead

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

    1266
    1267
    1268
    1269
    1270
    1271
    1272
    1273
    def start_arrowhead_length(self) -> float:
        """Return the length of the double-headed arc start arrowhead"""
        bbox = momapy.drawing.get_drawing_elements_bbox(
            self._start_arrowhead_border_drawing_elements()
        )
        if math.isnan(bbox.width):
            return 0.0
        return abs(bbox.west().x)

#### `` start_arrowhead_tip

    start_arrowhead_tip() -> Point

Return the tip anchor point of the double-headed arc start arrowhead

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

    1275
    1276
    1277
    1278
    1279
    1280
    1281
    1282
    1283
    def start_arrowhead_tip(self) -> momapy.geometry.Point:
        """Return the tip anchor point of the double-headed arc start arrowhead"""
        segment = self.segments[0]
        segment = momapy.geometry.Segment(segment.p2, segment.p1)
        segment_length = segment.length()
        if segment_length == 0:
            return segment.p2
        fraction = 1 - self.start_shorten / segment_length
        return segment.get_position_at_fraction(fraction)

#### `` 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)

### `` Inhibition `dataclass`

    Inhibition(
        *,
        id_: str = make_uuid4_as_str(),
        source: Species | BooleanLogicGate,
        target: Species | None,
    )

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 | `'720634f9-b839-491b-8c33-8abe5de80f10'`
`source` | `Species | BooleanLogicGate` | The source of the influence | required
`target` | `Species | None` | The target of the influence | required

### `` InhibitionLayout `dataclass`

    InhibitionLayout(
        *,
        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 = 3.0,
        fill: NoneValueType | Color | None = None,
        filter: NoneValueType | Filter | None = None,
        path_fill: NoneValueType | Color | None = NoneValue,
        path_filter: NoneValueType | Filter | None = None,
        path_stroke: NoneValueType | Color | None = black,
        path_stroke_dasharray: tuple[float, ...] | None = None,
        path_stroke_dashoffset: float | None = None,
        path_stroke_width: float | None = 1.0,
        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 = None,
        arrowhead_filter: NoneValueType | Filter | None = None,
        arrowhead_stroke: NoneValueType | Color | None = black,
        arrowhead_stroke_dasharray: tuple[float, ...]
        | None = None,
        arrowhead_stroke_dashoffset: float | None = None,
        arrowhead_stroke_width: float | None = 1.0,
        arrowhead_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        arrowhead_height: float = 10.0,
    )

Bases: `CellDesignerSingleHeadedArc`

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 | `'dc0ec75c-19e9-4785-ba3a-5b54e8c387bb'`
`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` |  | `3.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.0`
`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` | The arrowhead fill color of the arc | `None`
`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.0`
`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()

Return the self drawing elements of the single-headed arc

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

    754
    755
    756
    757
    758
    759
    760
    761
    762
    763
    764
    765
    766
    767
    def self_drawing_elements(self):
        drawing_elements = momapy.builder.super_or_builder(
            CellDesignerSingleHeadedArc, self
        ).self_drawing_elements()
        done_bases = []
        for base in type(self).__mro__:
            if (
                momapy.builder.issubclass_or_builder(base, momapy.sbgn.core._SBGNMixin)
                and base is not type(self)
                and not any([issubclass(done_base, base) for done_base in done_bases])
            ):
                drawing_elements += getattr(base, "_mixin_drawing_elements")(self)
                done_bases.append(base)
        return drawing_elements

#### `` 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)

### `` Inhibitor `dataclass`

    Inhibitor(
        *,
        id_: str = make_uuid4_as_str(),
        name: str | None = None,
        sbo_term: SBOTerm | None = None,
        metaid: str | None = None,
        referred_species: Species | BooleanLogicGate,
    )

Bases: `Modulator`

Class for inhibitors

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 | `'715412ba-df9a-4868-82d7-93d433a508cc'`
`name` | `str | None` |  | `None`
`sbo_term` | `SBOTerm | None` |  | `None`
`metaid` | `str | None` |  | `None`
`referred_species` | `Species | BooleanLogicGate` | The species the modifier refers to | required

### `` Ion `dataclass`

    Ion(
        *,
        id_: str = make_uuid4_as_str(),
        name: str | None = None,
        sbo_term: SBOTerm | None = None,
        metaid: str | None = None,
        compartment: Compartment | None = None,
        hypothetical: bool = False,
        active: bool = False,
        homomultimer: int = 1,
    )

Bases: `Species`

Class for ions

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 | `'48bd304c-830f-43b1-8fa1-40517eea7718'`
`name` | `str | None` |  | `None`
`sbo_term` | `SBOTerm | None` |  | `None`
`metaid` | `str | None` |  | `None`
`compartment` | `Compartment | None` |  | `None`
`hypothetical` | `bool` | Whether the species is hypothetical or not | `False`
`active` | `bool` | Whether the species is active or not | `False`
`homomultimer` | `int` | The number of subunits forming the species | `1`

### `` IonChannel `dataclass`

    IonChannel(
        *,
        id_: str = make_uuid4_as_str(),
        name: str | None = None,
        sbo_term: SBOTerm | None = None,
        metaid: str | None = None,
        compartment: Compartment | None = None,
        hypothetical: bool = False,
        active: bool = False,
        homomultimer: int = 1,
        template: IonChannelTemplate,
        modifications: frozenset[Modification] = frozenset(),
        structural_states: frozenset[
            StructuralState
        ] = frozenset(),
    )

Bases: `Protein`

Class for ion channels

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 | `'86b53d79-661c-4967-af50-8b083986f2ad'`
`name` | `str | None` |  | `None`
`sbo_term` | `SBOTerm | None` |  | `None`
`metaid` | `str | None` |  | `None`
`compartment` | `Compartment | None` |  | `None`
`hypothetical` | `bool` | Whether the species is hypothetical or not | `False`
`active` | `bool` | Whether the species is active or not | `False`
`homomultimer` | `int` | The number of subunits forming the species | `1`
`template` | `IonChannelTemplate` | The template of the ion channel | required
`modifications` | `frozenset[Modification]` | The modifications of the proteins | `<class 'frozenset'>`
`structural_states` | `frozenset[StructuralState]` | The structural states of the protein | `<class 'frozenset'>`

### `` IonChannelLayout `dataclass`

    IonChannelLayout(
        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,
        active: bool = False,
        active_fill: NoneValueType | Color | None = NoneValue,
        active_filter: NoneValueType | Filter | None = None,
        active_sep: float = 4.0,
        active_stroke: NoneValueType | Color | None = black,
        active_stroke_dasharray: NoneValueType
        | tuple[float]
        | None = (4, 2),
        active_stroke_dashoffset: float | None = None,
        active_stroke_width: float | None = 1.0,
        active_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        n: int = 1,
        rounded_corners: float = 5.0,
        right_rectangle_width: float = 20.0,
    )

Bases: `_MultiNodeMixin`, `CellDesignerNode`

Class for generic ion channel 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 | `'f6c042b9-2968-423c-af49-66727d719c42'`
`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`
`active` | `bool` |  | `False`
`active_fill` | `NoneValueType | Color | None` |  | `<momapy.drawing.NoneValueType object at 0x7fb32ae9f1d0>`
`active_filter` | `NoneValueType | Filter | None` |  | `None`
`active_sep` | `float` |  | `4.0`
`active_stroke` | `NoneValueType | Color | None` |  | `Color(red=0, green=0, blue=0, alpha=1.0)`
`active_stroke_dasharray` | `NoneValueType | tuple[float] | None` |  | `(4, 2)`
`active_stroke_dashoffset` | `float | None` |  | `None`
`active_stroke_width` | `float | None` |  | `1.0`
`active_transform` | `NoneValueType | tuple[Transformation] | None` |  | `None`
`n` | `int` |  | `1`
`rounded_corners` | `float` |  | `5.0`
`right_rectangle_width` | `float` |  | `20.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

### `` IonChannelTemplate `dataclass`

    IonChannelTemplate(
        *,
        id_: str = make_uuid4_as_str(),
        name: str,
        modification_residues: frozenset[
            ModificationResidue
        ] = frozenset(),
    )

Bases: `ProteinTemplate`

Class for ion channel templates

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 | `'b88ea852-c8d4-4c01-95dd-576f49fc7180'`
`name` | `str` | The name of the species template | required
`modification_residues` | `frozenset[ModificationResidue]` | The modification residues of the protein template | `<class 'frozenset'>`

### `` IonLayout `dataclass`

    IonLayout(
        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,
        active: bool = False,
        active_fill: NoneValueType | Color | None = NoneValue,
        active_filter: NoneValueType | Filter | None = None,
        active_sep: float = 4.0,
        active_stroke: NoneValueType | Color | None = black,
        active_stroke_dasharray: NoneValueType
        | tuple[float]
        | None = (4, 2),
        active_stroke_dashoffset: float | None = None,
        active_stroke_width: float | None = 1.0,
        active_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        n: int = 1,
    )

Bases: `_MultiNodeMixin`, `CellDesignerNode`

Class for ion 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 | `'4b02e5dd-2967-4e7f-ac7f-bff285c7dcfd'`
`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`
`active` | `bool` |  | `False`
`active_fill` | `NoneValueType | Color | None` |  | `<momapy.drawing.NoneValueType object at 0x7fb32ae9f1d0>`
`active_filter` | `NoneValueType | Filter | None` |  | `None`
`active_sep` | `float` |  | `4.0`
`active_stroke` | `NoneValueType | Color | None` |  | `Color(red=0, green=0, blue=0, alpha=1.0)`
`active_stroke_dasharray` | `NoneValueType | tuple[float] | None` |  | `(4, 2)`
`active_stroke_dashoffset` | `float | None` |  | `None`
`active_stroke_width` | `float | None` |  | `1.0`
`active_transform` | `NoneValueType | tuple[Transformation] | None` |  | `None`
`n` | `int` |  | `1`

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

### `` KnownOrUnknownModulation `dataclass`

    KnownOrUnknownModulation(
        *,
        id_: str = make_uuid4_as_str(),
        source: Species | BooleanLogicGate,
        target: Species | None,
    )

Bases: `CellDesignerModelElement`

KnownOrUnknownModulation(*, id_: str = , source: momapy.celldesigner.core.Species | momapy.celldesigner.core.BooleanLogicGate, target: momapy.celldesigner.core.Species | None)

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 | `'dc7bf002-b179-4561-9da6-7404b1f204fc'`
`source` | `Species | BooleanLogicGate` | The source of the influence | required
`target` | `Species | None` | The target of the influence | required

### `` KnownOrUnknownModulator `dataclass`

    KnownOrUnknownModulator(
        *,
        id_: str = make_uuid4_as_str(),
        name: str | None = None,
        sbo_term: SBOTerm | None = None,
        metaid: str | None = None,
        referred_species: Species | BooleanLogicGate,
    )

Bases: `ModifierSpeciesReference`, `CellDesignerModelElement`

Base class for know or unknown modulators

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 | `'e4212179-562f-47df-bbba-9a6544464d67'`
`name` | `str | None` |  | `None`
`sbo_term` | `SBOTerm | None` |  | `None`
`metaid` | `str | None` |  | `None`
`referred_species` | `Species | BooleanLogicGate` | The species the modifier refers to | required

### `` KnownTransitionOmitted `dataclass`

    KnownTransitionOmitted(
        *,
        id_: str = make_uuid4_as_str(),
        name: str | None = None,
        sbo_term: SBOTerm | None = None,
        metaid: str | None = None,
        reversible: bool,
        compartment: Compartment | None = None,
        reactants: frozenset[Reactant] = frozenset(),
        products: frozenset[Product] = frozenset(),
        modifiers: frozenset[
            KnownOrUnknownModulator
        ] = frozenset(),
    )

Bases: `Reaction`

Class for known transitions omitted

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 | `'5df9caff-50a6-42ce-aea8-037fdcab5655'`
`name` | `str | None` |  | `None`
`sbo_term` | `SBOTerm | None` |  | `None`
`metaid` | `str | None` |  | `None`
`reversible` | `bool` |  | required
`compartment` | `Compartment | None` |  | `None`
`reactants` | `frozenset[Reactant]` | The reactants of the reaction | `<class 'frozenset'>`
`products` | `frozenset[Product]` | The products of the reaction | `<class 'frozenset'>`
`modifiers` | `frozenset[KnownOrUnknownModulator]` | The modifiers of the reaction | `<class 'frozenset'>`

### `` KnownTransitionOmittedLayout `dataclass`

    KnownTransitionOmittedLayout(
        *,
        _left_connector_fraction: float = 0.4,
        _right_connector_fraction: float = 0.6,
        reaction_node_height: float = 10.0,
        reaction_node_width: float = 10.0,
        reaction_node_segment: int = 1,
        reaction_node_stroke: NoneValueType
        | Color
        | None = black,
        reaction_node_stroke_width: float | None = 1.0,
        reaction_node_stroke_dasharray: NoneValueType
        | tuple[float]
        | None = None,
        reaction_node_stroke_dashoffset: float | None = None,
        reaction_node_fill: NoneValueType
        | Color
        | None = white,
        reaction_node_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        reaction_node_filter: 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,
        end_shorten: float = 2.0,
        fill: NoneValueType | Color | None = None,
        filter: NoneValueType | Filter | None = None,
        path_fill: NoneValueType | Color | None = NoneValue,
        path_filter: NoneValueType | Filter | None = None,
        path_stroke: NoneValueType | Color | None = black,
        path_stroke_dasharray: tuple[float, ...] | None = None,
        path_stroke_dashoffset: float | None = None,
        path_stroke_width: float | None = 1.0,
        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 = 2.0,
        target: LayoutElement | None = None,
        transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        end_arrowhead_fill: NoneValueType
        | Color
        | None = black,
        end_arrowhead_filter: NoneValueType
        | Filter
        | None = None,
        end_arrowhead_stroke: NoneValueType
        | Color
        | None = black,
        end_arrowhead_stroke_dasharray: NoneValueType
        | tuple[float]
        | None = None,
        end_arrowhead_stroke_dashoffset: float | None = None,
        end_arrowhead_stroke_width: float | None = 1.0,
        end_arrowhead_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        start_arrowhead_fill: NoneValueType
        | Color
        | None = black,
        start_arrowhead_filter: NoneValueType
        | Filter
        | None = None,
        start_arrowhead_stroke: NoneValueType
        | Color
        | None = black,
        start_arrowhead_stroke_dasharray: NoneValueType
        | tuple[float]
        | None = None,
        start_arrowhead_stroke_dashoffset: float | None = None,
        start_arrowhead_stroke_width: float | None = 1.0,
        start_arrowhead_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        reversible: bool = False,
        end_arrowhead_height: float = 8.0,
        end_arrowhead_width: float = 15.0,
        start_arrowhead_height: float = 8.0,
        start_arrowhead_width: float = 15.0,
    )

Bases: `_ReactionLayout`, `_ReactionNodeMixin`

Class for known transition omitted layouts

Parameters:

Name | Type | Description | Default
--- | --- | --- | ---
`reaction_node_height` | `float` |  | `10.0`
`reaction_node_width` | `float` |  | `10.0`
`reaction_node_segment` | `int` |  | `1`
`reaction_node_stroke` | `NoneValueType | Color | None` |  | `Color(red=0, green=0, blue=0, alpha=1.0)`
`reaction_node_stroke_width` | `float | None` |  | `1.0`
`reaction_node_stroke_dasharray` | `NoneValueType | tuple[float] | None` |  | `None`
`reaction_node_stroke_dashoffset` | `float | None` |  | `None`
`reaction_node_fill` | `NoneValueType | Color | None` |  | `Color(red=255, green=255, blue=255, alpha=1.0)`
`reaction_node_transform` | `NoneValueType | tuple[Transformation] | None` |  | `None`
`reaction_node_filter` | `NoneValueType | Filter | None` |  | `None`
`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 | `'f33ae73a-a5a3-4370-a0cb-842555768504'`
`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` |  | `2.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.0`
`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` |  | `2.0`
`target` | `LayoutElement | None` | The target of the arc | `None`
`transform` | `NoneValueType | tuple[Transformation] | None` | The transform of the arc | `None`
`end_arrowhead_fill` | `NoneValueType | Color | None` |  | `Color(red=0, green=0, blue=0, alpha=1.0)`
`end_arrowhead_filter` | `NoneValueType | Filter | None` |  | `None`
`end_arrowhead_stroke` | `NoneValueType | Color | None` |  | `Color(red=0, green=0, blue=0, alpha=1.0)`
`end_arrowhead_stroke_dasharray` | `NoneValueType | tuple[float] | None` |  | `None`
`end_arrowhead_stroke_dashoffset` | `float | None` |  | `None`
`end_arrowhead_stroke_width` | `float | None` |  | `1.0`
`end_arrowhead_transform` | `NoneValueType | tuple[Transformation] | None` |  | `None`
`start_arrowhead_fill` | `NoneValueType | Color | None` |  | `Color(red=0, green=0, blue=0, alpha=1.0)`
`start_arrowhead_filter` | `NoneValueType | Filter | None` |  | `None`
`start_arrowhead_stroke` | `NoneValueType | Color | None` |  | `Color(red=0, green=0, blue=0, alpha=1.0)`
`start_arrowhead_stroke_dasharray` | `NoneValueType | tuple[float] | None` |  | `None`
`start_arrowhead_stroke_dashoffset` | `float | None` |  | `None`
`start_arrowhead_stroke_width` | `float | None` |  | `1.0`
`start_arrowhead_transform` | `NoneValueType | tuple[Transformation] | None` |  | `None`
`reversible` | `bool` |  | `False`
`end_arrowhead_height` | `float` |  | `8.0`
`end_arrowhead_width` | `float` |  | `15.0`
`start_arrowhead_height` | `float` |  | `8.0`
`start_arrowhead_width` | `float` |  | `15.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
`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_arrowhead_base` | Return the base anchor point of the double-headed arc end arrowhead
`end_arrowhead_bbox` | Return the bounding box of the double-headed arc start arrowhead
`end_arrowhead_border` | Return the point at the intersection of the drawing elements of the double-headed arc end arrowhead and the line going through the center of these drawing elements and the given point.
`end_arrowhead_length` | Return the length of the double-headed arc end arrowhead
`end_arrowhead_tip` | Return the tip anchor point of the double-headed arc end arrowhead
`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 double-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 double-headed arc. These include the drawing elements of the arc path, the start arrowhead, and the end arrowhead
`self_to_shapely` | Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout
`start_arrowhead_base` | Return the base anchor point of the double-headed arc start arrowhead
`start_arrowhead_bbox` | Return the bounding box of the double-headed arc start arrowhead
`start_arrowhead_border` | Return the point at the intersection of the drawing elements of the double-headed arc start arrowhead and the line going through the center of these drawing elements and the given point.
`start_arrowhead_drawing_elements` | Return the drawing elements of the double-headed arc start arrowhead
`start_arrowhead_length` | Return the length of the double-headed arc start arrowhead
`start_arrowhead_tip` | Return the tip anchor point of the double-headed arc start arrowhead
`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)()

#### `` 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_arrowhead_base

    end_arrowhead_base() -> Point

Return the base anchor point of the double-headed arc end arrowhead

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

    1333
    1334
    1335
    1336
    1337
    1338
    1339
    1340
    1341
    1342
    1343
    def end_arrowhead_base(self) -> momapy.geometry.Point:
        """Return the base anchor point of the double-headed arc end arrowhead"""
        arrowhead_length = self.end_arrowhead_length()
        if arrowhead_length == 0:
            return self.end_point()
        segment = self.segments[-1]
        segment_length = segment.length()
        if segment_length == 0:
            return self.end_arrowhead_tip() - (arrowhead_length, 0)
        fraction = 1 - (arrowhead_length + self.end_shorten) / segment_length
        return segment.get_position_at_fraction(fraction)

#### `` end_arrowhead_bbox

    end_arrowhead_bbox()

Return the bounding box of the double-headed arc start arrowhead

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

    1345
    1346
    1347
    1348
    1349
    def end_arrowhead_bbox(self):
        """Return the bounding box of the double-headed arc start arrowhead"""
        return momapy.drawing.get_drawing_elements_bbox(
            self.end_arrowhead_drawing_elements()
        )

#### `` end_arrowhead_border

    end_arrowhead_border(point)

Return the point at the intersection of the drawing elements of the double-headed arc end 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`

    1351
    1352
    1353
    1354
    1355
    1356
    1357
    1358
    1359
    1360
    1361
    def end_arrowhead_border(self, point):
        """Return the point at the intersection of the drawing elements of the double-headed arc end 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.end_arrowhead_drawing_elements(), point
        )
        if point.isnan():
            return self.end_arrowhead_tip()
        return point

#### `` end_arrowhead_length

    end_arrowhead_length() -> float

Return the length of the double-headed arc end arrowhead

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

    1315
    1316
    1317
    1318
    1319
    1320
    1321
    1322
    def end_arrowhead_length(self) -> float:
        """Return the length of the double-headed arc end arrowhead"""
        bbox = momapy.drawing.get_drawing_elements_bbox(
            self._end_arrowhead_border_drawing_elements()
        )
        if math.isnan(bbox.width):
            return 0.0
        return bbox.east().x

#### `` end_arrowhead_tip

    end_arrowhead_tip() -> Point

Return the tip anchor point of the double-headed arc end arrowhead

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

    1324
    1325
    1326
    1327
    1328
    1329
    1330
    1331
    def end_arrowhead_tip(self) -> momapy.geometry.Point:
        """Return the tip anchor point of the double-headed arc end arrowhead"""
        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)

#### `` 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 double-headed arc path

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

    1451
    1452
    1453
    1454
    1455
    1456
    1457
    1458
    1459
    1460
    1461
    1462
    1463
    1464
    1465
    1466
    1467
    1468
    1469
    1470
    1471
    1472
    1473
    1474
    1475
    1476
    1477
    1478
    1479
    1480
    1481
    1482
    1483
    1484
    1485
    1486
    1487
    1488
    1489
    1490
    1491
    1492
    def path_drawing_elements(self) -> list[momapy.drawing.Path]:
        """Return the drawing elements of the double-headed arc path"""
        start_arrowhead_length = self.start_arrowhead_length()
        end_arrowhead_length = self.end_arrowhead_length()
        if len(self.segments) == 1:
            segment = (
                self.segments[0]
                .shortened(self.start_shorten + start_arrowhead_length, "start")
                .shortened(self.end_shorten + end_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_arrowhead_length, "start"
            )
            last_segment = self.segments[-1].shortened(
                self.end_shorten + end_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()

Return the self drawing elements of the double-headed arc. These include the drawing elements of the arc path, the start arrowhead, and the end arrowhead

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

    782
    783
    784
    785
    786
    787
    788
    789
    790
    791
    792
    793
    794
    795
    def self_drawing_elements(self):
        drawing_elements = momapy.builder.super_or_builder(
            CellDesignerDoubleHeadedArc, self
        ).self_drawing_elements()
        done_bases = []
        for base in type(self).__mro__:
            if (
                momapy.builder.issubclass_or_builder(base, momapy.sbgn.core._SBGNMixin)
                and base is not type(self)
                and not any([issubclass(done_base, base) for done_base in done_bases])
            ):
                drawing_elements += getattr(base, "_mixin_drawing_elements")(self)
                done_bases.append(base)
        return drawing_elements

#### `` 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_arrowhead_base

    start_arrowhead_base() -> Point

Return the base anchor point of the double-headed arc start arrowhead

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

    1285
    1286
    1287
    1288
    1289
    1290
    1291
    1292
    1293
    1294
    1295
    1296
    def start_arrowhead_base(self) -> momapy.geometry.Point:
        """Return the base anchor point of the double-headed arc start arrowhead"""
        arrowhead_length = self.start_arrowhead_length()
        if arrowhead_length == 0:
            return self.start_point()
        segment = self.segments[0]
        segment = momapy.geometry.Segment(segment.p2, segment.p1)
        segment_length = segment.length()
        if segment_length == 0:
            return self.start_arrowhead_tip() + (arrowhead_length, 0)
        fraction = 1 - (arrowhead_length + self.start_shorten) / segment_length
        return segment.get_position_at_fraction(fraction)

#### `` start_arrowhead_bbox

    start_arrowhead_bbox() -> Bbox

Return the bounding box of the double-headed arc start arrowhead

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

    1298
    1299
    1300
    1301
    1302
    def start_arrowhead_bbox(self) -> momapy.geometry.Bbox:
        """Return the bounding box of the double-headed arc start arrowhead"""
        return momapy.drawing.get_drawing_elements_bbox(
            self.start_arrowhead_drawing_elements()
        )

#### `` start_arrowhead_border

    start_arrowhead_border(point) -> Point

Return the point at the intersection of the drawing elements of the double-headed arc start 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`

    1304
    1305
    1306
    1307
    1308
    1309
    1310
    1311
    1312
    1313
    def start_arrowhead_border(self, point) -> momapy.geometry.Point:
        """Return the point at the intersection of the drawing elements of the double-headed arc start 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.start_arrowhead_drawing_elements(), point
        )
        if point.isnan():
            return self.start_arrowhead_tip()
        return point

#### `` start_arrowhead_drawing_elements

    start_arrowhead_drawing_elements() -> list[DrawingElement]

Return the drawing elements of the double-headed arc start arrowhead

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

    1394
    1395
    1396
    1397
    1398
    1399
    1400
    1401
    1402
    1403
    1404
    1405
    1406
    1407
    1408
    1409
    1410
    1411
    1412
    1413
    def start_arrowhead_drawing_elements(
        self,
    ) -> list[momapy.drawing.DrawingElement]:
        """Return the drawing elements of the double-headed arc start arrowhead"""
        drawing_elements = self._start_arrowhead_border_drawing_elements()
        group = momapy.drawing.Group(
            class_=f"{type(self).__name__}_start_arrowhead",
            elements=tuple(drawing_elements),
            id_=f"{self.id_}_start_arrowhead",
            fill=self.start_arrowhead_fill,
            filter=self.start_arrowhead_filter,
            stroke=self.start_arrowhead_stroke,
            stroke_dasharray=self.start_arrowhead_stroke_dasharray,
            stroke_dashoffset=self.start_arrowhead_stroke_dashoffset,
            stroke_width=self.start_arrowhead_stroke_width,
            transform=self.start_arrowhead_transform,
        )
        transformation = self._get_start_arrowhead_transformation()
        group = group.transformed(transformation)
        return [group]

#### `` start_arrowhead_length

    start_arrowhead_length() -> float

Return the length of the double-headed arc start arrowhead

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

    1266
    1267
    1268
    1269
    1270
    1271
    1272
    1273
    def start_arrowhead_length(self) -> float:
        """Return the length of the double-headed arc start arrowhead"""
        bbox = momapy.drawing.get_drawing_elements_bbox(
            self._start_arrowhead_border_drawing_elements()
        )
        if math.isnan(bbox.width):
            return 0.0
        return abs(bbox.west().x)

#### `` start_arrowhead_tip

    start_arrowhead_tip() -> Point

Return the tip anchor point of the double-headed arc start arrowhead

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

    1275
    1276
    1277
    1278
    1279
    1280
    1281
    1282
    1283
    def start_arrowhead_tip(self) -> momapy.geometry.Point:
        """Return the tip anchor point of the double-headed arc start arrowhead"""
        segment = self.segments[0]
        segment = momapy.geometry.Segment(segment.p2, segment.p1)
        segment_length = segment.length()
        if segment_length == 0:
            return segment.p2
        fraction = 1 - self.start_shorten / segment_length
        return segment.get_position_at_fraction(fraction)

#### `` 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(
        *,
        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_fill: NoneValueType | Color | None = NoneValue,
        path_filter: NoneValueType | Filter | None = None,
        path_stroke: NoneValueType | Color | None = black,
        path_stroke_dasharray: tuple[float, ...] | None = None,
        path_stroke_dashoffset: float | None = None,
        path_stroke_width: float | None = 1.0,
        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 = None,
        arrowhead_filter: NoneValueType | Filter | None = None,
        arrowhead_stroke: NoneValueType | Color | None = black,
        arrowhead_stroke_dasharray: tuple[float, ...]
        | None = None,
        arrowhead_stroke_dashoffset: float | None = None,
        arrowhead_stroke_width: float | None = 1.0,
        arrowhead_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
    )

Bases: `CellDesignerSingleHeadedArc`

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 | `'6b1cd81c-f2de-4114-964a-d68dfff7c490'`
`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.0`
`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` | The arrowhead fill color of the arc | `None`
`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.0`
`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()

Return the self drawing elements of the single-headed arc

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

    754
    755
    756
    757
    758
    759
    760
    761
    762
    763
    764
    765
    766
    767
    def self_drawing_elements(self):
        drawing_elements = momapy.builder.super_or_builder(
            CellDesignerSingleHeadedArc, self
        ).self_drawing_elements()
        done_bases = []
        for base in type(self).__mro__:
            if (
                momapy.builder.issubclass_or_builder(base, momapy.sbgn.core._SBGNMixin)
                and base is not type(self)
                and not any([issubclass(done_base, base) for done_base in done_bases])
            ):
                drawing_elements += getattr(base, "_mixin_drawing_elements")(self)
                done_bases.append(base)
        return drawing_elements

#### `` 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)

### `` Modification `dataclass`

    Modification(
        *,
        id_: str = make_uuid4_as_str(),
        residue: ModificationResidue
        | ModificationSite
        | None = None,
        state: ModificationState | None = None,
    )

Bases: `CellDesignerModelElement`

Class for modifications

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 | `'640139cc-5c2f-41e6-999f-dc766f2b1e93'`
`residue` | `ModificationResidue | ModificationSite | None` | The residue of the modification | `None`
`state` | `ModificationState | None` | The state of the modification | `None`

### `` ModificationLayout `dataclass`

    ModificationLayout(
        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 = 16.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 = 16.0,
        active: bool = False,
        active_fill: NoneValueType | Color | None = NoneValue,
        active_filter: NoneValueType | Filter | None = None,
        active_sep: float = 4.0,
        active_stroke: NoneValueType | Color | None = black,
        active_stroke_dasharray: NoneValueType
        | tuple[float]
        | None = (4, 2),
        active_stroke_dashoffset: float | None = None,
        active_stroke_width: float | None = 1.0,
        active_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
    )

Bases: `_SimpleNodeMixin`, `CellDesignerNode`

Class for modification 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 | `'afc9dc5b-30ea-4729-86d3-3a72ce526459'`
`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` |  | `16.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` |  | `16.0`
`active` | `bool` |  | `False`
`active_fill` | `NoneValueType | Color | None` |  | `<momapy.drawing.NoneValueType object at 0x7fb32ae9f1d0>`
`active_filter` | `NoneValueType | Filter | None` |  | `None`
`active_sep` | `float` |  | `4.0`
`active_stroke` | `NoneValueType | Color | None` |  | `Color(red=0, green=0, blue=0, alpha=1.0)`
`active_stroke_dasharray` | `NoneValueType | tuple[float] | None` |  | `(4, 2)`
`active_stroke_dashoffset` | `float | None` |  | `None`
`active_stroke_width` | `float | None` |  | `1.0`
`active_transform` | `NoneValueType | tuple[Transformation] | 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
`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

### `` ModificationResidue `dataclass`

    ModificationResidue(
        *,
        id_: str = make_uuid4_as_str(),
        name: str | None = None,
        order: int | None = None,
    )

Bases: `CellDesignerModelElement`

Class for modification residues

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 | `'8d7e2180-c116-4b7d-b334-a2f7c73c29c2'`
`name` | `str | None` |  | `None`
`order` | `int | None` |  | `None`

### `` ModificationSite `dataclass`

    ModificationSite(
        *,
        id_: str = make_uuid4_as_str(),
        name: str | None = None,
        active: bool = False,
    )

Bases: `Region`

Class for modification sites

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 | `'565288e5-bed9-4a00-9e20-abfd6acd70cb'`
`name` | `str | None` | The name of the region | `None`
`active` | `bool` | Whether the region is active or not | `False`

### `` ModificationState

Bases: `Enum`

Class for modification states

### `` Modulation `dataclass`

    Modulation(
        *,
        id_: str = make_uuid4_as_str(),
        source: Species | BooleanLogicGate,
        target: Species | None,
    )

Bases: `KnownOrUnknownModulation`

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 | `'bb103d5e-b6f4-496b-a77e-84727fe9f99c'`
`source` | `Species | BooleanLogicGate` | The source of the influence | required
`target` | `Species | None` | The target of the influence | required

### `` ModulationLayout `dataclass`

    ModulationLayout(
        *,
        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_fill: NoneValueType | Color | None = NoneValue,
        path_filter: NoneValueType | Filter | None = None,
        path_stroke: NoneValueType | Color | None = black,
        path_stroke_dasharray: tuple[float, ...] | None = None,
        path_stroke_dashoffset: float | None = None,
        path_stroke_width: float | None = 1.0,
        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: NoneValueType | Color | None = black,
        arrowhead_stroke_dasharray: tuple[float, ...]
        | None = None,
        arrowhead_stroke_dashoffset: float | None = None,
        arrowhead_stroke_width: float | None = 1.0,
        arrowhead_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        arrowhead_height: float = 8.0,
        arrowhead_width: float = 15.0,
    )

Bases: `CellDesignerSingleHeadedArc`

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 | `'3b36bed2-220f-4971-9a64-d4b9e5c69372'`
`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.0`
`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.0`
`arrowhead_transform` | `NoneValueType | tuple[Transformation] | None` | The arrowhead transform of the arc | `None`
`arrowhead_height` | `float` |  | `8.0`
`arrowhead_width` | `float` |  | `15.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()

Return the self drawing elements of the single-headed arc

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

    754
    755
    756
    757
    758
    759
    760
    761
    762
    763
    764
    765
    766
    767
    def self_drawing_elements(self):
        drawing_elements = momapy.builder.super_or_builder(
            CellDesignerSingleHeadedArc, self
        ).self_drawing_elements()
        done_bases = []
        for base in type(self).__mro__:
            if (
                momapy.builder.issubclass_or_builder(base, momapy.sbgn.core._SBGNMixin)
                and base is not type(self)
                and not any([issubclass(done_base, base) for done_base in done_bases])
            ):
                drawing_elements += getattr(base, "_mixin_drawing_elements")(self)
                done_bases.append(base)
        return drawing_elements

#### `` 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)

### `` Modulator `dataclass`

    Modulator(
        *,
        id_: str = make_uuid4_as_str(),
        name: str | None = None,
        sbo_term: SBOTerm | None = None,
        metaid: str | None = None,
        referred_species: Species | BooleanLogicGate,
    )

Bases: `KnownOrUnknownModulator`

Class for modulators

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 | `'9ab8c166-13f3-4576-a657-a1f56b8dc0da'`
`name` | `str | None` |  | `None`
`sbo_term` | `SBOTerm | None` |  | `None`
`metaid` | `str | None` |  | `None`
`referred_species` | `Species | BooleanLogicGate` | The species the modifier refers to | required

### `` NegativeInfluence `dataclass`

    NegativeInfluence(
        *,
        id_: str = make_uuid4_as_str(),
        source: Species | BooleanLogicGate,
        target: Species | None,
    )

Bases: `Modulation`

Class for negative influences

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 | `'5631ae4b-61b0-491b-b05a-b78164500827'`
`source` | `Species | BooleanLogicGate` | The source of the influence | required
`target` | `Species | None` | The target of the influence | required

### `` NotGate `dataclass`

    NotGate(
        *,
        id_: str = make_uuid4_as_str(),
        inputs: frozenset[Species] = frozenset(),
    )

Bases: `BooleanLogicGate`

Class for not gates

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 | `'4e3f1fb7-6b16-49eb-8dfe-8afa047d77f5'`
`inputs` | `frozenset[Species]` | The inputs of the Boolean logic gate | `<class 'frozenset'>`

### `` NotGateLayout `dataclass`

    NotGateLayout(
        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 = 15.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 = 15.0,
        active: bool = False,
        active_fill: NoneValueType | Color | None = NoneValue,
        active_filter: NoneValueType | Filter | None = None,
        active_sep: float = 4.0,
        active_stroke: NoneValueType | Color | None = black,
        active_stroke_dasharray: NoneValueType
        | tuple[float]
        | None = (4, 2),
        active_stroke_dashoffset: float | None = None,
        active_stroke_width: float | None = 1.0,
        active_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
    )

Bases: `_SimpleNodeMixin`, `_TextMixin`, `CellDesignerNode`

Class for not gate 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 | `'d298cb6c-b7c6-44de-b3b0-acacb74aadad'`
`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` |  | `15.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` |  | `15.0`
`active` | `bool` |  | `False`
`active_fill` | `NoneValueType | Color | None` |  | `<momapy.drawing.NoneValueType object at 0x7fb32ae9f1d0>`
`active_filter` | `NoneValueType | Filter | None` |  | `None`
`active_sep` | `float` |  | `4.0`
`active_stroke` | `NoneValueType | Color | None` |  | `Color(red=0, green=0, blue=0, alpha=1.0)`
`active_stroke_dasharray` | `NoneValueType | tuple[float] | None` |  | `(4, 2)`
`active_stroke_dashoffset` | `float | None` |  | `None`
`active_stroke_width` | `float | None` |  | `1.0`
`active_transform` | `NoneValueType | tuple[Transformation] | 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
`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

### `` OrGate `dataclass`

    OrGate(
        *,
        id_: str = make_uuid4_as_str(),
        inputs: frozenset[Species] = frozenset(),
    )

Bases: `BooleanLogicGate`

Class for or gates

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 | `'2f633a7e-b995-4fd9-a6d9-05e1b2cbefe3'`
`inputs` | `frozenset[Species]` | The inputs of the Boolean logic gate | `<class 'frozenset'>`

### `` OrGateLayout `dataclass`

    OrGateLayout(
        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 = 15.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 = 15.0,
        active: bool = False,
        active_fill: NoneValueType | Color | None = NoneValue,
        active_filter: NoneValueType | Filter | None = None,
        active_sep: float = 4.0,
        active_stroke: NoneValueType | Color | None = black,
        active_stroke_dasharray: NoneValueType
        | tuple[float]
        | None = (4, 2),
        active_stroke_dashoffset: float | None = None,
        active_stroke_width: float | None = 1.0,
        active_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
    )

Bases: `_SimpleNodeMixin`, `_TextMixin`, `CellDesignerNode`

Class for or gate 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 | `'222fef74-664a-4e7d-9b1f-c0fd1a3de156'`
`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` |  | `15.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` |  | `15.0`
`active` | `bool` |  | `False`
`active_fill` | `NoneValueType | Color | None` |  | `<momapy.drawing.NoneValueType object at 0x7fb32ae9f1d0>`
`active_filter` | `NoneValueType | Filter | None` |  | `None`
`active_sep` | `float` |  | `4.0`
`active_stroke` | `NoneValueType | Color | None` |  | `Color(red=0, green=0, blue=0, alpha=1.0)`
`active_stroke_dasharray` | `NoneValueType | tuple[float] | None` |  | `(4, 2)`
`active_stroke_dashoffset` | `float | None` |  | `None`
`active_stroke_width` | `float | None` |  | `1.0`
`active_transform` | `NoneValueType | tuple[Transformation] | 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
`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

### `` OvalCompartmentLayout `dataclass`

    OvalCompartmentLayout(
        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 = 16.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 = 16.0,
        active: bool = False,
        active_fill: NoneValueType | Color | None = NoneValue,
        active_filter: NoneValueType | Filter | None = None,
        active_sep: float = 4.0,
        active_stroke: NoneValueType | Color | None = black,
        active_stroke_dasharray: NoneValueType
        | tuple[float]
        | None = (4, 2),
        active_stroke_dashoffset: float | None = None,
        active_stroke_width: float | None = 1.0,
        active_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        inner_fill: NoneValueType | Color | None = white,
        inner_stroke: NoneValueType | Color | None = black,
        inner_stroke_width: float | None = 1.0,
        sep: float = 12.0,
    )

Bases: `_SimpleNodeMixin`, `CellDesignerNode`

Class for oval 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 | `'357c80aa-7ecf-4884-b28c-6268eba313c8'`
`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` |  | `16.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` |  | `16.0`
`active` | `bool` |  | `False`
`active_fill` | `NoneValueType | Color | None` |  | `<momapy.drawing.NoneValueType object at 0x7fb32ae9f1d0>`
`active_filter` | `NoneValueType | Filter | None` |  | `None`
`active_sep` | `float` |  | `4.0`
`active_stroke` | `NoneValueType | Color | None` |  | `Color(red=0, green=0, blue=0, alpha=1.0)`
`active_stroke_dasharray` | `NoneValueType | tuple[float] | None` |  | `(4, 2)`
`active_stroke_dashoffset` | `float | None` |  | `None`
`active_stroke_width` | `float | None` |  | `1.0`
`active_transform` | `NoneValueType | tuple[Transformation] | None` |  | `None`
`inner_fill` | `NoneValueType | Color | None` |  | `Color(red=255, green=255, blue=255, alpha=1.0)`
`inner_stroke` | `NoneValueType | Color | None` |  | `Color(red=0, green=0, blue=0, alpha=1.0)`
`inner_stroke_width` | `float | None` |  | `1.0`
`sep` | `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

### `` Phenotype `dataclass`

    Phenotype(
        *,
        id_: str = make_uuid4_as_str(),
        name: str | None = None,
        sbo_term: SBOTerm | None = None,
        metaid: str | None = None,
        compartment: Compartment | None = None,
        hypothetical: bool = False,
        active: bool = False,
        homomultimer: int = 1,
    )

Bases: `Species`

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 | `'ebdf7d07-552c-47bd-a6c2-14c34b2248a0'`
`name` | `str | None` |  | `None`
`sbo_term` | `SBOTerm | None` |  | `None`
`metaid` | `str | None` |  | `None`
`compartment` | `Compartment | None` |  | `None`
`hypothetical` | `bool` | Whether the species is hypothetical or not | `False`
`active` | `bool` | Whether the species is active or not | `False`
`homomultimer` | `int` | The number of subunits forming the species | `1`

### `` PhenotypeLayout `dataclass`

    PhenotypeLayout(
        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,
        active: bool = False,
        active_fill: NoneValueType | Color | None = NoneValue,
        active_filter: NoneValueType | Filter | None = None,
        active_sep: float = 4.0,
        active_stroke: NoneValueType | Color | None = black,
        active_stroke_dasharray: NoneValueType
        | tuple[float]
        | None = (4, 2),
        active_stroke_dashoffset: float | None = None,
        active_stroke_width: float | None = 1.0,
        active_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        n: int = 1,
        angle: float = 60.0,
    )

Bases: `_MultiNodeMixin`, `CellDesignerNode`

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 | `'719b4aa1-d657-4db2-b1e8-3289710f3634'`
`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`
`active` | `bool` |  | `False`
`active_fill` | `NoneValueType | Color | None` |  | `<momapy.drawing.NoneValueType object at 0x7fb32ae9f1d0>`
`active_filter` | `NoneValueType | Filter | None` |  | `None`
`active_sep` | `float` |  | `4.0`
`active_stroke` | `NoneValueType | Color | None` |  | `Color(red=0, green=0, blue=0, alpha=1.0)`
`active_stroke_dasharray` | `NoneValueType | tuple[float] | None` |  | `(4, 2)`
`active_stroke_dashoffset` | `float | None` |  | `None`
`active_stroke_width` | `float | None` |  | `1.0`
`active_transform` | `NoneValueType | tuple[Transformation] | None` |  | `None`
`n` | `int` |  | `1`
`angle` | `float` |  | `60.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
`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 = 60.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/celldesigner/core.py`

    1240
    1241
    1242
    1243
    1244
    1245
    1246
    1247
    1248
    def east(self) -> momapy.geometry.Point:
        width = self.width - self.offset * (self._n - 1)
        height = self.height - self.offset * (self._n - 1)
        position = self.position + (
            self.width / 2 - width / 2,
            self.height / 2 - height / 2,
        )
        shape = self._make_subunit_shape(position, width, height)
        return shape.joint3()

#### `` east_north_east

    east_north_east() -> Point

Return the east north east anchor of the node

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

    1230
    1231
    1232
    1233
    1234
    1235
    1236
    1237
    1238
    def east_north_east(self) -> momapy.geometry.Point:
        width = self.width - self.offset * (self._n - 1)
        height = self.height - self.offset * (self._n - 1)
        position = self.position + (
            self.width / 2 - width / 2,
            self.height / 2 - height / 2,
        )
        shape = self._make_subunit_shape(position, width, height)
        return shape.joint3() / 2 + shape.joint2() / 2

#### `` east_south_east

    east_south_east() -> Point

Return the east south east west anchor of the node

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

    1250
    1251
    1252
    1253
    1254
    1255
    1256
    1257
    1258
    def east_south_east(self) -> momapy.geometry.Point:
        width = self.width - self.offset * (self._n - 1)
        height = self.height - self.offset * (self._n - 1)
        position = self.position + (
            self.width / 2 - width / 2,
            self.height / 2 - height / 2,
        )
        shape = self._make_subunit_shape(position, width, height)
        return shape.joint4() / 2 + shape.joint3() / 2

#### `` 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/celldesigner/core.py`

    1200
    1201
    1202
    1203
    1204
    1205
    1206
    1207
    1208
    def north(self) -> momapy.geometry.Point:
        width = self.width - self.offset * (self._n - 1)
        height = self.height - self.offset * (self._n - 1)
        position = self.position + (
            self.width / 2 - width / 2,
            self.height / 2 - height / 2,
        )
        shape = self._make_subunit_shape(position, width, height)
        return shape.joint1() / 2 + shape.joint2() / 2

#### `` north_east

    north_east() -> Point

Return the north east anchor of the node

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

    1220
    1221
    1222
    1223
    1224
    1225
    1226
    1227
    1228
    def north_east(self) -> momapy.geometry.Point:
        width = self.width - self.offset * (self._n - 1)
        height = self.height - self.offset * (self._n - 1)
        position = self.position + (
            self.width / 2 - width / 2,
            self.height / 2 - height / 2,
        )
        shape = self._make_subunit_shape(position, width, height)
        return shape.joint2()

#### `` north_north_east

    north_north_east() -> Point

Return the north north east anchor of the node

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

    1210
    1211
    1212
    1213
    1214
    1215
    1216
    1217
    1218
    def north_north_east(self) -> momapy.geometry.Point:
        width = self.width - self.offset * (self._n - 1)
        height = self.height - self.offset * (self._n - 1)
        position = self.position + (
            self.width / 2 - width / 2,
            self.height / 2 - height / 2,
        )
        shape = self._make_subunit_shape(position, width, height)
        return shape.joint1() * 0.25 + shape.joint2() * 0.75

#### `` north_north_west

    north_north_west() -> Point

Return the north north west anchor of the node

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

    1190
    1191
    1192
    1193
    1194
    1195
    1196
    1197
    1198
    def north_north_west(self) -> momapy.geometry.Point:
        width = self.width - self.offset * (self._n - 1)
        height = self.height - self.offset * (self._n - 1)
        position = self.position + (
            self.width / 2 - width / 2,
            self.height / 2 - height / 2,
        )
        shape = self._make_subunit_shape(position, width, height)
        return shape.joint1() * 0.75 + shape.joint2() * 0.25

#### `` north_west

    north_west() -> Point

Return the north west anchor of the node

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

    1180
    1181
    1182
    1183
    1184
    1185
    1186
    1187
    1188
    def north_west(self) -> momapy.geometry.Point:
        width = self.width - self.offset * (self._n - 1)
        height = self.height - self.offset * (self._n - 1)
        position = self.position + (
            self.width / 2 - width / 2,
            self.height / 2 - height / 2,
        )
        shape = self._make_subunit_shape(position, width, height)
        return shape.joint1()

#### `` 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/celldesigner/core.py`

    1280
    1281
    1282
    1283
    1284
    1285
    1286
    1287
    1288
    def south(self) -> momapy.geometry.Point:
        width = self.width - self.offset * (self._n - 1)
        height = self.height - self.offset * (self._n - 1)
        position = self.position + (
            self.width / 2 - width / 2,
            self.height / 2 - height / 2,
        )
        shape = self._make_subunit_shape(position, width, height)
        return shape.joint5() / 2 + shape.joint4() / 2

#### `` south_east

    south_east() -> Point

Return the south east anchor of the node

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

    1260
    1261
    1262
    1263
    1264
    1265
    1266
    1267
    1268
    def south_east(self) -> momapy.geometry.Point:
        width = self.width - self.offset * (self._n - 1)
        height = self.height - self.offset * (self._n - 1)
        position = self.position + (
            self.width / 2 - width / 2,
            self.height / 2 - height / 2,
        )
        shape = self._make_subunit_shape(position, width, height)
        return shape.joint4()

#### `` south_south_east

    south_south_east() -> Point

Return the south south east anchor of the node

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

    1270
    1271
    1272
    1273
    1274
    1275
    1276
    1277
    1278
    def south_south_east(self) -> momapy.geometry.Point:
        width = self.width - self.offset * (self._n - 1)
        height = self.height - self.offset * (self._n - 1)
        position = self.position + (
            self.width / 2 - width / 2,
            self.height / 2 - height / 2,
        )
        shape = self._make_subunit_shape(position, width, height)
        return shape.joint5() * 0.25 + shape.joint4() * 0.75

#### `` south_south_west

    south_south_west() -> Point

Return the south south west anchor of the node

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

    1290
    1291
    1292
    1293
    1294
    1295
    1296
    1297
    1298
    def south_south_west(self) -> momapy.geometry.Point:
        width = self.width - self.offset * (self._n - 1)
        height = self.height - self.offset * (self._n - 1)
        position = self.position + (
            self.width / 2 - width / 2,
            self.height / 2 - height / 2,
        )
        shape = self._make_subunit_shape(position, width, height)
        return shape.joint5() * 0.75 + shape.joint4() * 0.25

#### `` south_west

    south_west() -> Point

Return the south west anchor of the node

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

    1300
    1301
    1302
    1303
    1304
    1305
    1306
    1307
    1308
    def south_west(self) -> momapy.geometry.Point:
        width = self.width - self.offset * (self._n - 1)
        height = self.height - self.offset * (self._n - 1)
        position = self.position + (
            self.width / 2 - width / 2,
            self.height / 2 - height / 2,
        )
        shape = self._make_subunit_shape(position, width, height)
        return shape.joint5()

#### `` 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/celldesigner/core.py`

    1320
    1321
    1322
    1323
    1324
    1325
    1326
    1327
    1328
    def west(self) -> momapy.geometry.Point:
        width = self.width - self.offset * (self._n - 1)
        height = self.height - self.offset * (self._n - 1)
        position = self.position + (
            self.width / 2 - width / 2,
            self.height / 2 - height / 2,
        )
        shape = self._make_subunit_shape(position, width, height)
        return shape.joint6()

#### `` west_north_west

    west_north_west() -> Point

Return the west north west anchor of the node

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

    1330
    1331
    1332
    1333
    1334
    1335
    1336
    1337
    1338
    def west_north_west(self) -> momapy.geometry.Point:
        width = self.width - self.offset * (self._n - 1)
        height = self.height - self.offset * (self._n - 1)
        position = self.position + (
            self.width / 2 - width / 2,
            self.height / 2 - height / 2,
        )
        shape = self._make_subunit_shape(position, width, height)
        return shape.joint6() / 2 + shape.joint1() / 2

#### `` west_south_west

    west_south_west() -> Point

Return the west south west anchor of the node

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

    1310
    1311
    1312
    1313
    1314
    1315
    1316
    1317
    1318
    def west_south_west(self) -> momapy.geometry.Point:
        width = self.width - self.offset * (self._n - 1)
        height = self.height - self.offset * (self._n - 1)
        position = self.position + (
            self.width / 2 - width / 2,
            self.height / 2 - height / 2,
        )
        shape = self._make_subunit_shape(position, width, height)
        return shape.joint6() / 2 + shape.joint5() / 2

#### `` x `property`

    x: float

Return the x coordinate of the node

#### `` y `property`

    y: float

Return the y coordinate of the node

### `` PhysicalStimulation `dataclass`

    PhysicalStimulation(
        *,
        id_: str = make_uuid4_as_str(),
        source: Species | BooleanLogicGate,
        target: Species | None,
    )

Bases: `Modulation`

Class for physical 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 | `'9aeab4ef-6aaf-47f3-8037-4b35ac166f1a'`
`source` | `Species | BooleanLogicGate` | The source of the influence | required
`target` | `Species | None` | The target of the influence | required

### `` PhysicalStimulationLayout `dataclass`

    PhysicalStimulationLayout(
        *,
        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_fill: NoneValueType | Color | None = NoneValue,
        path_filter: NoneValueType | Filter | None = None,
        path_stroke: NoneValueType | Color | None = black,
        path_stroke_dasharray: tuple[float, ...] | None = None,
        path_stroke_dashoffset: float | None = None,
        path_stroke_width: float | None = 1.0,
        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: NoneValueType | Color | None = black,
        arrowhead_stroke_dasharray: tuple[float, ...]
        | None = None,
        arrowhead_stroke_dashoffset: float | None = None,
        arrowhead_stroke_width: float | None = 1.0,
        arrowhead_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        arrowhead_height: float = 10.0,
        arrowhead_width: float = 10.0,
    )

Bases: `CellDesignerSingleHeadedArc`

Class for physical 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 | `'34c7a6dc-cfcd-4194-af86-5eec3e282835'`
`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.0`
`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.0`
`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()

Return the self drawing elements of the single-headed arc

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

    754
    755
    756
    757
    758
    759
    760
    761
    762
    763
    764
    765
    766
    767
    def self_drawing_elements(self):
        drawing_elements = momapy.builder.super_or_builder(
            CellDesignerSingleHeadedArc, self
        ).self_drawing_elements()
        done_bases = []
        for base in type(self).__mro__:
            if (
                momapy.builder.issubclass_or_builder(base, momapy.sbgn.core._SBGNMixin)
                and base is not type(self)
                and not any([issubclass(done_base, base) for done_base in done_bases])
            ):
                drawing_elements += getattr(base, "_mixin_drawing_elements")(self)
                done_bases.append(base)
        return drawing_elements

#### `` 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)

### `` PhysicalStimulator `dataclass`

    PhysicalStimulator(
        *,
        id_: str = make_uuid4_as_str(),
        name: str | None = None,
        sbo_term: SBOTerm | None = None,
        metaid: str | None = None,
        referred_species: Species | BooleanLogicGate,
    )

Bases: `Modulator`

Class for physical stimulators

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 | `'dd051c9b-039b-4da9-ba9d-bffffc2d33ab'`
`name` | `str | None` |  | `None`
`sbo_term` | `SBOTerm | None` |  | `None`
`metaid` | `str | None` |  | `None`
`referred_species` | `Species | BooleanLogicGate` | The species the modifier refers to | required

### `` PositiveInfluence `dataclass`

    PositiveInfluence(
        *,
        id_: str = make_uuid4_as_str(),
        source: Species | BooleanLogicGate,
        target: Species | None,
    )

Bases: `Modulation`

Class for positive influences

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 | `'00e684bf-ae5e-43b6-9bfe-d387378e67d2'`
`source` | `Species | BooleanLogicGate` | The source of the influence | required
`target` | `Species | None` | The target of the influence | required

### `` PositiveInfluenceLayout `dataclass`

    PositiveInfluenceLayout(
        *,
        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_fill: NoneValueType | Color | None = NoneValue,
        path_filter: NoneValueType | Filter | None = None,
        path_stroke: NoneValueType | Color | None = black,
        path_stroke_dasharray: tuple[float, ...] | None = None,
        path_stroke_dashoffset: float | None = None,
        path_stroke_width: float | None = 1.0,
        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 = NoneValue,
        arrowhead_filter: NoneValueType | Filter | None = None,
        arrowhead_stroke: NoneValueType | Color | None = black,
        arrowhead_stroke_dasharray: tuple[float, ...]
        | None = None,
        arrowhead_stroke_dashoffset: float | None = None,
        arrowhead_stroke_width: float | None = 2.0,
        arrowhead_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        arrowhead_height: float = 10.0,
        arrowhead_width: float = 10.0,
    )

Bases: `CellDesignerSingleHeadedArc`

Class for positive influence 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 | `'8492eff9-464d-4f9f-a57e-dc55e58c6270'`
`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.0`
`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` |  | `<momapy.drawing.NoneValueType object at 0x7fb32ae9f1d0>`
`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` |  | `2.0`
`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()

Return the self drawing elements of the single-headed arc

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

    754
    755
    756
    757
    758
    759
    760
    761
    762
    763
    764
    765
    766
    767
    def self_drawing_elements(self):
        drawing_elements = momapy.builder.super_or_builder(
            CellDesignerSingleHeadedArc, self
        ).self_drawing_elements()
        done_bases = []
        for base in type(self).__mro__:
            if (
                momapy.builder.issubclass_or_builder(base, momapy.sbgn.core._SBGNMixin)
                and base is not type(self)
                and not any([issubclass(done_base, base) for done_base in done_bases])
            ):
                drawing_elements += getattr(base, "_mixin_drawing_elements")(self)
                done_bases.append(base)
        return drawing_elements

#### `` 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)

### `` Product `dataclass`

    Product(
        *,
        id_: str = make_uuid4_as_str(),
        name: str | None = None,
        sbo_term: SBOTerm | None = None,
        metaid: str | None = None,
        referred_species: Species,
        stoichiometry: int | None = None,
        base: bool = False,
    )

Bases: `SpeciesReference`, `CellDesignerModelElement`

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 | `'71743f77-640d-4634-a41e-acffc37c49d9'`
`name` | `str | None` |  | `None`
`sbo_term` | `SBOTerm | None` |  | `None`
`metaid` | `str | None` |  | `None`
`referred_species` | `Species` |  | required
`stoichiometry` | `int | None` |  | `None`
`base` | `bool` | Whether the product is a base product or not | `False`

### `` ProductionLayout `dataclass`

    ProductionLayout(
        *,
        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 = 2.0,
        fill: NoneValueType | Color | None = None,
        filter: NoneValueType | Filter | None = None,
        path_fill: NoneValueType | Color | None = NoneValue,
        path_filter: NoneValueType | Filter | None = None,
        path_stroke: NoneValueType | Color | None = black,
        path_stroke_dasharray: tuple[float, ...] | None = None,
        path_stroke_dashoffset: float | None = None,
        path_stroke_width: float | None = 1.0,
        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: NoneValueType | Color | None = black,
        arrowhead_stroke_dasharray: tuple[float, ...]
        | None = None,
        arrowhead_stroke_dashoffset: float | None = None,
        arrowhead_stroke_width: float | None = 1.0,
        arrowhead_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        arrowhead_height: float = 8.0,
        arrowhead_width: float = 15.0,
    )

Bases: `CellDesignerSingleHeadedArc`

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 | `'ba078ad6-4df8-42e6-8881-e0bb9482d8c3'`
`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` |  | `2.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.0`
`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.0`
`arrowhead_transform` | `NoneValueType | tuple[Transformation] | None` | The arrowhead transform of the arc | `None`
`arrowhead_height` | `float` |  | `8.0`
`arrowhead_width` | `float` |  | `15.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()

Return the self drawing elements of the single-headed arc

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

    754
    755
    756
    757
    758
    759
    760
    761
    762
    763
    764
    765
    766
    767
    def self_drawing_elements(self):
        drawing_elements = momapy.builder.super_or_builder(
            CellDesignerSingleHeadedArc, self
        ).self_drawing_elements()
        done_bases = []
        for base in type(self).__mro__:
            if (
                momapy.builder.issubclass_or_builder(base, momapy.sbgn.core._SBGNMixin)
                and base is not type(self)
                and not any([issubclass(done_base, base) for done_base in done_bases])
            ):
                drawing_elements += getattr(base, "_mixin_drawing_elements")(self)
                done_bases.append(base)
        return drawing_elements

#### `` 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)

### `` Protein `dataclass`

    Protein(
        *,
        id_: str = make_uuid4_as_str(),
        name: str | None = None,
        sbo_term: SBOTerm | None = None,
        metaid: str | None = None,
        compartment: Compartment | None = None,
        hypothetical: bool = False,
        active: bool = False,
        homomultimer: int = 1,
        template: ProteinTemplate,
        modifications: frozenset[Modification] = frozenset(),
        structural_states: frozenset[
            StructuralState
        ] = frozenset(),
    )

Bases: `Species`

Base class for proteins

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 | `'326548b5-1c61-44e0-8941-60829396f1ef'`
`name` | `str | None` |  | `None`
`sbo_term` | `SBOTerm | None` |  | `None`
`metaid` | `str | None` |  | `None`
`compartment` | `Compartment | None` |  | `None`
`hypothetical` | `bool` | Whether the species is hypothetical or not | `False`
`active` | `bool` | Whether the species is active or not | `False`
`homomultimer` | `int` | The number of subunits forming the species | `1`
`template` | `ProteinTemplate` | The template of the species | required
`modifications` | `frozenset[Modification]` | The modifications of the proteins | `<class 'frozenset'>`
`structural_states` | `frozenset[StructuralState]` | The structural states of the protein | `<class 'frozenset'>`

### `` ProteinBindingDomain `dataclass`

    ProteinBindingDomain(
        *,
        id_: str = make_uuid4_as_str(),
        name: str | None = None,
        active: bool = False,
    )

Bases: `Region`

Class for protein binding domains

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 | `'1477e5f4-77bb-4808-b19f-e7faa4684ce5'`
`name` | `str | None` | The name of the region | `None`
`active` | `bool` | Whether the region is active or not | `False`

### `` ProteinTemplate `dataclass`

    ProteinTemplate(
        *,
        id_: str = make_uuid4_as_str(),
        name: str,
        modification_residues: frozenset[
            ModificationResidue
        ] = frozenset(),
    )

Bases: `SpeciesTemplate`

Base class for protein templates

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 | `'0fd210ea-a79f-41de-b4dd-0a58df22f632'`
`name` | `str` | The name of the species template | required
`modification_residues` | `frozenset[ModificationResidue]` | The modification residues of the protein template | `<class 'frozenset'>`

### `` RNA `dataclass`

    RNA(
        *,
        id_: str = make_uuid4_as_str(),
        name: str | None = None,
        sbo_term: SBOTerm | None = None,
        metaid: str | None = None,
        compartment: Compartment | None = None,
        hypothetical: bool = False,
        active: bool = False,
        homomultimer: int = 1,
        template: RNATemplate,
        modifications: frozenset[Modification] = frozenset(),
    )

Bases: `Species`

Class for RNAs

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 | `'fe233ca3-342a-4dbb-b8c5-2729a4146b86'`
`name` | `str | None` |  | `None`
`sbo_term` | `SBOTerm | None` |  | `None`
`metaid` | `str | None` |  | `None`
`compartment` | `Compartment | None` |  | `None`
`hypothetical` | `bool` | Whether the species is hypothetical or not | `False`
`active` | `bool` | Whether the species is active or not | `False`
`homomultimer` | `int` | The number of subunits forming the species | `1`
`template` | `RNATemplate` |  | required
`modifications` | `frozenset[Modification]` | frozenset() -> empty frozenset object frozenset(iterable) -> frozenset object Build an immutable unordered collection of unique elements. | `<class 'frozenset'>`

### `` RNALayout `dataclass`

    RNALayout(
        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,
        active: bool = False,
        active_fill: NoneValueType | Color | None = NoneValue,
        active_filter: NoneValueType | Filter | None = None,
        active_sep: float = 4.0,
        active_stroke: NoneValueType | Color | None = black,
        active_stroke_dasharray: NoneValueType
        | tuple[float]
        | None = (4, 2),
        active_stroke_dashoffset: float | None = None,
        active_stroke_width: float | None = 1.0,
        active_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        n: int = 1,
        angle: float = 45.0,
    )

Bases: `_MultiNodeMixin`, `CellDesignerNode`

Class for RNA 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 | `'c4c25fd6-f91f-4e6f-8a09-d5272e7e6ba6'`
`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`
`active` | `bool` |  | `False`
`active_fill` | `NoneValueType | Color | None` |  | `<momapy.drawing.NoneValueType object at 0x7fb32ae9f1d0>`
`active_filter` | `NoneValueType | Filter | None` |  | `None`
`active_sep` | `float` |  | `4.0`
`active_stroke` | `NoneValueType | Color | None` |  | `Color(red=0, green=0, blue=0, alpha=1.0)`
`active_stroke_dasharray` | `NoneValueType | tuple[float] | None` |  | `(4, 2)`
`active_stroke_dashoffset` | `float | None` |  | `None`
`active_stroke_width` | `float | None` |  | `1.0`
`active_transform` | `NoneValueType | tuple[Transformation] | None` |  | `None`
`n` | `int` |  | `1`
`angle` | `float` |  | `45.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
`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 = 45.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/celldesigner/core.py`

    1414
    1415
    1416
    1417
    1418
    1419
    1420
    1421
    1422
    def east(self) -> momapy.geometry.Point:
        width = self.width - self.offset * (self._n - 1)
        height = self.height - self.offset * (self._n - 1)
        position = self.position + (
            self.width / 2 - width / 2,
            self.height / 2 - height / 2,
        )
        shape = self._make_subunit_shape(position, width, height)
        return shape.joint3() / 2 + shape.joint2() / 2

#### `` east_north_east

    east_north_east() -> Point

Return the east north east anchor of the node

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

    1404
    1405
    1406
    1407
    1408
    1409
    1410
    1411
    1412
    def east_north_east(self) -> momapy.geometry.Point:
        width = self.width - self.offset * (self._n - 1)
        height = self.height - self.offset * (self._n - 1)
        position = self.position + (
            self.width / 2 - width / 2,
            self.height / 2 - height / 2,
        )
        shape = self._make_subunit_shape(position, width, height)
        return shape.joint3() * 0.25 + shape.joint2() * 0.75

#### `` east_south_east

    east_south_east() -> Point

Return the east south east west anchor of the node

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

    1424
    1425
    1426
    1427
    1428
    1429
    1430
    1431
    1432
    def east_south_east(self) -> momapy.geometry.Point:
        width = self.width - self.offset * (self._n - 1)
        height = self.height - self.offset * (self._n - 1)
        position = self.position + (
            self.width / 2 - width / 2,
            self.height / 2 - height / 2,
        )
        shape = self._make_subunit_shape(position, width, height)
        return shape.joint3() * 0.75 + shape.joint2() * 0.25

#### `` 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/celldesigner/core.py`

    1374
    1375
    1376
    1377
    1378
    1379
    1380
    1381
    1382
    def north(self) -> momapy.geometry.Point:
        width = self.width - self.offset * (self._n - 1)
        height = self.height - self.offset * (self._n - 1)
        position = self.position + (
            self.width / 2 - width / 2,
            self.height / 2 - height / 2,
        )
        shape = self._make_subunit_shape(position, width, height)
        return shape.joint1() / 2 + shape.joint2() / 2

#### `` north_east

    north_east() -> Point

Return the north east anchor of the node

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

    1394
    1395
    1396
    1397
    1398
    1399
    1400
    1401
    1402
    def north_east(self) -> momapy.geometry.Point:
        width = self.width - self.offset * (self._n - 1)
        height = self.height - self.offset * (self._n - 1)
        position = self.position + (
            self.width / 2 - width / 2,
            self.height / 2 - height / 2,
        )
        shape = self._make_subunit_shape(position, width, height)
        return shape.joint2()

#### `` north_north_east

    north_north_east() -> Point

Return the north north east anchor of the node

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

    1384
    1385
    1386
    1387
    1388
    1389
    1390
    1391
    1392
    def north_north_east(self) -> momapy.geometry.Point:
        width = self.width - self.offset * (self._n - 1)
        height = self.height - self.offset * (self._n - 1)
        position = self.position + (
            self.width / 2 - width / 2,
            self.height / 2 - height / 2,
        )
        shape = self._make_subunit_shape(position, width, height)
        return shape.joint1() * 0.25 + shape.joint2() * 0.75

#### `` north_north_west

    north_north_west() -> Point

Return the north north west anchor of the node

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

    1364
    1365
    1366
    1367
    1368
    1369
    1370
    1371
    1372
    def north_north_west(self) -> momapy.geometry.Point:
        width = self.width - self.offset * (self._n - 1)
        height = self.height - self.offset * (self._n - 1)
        position = self.position + (
            self.width / 2 - width / 2,
            self.height / 2 - height / 2,
        )
        shape = self._make_subunit_shape(position, width, height)
        return shape.joint1() * 0.75 + shape.joint2() * 0.25

#### `` north_west

    north_west() -> Point

Return the north west anchor of the node

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

    1354
    1355
    1356
    1357
    1358
    1359
    1360
    1361
    1362
    def north_west(self) -> momapy.geometry.Point:
        width = self.width - self.offset * (self._n - 1)
        height = self.height - self.offset * (self._n - 1)
        position = self.position + (
            self.width / 2 - width / 2,
            self.height / 2 - height / 2,
        )
        shape = self._make_subunit_shape(position, width, height)
        return shape.joint1()

#### `` 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/celldesigner/core.py`

    1454
    1455
    1456
    1457
    1458
    1459
    1460
    1461
    1462
    def south(self) -> momapy.geometry.Point:
        width = self.width - self.offset * (self._n - 1)
        height = self.height - self.offset * (self._n - 1)
        position = self.position + (
            self.width / 2 - width / 2,
            self.height / 2 - height / 2,
        )
        shape = self._make_subunit_shape(position, width, height)
        return shape.joint4() / 2 + shape.joint3() / 2

#### `` south_east

    south_east() -> Point

Return the south east anchor of the node

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

    1434
    1435
    1436
    1437
    1438
    1439
    1440
    1441
    1442
    def south_east(self) -> momapy.geometry.Point:
        width = self.width - self.offset * (self._n - 1)
        height = self.height - self.offset * (self._n - 1)
        position = self.position + (
            self.width / 2 - width / 2,
            self.height / 2 - height / 2,
        )
        shape = self._make_subunit_shape(position, width, height)
        return shape.joint3()

#### `` south_south_east

    south_south_east() -> Point

Return the south south east anchor of the node

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

    1444
    1445
    1446
    1447
    1448
    1449
    1450
    1451
    1452
    def south_south_east(self) -> momapy.geometry.Point:
        width = self.width - self.offset * (self._n - 1)
        height = self.height - self.offset * (self._n - 1)
        position = self.position + (
            self.width / 2 - width / 2,
            self.height / 2 - height / 2,
        )
        shape = self._make_subunit_shape(position, width, height)
        return shape.joint4() * 0.25 + shape.joint3() * 0.75

#### `` south_south_west

    south_south_west() -> Point

Return the south south west anchor of the node

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

    1464
    1465
    1466
    1467
    1468
    1469
    1470
    1471
    1472
    def south_south_west(self) -> momapy.geometry.Point:
        width = self.width - self.offset * (self._n - 1)
        height = self.height - self.offset * (self._n - 1)
        position = self.position + (
            self.width / 2 - width / 2,
            self.height / 2 - height / 2,
        )
        shape = self._make_subunit_shape(position, width, height)
        return shape.joint4() * 0.75 + shape.joint3() * 0.25

#### `` south_west

    south_west() -> Point

Return the south west anchor of the node

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

    1474
    1475
    1476
    1477
    1478
    1479
    1480
    1481
    1482
    def south_west(self) -> momapy.geometry.Point:
        width = self.width - self.offset * (self._n - 1)
        height = self.height - self.offset * (self._n - 1)
        position = self.position + (
            self.width / 2 - width / 2,
            self.height / 2 - height / 2,
        )
        shape = self._make_subunit_shape(position, width, height)
        return shape.joint4()

#### `` 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/celldesigner/core.py`

    1494
    1495
    1496
    1497
    1498
    1499
    1500
    1501
    1502
    def west(self) -> momapy.geometry.Point:
        width = self.width - self.offset * (self._n - 1)
        height = self.height - self.offset * (self._n - 1)
        position = self.position + (
            self.width / 2 - width / 2,
            self.height / 2 - height / 2,
        )
        shape = self._make_subunit_shape(position, width, height)
        return shape.joint4() / 2 + shape.joint1() / 2

#### `` west_north_west

    west_north_west() -> Point

Return the west north west anchor of the node

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

    1504
    1505
    1506
    1507
    1508
    1509
    1510
    1511
    1512
    def west_north_west(self) -> momapy.geometry.Point:
        width = self.width - self.offset * (self._n - 1)
        height = self.height - self.offset * (self._n - 1)
        position = self.position + (
            self.width / 2 - width / 2,
            self.height / 2 - height / 2,
        )
        shape = self._make_subunit_shape(position, width, height)
        return shape.joint4() * 0.25 + shape.joint1() * 0.75

#### `` west_south_west

    west_south_west() -> Point

Return the west south west anchor of the node

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

    1484
    1485
    1486
    1487
    1488
    1489
    1490
    1491
    1492
    def west_south_west(self) -> momapy.geometry.Point:
        width = self.width - self.offset * (self._n - 1)
        height = self.height - self.offset * (self._n - 1)
        position = self.position + (
            self.width / 2 - width / 2,
            self.height / 2 - height / 2,
        )
        shape = self._make_subunit_shape(position, width, height)
        return shape.joint4() * 0.75 + shape.joint1() * 0.25

#### `` x `property`

    x: float

Return the x coordinate of the node

#### `` y `property`

    y: float

Return the y coordinate of the node

### `` RNATemplate `dataclass`

    RNATemplate(
        *,
        id_: str = make_uuid4_as_str(),
        name: str,
        regions: frozenset[
            ModificationSite
            | CodingRegion
            | ProteinBindingDomain
        ] = frozenset(),
    )

Bases: `SpeciesTemplate`

Class for RNA templates

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 | `'efe39bfb-d2a7-4221-a1b3-b2fa4c22781d'`
`name` | `str` | The name of the species template | required
`regions` | `frozenset[Union[ModificationSite, CodingRegion, ProteinBindingDomain]]` | The regions of the RNA template | `<class 'frozenset'>`

### `` Reactant `dataclass`

    Reactant(
        *,
        id_: str = make_uuid4_as_str(),
        name: str | None = None,
        sbo_term: SBOTerm | None = None,
        metaid: str | None = None,
        referred_species: Species,
        stoichiometry: int | None = None,
        base: bool = False,
    )

Bases: `SpeciesReference`, `CellDesignerModelElement`

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 | `'2773cef1-b63c-4674-a14c-034683f8a884'`
`name` | `str | None` |  | `None`
`sbo_term` | `SBOTerm | None` |  | `None`
`metaid` | `str | None` |  | `None`
`referred_species` | `Species` |  | required
`stoichiometry` | `int | None` |  | `None`
`base` | `bool` | Whether the reactant is a base reactant or not | `False`

### `` Reaction `dataclass`

    Reaction(
        *,
        id_: str = make_uuid4_as_str(),
        name: str | None = None,
        sbo_term: SBOTerm | None = None,
        metaid: str | None = None,
        reversible: bool,
        compartment: Compartment | None = None,
        reactants: frozenset[Reactant] = frozenset(),
        products: frozenset[Product] = frozenset(),
        modifiers: frozenset[
            KnownOrUnknownModulator
        ] = frozenset(),
    )

Bases: `Reaction`, `CellDesignerModelElement`

Base class for reactions

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 | `'e3f82ccc-2ccc-4996-beca-550c956e5cce'`
`name` | `str | None` |  | `None`
`sbo_term` | `SBOTerm | None` |  | `None`
`metaid` | `str | None` |  | `None`
`reversible` | `bool` |  | required
`compartment` | `Compartment | None` |  | `None`
`reactants` | `frozenset[Reactant]` | The reactants of the reaction | `<class 'frozenset'>`
`products` | `frozenset[Product]` | The products of the reaction | `<class 'frozenset'>`
`modifiers` | `frozenset[KnownOrUnknownModulator]` | The modifiers of the reaction | `<class 'frozenset'>`

### `` Receptor `dataclass`

    Receptor(
        *,
        id_: str = make_uuid4_as_str(),
        name: str | None = None,
        sbo_term: SBOTerm | None = None,
        metaid: str | None = None,
        compartment: Compartment | None = None,
        hypothetical: bool = False,
        active: bool = False,
        homomultimer: int = 1,
        template: ReceptorTemplate,
        modifications: frozenset[Modification] = frozenset(),
        structural_states: frozenset[
            StructuralState
        ] = frozenset(),
    )

Bases: `Protein`

Class for receptors

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 | `'8f13fd29-2a81-44df-916a-321cf676977c'`
`name` | `str | None` |  | `None`
`sbo_term` | `SBOTerm | None` |  | `None`
`metaid` | `str | None` |  | `None`
`compartment` | `Compartment | None` |  | `None`
`hypothetical` | `bool` | Whether the species is hypothetical or not | `False`
`active` | `bool` | Whether the species is active or not | `False`
`homomultimer` | `int` | The number of subunits forming the species | `1`
`template` | `ReceptorTemplate` | The template of the receptor | required
`modifications` | `frozenset[Modification]` | The modifications of the proteins | `<class 'frozenset'>`
`structural_states` | `frozenset[StructuralState]` | The structural states of the protein | `<class 'frozenset'>`

### `` ReceptorLayout `dataclass`

    ReceptorLayout(
        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,
        active: bool = False,
        active_fill: NoneValueType | Color | None = NoneValue,
        active_filter: NoneValueType | Filter | None = None,
        active_sep: float = 4.0,
        active_stroke: NoneValueType | Color | None = black,
        active_stroke_dasharray: NoneValueType
        | tuple[float]
        | None = (4, 2),
        active_stroke_dashoffset: float | None = None,
        active_stroke_width: float | None = 1.0,
        active_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        n: int = 1,
        vertical_truncation: float = 0.1,
    )

Bases: `_MultiNodeMixin`, `CellDesignerNode`

Class for receptor 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 | `'e6060ee5-da1a-4096-8cd4-d126d02cc981'`
`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`
`active` | `bool` |  | `False`
`active_fill` | `NoneValueType | Color | None` |  | `<momapy.drawing.NoneValueType object at 0x7fb32ae9f1d0>`
`active_filter` | `NoneValueType | Filter | None` |  | `None`
`active_sep` | `float` |  | `4.0`
`active_stroke` | `NoneValueType | Color | None` |  | `Color(red=0, green=0, blue=0, alpha=1.0)`
`active_stroke_dasharray` | `NoneValueType | tuple[float] | None` |  | `(4, 2)`
`active_stroke_dashoffset` | `float | None` |  | `None`
`active_stroke_width` | `float | None` |  | `1.0`
`active_transform` | `NoneValueType | tuple[Transformation] | None` |  | `None`
`n` | `int` |  | `1`
`vertical_truncation` | `float` |  | `0.1`

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/celldesigner/core.py`

    1882
    1883
    1884
    1885
    1886
    1887
    1888
    1889
    1890
    def east(self) -> momapy.geometry.Point:
        width = self.width - self.offset * (self._n - 1)
        height = self.height - self.offset * (self._n - 1)
        position = self.position + (
            self.width / 2 - width / 2,
            self.height / 2 - height / 2,
        )
        shape = self._make_subunit_shape(position, width, height)
        return shape.joint4() / 2 + shape.joint3() / 2

#### `` east_north_east

    east_north_east() -> Point

Return the east north east anchor of the node

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

    1872
    1873
    1874
    1875
    1876
    1877
    1878
    1879
    1880
    def east_north_east(self) -> momapy.geometry.Point:
        width = self.width - self.offset * (self._n - 1)
        height = self.height - self.offset * (self._n - 1)
        position = self.position + (
            self.width / 2 - width / 2,
            self.height / 2 - height / 2,
        )
        shape = self._make_subunit_shape(position, width, height)
        return shape.joint4() * 0.25 + shape.joint3() * 0.75

#### `` east_south_east

    east_south_east() -> Point

Return the east south east west anchor of the node

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

    1892
    1893
    1894
    1895
    1896
    1897
    1898
    1899
    1900
    def east_south_east(self) -> momapy.geometry.Point:
        width = self.width - self.offset * (self._n - 1)
        height = self.height - self.offset * (self._n - 1)
        position = self.position + (
            self.width / 2 - width / 2,
            self.height / 2 - height / 2,
        )
        shape = self._make_subunit_shape(position, width, height)
        return shape.joint4() * 0.75 + shape.joint3() * 0.25

#### `` 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/celldesigner/core.py`

    1842
    1843
    1844
    1845
    1846
    1847
    1848
    1849
    1850
    def north(self) -> momapy.geometry.Point:
        width = self.width - self.offset * (self._n - 1)
        height = self.height - self.offset * (self._n - 1)
        position = self.position + (
            self.width / 2 - width / 2,
            self.height / 2 - height / 2,
        )
        shape = self._make_subunit_shape(position, width, height)
        return shape.joint2()

#### `` north_east

    north_east() -> Point

Return the north east anchor of the node

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

    1862
    1863
    1864
    1865
    1866
    1867
    1868
    1869
    1870
    def north_east(self) -> momapy.geometry.Point:
        width = self.width - self.offset * (self._n - 1)
        height = self.height - self.offset * (self._n - 1)
        position = self.position + (
            self.width / 2 - width / 2,
            self.height / 2 - height / 2,
        )
        shape = self._make_subunit_shape(position, width, height)
        return shape.joint3()

#### `` north_north_east

    north_north_east() -> Point

Return the north north east anchor of the node

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

    1852
    1853
    1854
    1855
    1856
    1857
    1858
    1859
    1860
    def north_north_east(self) -> momapy.geometry.Point:
        width = self.width - self.offset * (self._n - 1)
        height = self.height - self.offset * (self._n - 1)
        position = self.position + (
            self.width / 2 - width / 2,
            self.height / 2 - height / 2,
        )
        shape = self._make_subunit_shape(position, width, height)
        return shape.joint2() * 0.25 + shape.joint3() * 0.75

#### `` north_north_west

    north_north_west() -> Point

Return the north north west anchor of the node

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

    1832
    1833
    1834
    1835
    1836
    1837
    1838
    1839
    1840
    def north_north_west(self) -> momapy.geometry.Point:
        width = self.width - self.offset * (self._n - 1)
        height = self.height - self.offset * (self._n - 1)
        position = self.position + (
            self.width / 2 - width / 2,
            self.height / 2 - height / 2,
        )
        shape = self._make_subunit_shape(position, width, height)
        return shape.joint1() / 2 + shape.joint2() / 2

#### `` north_west

    north_west() -> Point

Return the north west anchor of the node

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

    1822
    1823
    1824
    1825
    1826
    1827
    1828
    1829
    1830
    def north_west(self) -> momapy.geometry.Point:
        width = self.width - self.offset * (self._n - 1)
        height = self.height - self.offset * (self._n - 1)
        position = self.position + (
            self.width / 2 - width / 2,
            self.height / 2 - height / 2,
        )
        shape = self._make_subunit_shape(position, width, height)
        return shape.joint1()

#### `` 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/celldesigner/core.py`

    1922
    1923
    1924
    1925
    1926
    1927
    1928
    1929
    1930
    def south(self) -> momapy.geometry.Point:
        width = self.width - self.offset * (self._n - 1)
        height = self.height - self.offset * (self._n - 1)
        position = self.position + (
            self.width / 2 - width / 2,
            self.height / 2 - height / 2,
        )
        shape = self._make_subunit_shape(position, width, height)
        return shape.joint5()

#### `` south_east

    south_east() -> Point

Return the south east anchor of the node

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

    1902
    1903
    1904
    1905
    1906
    1907
    1908
    1909
    1910
    def south_east(self) -> momapy.geometry.Point:
        width = self.width - self.offset * (self._n - 1)
        height = self.height - self.offset * (self._n - 1)
        position = self.position + (
            self.width / 2 - width / 2,
            self.height / 2 - height / 2,
        )
        shape = self._make_subunit_shape(position, width, height)
        return shape.joint4()

#### `` south_south_east

    south_south_east() -> Point

Return the south south east anchor of the node

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

    1912
    1913
    1914
    1915
    1916
    1917
    1918
    1919
    1920
    def south_south_east(self) -> momapy.geometry.Point:
        width = self.width - self.offset * (self._n - 1)
        height = self.height - self.offset * (self._n - 1)
        position = self.position + (
            self.width / 2 - width / 2,
            self.height / 2 - height / 2,
        )
        shape = self._make_subunit_shape(position, width, height)
        return shape.joint5() / 2 + shape.joint4() / 2

#### `` south_south_west

    south_south_west() -> Point

Return the south south west anchor of the node

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

    1932
    1933
    1934
    1935
    1936
    1937
    1938
    1939
    1940
    def south_south_west(self) -> momapy.geometry.Point:
        width = self.width - self.offset * (self._n - 1)
        height = self.height - self.offset * (self._n - 1)
        position = self.position + (
            self.width / 2 - width / 2,
            self.height / 2 - height / 2,
        )
        shape = self._make_subunit_shape(position, width, height)
        return shape.joint6() / 2 + shape.joint5() / 2

#### `` south_west

    south_west() -> Point

Return the south west anchor of the node

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

    1942
    1943
    1944
    1945
    1946
    1947
    1948
    1949
    1950
    def south_west(self) -> momapy.geometry.Point:
        width = self.width - self.offset * (self._n - 1)
        height = self.height - self.offset * (self._n - 1)
        position = self.position + (
            self.width / 2 - width / 2,
            self.height / 2 - height / 2,
        )
        shape = self._make_subunit_shape(position, width, height)
        return shape.joint6()

#### `` 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/celldesigner/core.py`

    1962
    1963
    1964
    1965
    1966
    1967
    1968
    1969
    1970
    def west(self) -> momapy.geometry.Point:
        width = self.width - self.offset * (self._n - 1)
        height = self.height - self.offset * (self._n - 1)
        position = self.position + (
            self.width / 2 - width / 2,
            self.height / 2 - height / 2,
        )
        shape = self._make_subunit_shape(position, width, height)
        return shape.joint6() / 2 + shape.joint1() / 2

#### `` west_north_west

    west_north_west() -> Point

Return the west north west anchor of the node

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

    1972
    1973
    1974
    1975
    1976
    1977
    1978
    1979
    1980
    def west_north_west(self) -> momapy.geometry.Point:
        width = self.width - self.offset * (self._n - 1)
        height = self.height - self.offset * (self._n - 1)
        position = self.position + (
            self.width / 2 - width / 2,
            self.height / 2 - height / 2,
        )
        shape = self._make_subunit_shape(position, width, height)
        return shape.joint6() * 0.25 + shape.joint1() * 0.75

#### `` west_south_west

    west_south_west() -> Point

Return the west south west anchor of the node

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

    1952
    1953
    1954
    1955
    1956
    1957
    1958
    1959
    1960
    def west_south_west(self) -> momapy.geometry.Point:
        width = self.width - self.offset * (self._n - 1)
        height = self.height - self.offset * (self._n - 1)
        position = self.position + (
            self.width / 2 - width / 2,
            self.height / 2 - height / 2,
        )
        shape = self._make_subunit_shape(position, width, height)
        return shape.joint6() * 0.75 + shape.joint1() * 0.25

#### `` x `property`

    x: float

Return the x coordinate of the node

#### `` y `property`

    y: float

Return the y coordinate of the node

### `` ReceptorTemplate `dataclass`

    ReceptorTemplate(
        *,
        id_: str = make_uuid4_as_str(),
        name: str,
        modification_residues: frozenset[
            ModificationResidue
        ] = frozenset(),
    )

Bases: `ProteinTemplate`

Class for receptor templates

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 | `'cd04c224-5c4b-47c3-8798-ec3cf301713f'`
`name` | `str` | The name of the species template | required
`modification_residues` | `frozenset[ModificationResidue]` | The modification residues of the protein template | `<class 'frozenset'>`

### `` RectangleCompartmentLayout `dataclass`

    RectangleCompartmentLayout(
        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 = 16.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 = 16.0,
        active: bool = False,
        active_fill: NoneValueType | Color | None = NoneValue,
        active_filter: NoneValueType | Filter | None = None,
        active_sep: float = 4.0,
        active_stroke: NoneValueType | Color | None = black,
        active_stroke_dasharray: NoneValueType
        | tuple[float]
        | None = (4, 2),
        active_stroke_dashoffset: float | None = None,
        active_stroke_width: float | None = 1.0,
        active_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        inner_fill: NoneValueType | Color | None = white,
        inner_rounded_corners: float = 10.0,
        inner_stroke: NoneValueType | Color | None = black,
        inner_stroke_width: float | None = 1.0,
        rounded_corners: float = 10.0,
        sep: float = 12.0,
    )

Bases: `_SimpleNodeMixin`, `CellDesignerNode`

Class for rectangle 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 | `'72846152-beee-41f3-b1f3-19d21c94cffd'`
`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` |  | `16.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` |  | `16.0`
`active` | `bool` |  | `False`
`active_fill` | `NoneValueType | Color | None` |  | `<momapy.drawing.NoneValueType object at 0x7fb32ae9f1d0>`
`active_filter` | `NoneValueType | Filter | None` |  | `None`
`active_sep` | `float` |  | `4.0`
`active_stroke` | `NoneValueType | Color | None` |  | `Color(red=0, green=0, blue=0, alpha=1.0)`
`active_stroke_dasharray` | `NoneValueType | tuple[float] | None` |  | `(4, 2)`
`active_stroke_dashoffset` | `float | None` |  | `None`
`active_stroke_width` | `float | None` |  | `1.0`
`active_transform` | `NoneValueType | tuple[Transformation] | None` |  | `None`
`inner_fill` | `NoneValueType | Color | None` |  | `Color(red=255, green=255, blue=255, alpha=1.0)`
`inner_rounded_corners` | `float` |  | `10.0`
`inner_stroke` | `NoneValueType | Color | None` |  | `Color(red=0, green=0, blue=0, alpha=1.0)`
`inner_stroke_width` | `float | None` |  | `1.0`
`rounded_corners` | `float` |  | `10.0`
`sep` | `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

### `` Region `dataclass`

    Region(
        *,
        id_: str = make_uuid4_as_str(),
        name: str | None = None,
        active: bool = False,
    )

Bases: `CellDesignerModelElement`

Class for regions

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 | `'b7f4c180-f257-42ac-aa3e-45a1ff40674a'`
`name` | `str | None` | The name of the region | `None`
`active` | `bool` | Whether the region is active or not | `False`

### `` RegulatoryRegion `dataclass`

    RegulatoryRegion(
        *,
        id_: str = make_uuid4_as_str(),
        name: str | None = None,
        active: bool = False,
    )

Bases: `Region`

Class for regulatory regions

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 | `'0d20e00b-db96-43ad-90ac-63aec07ce231'`
`name` | `str | None` | The name of the region | `None`
`active` | `bool` | Whether the region is active or not | `False`

### `` SimpleMolecule `dataclass`

    SimpleMolecule(
        *,
        id_: str = make_uuid4_as_str(),
        name: str | None = None,
        sbo_term: SBOTerm | None = None,
        metaid: str | None = None,
        compartment: Compartment | None = None,
        hypothetical: bool = False,
        active: bool = False,
        homomultimer: int = 1,
    )

Bases: `Species`

Class for simple molecules

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 | `'4e83270b-2095-4eef-9609-25be84ab4936'`
`name` | `str | None` |  | `None`
`sbo_term` | `SBOTerm | None` |  | `None`
`metaid` | `str | None` |  | `None`
`compartment` | `Compartment | None` |  | `None`
`hypothetical` | `bool` | Whether the species is hypothetical or not | `False`
`active` | `bool` | Whether the species is active or not | `False`
`homomultimer` | `int` | The number of subunits forming the species | `1`

### `` SimpleMoleculeLayout `dataclass`

    SimpleMoleculeLayout(
        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,
        active: bool = False,
        active_fill: NoneValueType | Color | None = NoneValue,
        active_filter: NoneValueType | Filter | None = None,
        active_sep: float = 4.0,
        active_stroke: NoneValueType | Color | None = black,
        active_stroke_dasharray: NoneValueType
        | tuple[float]
        | None = (4, 2),
        active_stroke_dashoffset: float | None = None,
        active_stroke_width: float | None = 1.0,
        active_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        n: int = 1,
    )

Bases: `_MultiNodeMixin`, `CellDesignerNode`

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 | `'7c7bd364-c3a3-4e0f-bb3b-75672b782302'`
`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`
`active` | `bool` |  | `False`
`active_fill` | `NoneValueType | Color | None` |  | `<momapy.drawing.NoneValueType object at 0x7fb32ae9f1d0>`
`active_filter` | `NoneValueType | Filter | None` |  | `None`
`active_sep` | `float` |  | `4.0`
`active_stroke` | `NoneValueType | Color | None` |  | `Color(red=0, green=0, blue=0, alpha=1.0)`
`active_stroke_dasharray` | `NoneValueType | tuple[float] | None` |  | `(4, 2)`
`active_stroke_dashoffset` | `float | None` |  | `None`
`active_stroke_width` | `float | None` |  | `1.0`
`active_transform` | `NoneValueType | tuple[Transformation] | None` |  | `None`
`n` | `int` |  | `1`

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

### `` Species `dataclass`

    Species(
        *,
        id_: str = make_uuid4_as_str(),
        name: str | None = None,
        sbo_term: SBOTerm | None = None,
        metaid: str | None = None,
        compartment: Compartment | None = None,
        hypothetical: bool = False,
        active: bool = False,
        homomultimer: int = 1,
    )

Bases: `Species`, `CellDesignerModelElement`

Base class for species

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 | `'78683a0f-d250-4819-9a9e-cae943c63ea1'`
`name` | `str | None` |  | `None`
`sbo_term` | `SBOTerm | None` |  | `None`
`metaid` | `str | None` |  | `None`
`compartment` | `Compartment | None` |  | `None`
`hypothetical` | `bool` | Whether the species is hypothetical or not | `False`
`active` | `bool` | Whether the species is active or not | `False`
`homomultimer` | `int` | The number of subunits forming the species | `1`

### `` SpeciesTemplate `dataclass`

    SpeciesTemplate(
        *, id_: str = make_uuid4_as_str(), name: str
    )

Bases: `CellDesignerModelElement`

Base class for species templates

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 | `'fcea97db-5d7e-4116-b600-2b279020fab9'`
`name` | `str` | The name of the species template | required

### `` StateTransition `dataclass`

    StateTransition(
        *,
        id_: str = make_uuid4_as_str(),
        name: str | None = None,
        sbo_term: SBOTerm | None = None,
        metaid: str | None = None,
        reversible: bool,
        compartment: Compartment | None = None,
        reactants: frozenset[Reactant] = frozenset(),
        products: frozenset[Product] = frozenset(),
        modifiers: frozenset[
            KnownOrUnknownModulator
        ] = frozenset(),
    )

Bases: `Reaction`

Class for state transitions

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 | `'a0fee2fd-e73f-4ab4-88e7-557771f3ca4f'`
`name` | `str | None` |  | `None`
`sbo_term` | `SBOTerm | None` |  | `None`
`metaid` | `str | None` |  | `None`
`reversible` | `bool` |  | required
`compartment` | `Compartment | None` |  | `None`
`reactants` | `frozenset[Reactant]` | The reactants of the reaction | `<class 'frozenset'>`
`products` | `frozenset[Product]` | The products of the reaction | `<class 'frozenset'>`
`modifiers` | `frozenset[KnownOrUnknownModulator]` | The modifiers of the reaction | `<class 'frozenset'>`

### `` StateTransitionLayout `dataclass`

    StateTransitionLayout(
        *,
        _left_connector_fraction: float = 0.4,
        _right_connector_fraction: float = 0.6,
        reaction_node_height: float = 10.0,
        reaction_node_width: float = 10.0,
        reaction_node_segment: int = 1,
        reaction_node_stroke: NoneValueType
        | Color
        | None = black,
        reaction_node_stroke_width: float | None = 1.0,
        reaction_node_stroke_dasharray: NoneValueType
        | tuple[float]
        | None = None,
        reaction_node_stroke_dashoffset: float | None = None,
        reaction_node_fill: NoneValueType
        | Color
        | None = white,
        reaction_node_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        reaction_node_filter: 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,
        end_shorten: float = 2.0,
        fill: NoneValueType | Color | None = None,
        filter: NoneValueType | Filter | None = None,
        path_fill: NoneValueType | Color | None = NoneValue,
        path_filter: NoneValueType | Filter | None = None,
        path_stroke: NoneValueType | Color | None = black,
        path_stroke_dasharray: tuple[float, ...] | None = None,
        path_stroke_dashoffset: float | None = None,
        path_stroke_width: float | None = 1.0,
        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 = 2.0,
        target: LayoutElement | None = None,
        transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        end_arrowhead_fill: NoneValueType
        | Color
        | None = black,
        end_arrowhead_filter: NoneValueType
        | Filter
        | None = None,
        end_arrowhead_stroke: NoneValueType
        | Color
        | None = black,
        end_arrowhead_stroke_dasharray: NoneValueType
        | tuple[float]
        | None = None,
        end_arrowhead_stroke_dashoffset: float | None = None,
        end_arrowhead_stroke_width: float | None = 1.0,
        end_arrowhead_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        start_arrowhead_fill: NoneValueType
        | Color
        | None = black,
        start_arrowhead_filter: NoneValueType
        | Filter
        | None = None,
        start_arrowhead_stroke: NoneValueType
        | Color
        | None = black,
        start_arrowhead_stroke_dasharray: NoneValueType
        | tuple[float]
        | None = None,
        start_arrowhead_stroke_dashoffset: float | None = None,
        start_arrowhead_stroke_width: float | None = 1.0,
        start_arrowhead_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        reversible: bool = False,
        end_arrowhead_height: float = 8.0,
        end_arrowhead_width: float = 15.0,
        start_arrowhead_height: float = 8.0,
        start_arrowhead_width: float = 15.0,
    )

Bases: `_ReactionLayout`, `_ReactionNodeMixin`

Class for state transition layouts

Parameters:

Name | Type | Description | Default
--- | --- | --- | ---
`reaction_node_height` | `float` |  | `10.0`
`reaction_node_width` | `float` |  | `10.0`
`reaction_node_segment` | `int` |  | `1`
`reaction_node_stroke` | `NoneValueType | Color | None` |  | `Color(red=0, green=0, blue=0, alpha=1.0)`
`reaction_node_stroke_width` | `float | None` |  | `1.0`
`reaction_node_stroke_dasharray` | `NoneValueType | tuple[float] | None` |  | `None`
`reaction_node_stroke_dashoffset` | `float | None` |  | `None`
`reaction_node_fill` | `NoneValueType | Color | None` |  | `Color(red=255, green=255, blue=255, alpha=1.0)`
`reaction_node_transform` | `NoneValueType | tuple[Transformation] | None` |  | `None`
`reaction_node_filter` | `NoneValueType | Filter | None` |  | `None`
`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 | `'acc9341f-bee2-4448-9bbd-8d935257804f'`
`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` |  | `2.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.0`
`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` |  | `2.0`
`target` | `LayoutElement | None` | The target of the arc | `None`
`transform` | `NoneValueType | tuple[Transformation] | None` | The transform of the arc | `None`
`end_arrowhead_fill` | `NoneValueType | Color | None` |  | `Color(red=0, green=0, blue=0, alpha=1.0)`
`end_arrowhead_filter` | `NoneValueType | Filter | None` |  | `None`
`end_arrowhead_stroke` | `NoneValueType | Color | None` |  | `Color(red=0, green=0, blue=0, alpha=1.0)`
`end_arrowhead_stroke_dasharray` | `NoneValueType | tuple[float] | None` |  | `None`
`end_arrowhead_stroke_dashoffset` | `float | None` |  | `None`
`end_arrowhead_stroke_width` | `float | None` |  | `1.0`
`end_arrowhead_transform` | `NoneValueType | tuple[Transformation] | None` |  | `None`
`start_arrowhead_fill` | `NoneValueType | Color | None` |  | `Color(red=0, green=0, blue=0, alpha=1.0)`
`start_arrowhead_filter` | `NoneValueType | Filter | None` |  | `None`
`start_arrowhead_stroke` | `NoneValueType | Color | None` |  | `Color(red=0, green=0, blue=0, alpha=1.0)`
`start_arrowhead_stroke_dasharray` | `NoneValueType | tuple[float] | None` |  | `None`
`start_arrowhead_stroke_dashoffset` | `float | None` |  | `None`
`start_arrowhead_stroke_width` | `float | None` |  | `1.0`
`start_arrowhead_transform` | `NoneValueType | tuple[Transformation] | None` |  | `None`
`reversible` | `bool` |  | `False`
`end_arrowhead_height` | `float` |  | `8.0`
`end_arrowhead_width` | `float` |  | `15.0`
`start_arrowhead_height` | `float` |  | `8.0`
`start_arrowhead_width` | `float` |  | `15.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
`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_arrowhead_base` | Return the base anchor point of the double-headed arc end arrowhead
`end_arrowhead_bbox` | Return the bounding box of the double-headed arc start arrowhead
`end_arrowhead_border` | Return the point at the intersection of the drawing elements of the double-headed arc end arrowhead and the line going through the center of these drawing elements and the given point.
`end_arrowhead_length` | Return the length of the double-headed arc end arrowhead
`end_arrowhead_tip` | Return the tip anchor point of the double-headed arc end arrowhead
`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 double-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 double-headed arc. These include the drawing elements of the arc path, the start arrowhead, and the end arrowhead
`self_to_shapely` | Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout
`start_arrowhead_base` | Return the base anchor point of the double-headed arc start arrowhead
`start_arrowhead_bbox` | Return the bounding box of the double-headed arc start arrowhead
`start_arrowhead_border` | Return the point at the intersection of the drawing elements of the double-headed arc start arrowhead and the line going through the center of these drawing elements and the given point.
`start_arrowhead_drawing_elements` | Return the drawing elements of the double-headed arc start arrowhead
`start_arrowhead_length` | Return the length of the double-headed arc start arrowhead
`start_arrowhead_tip` | Return the tip anchor point of the double-headed arc start arrowhead
`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)()

#### `` 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_arrowhead_base

    end_arrowhead_base() -> Point

Return the base anchor point of the double-headed arc end arrowhead

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

    1333
    1334
    1335
    1336
    1337
    1338
    1339
    1340
    1341
    1342
    1343
    def end_arrowhead_base(self) -> momapy.geometry.Point:
        """Return the base anchor point of the double-headed arc end arrowhead"""
        arrowhead_length = self.end_arrowhead_length()
        if arrowhead_length == 0:
            return self.end_point()
        segment = self.segments[-1]
        segment_length = segment.length()
        if segment_length == 0:
            return self.end_arrowhead_tip() - (arrowhead_length, 0)
        fraction = 1 - (arrowhead_length + self.end_shorten) / segment_length
        return segment.get_position_at_fraction(fraction)

#### `` end_arrowhead_bbox

    end_arrowhead_bbox()

Return the bounding box of the double-headed arc start arrowhead

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

    1345
    1346
    1347
    1348
    1349
    def end_arrowhead_bbox(self):
        """Return the bounding box of the double-headed arc start arrowhead"""
        return momapy.drawing.get_drawing_elements_bbox(
            self.end_arrowhead_drawing_elements()
        )

#### `` end_arrowhead_border

    end_arrowhead_border(point)

Return the point at the intersection of the drawing elements of the double-headed arc end 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`

    1351
    1352
    1353
    1354
    1355
    1356
    1357
    1358
    1359
    1360
    1361
    def end_arrowhead_border(self, point):
        """Return the point at the intersection of the drawing elements of the double-headed arc end 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.end_arrowhead_drawing_elements(), point
        )
        if point.isnan():
            return self.end_arrowhead_tip()
        return point

#### `` end_arrowhead_length

    end_arrowhead_length() -> float

Return the length of the double-headed arc end arrowhead

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

    1315
    1316
    1317
    1318
    1319
    1320
    1321
    1322
    def end_arrowhead_length(self) -> float:
        """Return the length of the double-headed arc end arrowhead"""
        bbox = momapy.drawing.get_drawing_elements_bbox(
            self._end_arrowhead_border_drawing_elements()
        )
        if math.isnan(bbox.width):
            return 0.0
        return bbox.east().x

#### `` end_arrowhead_tip

    end_arrowhead_tip() -> Point

Return the tip anchor point of the double-headed arc end arrowhead

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

    1324
    1325
    1326
    1327
    1328
    1329
    1330
    1331
    def end_arrowhead_tip(self) -> momapy.geometry.Point:
        """Return the tip anchor point of the double-headed arc end arrowhead"""
        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)

#### `` 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 double-headed arc path

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

    1451
    1452
    1453
    1454
    1455
    1456
    1457
    1458
    1459
    1460
    1461
    1462
    1463
    1464
    1465
    1466
    1467
    1468
    1469
    1470
    1471
    1472
    1473
    1474
    1475
    1476
    1477
    1478
    1479
    1480
    1481
    1482
    1483
    1484
    1485
    1486
    1487
    1488
    1489
    1490
    1491
    1492
    def path_drawing_elements(self) -> list[momapy.drawing.Path]:
        """Return the drawing elements of the double-headed arc path"""
        start_arrowhead_length = self.start_arrowhead_length()
        end_arrowhead_length = self.end_arrowhead_length()
        if len(self.segments) == 1:
            segment = (
                self.segments[0]
                .shortened(self.start_shorten + start_arrowhead_length, "start")
                .shortened(self.end_shorten + end_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_arrowhead_length, "start"
            )
            last_segment = self.segments[-1].shortened(
                self.end_shorten + end_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()

Return the self drawing elements of the double-headed arc. These include the drawing elements of the arc path, the start arrowhead, and the end arrowhead

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

    782
    783
    784
    785
    786
    787
    788
    789
    790
    791
    792
    793
    794
    795
    def self_drawing_elements(self):
        drawing_elements = momapy.builder.super_or_builder(
            CellDesignerDoubleHeadedArc, self
        ).self_drawing_elements()
        done_bases = []
        for base in type(self).__mro__:
            if (
                momapy.builder.issubclass_or_builder(base, momapy.sbgn.core._SBGNMixin)
                and base is not type(self)
                and not any([issubclass(done_base, base) for done_base in done_bases])
            ):
                drawing_elements += getattr(base, "_mixin_drawing_elements")(self)
                done_bases.append(base)
        return drawing_elements

#### `` 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_arrowhead_base

    start_arrowhead_base() -> Point

Return the base anchor point of the double-headed arc start arrowhead

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

    1285
    1286
    1287
    1288
    1289
    1290
    1291
    1292
    1293
    1294
    1295
    1296
    def start_arrowhead_base(self) -> momapy.geometry.Point:
        """Return the base anchor point of the double-headed arc start arrowhead"""
        arrowhead_length = self.start_arrowhead_length()
        if arrowhead_length == 0:
            return self.start_point()
        segment = self.segments[0]
        segment = momapy.geometry.Segment(segment.p2, segment.p1)
        segment_length = segment.length()
        if segment_length == 0:
            return self.start_arrowhead_tip() + (arrowhead_length, 0)
        fraction = 1 - (arrowhead_length + self.start_shorten) / segment_length
        return segment.get_position_at_fraction(fraction)

#### `` start_arrowhead_bbox

    start_arrowhead_bbox() -> Bbox

Return the bounding box of the double-headed arc start arrowhead

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

    1298
    1299
    1300
    1301
    1302
    def start_arrowhead_bbox(self) -> momapy.geometry.Bbox:
        """Return the bounding box of the double-headed arc start arrowhead"""
        return momapy.drawing.get_drawing_elements_bbox(
            self.start_arrowhead_drawing_elements()
        )

#### `` start_arrowhead_border

    start_arrowhead_border(point) -> Point

Return the point at the intersection of the drawing elements of the double-headed arc start 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`

    1304
    1305
    1306
    1307
    1308
    1309
    1310
    1311
    1312
    1313
    def start_arrowhead_border(self, point) -> momapy.geometry.Point:
        """Return the point at the intersection of the drawing elements of the double-headed arc start 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.start_arrowhead_drawing_elements(), point
        )
        if point.isnan():
            return self.start_arrowhead_tip()
        return point

#### `` start_arrowhead_drawing_elements

    start_arrowhead_drawing_elements() -> list[DrawingElement]

Return the drawing elements of the double-headed arc start arrowhead

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

    1394
    1395
    1396
    1397
    1398
    1399
    1400
    1401
    1402
    1403
    1404
    1405
    1406
    1407
    1408
    1409
    1410
    1411
    1412
    1413
    def start_arrowhead_drawing_elements(
        self,
    ) -> list[momapy.drawing.DrawingElement]:
        """Return the drawing elements of the double-headed arc start arrowhead"""
        drawing_elements = self._start_arrowhead_border_drawing_elements()
        group = momapy.drawing.Group(
            class_=f"{type(self).__name__}_start_arrowhead",
            elements=tuple(drawing_elements),
            id_=f"{self.id_}_start_arrowhead",
            fill=self.start_arrowhead_fill,
            filter=self.start_arrowhead_filter,
            stroke=self.start_arrowhead_stroke,
            stroke_dasharray=self.start_arrowhead_stroke_dasharray,
            stroke_dashoffset=self.start_arrowhead_stroke_dashoffset,
            stroke_width=self.start_arrowhead_stroke_width,
            transform=self.start_arrowhead_transform,
        )
        transformation = self._get_start_arrowhead_transformation()
        group = group.transformed(transformation)
        return [group]

#### `` start_arrowhead_length

    start_arrowhead_length() -> float

Return the length of the double-headed arc start arrowhead

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

    1266
    1267
    1268
    1269
    1270
    1271
    1272
    1273
    def start_arrowhead_length(self) -> float:
        """Return the length of the double-headed arc start arrowhead"""
        bbox = momapy.drawing.get_drawing_elements_bbox(
            self._start_arrowhead_border_drawing_elements()
        )
        if math.isnan(bbox.width):
            return 0.0
        return abs(bbox.west().x)

#### `` start_arrowhead_tip

    start_arrowhead_tip() -> Point

Return the tip anchor point of the double-headed arc start arrowhead

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

    1275
    1276
    1277
    1278
    1279
    1280
    1281
    1282
    1283
    def start_arrowhead_tip(self) -> momapy.geometry.Point:
        """Return the tip anchor point of the double-headed arc start arrowhead"""
        segment = self.segments[0]
        segment = momapy.geometry.Segment(segment.p2, segment.p1)
        segment_length = segment.length()
        if segment_length == 0:
            return segment.p2
        fraction = 1 - self.start_shorten / segment_length
        return segment.get_position_at_fraction(fraction)

#### `` 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)

### `` StructuralState `dataclass`

    StructuralState(
        *,
        id_: str = make_uuid4_as_str(),
        value: str | None = None,
    )

Bases: `CellDesignerModelElement`

Class for structural states

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 | `'ccfde6af-4535-4618-9839-1b74a0a0e9b8'`
`value` | `str | None` | The value of the structural state | `None`

### `` StructuralStateLayout `dataclass`

    StructuralStateLayout(
        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 = 16.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 = 50.0,
        active: bool = False,
        active_fill: NoneValueType | Color | None = NoneValue,
        active_filter: NoneValueType | Filter | None = None,
        active_sep: float = 4.0,
        active_stroke: NoneValueType | Color | None = black,
        active_stroke_dasharray: NoneValueType
        | tuple[float]
        | None = (4, 2),
        active_stroke_dashoffset: float | None = None,
        active_stroke_width: float | None = 1.0,
        active_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
    )

Bases: `_SimpleNodeMixin`, `CellDesignerNode`

Class for structural states 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 | `'9dbf3f25-ace8-40ff-bb67-0c9506ece969'`
`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` |  | `16.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` |  | `50.0`
`active` | `bool` |  | `False`
`active_fill` | `NoneValueType | Color | None` |  | `<momapy.drawing.NoneValueType object at 0x7fb32ae9f1d0>`
`active_filter` | `NoneValueType | Filter | None` |  | `None`
`active_sep` | `float` |  | `4.0`
`active_stroke` | `NoneValueType | Color | None` |  | `Color(red=0, green=0, blue=0, alpha=1.0)`
`active_stroke_dasharray` | `NoneValueType | tuple[float] | None` |  | `(4, 2)`
`active_stroke_dashoffset` | `float | None` |  | `None`
`active_stroke_width` | `float | None` |  | `1.0`
`active_transform` | `NoneValueType | tuple[Transformation] | 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
`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

### `` Transcription `dataclass`

    Transcription(
        *,
        id_: str = make_uuid4_as_str(),
        name: str | None = None,
        sbo_term: SBOTerm | None = None,
        metaid: str | None = None,
        reversible: bool,
        compartment: Compartment | None = None,
        reactants: frozenset[Reactant] = frozenset(),
        products: frozenset[Product] = frozenset(),
        modifiers: frozenset[
            KnownOrUnknownModulator
        ] = frozenset(),
    )

Bases: `Reaction`

Class for transcriptions

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 | `'6ba31e58-d7c1-42ea-9fd9-1579cdbec4d2'`
`name` | `str | None` |  | `None`
`sbo_term` | `SBOTerm | None` |  | `None`
`metaid` | `str | None` |  | `None`
`reversible` | `bool` |  | required
`compartment` | `Compartment | None` |  | `None`
`reactants` | `frozenset[Reactant]` | The reactants of the reaction | `<class 'frozenset'>`
`products` | `frozenset[Product]` | The products of the reaction | `<class 'frozenset'>`
`modifiers` | `frozenset[KnownOrUnknownModulator]` | The modifiers of the reaction | `<class 'frozenset'>`

### `` TranscriptionLayout `dataclass`

    TranscriptionLayout(
        *,
        _left_connector_fraction: float = 0.4,
        _right_connector_fraction: float = 0.6,
        reaction_node_height: float = 10.0,
        reaction_node_width: float = 10.0,
        reaction_node_segment: int = 1,
        reaction_node_stroke: NoneValueType
        | Color
        | None = black,
        reaction_node_stroke_width: float | None = 1.0,
        reaction_node_stroke_dasharray: NoneValueType
        | tuple[float]
        | None = None,
        reaction_node_stroke_dashoffset: float | None = None,
        reaction_node_fill: NoneValueType
        | Color
        | None = white,
        reaction_node_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        reaction_node_filter: 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,
        end_shorten: float = 2.0,
        fill: NoneValueType | Color | None = None,
        filter: NoneValueType | Filter | None = None,
        path_fill: NoneValueType | Color | None = NoneValue,
        path_filter: NoneValueType | Filter | None = None,
        path_stroke: NoneValueType | Color | None = black,
        path_stroke_dasharray: NoneValueType
        | tuple[float]
        | None = (12, 4, 2, 4, 2, 4),
        path_stroke_dashoffset: float | None = None,
        path_stroke_width: float | None = 1.0,
        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 = 2.0,
        target: LayoutElement | None = None,
        transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        end_arrowhead_fill: NoneValueType
        | Color
        | None = black,
        end_arrowhead_filter: NoneValueType
        | Filter
        | None = None,
        end_arrowhead_stroke: NoneValueType
        | Color
        | None = black,
        end_arrowhead_stroke_dasharray: NoneValueType
        | tuple[float]
        | None = None,
        end_arrowhead_stroke_dashoffset: float | None = None,
        end_arrowhead_stroke_width: float | None = 1.0,
        end_arrowhead_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        start_arrowhead_fill: NoneValueType
        | Color
        | None = black,
        start_arrowhead_filter: NoneValueType
        | Filter
        | None = None,
        start_arrowhead_stroke: NoneValueType
        | Color
        | None = black,
        start_arrowhead_stroke_dasharray: NoneValueType
        | tuple[float]
        | None = None,
        start_arrowhead_stroke_dashoffset: float | None = None,
        start_arrowhead_stroke_width: float | None = 1.0,
        start_arrowhead_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        reversible: bool = False,
        end_arrowhead_height: float = 8.0,
        end_arrowhead_width: float = 15.0,
        start_arrowhead_height: float = 8.0,
        start_arrowhead_width: float = 15.0,
    )

Bases: `_ReactionLayout`, `_ReactionNodeMixin`

Class for transcription layouts

Parameters:

Name | Type | Description | Default
--- | --- | --- | ---
`reaction_node_height` | `float` |  | `10.0`
`reaction_node_width` | `float` |  | `10.0`
`reaction_node_segment` | `int` |  | `1`
`reaction_node_stroke` | `NoneValueType | Color | None` |  | `Color(red=0, green=0, blue=0, alpha=1.0)`
`reaction_node_stroke_width` | `float | None` |  | `1.0`
`reaction_node_stroke_dasharray` | `NoneValueType | tuple[float] | None` |  | `None`
`reaction_node_stroke_dashoffset` | `float | None` |  | `None`
`reaction_node_fill` | `NoneValueType | Color | None` |  | `Color(red=255, green=255, blue=255, alpha=1.0)`
`reaction_node_transform` | `NoneValueType | tuple[Transformation] | None` |  | `None`
`reaction_node_filter` | `NoneValueType | Filter | None` |  | `None`
`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 | `'56aa5907-e4a7-4a1c-9072-4fc81d9896d6'`
`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` |  | `2.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` | `NoneValueType | tuple[float] | None` |  | `(12, 4, 2, 4, 2, 4)`
`path_stroke_dashoffset` | `float | None` | The path stroke dashoffset of the arc | `None`
`path_stroke_width` | `float | None` |  | `1.0`
`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` |  | `2.0`
`target` | `LayoutElement | None` | The target of the arc | `None`
`transform` | `NoneValueType | tuple[Transformation] | None` | The transform of the arc | `None`
`end_arrowhead_fill` | `NoneValueType | Color | None` |  | `Color(red=0, green=0, blue=0, alpha=1.0)`
`end_arrowhead_filter` | `NoneValueType | Filter | None` |  | `None`
`end_arrowhead_stroke` | `NoneValueType | Color | None` |  | `Color(red=0, green=0, blue=0, alpha=1.0)`
`end_arrowhead_stroke_dasharray` | `NoneValueType | tuple[float] | None` |  | `None`
`end_arrowhead_stroke_dashoffset` | `float | None` |  | `None`
`end_arrowhead_stroke_width` | `float | None` |  | `1.0`
`end_arrowhead_transform` | `NoneValueType | tuple[Transformation] | None` |  | `None`
`start_arrowhead_fill` | `NoneValueType | Color | None` |  | `Color(red=0, green=0, blue=0, alpha=1.0)`
`start_arrowhead_filter` | `NoneValueType | Filter | None` |  | `None`
`start_arrowhead_stroke` | `NoneValueType | Color | None` |  | `Color(red=0, green=0, blue=0, alpha=1.0)`
`start_arrowhead_stroke_dasharray` | `NoneValueType | tuple[float] | None` |  | `None`
`start_arrowhead_stroke_dashoffset` | `float | None` |  | `None`
`start_arrowhead_stroke_width` | `float | None` |  | `1.0`
`start_arrowhead_transform` | `NoneValueType | tuple[Transformation] | None` |  | `None`
`reversible` | `bool` |  | `False`
`end_arrowhead_height` | `float` |  | `8.0`
`end_arrowhead_width` | `float` |  | `15.0`
`start_arrowhead_height` | `float` |  | `8.0`
`start_arrowhead_width` | `float` |  | `15.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
`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_arrowhead_base` | Return the base anchor point of the double-headed arc end arrowhead
`end_arrowhead_bbox` | Return the bounding box of the double-headed arc start arrowhead
`end_arrowhead_border` | Return the point at the intersection of the drawing elements of the double-headed arc end arrowhead and the line going through the center of these drawing elements and the given point.
`end_arrowhead_length` | Return the length of the double-headed arc end arrowhead
`end_arrowhead_tip` | Return the tip anchor point of the double-headed arc end arrowhead
`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 double-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 double-headed arc. These include the drawing elements of the arc path, the start arrowhead, and the end arrowhead
`self_to_shapely` | Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout
`start_arrowhead_base` | Return the base anchor point of the double-headed arc start arrowhead
`start_arrowhead_bbox` | Return the bounding box of the double-headed arc start arrowhead
`start_arrowhead_border` | Return the point at the intersection of the drawing elements of the double-headed arc start arrowhead and the line going through the center of these drawing elements and the given point.
`start_arrowhead_drawing_elements` | Return the drawing elements of the double-headed arc start arrowhead
`start_arrowhead_length` | Return the length of the double-headed arc start arrowhead
`start_arrowhead_tip` | Return the tip anchor point of the double-headed arc start arrowhead
`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)()

#### `` 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_arrowhead_base

    end_arrowhead_base() -> Point

Return the base anchor point of the double-headed arc end arrowhead

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

    1333
    1334
    1335
    1336
    1337
    1338
    1339
    1340
    1341
    1342
    1343
    def end_arrowhead_base(self) -> momapy.geometry.Point:
        """Return the base anchor point of the double-headed arc end arrowhead"""
        arrowhead_length = self.end_arrowhead_length()
        if arrowhead_length == 0:
            return self.end_point()
        segment = self.segments[-1]
        segment_length = segment.length()
        if segment_length == 0:
            return self.end_arrowhead_tip() - (arrowhead_length, 0)
        fraction = 1 - (arrowhead_length + self.end_shorten) / segment_length
        return segment.get_position_at_fraction(fraction)

#### `` end_arrowhead_bbox

    end_arrowhead_bbox()

Return the bounding box of the double-headed arc start arrowhead

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

    1345
    1346
    1347
    1348
    1349
    def end_arrowhead_bbox(self):
        """Return the bounding box of the double-headed arc start arrowhead"""
        return momapy.drawing.get_drawing_elements_bbox(
            self.end_arrowhead_drawing_elements()
        )

#### `` end_arrowhead_border

    end_arrowhead_border(point)

Return the point at the intersection of the drawing elements of the double-headed arc end 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`

    1351
    1352
    1353
    1354
    1355
    1356
    1357
    1358
    1359
    1360
    1361
    def end_arrowhead_border(self, point):
        """Return the point at the intersection of the drawing elements of the double-headed arc end 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.end_arrowhead_drawing_elements(), point
        )
        if point.isnan():
            return self.end_arrowhead_tip()
        return point

#### `` end_arrowhead_length

    end_arrowhead_length() -> float

Return the length of the double-headed arc end arrowhead

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

    1315
    1316
    1317
    1318
    1319
    1320
    1321
    1322
    def end_arrowhead_length(self) -> float:
        """Return the length of the double-headed arc end arrowhead"""
        bbox = momapy.drawing.get_drawing_elements_bbox(
            self._end_arrowhead_border_drawing_elements()
        )
        if math.isnan(bbox.width):
            return 0.0
        return bbox.east().x

#### `` end_arrowhead_tip

    end_arrowhead_tip() -> Point

Return the tip anchor point of the double-headed arc end arrowhead

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

    1324
    1325
    1326
    1327
    1328
    1329
    1330
    1331
    def end_arrowhead_tip(self) -> momapy.geometry.Point:
        """Return the tip anchor point of the double-headed arc end arrowhead"""
        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)

#### `` 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 double-headed arc path

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

    1451
    1452
    1453
    1454
    1455
    1456
    1457
    1458
    1459
    1460
    1461
    1462
    1463
    1464
    1465
    1466
    1467
    1468
    1469
    1470
    1471
    1472
    1473
    1474
    1475
    1476
    1477
    1478
    1479
    1480
    1481
    1482
    1483
    1484
    1485
    1486
    1487
    1488
    1489
    1490
    1491
    1492
    def path_drawing_elements(self) -> list[momapy.drawing.Path]:
        """Return the drawing elements of the double-headed arc path"""
        start_arrowhead_length = self.start_arrowhead_length()
        end_arrowhead_length = self.end_arrowhead_length()
        if len(self.segments) == 1:
            segment = (
                self.segments[0]
                .shortened(self.start_shorten + start_arrowhead_length, "start")
                .shortened(self.end_shorten + end_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_arrowhead_length, "start"
            )
            last_segment = self.segments[-1].shortened(
                self.end_shorten + end_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()

Return the self drawing elements of the double-headed arc. These include the drawing elements of the arc path, the start arrowhead, and the end arrowhead

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

    782
    783
    784
    785
    786
    787
    788
    789
    790
    791
    792
    793
    794
    795
    def self_drawing_elements(self):
        drawing_elements = momapy.builder.super_or_builder(
            CellDesignerDoubleHeadedArc, self
        ).self_drawing_elements()
        done_bases = []
        for base in type(self).__mro__:
            if (
                momapy.builder.issubclass_or_builder(base, momapy.sbgn.core._SBGNMixin)
                and base is not type(self)
                and not any([issubclass(done_base, base) for done_base in done_bases])
            ):
                drawing_elements += getattr(base, "_mixin_drawing_elements")(self)
                done_bases.append(base)
        return drawing_elements

#### `` 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_arrowhead_base

    start_arrowhead_base() -> Point

Return the base anchor point of the double-headed arc start arrowhead

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

    1285
    1286
    1287
    1288
    1289
    1290
    1291
    1292
    1293
    1294
    1295
    1296
    def start_arrowhead_base(self) -> momapy.geometry.Point:
        """Return the base anchor point of the double-headed arc start arrowhead"""
        arrowhead_length = self.start_arrowhead_length()
        if arrowhead_length == 0:
            return self.start_point()
        segment = self.segments[0]
        segment = momapy.geometry.Segment(segment.p2, segment.p1)
        segment_length = segment.length()
        if segment_length == 0:
            return self.start_arrowhead_tip() + (arrowhead_length, 0)
        fraction = 1 - (arrowhead_length + self.start_shorten) / segment_length
        return segment.get_position_at_fraction(fraction)

#### `` start_arrowhead_bbox

    start_arrowhead_bbox() -> Bbox

Return the bounding box of the double-headed arc start arrowhead

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

    1298
    1299
    1300
    1301
    1302
    def start_arrowhead_bbox(self) -> momapy.geometry.Bbox:
        """Return the bounding box of the double-headed arc start arrowhead"""
        return momapy.drawing.get_drawing_elements_bbox(
            self.start_arrowhead_drawing_elements()
        )

#### `` start_arrowhead_border

    start_arrowhead_border(point) -> Point

Return the point at the intersection of the drawing elements of the double-headed arc start 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`

    1304
    1305
    1306
    1307
    1308
    1309
    1310
    1311
    1312
    1313
    def start_arrowhead_border(self, point) -> momapy.geometry.Point:
        """Return the point at the intersection of the drawing elements of the double-headed arc start 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.start_arrowhead_drawing_elements(), point
        )
        if point.isnan():
            return self.start_arrowhead_tip()
        return point

#### `` start_arrowhead_drawing_elements

    start_arrowhead_drawing_elements() -> list[DrawingElement]

Return the drawing elements of the double-headed arc start arrowhead

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

    1394
    1395
    1396
    1397
    1398
    1399
    1400
    1401
    1402
    1403
    1404
    1405
    1406
    1407
    1408
    1409
    1410
    1411
    1412
    1413
    def start_arrowhead_drawing_elements(
        self,
    ) -> list[momapy.drawing.DrawingElement]:
        """Return the drawing elements of the double-headed arc start arrowhead"""
        drawing_elements = self._start_arrowhead_border_drawing_elements()
        group = momapy.drawing.Group(
            class_=f"{type(self).__name__}_start_arrowhead",
            elements=tuple(drawing_elements),
            id_=f"{self.id_}_start_arrowhead",
            fill=self.start_arrowhead_fill,
            filter=self.start_arrowhead_filter,
            stroke=self.start_arrowhead_stroke,
            stroke_dasharray=self.start_arrowhead_stroke_dasharray,
            stroke_dashoffset=self.start_arrowhead_stroke_dashoffset,
            stroke_width=self.start_arrowhead_stroke_width,
            transform=self.start_arrowhead_transform,
        )
        transformation = self._get_start_arrowhead_transformation()
        group = group.transformed(transformation)
        return [group]

#### `` start_arrowhead_length

    start_arrowhead_length() -> float

Return the length of the double-headed arc start arrowhead

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

    1266
    1267
    1268
    1269
    1270
    1271
    1272
    1273
    def start_arrowhead_length(self) -> float:
        """Return the length of the double-headed arc start arrowhead"""
        bbox = momapy.drawing.get_drawing_elements_bbox(
            self._start_arrowhead_border_drawing_elements()
        )
        if math.isnan(bbox.width):
            return 0.0
        return abs(bbox.west().x)

#### `` start_arrowhead_tip

    start_arrowhead_tip() -> Point

Return the tip anchor point of the double-headed arc start arrowhead

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

    1275
    1276
    1277
    1278
    1279
    1280
    1281
    1282
    1283
    def start_arrowhead_tip(self) -> momapy.geometry.Point:
        """Return the tip anchor point of the double-headed arc start arrowhead"""
        segment = self.segments[0]
        segment = momapy.geometry.Segment(segment.p2, segment.p1)
        segment_length = segment.length()
        if segment_length == 0:
            return segment.p2
        fraction = 1 - self.start_shorten / segment_length
        return segment.get_position_at_fraction(fraction)

#### `` 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)

### `` TranscriptionStartingSiteL `dataclass`

    TranscriptionStartingSiteL(
        *,
        id_: str = make_uuid4_as_str(),
        name: str | None = None,
        active: bool = False,
    )

Bases: `Region`

Class for left transcription starting sites

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 | `'8d64ce7c-dd29-42a8-b3c9-b8e6e4713ca2'`
`name` | `str | None` | The name of the region | `None`
`active` | `bool` | Whether the region is active or not | `False`

### `` TranscriptionStartingSiteR `dataclass`

    TranscriptionStartingSiteR(
        *,
        id_: str = make_uuid4_as_str(),
        name: str | None = None,
        active: bool = False,
    )

Bases: `Region`

Class for right transcription starting sites

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 | `'6dd78d1c-6092-437e-ad5f-5c2b6185ca47'`
`name` | `str | None` | The name of the region | `None`
`active` | `bool` | Whether the region is active or not | `False`

### `` Translation `dataclass`

    Translation(
        *,
        id_: str = make_uuid4_as_str(),
        name: str | None = None,
        sbo_term: SBOTerm | None = None,
        metaid: str | None = None,
        reversible: bool,
        compartment: Compartment | None = None,
        reactants: frozenset[Reactant] = frozenset(),
        products: frozenset[Product] = frozenset(),
        modifiers: frozenset[
            KnownOrUnknownModulator
        ] = frozenset(),
    )

Bases: `Reaction`

Class for translation

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 | `'56200166-e16f-4c09-a52f-e84594e74757'`
`name` | `str | None` |  | `None`
`sbo_term` | `SBOTerm | None` |  | `None`
`metaid` | `str | None` |  | `None`
`reversible` | `bool` |  | required
`compartment` | `Compartment | None` |  | `None`
`reactants` | `frozenset[Reactant]` | The reactants of the reaction | `<class 'frozenset'>`
`products` | `frozenset[Product]` | The products of the reaction | `<class 'frozenset'>`
`modifiers` | `frozenset[KnownOrUnknownModulator]` | The modifiers of the reaction | `<class 'frozenset'>`

### `` TranslationLayout `dataclass`

    TranslationLayout(
        *,
        _left_connector_fraction: float = 0.4,
        _right_connector_fraction: float = 0.6,
        reaction_node_height: float = 10.0,
        reaction_node_width: float = 10.0,
        reaction_node_segment: int = 1,
        reaction_node_stroke: NoneValueType
        | Color
        | None = black,
        reaction_node_stroke_width: float | None = 1.0,
        reaction_node_stroke_dasharray: NoneValueType
        | tuple[float]
        | None = None,
        reaction_node_stroke_dashoffset: float | None = None,
        reaction_node_fill: NoneValueType
        | Color
        | None = white,
        reaction_node_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        reaction_node_filter: 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,
        end_shorten: float = 2.0,
        fill: NoneValueType | Color | None = None,
        filter: NoneValueType | Filter | None = None,
        path_fill: NoneValueType | Color | None = NoneValue,
        path_filter: NoneValueType | Filter | None = None,
        path_stroke: NoneValueType | Color | None = black,
        path_stroke_dasharray: NoneValueType
        | tuple[float]
        | None = (12, 4, 2, 4),
        path_stroke_dashoffset: float | None = None,
        path_stroke_width: float | None = 1.0,
        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 = 2.0,
        target: LayoutElement | None = None,
        transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        end_arrowhead_fill: NoneValueType
        | Color
        | None = black,
        end_arrowhead_filter: NoneValueType
        | Filter
        | None = None,
        end_arrowhead_stroke: NoneValueType
        | Color
        | None = black,
        end_arrowhead_stroke_dasharray: NoneValueType
        | tuple[float]
        | None = None,
        end_arrowhead_stroke_dashoffset: float | None = None,
        end_arrowhead_stroke_width: float | None = 1.0,
        end_arrowhead_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        start_arrowhead_fill: NoneValueType
        | Color
        | None = black,
        start_arrowhead_filter: NoneValueType
        | Filter
        | None = None,
        start_arrowhead_stroke: NoneValueType
        | Color
        | None = black,
        start_arrowhead_stroke_dasharray: NoneValueType
        | tuple[float]
        | None = None,
        start_arrowhead_stroke_dashoffset: float | None = None,
        start_arrowhead_stroke_width: float | None = 1.0,
        start_arrowhead_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        reversible: bool = False,
        end_arrowhead_height: float = 8.0,
        end_arrowhead_width: float = 15.0,
        start_arrowhead_height: float = 8.0,
        start_arrowhead_width: float = 15.0,
    )

Bases: `_ReactionLayout`, `_ReactionNodeMixin`

Class for translation layouts

Parameters:

Name | Type | Description | Default
--- | --- | --- | ---
`reaction_node_height` | `float` |  | `10.0`
`reaction_node_width` | `float` |  | `10.0`
`reaction_node_segment` | `int` |  | `1`
`reaction_node_stroke` | `NoneValueType | Color | None` |  | `Color(red=0, green=0, blue=0, alpha=1.0)`
`reaction_node_stroke_width` | `float | None` |  | `1.0`
`reaction_node_stroke_dasharray` | `NoneValueType | tuple[float] | None` |  | `None`
`reaction_node_stroke_dashoffset` | `float | None` |  | `None`
`reaction_node_fill` | `NoneValueType | Color | None` |  | `Color(red=255, green=255, blue=255, alpha=1.0)`
`reaction_node_transform` | `NoneValueType | tuple[Transformation] | None` |  | `None`
`reaction_node_filter` | `NoneValueType | Filter | None` |  | `None`
`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 | `'6e6865b0-dc6c-4cdc-9618-e128b19b25f0'`
`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` |  | `2.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` | `NoneValueType | tuple[float] | None` |  | `(12, 4, 2, 4)`
`path_stroke_dashoffset` | `float | None` | The path stroke dashoffset of the arc | `None`
`path_stroke_width` | `float | None` |  | `1.0`
`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` |  | `2.0`
`target` | `LayoutElement | None` | The target of the arc | `None`
`transform` | `NoneValueType | tuple[Transformation] | None` | The transform of the arc | `None`
`end_arrowhead_fill` | `NoneValueType | Color | None` |  | `Color(red=0, green=0, blue=0, alpha=1.0)`
`end_arrowhead_filter` | `NoneValueType | Filter | None` |  | `None`
`end_arrowhead_stroke` | `NoneValueType | Color | None` |  | `Color(red=0, green=0, blue=0, alpha=1.0)`
`end_arrowhead_stroke_dasharray` | `NoneValueType | tuple[float] | None` |  | `None`
`end_arrowhead_stroke_dashoffset` | `float | None` |  | `None`
`end_arrowhead_stroke_width` | `float | None` |  | `1.0`
`end_arrowhead_transform` | `NoneValueType | tuple[Transformation] | None` |  | `None`
`start_arrowhead_fill` | `NoneValueType | Color | None` |  | `Color(red=0, green=0, blue=0, alpha=1.0)`
`start_arrowhead_filter` | `NoneValueType | Filter | None` |  | `None`
`start_arrowhead_stroke` | `NoneValueType | Color | None` |  | `Color(red=0, green=0, blue=0, alpha=1.0)`
`start_arrowhead_stroke_dasharray` | `NoneValueType | tuple[float] | None` |  | `None`
`start_arrowhead_stroke_dashoffset` | `float | None` |  | `None`
`start_arrowhead_stroke_width` | `float | None` |  | `1.0`
`start_arrowhead_transform` | `NoneValueType | tuple[Transformation] | None` |  | `None`
`reversible` | `bool` |  | `False`
`end_arrowhead_height` | `float` |  | `8.0`
`end_arrowhead_width` | `float` |  | `15.0`
`start_arrowhead_height` | `float` |  | `8.0`
`start_arrowhead_width` | `float` |  | `15.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
`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_arrowhead_base` | Return the base anchor point of the double-headed arc end arrowhead
`end_arrowhead_bbox` | Return the bounding box of the double-headed arc start arrowhead
`end_arrowhead_border` | Return the point at the intersection of the drawing elements of the double-headed arc end arrowhead and the line going through the center of these drawing elements and the given point.
`end_arrowhead_length` | Return the length of the double-headed arc end arrowhead
`end_arrowhead_tip` | Return the tip anchor point of the double-headed arc end arrowhead
`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 double-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 double-headed arc. These include the drawing elements of the arc path, the start arrowhead, and the end arrowhead
`self_to_shapely` | Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout
`start_arrowhead_base` | Return the base anchor point of the double-headed arc start arrowhead
`start_arrowhead_bbox` | Return the bounding box of the double-headed arc start arrowhead
`start_arrowhead_border` | Return the point at the intersection of the drawing elements of the double-headed arc start arrowhead and the line going through the center of these drawing elements and the given point.
`start_arrowhead_drawing_elements` | Return the drawing elements of the double-headed arc start arrowhead
`start_arrowhead_length` | Return the length of the double-headed arc start arrowhead
`start_arrowhead_tip` | Return the tip anchor point of the double-headed arc start arrowhead
`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)()

#### `` 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_arrowhead_base

    end_arrowhead_base() -> Point

Return the base anchor point of the double-headed arc end arrowhead

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

    1333
    1334
    1335
    1336
    1337
    1338
    1339
    1340
    1341
    1342
    1343
    def end_arrowhead_base(self) -> momapy.geometry.Point:
        """Return the base anchor point of the double-headed arc end arrowhead"""
        arrowhead_length = self.end_arrowhead_length()
        if arrowhead_length == 0:
            return self.end_point()
        segment = self.segments[-1]
        segment_length = segment.length()
        if segment_length == 0:
            return self.end_arrowhead_tip() - (arrowhead_length, 0)
        fraction = 1 - (arrowhead_length + self.end_shorten) / segment_length
        return segment.get_position_at_fraction(fraction)

#### `` end_arrowhead_bbox

    end_arrowhead_bbox()

Return the bounding box of the double-headed arc start arrowhead

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

    1345
    1346
    1347
    1348
    1349
    def end_arrowhead_bbox(self):
        """Return the bounding box of the double-headed arc start arrowhead"""
        return momapy.drawing.get_drawing_elements_bbox(
            self.end_arrowhead_drawing_elements()
        )

#### `` end_arrowhead_border

    end_arrowhead_border(point)

Return the point at the intersection of the drawing elements of the double-headed arc end 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`

    1351
    1352
    1353
    1354
    1355
    1356
    1357
    1358
    1359
    1360
    1361
    def end_arrowhead_border(self, point):
        """Return the point at the intersection of the drawing elements of the double-headed arc end 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.end_arrowhead_drawing_elements(), point
        )
        if point.isnan():
            return self.end_arrowhead_tip()
        return point

#### `` end_arrowhead_length

    end_arrowhead_length() -> float

Return the length of the double-headed arc end arrowhead

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

    1315
    1316
    1317
    1318
    1319
    1320
    1321
    1322
    def end_arrowhead_length(self) -> float:
        """Return the length of the double-headed arc end arrowhead"""
        bbox = momapy.drawing.get_drawing_elements_bbox(
            self._end_arrowhead_border_drawing_elements()
        )
        if math.isnan(bbox.width):
            return 0.0
        return bbox.east().x

#### `` end_arrowhead_tip

    end_arrowhead_tip() -> Point

Return the tip anchor point of the double-headed arc end arrowhead

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

    1324
    1325
    1326
    1327
    1328
    1329
    1330
    1331
    def end_arrowhead_tip(self) -> momapy.geometry.Point:
        """Return the tip anchor point of the double-headed arc end arrowhead"""
        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)

#### `` 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 double-headed arc path

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

    1451
    1452
    1453
    1454
    1455
    1456
    1457
    1458
    1459
    1460
    1461
    1462
    1463
    1464
    1465
    1466
    1467
    1468
    1469
    1470
    1471
    1472
    1473
    1474
    1475
    1476
    1477
    1478
    1479
    1480
    1481
    1482
    1483
    1484
    1485
    1486
    1487
    1488
    1489
    1490
    1491
    1492
    def path_drawing_elements(self) -> list[momapy.drawing.Path]:
        """Return the drawing elements of the double-headed arc path"""
        start_arrowhead_length = self.start_arrowhead_length()
        end_arrowhead_length = self.end_arrowhead_length()
        if len(self.segments) == 1:
            segment = (
                self.segments[0]
                .shortened(self.start_shorten + start_arrowhead_length, "start")
                .shortened(self.end_shorten + end_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_arrowhead_length, "start"
            )
            last_segment = self.segments[-1].shortened(
                self.end_shorten + end_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()

Return the self drawing elements of the double-headed arc. These include the drawing elements of the arc path, the start arrowhead, and the end arrowhead

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

    782
    783
    784
    785
    786
    787
    788
    789
    790
    791
    792
    793
    794
    795
    def self_drawing_elements(self):
        drawing_elements = momapy.builder.super_or_builder(
            CellDesignerDoubleHeadedArc, self
        ).self_drawing_elements()
        done_bases = []
        for base in type(self).__mro__:
            if (
                momapy.builder.issubclass_or_builder(base, momapy.sbgn.core._SBGNMixin)
                and base is not type(self)
                and not any([issubclass(done_base, base) for done_base in done_bases])
            ):
                drawing_elements += getattr(base, "_mixin_drawing_elements")(self)
                done_bases.append(base)
        return drawing_elements

#### `` 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_arrowhead_base

    start_arrowhead_base() -> Point

Return the base anchor point of the double-headed arc start arrowhead

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

    1285
    1286
    1287
    1288
    1289
    1290
    1291
    1292
    1293
    1294
    1295
    1296
    def start_arrowhead_base(self) -> momapy.geometry.Point:
        """Return the base anchor point of the double-headed arc start arrowhead"""
        arrowhead_length = self.start_arrowhead_length()
        if arrowhead_length == 0:
            return self.start_point()
        segment = self.segments[0]
        segment = momapy.geometry.Segment(segment.p2, segment.p1)
        segment_length = segment.length()
        if segment_length == 0:
            return self.start_arrowhead_tip() + (arrowhead_length, 0)
        fraction = 1 - (arrowhead_length + self.start_shorten) / segment_length
        return segment.get_position_at_fraction(fraction)

#### `` start_arrowhead_bbox

    start_arrowhead_bbox() -> Bbox

Return the bounding box of the double-headed arc start arrowhead

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

    1298
    1299
    1300
    1301
    1302
    def start_arrowhead_bbox(self) -> momapy.geometry.Bbox:
        """Return the bounding box of the double-headed arc start arrowhead"""
        return momapy.drawing.get_drawing_elements_bbox(
            self.start_arrowhead_drawing_elements()
        )

#### `` start_arrowhead_border

    start_arrowhead_border(point) -> Point

Return the point at the intersection of the drawing elements of the double-headed arc start 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`

    1304
    1305
    1306
    1307
    1308
    1309
    1310
    1311
    1312
    1313
    def start_arrowhead_border(self, point) -> momapy.geometry.Point:
        """Return the point at the intersection of the drawing elements of the double-headed arc start 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.start_arrowhead_drawing_elements(), point
        )
        if point.isnan():
            return self.start_arrowhead_tip()
        return point

#### `` start_arrowhead_drawing_elements

    start_arrowhead_drawing_elements() -> list[DrawingElement]

Return the drawing elements of the double-headed arc start arrowhead

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

    1394
    1395
    1396
    1397
    1398
    1399
    1400
    1401
    1402
    1403
    1404
    1405
    1406
    1407
    1408
    1409
    1410
    1411
    1412
    1413
    def start_arrowhead_drawing_elements(
        self,
    ) -> list[momapy.drawing.DrawingElement]:
        """Return the drawing elements of the double-headed arc start arrowhead"""
        drawing_elements = self._start_arrowhead_border_drawing_elements()
        group = momapy.drawing.Group(
            class_=f"{type(self).__name__}_start_arrowhead",
            elements=tuple(drawing_elements),
            id_=f"{self.id_}_start_arrowhead",
            fill=self.start_arrowhead_fill,
            filter=self.start_arrowhead_filter,
            stroke=self.start_arrowhead_stroke,
            stroke_dasharray=self.start_arrowhead_stroke_dasharray,
            stroke_dashoffset=self.start_arrowhead_stroke_dashoffset,
            stroke_width=self.start_arrowhead_stroke_width,
            transform=self.start_arrowhead_transform,
        )
        transformation = self._get_start_arrowhead_transformation()
        group = group.transformed(transformation)
        return [group]

#### `` start_arrowhead_length

    start_arrowhead_length() -> float

Return the length of the double-headed arc start arrowhead

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

    1266
    1267
    1268
    1269
    1270
    1271
    1272
    1273
    def start_arrowhead_length(self) -> float:
        """Return the length of the double-headed arc start arrowhead"""
        bbox = momapy.drawing.get_drawing_elements_bbox(
            self._start_arrowhead_border_drawing_elements()
        )
        if math.isnan(bbox.width):
            return 0.0
        return abs(bbox.west().x)

#### `` start_arrowhead_tip

    start_arrowhead_tip() -> Point

Return the tip anchor point of the double-headed arc start arrowhead

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

    1275
    1276
    1277
    1278
    1279
    1280
    1281
    1282
    1283
    def start_arrowhead_tip(self) -> momapy.geometry.Point:
        """Return the tip anchor point of the double-headed arc start arrowhead"""
        segment = self.segments[0]
        segment = momapy.geometry.Segment(segment.p2, segment.p1)
        segment_length = segment.length()
        if segment_length == 0:
            return segment.p2
        fraction = 1 - self.start_shorten / segment_length
        return segment.get_position_at_fraction(fraction)

#### `` 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)

### `` Transport `dataclass`

    Transport(
        *,
        id_: str = make_uuid4_as_str(),
        name: str | None = None,
        sbo_term: SBOTerm | None = None,
        metaid: str | None = None,
        reversible: bool,
        compartment: Compartment | None = None,
        reactants: frozenset[Reactant] = frozenset(),
        products: frozenset[Product] = frozenset(),
        modifiers: frozenset[
            KnownOrUnknownModulator
        ] = frozenset(),
    )

Bases: `Reaction`

Class for transports

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 | `'d9521e78-5b07-472a-98b6-3e320f2f042f'`
`name` | `str | None` |  | `None`
`sbo_term` | `SBOTerm | None` |  | `None`
`metaid` | `str | None` |  | `None`
`reversible` | `bool` |  | required
`compartment` | `Compartment | None` |  | `None`
`reactants` | `frozenset[Reactant]` | The reactants of the reaction | `<class 'frozenset'>`
`products` | `frozenset[Product]` | The products of the reaction | `<class 'frozenset'>`
`modifiers` | `frozenset[KnownOrUnknownModulator]` | The modifiers of the reaction | `<class 'frozenset'>`

### `` TransportLayout `dataclass`

    TransportLayout(
        *,
        _left_connector_fraction: float = 0.4,
        _right_connector_fraction: float = 0.6,
        reaction_node_height: float = 10.0,
        reaction_node_width: float = 10.0,
        reaction_node_segment: int = 1,
        reaction_node_stroke: NoneValueType
        | Color
        | None = black,
        reaction_node_stroke_width: float | None = 1.0,
        reaction_node_stroke_dasharray: NoneValueType
        | tuple[float]
        | None = None,
        reaction_node_stroke_dashoffset: float | None = None,
        reaction_node_fill: NoneValueType
        | Color
        | None = white,
        reaction_node_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        reaction_node_filter: 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,
        end_shorten: float = 2.0,
        fill: NoneValueType | Color | None = None,
        filter: NoneValueType | Filter | None = None,
        path_fill: NoneValueType | Color | None = NoneValue,
        path_filter: NoneValueType | Filter | None = None,
        path_stroke: NoneValueType | Color | None = black,
        path_stroke_dasharray: tuple[float, ...] | None = None,
        path_stroke_dashoffset: float | None = None,
        path_stroke_width: float | None = 1.0,
        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 = 2.0,
        target: LayoutElement | None = None,
        transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        end_arrowhead_fill: NoneValueType
        | Color
        | None = black,
        end_arrowhead_filter: NoneValueType
        | Filter
        | None = None,
        end_arrowhead_stroke: NoneValueType
        | Color
        | None = black,
        end_arrowhead_stroke_dasharray: NoneValueType
        | tuple[float]
        | None = None,
        end_arrowhead_stroke_dashoffset: float | None = None,
        end_arrowhead_stroke_width: float | None = 1.0,
        end_arrowhead_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        start_arrowhead_fill: NoneValueType
        | Color
        | None = black,
        start_arrowhead_filter: NoneValueType
        | Filter
        | None = None,
        start_arrowhead_stroke: NoneValueType
        | Color
        | None = black,
        start_arrowhead_stroke_dasharray: NoneValueType
        | tuple[float]
        | None = None,
        start_arrowhead_stroke_dashoffset: float | None = None,
        start_arrowhead_stroke_width: float | None = 1.0,
        start_arrowhead_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        reversible: bool = False,
        end_arrowhead_bar_height: float = 8.0,
        end_arrowhead_sep: float = 5.0,
        end_arrowhead_triangle_height: float = 8.0,
        end_arrowhead_triangle_width: float = 15.0,
        start_arrowhead_bar_height: float = 8.0,
        start_arrowhead_sep: float = 4.0,
        start_arrowhead_triangle_height: float = 8.0,
        start_arrowhead_triangle_width: float = 15.0,
    )

Bases: `_ReactionLayout`, `_ReactionNodeMixin`

Class for transport layouts

Parameters:

Name | Type | Description | Default
--- | --- | --- | ---
`reaction_node_height` | `float` |  | `10.0`
`reaction_node_width` | `float` |  | `10.0`
`reaction_node_segment` | `int` |  | `1`
`reaction_node_stroke` | `NoneValueType | Color | None` |  | `Color(red=0, green=0, blue=0, alpha=1.0)`
`reaction_node_stroke_width` | `float | None` |  | `1.0`
`reaction_node_stroke_dasharray` | `NoneValueType | tuple[float] | None` |  | `None`
`reaction_node_stroke_dashoffset` | `float | None` |  | `None`
`reaction_node_fill` | `NoneValueType | Color | None` |  | `Color(red=255, green=255, blue=255, alpha=1.0)`
`reaction_node_transform` | `NoneValueType | tuple[Transformation] | None` |  | `None`
`reaction_node_filter` | `NoneValueType | Filter | None` |  | `None`
`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 | `'22304a9a-9e24-4841-bbd0-1862e2c9b8b5'`
`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` |  | `2.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.0`
`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` |  | `2.0`
`target` | `LayoutElement | None` | The target of the arc | `None`
`transform` | `NoneValueType | tuple[Transformation] | None` | The transform of the arc | `None`
`end_arrowhead_fill` | `NoneValueType | Color | None` |  | `Color(red=0, green=0, blue=0, alpha=1.0)`
`end_arrowhead_filter` | `NoneValueType | Filter | None` |  | `None`
`end_arrowhead_stroke` | `NoneValueType | Color | None` |  | `Color(red=0, green=0, blue=0, alpha=1.0)`
`end_arrowhead_stroke_dasharray` | `NoneValueType | tuple[float] | None` |  | `None`
`end_arrowhead_stroke_dashoffset` | `float | None` |  | `None`
`end_arrowhead_stroke_width` | `float | None` |  | `1.0`
`end_arrowhead_transform` | `NoneValueType | tuple[Transformation] | None` |  | `None`
`start_arrowhead_fill` | `NoneValueType | Color | None` |  | `Color(red=0, green=0, blue=0, alpha=1.0)`
`start_arrowhead_filter` | `NoneValueType | Filter | None` |  | `None`
`start_arrowhead_stroke` | `NoneValueType | Color | None` |  | `Color(red=0, green=0, blue=0, alpha=1.0)`
`start_arrowhead_stroke_dasharray` | `NoneValueType | tuple[float] | None` |  | `None`
`start_arrowhead_stroke_dashoffset` | `float | None` |  | `None`
`start_arrowhead_stroke_width` | `float | None` |  | `1.0`
`start_arrowhead_transform` | `NoneValueType | tuple[Transformation] | None` |  | `None`
`reversible` | `bool` |  | `False`
`end_arrowhead_bar_height` | `float` |  | `8.0`
`end_arrowhead_sep` | `float` |  | `5.0`
`end_arrowhead_triangle_height` | `float` |  | `8.0`
`end_arrowhead_triangle_width` | `float` |  | `15.0`
`start_arrowhead_bar_height` | `float` |  | `8.0`
`start_arrowhead_sep` | `float` |  | `4.0`
`start_arrowhead_triangle_height` | `float` |  | `8.0`
`start_arrowhead_triangle_width` | `float` |  | `15.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
`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_arrowhead_base` | Return the base anchor point of the double-headed arc end arrowhead
`end_arrowhead_bbox` | Return the bounding box of the double-headed arc start arrowhead
`end_arrowhead_border` | Return the point at the intersection of the drawing elements of the double-headed arc end arrowhead and the line going through the center of these drawing elements and the given point.
`end_arrowhead_length` | Return the length of the double-headed arc end arrowhead
`end_arrowhead_tip` | Return the tip anchor point of the double-headed arc end arrowhead
`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 double-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 double-headed arc. These include the drawing elements of the arc path, the start arrowhead, and the end arrowhead
`self_to_shapely` | Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout
`start_arrowhead_base` | Return the base anchor point of the double-headed arc start arrowhead
`start_arrowhead_bbox` | Return the bounding box of the double-headed arc start arrowhead
`start_arrowhead_border` | Return the point at the intersection of the drawing elements of the double-headed arc start arrowhead and the line going through the center of these drawing elements and the given point.
`start_arrowhead_drawing_elements` | Return the drawing elements of the double-headed arc start arrowhead
`start_arrowhead_length` | Return the length of the double-headed arc start arrowhead
`start_arrowhead_tip` | Return the tip anchor point of the double-headed arc start arrowhead
`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)()

#### `` 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_arrowhead_base

    end_arrowhead_base() -> Point

Return the base anchor point of the double-headed arc end arrowhead

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

    1333
    1334
    1335
    1336
    1337
    1338
    1339
    1340
    1341
    1342
    1343
    def end_arrowhead_base(self) -> momapy.geometry.Point:
        """Return the base anchor point of the double-headed arc end arrowhead"""
        arrowhead_length = self.end_arrowhead_length()
        if arrowhead_length == 0:
            return self.end_point()
        segment = self.segments[-1]
        segment_length = segment.length()
        if segment_length == 0:
            return self.end_arrowhead_tip() - (arrowhead_length, 0)
        fraction = 1 - (arrowhead_length + self.end_shorten) / segment_length
        return segment.get_position_at_fraction(fraction)

#### `` end_arrowhead_bbox

    end_arrowhead_bbox()

Return the bounding box of the double-headed arc start arrowhead

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

    1345
    1346
    1347
    1348
    1349
    def end_arrowhead_bbox(self):
        """Return the bounding box of the double-headed arc start arrowhead"""
        return momapy.drawing.get_drawing_elements_bbox(
            self.end_arrowhead_drawing_elements()
        )

#### `` end_arrowhead_border

    end_arrowhead_border(point)

Return the point at the intersection of the drawing elements of the double-headed arc end 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`

    1351
    1352
    1353
    1354
    1355
    1356
    1357
    1358
    1359
    1360
    1361
    def end_arrowhead_border(self, point):
        """Return the point at the intersection of the drawing elements of the double-headed arc end 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.end_arrowhead_drawing_elements(), point
        )
        if point.isnan():
            return self.end_arrowhead_tip()
        return point

#### `` end_arrowhead_length

    end_arrowhead_length() -> float

Return the length of the double-headed arc end arrowhead

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

    1315
    1316
    1317
    1318
    1319
    1320
    1321
    1322
    def end_arrowhead_length(self) -> float:
        """Return the length of the double-headed arc end arrowhead"""
        bbox = momapy.drawing.get_drawing_elements_bbox(
            self._end_arrowhead_border_drawing_elements()
        )
        if math.isnan(bbox.width):
            return 0.0
        return bbox.east().x

#### `` end_arrowhead_tip

    end_arrowhead_tip() -> Point

Return the tip anchor point of the double-headed arc end arrowhead

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

    1324
    1325
    1326
    1327
    1328
    1329
    1330
    1331
    def end_arrowhead_tip(self) -> momapy.geometry.Point:
        """Return the tip anchor point of the double-headed arc end arrowhead"""
        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)

#### `` 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 double-headed arc path

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

    1451
    1452
    1453
    1454
    1455
    1456
    1457
    1458
    1459
    1460
    1461
    1462
    1463
    1464
    1465
    1466
    1467
    1468
    1469
    1470
    1471
    1472
    1473
    1474
    1475
    1476
    1477
    1478
    1479
    1480
    1481
    1482
    1483
    1484
    1485
    1486
    1487
    1488
    1489
    1490
    1491
    1492
    def path_drawing_elements(self) -> list[momapy.drawing.Path]:
        """Return the drawing elements of the double-headed arc path"""
        start_arrowhead_length = self.start_arrowhead_length()
        end_arrowhead_length = self.end_arrowhead_length()
        if len(self.segments) == 1:
            segment = (
                self.segments[0]
                .shortened(self.start_shorten + start_arrowhead_length, "start")
                .shortened(self.end_shorten + end_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_arrowhead_length, "start"
            )
            last_segment = self.segments[-1].shortened(
                self.end_shorten + end_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()

Return the self drawing elements of the double-headed arc. These include the drawing elements of the arc path, the start arrowhead, and the end arrowhead

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

    782
    783
    784
    785
    786
    787
    788
    789
    790
    791
    792
    793
    794
    795
    def self_drawing_elements(self):
        drawing_elements = momapy.builder.super_or_builder(
            CellDesignerDoubleHeadedArc, self
        ).self_drawing_elements()
        done_bases = []
        for base in type(self).__mro__:
            if (
                momapy.builder.issubclass_or_builder(base, momapy.sbgn.core._SBGNMixin)
                and base is not type(self)
                and not any([issubclass(done_base, base) for done_base in done_bases])
            ):
                drawing_elements += getattr(base, "_mixin_drawing_elements")(self)
                done_bases.append(base)
        return drawing_elements

#### `` 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_arrowhead_base

    start_arrowhead_base() -> Point

Return the base anchor point of the double-headed arc start arrowhead

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

    1285
    1286
    1287
    1288
    1289
    1290
    1291
    1292
    1293
    1294
    1295
    1296
    def start_arrowhead_base(self) -> momapy.geometry.Point:
        """Return the base anchor point of the double-headed arc start arrowhead"""
        arrowhead_length = self.start_arrowhead_length()
        if arrowhead_length == 0:
            return self.start_point()
        segment = self.segments[0]
        segment = momapy.geometry.Segment(segment.p2, segment.p1)
        segment_length = segment.length()
        if segment_length == 0:
            return self.start_arrowhead_tip() + (arrowhead_length, 0)
        fraction = 1 - (arrowhead_length + self.start_shorten) / segment_length
        return segment.get_position_at_fraction(fraction)

#### `` start_arrowhead_bbox

    start_arrowhead_bbox() -> Bbox

Return the bounding box of the double-headed arc start arrowhead

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

    1298
    1299
    1300
    1301
    1302
    def start_arrowhead_bbox(self) -> momapy.geometry.Bbox:
        """Return the bounding box of the double-headed arc start arrowhead"""
        return momapy.drawing.get_drawing_elements_bbox(
            self.start_arrowhead_drawing_elements()
        )

#### `` start_arrowhead_border

    start_arrowhead_border(point) -> Point

Return the point at the intersection of the drawing elements of the double-headed arc start 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`

    1304
    1305
    1306
    1307
    1308
    1309
    1310
    1311
    1312
    1313
    def start_arrowhead_border(self, point) -> momapy.geometry.Point:
        """Return the point at the intersection of the drawing elements of the double-headed arc start 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.start_arrowhead_drawing_elements(), point
        )
        if point.isnan():
            return self.start_arrowhead_tip()
        return point

#### `` start_arrowhead_drawing_elements

    start_arrowhead_drawing_elements() -> list[DrawingElement]

Return the drawing elements of the double-headed arc start arrowhead

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

    1394
    1395
    1396
    1397
    1398
    1399
    1400
    1401
    1402
    1403
    1404
    1405
    1406
    1407
    1408
    1409
    1410
    1411
    1412
    1413
    def start_arrowhead_drawing_elements(
        self,
    ) -> list[momapy.drawing.DrawingElement]:
        """Return the drawing elements of the double-headed arc start arrowhead"""
        drawing_elements = self._start_arrowhead_border_drawing_elements()
        group = momapy.drawing.Group(
            class_=f"{type(self).__name__}_start_arrowhead",
            elements=tuple(drawing_elements),
            id_=f"{self.id_}_start_arrowhead",
            fill=self.start_arrowhead_fill,
            filter=self.start_arrowhead_filter,
            stroke=self.start_arrowhead_stroke,
            stroke_dasharray=self.start_arrowhead_stroke_dasharray,
            stroke_dashoffset=self.start_arrowhead_stroke_dashoffset,
            stroke_width=self.start_arrowhead_stroke_width,
            transform=self.start_arrowhead_transform,
        )
        transformation = self._get_start_arrowhead_transformation()
        group = group.transformed(transformation)
        return [group]

#### `` start_arrowhead_length

    start_arrowhead_length() -> float

Return the length of the double-headed arc start arrowhead

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

    1266
    1267
    1268
    1269
    1270
    1271
    1272
    1273
    def start_arrowhead_length(self) -> float:
        """Return the length of the double-headed arc start arrowhead"""
        bbox = momapy.drawing.get_drawing_elements_bbox(
            self._start_arrowhead_border_drawing_elements()
        )
        if math.isnan(bbox.width):
            return 0.0
        return abs(bbox.west().x)

#### `` start_arrowhead_tip

    start_arrowhead_tip() -> Point

Return the tip anchor point of the double-headed arc start arrowhead

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

    1275
    1276
    1277
    1278
    1279
    1280
    1281
    1282
    1283
    def start_arrowhead_tip(self) -> momapy.geometry.Point:
        """Return the tip anchor point of the double-headed arc start arrowhead"""
        segment = self.segments[0]
        segment = momapy.geometry.Segment(segment.p2, segment.p1)
        segment_length = segment.length()
        if segment_length == 0:
            return segment.p2
        fraction = 1 - self.start_shorten / segment_length
        return segment.get_position_at_fraction(fraction)

#### `` 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)

### `` Trigger `dataclass`

    Trigger(
        *,
        id_: str = make_uuid4_as_str(),
        name: str | None = None,
        sbo_term: SBOTerm | None = None,
        metaid: str | None = None,
        referred_species: Species | BooleanLogicGate,
    )

Bases: `Modulator`

Class for triggers

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 | `'3dda08a1-cce6-4899-aa6a-4050b9addf38'`
`name` | `str | None` |  | `None`
`sbo_term` | `SBOTerm | None` |  | `None`
`metaid` | `str | None` |  | `None`
`referred_species` | `Species | BooleanLogicGate` | The species the modifier refers to | required

### `` Triggering `dataclass`

    Triggering(
        *,
        id_: str = make_uuid4_as_str(),
        source: Species | BooleanLogicGate,
        target: Species | None,
    )

Bases: `Modulation`

Class for triggerings

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 | `'ac163653-e45e-4c46-a095-b30e9775994d'`
`source` | `Species | BooleanLogicGate` | The source of the influence | required
`target` | `Species | None` | The target of the influence | required

### `` TriggeringLayout `dataclass`

    TriggeringLayout(
        *,
        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_fill: NoneValueType | Color | None = NoneValue,
        path_filter: NoneValueType | Filter | None = None,
        path_stroke: NoneValueType | Color | None = black,
        path_stroke_dasharray: tuple[float, ...] | None = None,
        path_stroke_dashoffset: float | None = None,
        path_stroke_width: float | None = 1.0,
        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: NoneValueType | Color | None = black,
        arrowhead_stroke_dasharray: tuple[float, ...]
        | None = None,
        arrowhead_stroke_dashoffset: float | None = None,
        arrowhead_stroke_width: float | None = 1.0,
        arrowhead_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        arrowhead_bar_height: float = 8.0,
        arrowhead_sep: float = 5.0,
        arrowhead_triangle_height: float = 10.0,
        arrowhead_triangle_width: float = 15.0,
    )

Bases: `CellDesignerSingleHeadedArc`

Class for triggering 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 | `'5dd12130-cb66-41b2-895c-ce3fa49cb8d5'`
`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.0`
`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.0`
`arrowhead_transform` | `NoneValueType | tuple[Transformation] | None` | The arrowhead transform of the arc | `None`
`arrowhead_bar_height` | `float` |  | `8.0`
`arrowhead_sep` | `float` |  | `5.0`
`arrowhead_triangle_height` | `float` |  | `10.0`
`arrowhead_triangle_width` | `float` |  | `15.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()

Return the self drawing elements of the single-headed arc

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

    754
    755
    756
    757
    758
    759
    760
    761
    762
    763
    764
    765
    766
    767
    def self_drawing_elements(self):
        drawing_elements = momapy.builder.super_or_builder(
            CellDesignerSingleHeadedArc, self
        ).self_drawing_elements()
        done_bases = []
        for base in type(self).__mro__:
            if (
                momapy.builder.issubclass_or_builder(base, momapy.sbgn.core._SBGNMixin)
                and base is not type(self)
                and not any([issubclass(done_base, base) for done_base in done_bases])
            ):
                drawing_elements += getattr(base, "_mixin_drawing_elements")(self)
                done_bases.append(base)
        return drawing_elements

#### `` 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)

### `` TruncatedProtein `dataclass`

    TruncatedProtein(
        *,
        id_: str = make_uuid4_as_str(),
        name: str | None = None,
        sbo_term: SBOTerm | None = None,
        metaid: str | None = None,
        compartment: Compartment | None = None,
        hypothetical: bool = False,
        active: bool = False,
        homomultimer: int = 1,
        template: TruncatedProteinTemplate,
        modifications: frozenset[Modification] = frozenset(),
        structural_states: frozenset[
            StructuralState
        ] = frozenset(),
    )

Bases: `Protein`

Class for truncated proteins

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 | `'019bffd4-14c1-474a-b30e-4e01ceabe024'`
`name` | `str | None` |  | `None`
`sbo_term` | `SBOTerm | None` |  | `None`
`metaid` | `str | None` |  | `None`
`compartment` | `Compartment | None` |  | `None`
`hypothetical` | `bool` | Whether the species is hypothetical or not | `False`
`active` | `bool` | Whether the species is active or not | `False`
`homomultimer` | `int` | The number of subunits forming the species | `1`
`template` | `TruncatedProteinTemplate` | The template of the truncated protein | required
`modifications` | `frozenset[Modification]` | The modifications of the proteins | `<class 'frozenset'>`
`structural_states` | `frozenset[StructuralState]` | The structural states of the protein | `<class 'frozenset'>`

### `` TruncatedProteinLayout `dataclass`

    TruncatedProteinLayout(
        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,
        active: bool = False,
        active_fill: NoneValueType | Color | None = NoneValue,
        active_filter: NoneValueType | Filter | None = None,
        active_sep: float = 4.0,
        active_stroke: NoneValueType | Color | None = black,
        active_stroke_dasharray: NoneValueType
        | tuple[float]
        | None = (4, 2),
        active_stroke_dashoffset: float | None = None,
        active_stroke_width: float | None = 1.0,
        active_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        n: int = 1,
        rounded_corners: float = 15.0,
        vertical_truncation: float = 0.4,
        horizontal_truncation: float = 0.2,
    )

Bases: `_MultiNodeMixin`, `CellDesignerNode`

Class for truncated protein 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 | `'fe03e203-3b72-4dd6-b1bd-4403c1ca63db'`
`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`
`active` | `bool` |  | `False`
`active_fill` | `NoneValueType | Color | None` |  | `<momapy.drawing.NoneValueType object at 0x7fb32ae9f1d0>`
`active_filter` | `NoneValueType | Filter | None` |  | `None`
`active_sep` | `float` |  | `4.0`
`active_stroke` | `NoneValueType | Color | None` |  | `Color(red=0, green=0, blue=0, alpha=1.0)`
`active_stroke_dasharray` | `NoneValueType | tuple[float] | None` |  | `(4, 2)`
`active_stroke_dashoffset` | `float | None` |  | `None`
`active_stroke_width` | `float | None` |  | `1.0`
`active_transform` | `NoneValueType | tuple[Transformation] | None` |  | `None`
`n` | `int` |  | `1`
`rounded_corners` | `float` |  | `15.0`
`vertical_truncation` | `float` |  | `0.4`
`horizontal_truncation` | `float` |  | `0.2`

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

### `` TruncatedProteinTemplate `dataclass`

    TruncatedProteinTemplate(
        *,
        id_: str = make_uuid4_as_str(),
        name: str,
        modification_residues: frozenset[
            ModificationResidue
        ] = frozenset(),
    )

Bases: `ProteinTemplate`

Class for truncated protein templates

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 | `'b25f4a11-c1b0-43a5-84d3-f798feceab66'`
`name` | `str` | The name of the species template | required
`modification_residues` | `frozenset[ModificationResidue]` | The modification residues of the protein template | `<class 'frozenset'>`

### `` Truncation `dataclass`

    Truncation(
        *,
        id_: str = make_uuid4_as_str(),
        name: str | None = None,
        sbo_term: SBOTerm | None = None,
        metaid: str | None = None,
        reversible: bool,
        compartment: Compartment | None = None,
        reactants: frozenset[Reactant] = frozenset(),
        products: frozenset[Product] = frozenset(),
        modifiers: frozenset[
            KnownOrUnknownModulator
        ] = frozenset(),
    )

Bases: `Reaction`

Class for truncations

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 | `'1700a3a4-f596-49c8-852b-7d4b13de11ee'`
`name` | `str | None` |  | `None`
`sbo_term` | `SBOTerm | None` |  | `None`
`metaid` | `str | None` |  | `None`
`reversible` | `bool` |  | required
`compartment` | `Compartment | None` |  | `None`
`reactants` | `frozenset[Reactant]` | The reactants of the reaction | `<class 'frozenset'>`
`products` | `frozenset[Product]` | The products of the reaction | `<class 'frozenset'>`
`modifiers` | `frozenset[KnownOrUnknownModulator]` | The modifiers of the reaction | `<class 'frozenset'>`

### `` TruncationLayout `dataclass`

    TruncationLayout(
        *,
        _left_connector_fraction: float = 0.4,
        _right_connector_fraction: float = 0.6,
        reaction_node_height: float = 10.0,
        reaction_node_width: float = 10.0,
        reaction_node_segment: int = 1,
        reaction_node_stroke: NoneValueType
        | Color
        | None = black,
        reaction_node_stroke_width: float | None = 1.0,
        reaction_node_stroke_dasharray: NoneValueType
        | tuple[float]
        | None = None,
        reaction_node_stroke_dashoffset: float | None = None,
        reaction_node_fill: NoneValueType
        | Color
        | None = white,
        reaction_node_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        reaction_node_filter: 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,
        end_shorten: float = 2.0,
        fill: NoneValueType | Color | None = None,
        filter: NoneValueType | Filter | None = None,
        path_fill: NoneValueType | Color | None = NoneValue,
        path_filter: NoneValueType | Filter | None = None,
        path_stroke: NoneValueType | Color | None = black,
        path_stroke_dasharray: tuple[float, ...] | None = None,
        path_stroke_dashoffset: float | None = None,
        path_stroke_width: float | None = 1.0,
        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 = 2.0,
        target: LayoutElement | None = None,
        transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        end_arrowhead_fill: NoneValueType
        | Color
        | None = white,
        end_arrowhead_filter: NoneValueType
        | Filter
        | None = None,
        end_arrowhead_stroke: NoneValueType
        | Color
        | None = black,
        end_arrowhead_stroke_dasharray: NoneValueType
        | tuple[float]
        | None = None,
        end_arrowhead_stroke_dashoffset: float | None = None,
        end_arrowhead_stroke_width: float | None = 1.0,
        end_arrowhead_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        start_arrowhead_fill: NoneValueType
        | Color
        | None = black,
        start_arrowhead_filter: NoneValueType
        | Filter
        | None = None,
        start_arrowhead_stroke: NoneValueType
        | Color
        | None = black,
        start_arrowhead_stroke_dasharray: NoneValueType
        | tuple[float]
        | None = None,
        start_arrowhead_stroke_dashoffset: float | None = None,
        start_arrowhead_stroke_width: float | None = 1.0,
        start_arrowhead_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        reversible: bool = False,
        end_arrowhead_height: float = 10.0,
        end_arrowhead_sep: float = 2.0,
        end_arrowhead_width: float = 10.0,
        start_arrowhead_height: float = 8.0,
        start_arrowhead_width: float = 15.0,
    )

Bases: `_ReactionLayout`, `_ReactionNodeMixin`

Class for truncation layouts

Parameters:

Name | Type | Description | Default
--- | --- | --- | ---
`reaction_node_height` | `float` |  | `10.0`
`reaction_node_width` | `float` |  | `10.0`
`reaction_node_segment` | `int` |  | `1`
`reaction_node_stroke` | `NoneValueType | Color | None` |  | `Color(red=0, green=0, blue=0, alpha=1.0)`
`reaction_node_stroke_width` | `float | None` |  | `1.0`
`reaction_node_stroke_dasharray` | `NoneValueType | tuple[float] | None` |  | `None`
`reaction_node_stroke_dashoffset` | `float | None` |  | `None`
`reaction_node_fill` | `NoneValueType | Color | None` |  | `Color(red=255, green=255, blue=255, alpha=1.0)`
`reaction_node_transform` | `NoneValueType | tuple[Transformation] | None` |  | `None`
`reaction_node_filter` | `NoneValueType | Filter | None` |  | `None`
`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 | `'24645f62-072b-44c2-bbb2-202bc58b48fd'`
`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` |  | `2.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.0`
`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` |  | `2.0`
`target` | `LayoutElement | None` | The target of the arc | `None`
`transform` | `NoneValueType | tuple[Transformation] | None` | The transform of the arc | `None`
`end_arrowhead_fill` | `NoneValueType | Color | None` |  | `Color(red=255, green=255, blue=255, alpha=1.0)`
`end_arrowhead_filter` | `NoneValueType | Filter | None` |  | `None`
`end_arrowhead_stroke` | `NoneValueType | Color | None` |  | `Color(red=0, green=0, blue=0, alpha=1.0)`
`end_arrowhead_stroke_dasharray` | `NoneValueType | tuple[float] | None` |  | `None`
`end_arrowhead_stroke_dashoffset` | `float | None` |  | `None`
`end_arrowhead_stroke_width` | `float | None` |  | `1.0`
`end_arrowhead_transform` | `NoneValueType | tuple[Transformation] | None` |  | `None`
`start_arrowhead_fill` | `NoneValueType | Color | None` |  | `Color(red=0, green=0, blue=0, alpha=1.0)`
`start_arrowhead_filter` | `NoneValueType | Filter | None` |  | `None`
`start_arrowhead_stroke` | `NoneValueType | Color | None` |  | `Color(red=0, green=0, blue=0, alpha=1.0)`
`start_arrowhead_stroke_dasharray` | `NoneValueType | tuple[float] | None` |  | `None`
`start_arrowhead_stroke_dashoffset` | `float | None` |  | `None`
`start_arrowhead_stroke_width` | `float | None` |  | `1.0`
`start_arrowhead_transform` | `NoneValueType | tuple[Transformation] | None` |  | `None`
`reversible` | `bool` |  | `False`
`end_arrowhead_height` | `float` |  | `10.0`
`end_arrowhead_sep` | `float` |  | `2.0`
`end_arrowhead_width` | `float` |  | `10.0`
`start_arrowhead_height` | `float` |  | `8.0`
`start_arrowhead_width` | `float` |  | `15.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
`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_arrowhead_base` | Return the base anchor point of the double-headed arc end arrowhead
`end_arrowhead_bbox` | Return the bounding box of the double-headed arc start arrowhead
`end_arrowhead_border` | Return the point at the intersection of the drawing elements of the double-headed arc end arrowhead and the line going through the center of these drawing elements and the given point.
`end_arrowhead_length` | Return the length of the double-headed arc end arrowhead
`end_arrowhead_tip` | Return the tip anchor point of the double-headed arc end arrowhead
`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 double-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 double-headed arc. These include the drawing elements of the arc path, the start arrowhead, and the end arrowhead
`self_to_shapely` | Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout
`start_arrowhead_base` | Return the base anchor point of the double-headed arc start arrowhead
`start_arrowhead_bbox` | Return the bounding box of the double-headed arc start arrowhead
`start_arrowhead_border` | Return the point at the intersection of the drawing elements of the double-headed arc start arrowhead and the line going through the center of these drawing elements and the given point.
`start_arrowhead_drawing_elements` | Return the drawing elements of the double-headed arc start arrowhead
`start_arrowhead_length` | Return the length of the double-headed arc start arrowhead
`start_arrowhead_tip` | Return the tip anchor point of the double-headed arc start arrowhead
`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)()

#### `` 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_arrowhead_base

    end_arrowhead_base() -> Point

Return the base anchor point of the double-headed arc end arrowhead

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

    1333
    1334
    1335
    1336
    1337
    1338
    1339
    1340
    1341
    1342
    1343
    def end_arrowhead_base(self) -> momapy.geometry.Point:
        """Return the base anchor point of the double-headed arc end arrowhead"""
        arrowhead_length = self.end_arrowhead_length()
        if arrowhead_length == 0:
            return self.end_point()
        segment = self.segments[-1]
        segment_length = segment.length()
        if segment_length == 0:
            return self.end_arrowhead_tip() - (arrowhead_length, 0)
        fraction = 1 - (arrowhead_length + self.end_shorten) / segment_length
        return segment.get_position_at_fraction(fraction)

#### `` end_arrowhead_bbox

    end_arrowhead_bbox()

Return the bounding box of the double-headed arc start arrowhead

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

    1345
    1346
    1347
    1348
    1349
    def end_arrowhead_bbox(self):
        """Return the bounding box of the double-headed arc start arrowhead"""
        return momapy.drawing.get_drawing_elements_bbox(
            self.end_arrowhead_drawing_elements()
        )

#### `` end_arrowhead_border

    end_arrowhead_border(point)

Return the point at the intersection of the drawing elements of the double-headed arc end 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`

    1351
    1352
    1353
    1354
    1355
    1356
    1357
    1358
    1359
    1360
    1361
    def end_arrowhead_border(self, point):
        """Return the point at the intersection of the drawing elements of the double-headed arc end 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.end_arrowhead_drawing_elements(), point
        )
        if point.isnan():
            return self.end_arrowhead_tip()
        return point

#### `` end_arrowhead_length

    end_arrowhead_length() -> float

Return the length of the double-headed arc end arrowhead

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

    1315
    1316
    1317
    1318
    1319
    1320
    1321
    1322
    def end_arrowhead_length(self) -> float:
        """Return the length of the double-headed arc end arrowhead"""
        bbox = momapy.drawing.get_drawing_elements_bbox(
            self._end_arrowhead_border_drawing_elements()
        )
        if math.isnan(bbox.width):
            return 0.0
        return bbox.east().x

#### `` end_arrowhead_tip

    end_arrowhead_tip() -> Point

Return the tip anchor point of the double-headed arc end arrowhead

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

    1324
    1325
    1326
    1327
    1328
    1329
    1330
    1331
    def end_arrowhead_tip(self) -> momapy.geometry.Point:
        """Return the tip anchor point of the double-headed arc end arrowhead"""
        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)

#### `` 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 double-headed arc path

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

    1451
    1452
    1453
    1454
    1455
    1456
    1457
    1458
    1459
    1460
    1461
    1462
    1463
    1464
    1465
    1466
    1467
    1468
    1469
    1470
    1471
    1472
    1473
    1474
    1475
    1476
    1477
    1478
    1479
    1480
    1481
    1482
    1483
    1484
    1485
    1486
    1487
    1488
    1489
    1490
    1491
    1492
    def path_drawing_elements(self) -> list[momapy.drawing.Path]:
        """Return the drawing elements of the double-headed arc path"""
        start_arrowhead_length = self.start_arrowhead_length()
        end_arrowhead_length = self.end_arrowhead_length()
        if len(self.segments) == 1:
            segment = (
                self.segments[0]
                .shortened(self.start_shorten + start_arrowhead_length, "start")
                .shortened(self.end_shorten + end_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_arrowhead_length, "start"
            )
            last_segment = self.segments[-1].shortened(
                self.end_shorten + end_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()

Return the self drawing elements of the double-headed arc. These include the drawing elements of the arc path, the start arrowhead, and the end arrowhead

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

    782
    783
    784
    785
    786
    787
    788
    789
    790
    791
    792
    793
    794
    795
    def self_drawing_elements(self):
        drawing_elements = momapy.builder.super_or_builder(
            CellDesignerDoubleHeadedArc, self
        ).self_drawing_elements()
        done_bases = []
        for base in type(self).__mro__:
            if (
                momapy.builder.issubclass_or_builder(base, momapy.sbgn.core._SBGNMixin)
                and base is not type(self)
                and not any([issubclass(done_base, base) for done_base in done_bases])
            ):
                drawing_elements += getattr(base, "_mixin_drawing_elements")(self)
                done_bases.append(base)
        return drawing_elements

#### `` 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_arrowhead_base

    start_arrowhead_base() -> Point

Return the base anchor point of the double-headed arc start arrowhead

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

    1285
    1286
    1287
    1288
    1289
    1290
    1291
    1292
    1293
    1294
    1295
    1296
    def start_arrowhead_base(self) -> momapy.geometry.Point:
        """Return the base anchor point of the double-headed arc start arrowhead"""
        arrowhead_length = self.start_arrowhead_length()
        if arrowhead_length == 0:
            return self.start_point()
        segment = self.segments[0]
        segment = momapy.geometry.Segment(segment.p2, segment.p1)
        segment_length = segment.length()
        if segment_length == 0:
            return self.start_arrowhead_tip() + (arrowhead_length, 0)
        fraction = 1 - (arrowhead_length + self.start_shorten) / segment_length
        return segment.get_position_at_fraction(fraction)

#### `` start_arrowhead_bbox

    start_arrowhead_bbox() -> Bbox

Return the bounding box of the double-headed arc start arrowhead

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

    1298
    1299
    1300
    1301
    1302
    def start_arrowhead_bbox(self) -> momapy.geometry.Bbox:
        """Return the bounding box of the double-headed arc start arrowhead"""
        return momapy.drawing.get_drawing_elements_bbox(
            self.start_arrowhead_drawing_elements()
        )

#### `` start_arrowhead_border

    start_arrowhead_border(point) -> Point

Return the point at the intersection of the drawing elements of the double-headed arc start 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`

    1304
    1305
    1306
    1307
    1308
    1309
    1310
    1311
    1312
    1313
    def start_arrowhead_border(self, point) -> momapy.geometry.Point:
        """Return the point at the intersection of the drawing elements of the double-headed arc start 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.start_arrowhead_drawing_elements(), point
        )
        if point.isnan():
            return self.start_arrowhead_tip()
        return point

#### `` start_arrowhead_drawing_elements

    start_arrowhead_drawing_elements() -> list[DrawingElement]

Return the drawing elements of the double-headed arc start arrowhead

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

    1394
    1395
    1396
    1397
    1398
    1399
    1400
    1401
    1402
    1403
    1404
    1405
    1406
    1407
    1408
    1409
    1410
    1411
    1412
    1413
    def start_arrowhead_drawing_elements(
        self,
    ) -> list[momapy.drawing.DrawingElement]:
        """Return the drawing elements of the double-headed arc start arrowhead"""
        drawing_elements = self._start_arrowhead_border_drawing_elements()
        group = momapy.drawing.Group(
            class_=f"{type(self).__name__}_start_arrowhead",
            elements=tuple(drawing_elements),
            id_=f"{self.id_}_start_arrowhead",
            fill=self.start_arrowhead_fill,
            filter=self.start_arrowhead_filter,
            stroke=self.start_arrowhead_stroke,
            stroke_dasharray=self.start_arrowhead_stroke_dasharray,
            stroke_dashoffset=self.start_arrowhead_stroke_dashoffset,
            stroke_width=self.start_arrowhead_stroke_width,
            transform=self.start_arrowhead_transform,
        )
        transformation = self._get_start_arrowhead_transformation()
        group = group.transformed(transformation)
        return [group]

#### `` start_arrowhead_length

    start_arrowhead_length() -> float

Return the length of the double-headed arc start arrowhead

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

    1266
    1267
    1268
    1269
    1270
    1271
    1272
    1273
    def start_arrowhead_length(self) -> float:
        """Return the length of the double-headed arc start arrowhead"""
        bbox = momapy.drawing.get_drawing_elements_bbox(
            self._start_arrowhead_border_drawing_elements()
        )
        if math.isnan(bbox.width):
            return 0.0
        return abs(bbox.west().x)

#### `` start_arrowhead_tip

    start_arrowhead_tip() -> Point

Return the tip anchor point of the double-headed arc start arrowhead

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

    1275
    1276
    1277
    1278
    1279
    1280
    1281
    1282
    1283
    def start_arrowhead_tip(self) -> momapy.geometry.Point:
        """Return the tip anchor point of the double-headed arc start arrowhead"""
        segment = self.segments[0]
        segment = momapy.geometry.Segment(segment.p2, segment.p1)
        segment_length = segment.length()
        if segment_length == 0:
            return segment.p2
        fraction = 1 - self.start_shorten / segment_length
        return segment.get_position_at_fraction(fraction)

#### `` 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)

### `` Unknown `dataclass`

    Unknown(
        *,
        id_: str = make_uuid4_as_str(),
        name: str | None = None,
        sbo_term: SBOTerm | None = None,
        metaid: str | None = None,
        compartment: Compartment | None = None,
        hypothetical: bool = False,
        active: bool = False,
        homomultimer: int = 1,
    )

Bases: `Species`

Class for unknown species

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 | `'87cac202-31d9-4313-92ee-9e452566b708'`
`name` | `str | None` |  | `None`
`sbo_term` | `SBOTerm | None` |  | `None`
`metaid` | `str | None` |  | `None`
`compartment` | `Compartment | None` |  | `None`
`hypothetical` | `bool` | Whether the species is hypothetical or not | `False`
`active` | `bool` | Whether the species is active or not | `False`
`homomultimer` | `int` | The number of subunits forming the species | `1`

### `` UnknownCatalysis `dataclass`

    UnknownCatalysis(
        *,
        id_: str = make_uuid4_as_str(),
        source: Species | BooleanLogicGate,
        target: Species | None,
    )

Bases: `UnknownModulation`

Class for unknown 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 | `'96e67e60-9a43-46f5-9bff-692fe2a1c92a'`
`source` | `Species | BooleanLogicGate` | The source of the influence | required
`target` | `Species | None` | The target of the influence | required

### `` UnknownCatalysisLayout `dataclass`

    UnknownCatalysisLayout(
        *,
        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_fill: NoneValueType | Color | None = NoneValue,
        path_filter: NoneValueType | Filter | None = None,
        path_stroke: NoneValueType | Color | None = black,
        path_stroke_dasharray: NoneValueType
        | tuple[float]
        | None = (12, 4),
        path_stroke_dashoffset: float | None = None,
        path_stroke_width: float | None = 1.0,
        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: NoneValueType | Color | None = black,
        arrowhead_stroke_dasharray: tuple[float, ...]
        | None = None,
        arrowhead_stroke_dashoffset: float | None = None,
        arrowhead_stroke_width: float | None = 1.0,
        arrowhead_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        arrowhead_height: float = 7.0,
        arrowhead_width: float = 7.0,
    )

Bases: `CellDesignerSingleHeadedArc`

Class for unknown 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 | `'b6b2a325-17e7-470b-bc0a-2863ee36377b'`
`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` | `NoneValueType | tuple[float] | None` |  | `(12, 4)`
`path_stroke_dashoffset` | `float | None` | The path stroke dashoffset of the arc | `None`
`path_stroke_width` | `float | None` |  | `1.0`
`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.0`
`arrowhead_transform` | `NoneValueType | tuple[Transformation] | None` | The arrowhead transform of the arc | `None`
`arrowhead_height` | `float` |  | `7.0`
`arrowhead_width` | `float` |  | `7.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()

Return the self drawing elements of the single-headed arc

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

    754
    755
    756
    757
    758
    759
    760
    761
    762
    763
    764
    765
    766
    767
    def self_drawing_elements(self):
        drawing_elements = momapy.builder.super_or_builder(
            CellDesignerSingleHeadedArc, self
        ).self_drawing_elements()
        done_bases = []
        for base in type(self).__mro__:
            if (
                momapy.builder.issubclass_or_builder(base, momapy.sbgn.core._SBGNMixin)
                and base is not type(self)
                and not any([issubclass(done_base, base) for done_base in done_bases])
            ):
                drawing_elements += getattr(base, "_mixin_drawing_elements")(self)
                done_bases.append(base)
        return drawing_elements

#### `` 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)

### `` UnknownCatalyzer `dataclass`

    UnknownCatalyzer(
        *,
        id_: str = make_uuid4_as_str(),
        name: str | None = None,
        sbo_term: SBOTerm | None = None,
        metaid: str | None = None,
        referred_species: Species | BooleanLogicGate,
    )

Bases: `UnknownModulator`

Class for unknown catalyzers

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 | `'57f65df0-4f34-404b-8287-bdaea7fab43a'`
`name` | `str | None` |  | `None`
`sbo_term` | `SBOTerm | None` |  | `None`
`metaid` | `str | None` |  | `None`
`referred_species` | `Species | BooleanLogicGate` | The species the modifier refers to | required

### `` UnknownGate `dataclass`

    UnknownGate(
        *,
        id_: str = make_uuid4_as_str(),
        inputs: frozenset[Species] = frozenset(),
    )

Bases: `BooleanLogicGate`

Class for unknown gates

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 | `'469ce633-8757-4e40-855f-2f975037b3a5'`
`inputs` | `frozenset[Species]` | The inputs of the Boolean logic gate | `<class 'frozenset'>`

### `` UnknownGateLayout `dataclass`

    UnknownGateLayout(
        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 = 15.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 = 15.0,
        active: bool = False,
        active_fill: NoneValueType | Color | None = NoneValue,
        active_filter: NoneValueType | Filter | None = None,
        active_sep: float = 4.0,
        active_stroke: NoneValueType | Color | None = black,
        active_stroke_dasharray: NoneValueType
        | tuple[float]
        | None = (4, 2),
        active_stroke_dashoffset: float | None = None,
        active_stroke_width: float | None = 1.0,
        active_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
    )

Bases: `_SimpleNodeMixin`, `_TextMixin`, `CellDesignerNode`

Class for unknown gate 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 | `'19d76405-1ecc-421f-b8da-9f0cad0311a4'`
`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` |  | `15.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` |  | `15.0`
`active` | `bool` |  | `False`
`active_fill` | `NoneValueType | Color | None` |  | `<momapy.drawing.NoneValueType object at 0x7fb32ae9f1d0>`
`active_filter` | `NoneValueType | Filter | None` |  | `None`
`active_sep` | `float` |  | `4.0`
`active_stroke` | `NoneValueType | Color | None` |  | `Color(red=0, green=0, blue=0, alpha=1.0)`
`active_stroke_dasharray` | `NoneValueType | tuple[float] | None` |  | `(4, 2)`
`active_stroke_dashoffset` | `float | None` |  | `None`
`active_stroke_width` | `float | None` |  | `1.0`
`active_transform` | `NoneValueType | tuple[Transformation] | 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
`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

### `` UnknownInhibition `dataclass`

    UnknownInhibition(
        *,
        id_: str = make_uuid4_as_str(),
        source: Species | BooleanLogicGate,
        target: Species | None,
    )

Bases: `UnknownModulation`

Class for unknown 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 | `'892ebf26-7dfc-4d3c-adc4-51badf4749ef'`
`source` | `Species | BooleanLogicGate` | The source of the influence | required
`target` | `Species | None` | The target of the influence | required

### `` UnknownInhibitionLayout `dataclass`

    UnknownInhibitionLayout(
        *,
        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 = 3.0,
        fill: NoneValueType | Color | None = None,
        filter: NoneValueType | Filter | None = None,
        path_fill: NoneValueType | Color | None = NoneValue,
        path_filter: NoneValueType | Filter | None = None,
        path_stroke: NoneValueType | Color | None = black,
        path_stroke_dasharray: NoneValueType
        | tuple[float]
        | None = (12, 4),
        path_stroke_dashoffset: float | None = None,
        path_stroke_width: float | None = 1.0,
        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 = None,
        arrowhead_filter: NoneValueType | Filter | None = None,
        arrowhead_stroke: NoneValueType | Color | None = black,
        arrowhead_stroke_dasharray: tuple[float, ...]
        | None = None,
        arrowhead_stroke_dashoffset: float | None = None,
        arrowhead_stroke_width: float | None = 1.0,
        arrowhead_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        arrowhead_height: float = 10.0,
    )

Bases: `CellDesignerSingleHeadedArc`

Class for unknown 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 | `'069f7784-05a5-4b04-a388-2dbf35f3fda1'`
`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` |  | `3.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` | `NoneValueType | tuple[float] | None` |  | `(12, 4)`
`path_stroke_dashoffset` | `float | None` | The path stroke dashoffset of the arc | `None`
`path_stroke_width` | `float | None` |  | `1.0`
`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` | The arrowhead fill color of the arc | `None`
`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.0`
`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()

Return the self drawing elements of the single-headed arc

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

    754
    755
    756
    757
    758
    759
    760
    761
    762
    763
    764
    765
    766
    767
    def self_drawing_elements(self):
        drawing_elements = momapy.builder.super_or_builder(
            CellDesignerSingleHeadedArc, self
        ).self_drawing_elements()
        done_bases = []
        for base in type(self).__mro__:
            if (
                momapy.builder.issubclass_or_builder(base, momapy.sbgn.core._SBGNMixin)
                and base is not type(self)
                and not any([issubclass(done_base, base) for done_base in done_bases])
            ):
                drawing_elements += getattr(base, "_mixin_drawing_elements")(self)
                done_bases.append(base)
        return drawing_elements

#### `` 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)

### `` UnknownInhibitor `dataclass`

    UnknownInhibitor(
        *,
        id_: str = make_uuid4_as_str(),
        name: str | None = None,
        sbo_term: SBOTerm | None = None,
        metaid: str | None = None,
        referred_species: Species | BooleanLogicGate,
    )

Bases: `UnknownModulator`

Class for unknown inhibitors

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 | `'182460be-fb67-4d6b-85fb-8b78b16d76e6'`
`name` | `str | None` |  | `None`
`sbo_term` | `SBOTerm | None` |  | `None`
`metaid` | `str | None` |  | `None`
`referred_species` | `Species | BooleanLogicGate` | The species the modifier refers to | required

### `` UnknownLayout `dataclass`

    UnknownLayout(
        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,
        fill: NoneValueType | Color | None = gray,
        filter: NoneValueType | Filter | None = None,
        height: float = 30.0,
        label: TextLayout | None = None,
        position: Point,
        stroke: NoneValueType | Color | None = NoneValue,
        stroke_dasharray: tuple[float, ...] | None = None,
        stroke_dashoffset: float | None = None,
        transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        width: float = 60.0,
        active: bool = False,
        active_fill: NoneValueType | Color | None = NoneValue,
        active_filter: NoneValueType | Filter | None = None,
        active_sep: float = 4.0,
        active_stroke: NoneValueType | Color | None = black,
        active_stroke_dasharray: NoneValueType
        | tuple[float]
        | None = (4, 2),
        active_stroke_dashoffset: float | None = None,
        active_stroke_width: float | None = 1.0,
        active_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        n: int = 1,
    )

Bases: `_MultiNodeMixin`, `CellDesignerNode`

Class for unknown species 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 | `'5b4ff628-247a-4f0a-8686-ec1f7ef6ff6c'`
`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=128, green=128, blue=128, 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` |  | `<momapy.drawing.NoneValueType object at 0x7fb32ae9f1d0>`
`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`
`active` | `bool` |  | `False`
`active_fill` | `NoneValueType | Color | None` |  | `<momapy.drawing.NoneValueType object at 0x7fb32ae9f1d0>`
`active_filter` | `NoneValueType | Filter | None` |  | `None`
`active_sep` | `float` |  | `4.0`
`active_stroke` | `NoneValueType | Color | None` |  | `Color(red=0, green=0, blue=0, alpha=1.0)`
`active_stroke_dasharray` | `NoneValueType | tuple[float] | None` |  | `(4, 2)`
`active_stroke_dashoffset` | `float | None` |  | `None`
`active_stroke_width` | `float | None` |  | `1.0`
`active_transform` | `NoneValueType | tuple[Transformation] | None` |  | `None`
`n` | `int` |  | `1`

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

### `` UnknownModulation `dataclass`

    UnknownModulation(
        *,
        id_: str = make_uuid4_as_str(),
        source: Species | BooleanLogicGate,
        target: Species | None,
    )

Bases: `KnownOrUnknownModulation`

Class for unknown 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 | `'0e31f432-2cf3-4f76-a8e8-4cb77aa62221'`
`source` | `Species | BooleanLogicGate` | The source of the influence | required
`target` | `Species | None` | The target of the influence | required

### `` UnknownModulationLayout `dataclass`

    UnknownModulationLayout(
        *,
        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_fill: NoneValueType | Color | None = NoneValue,
        path_filter: NoneValueType | Filter | None = None,
        path_stroke: NoneValueType | Color | None = black,
        path_stroke_dasharray: NoneValueType
        | tuple[float]
        | None = (12, 4),
        path_stroke_dashoffset: float | None = None,
        path_stroke_width: float | None = 1.0,
        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: NoneValueType | Color | None = black,
        arrowhead_stroke_dasharray: tuple[float, ...]
        | None = None,
        arrowhead_stroke_dashoffset: float | None = None,
        arrowhead_stroke_width: float | None = 1.0,
        arrowhead_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        arrowhead_height: float = 8.0,
        arrowhead_width: float = 15.0,
    )

Bases: `CellDesignerSingleHeadedArc`

Class for unknown 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 | `'ba855eb2-8bc1-43bd-93f9-3341e5de7019'`
`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` | `NoneValueType | tuple[float] | None` |  | `(12, 4)`
`path_stroke_dashoffset` | `float | None` | The path stroke dashoffset of the arc | `None`
`path_stroke_width` | `float | None` |  | `1.0`
`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.0`
`arrowhead_transform` | `NoneValueType | tuple[Transformation] | None` | The arrowhead transform of the arc | `None`
`arrowhead_height` | `float` |  | `8.0`
`arrowhead_width` | `float` |  | `15.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()

Return the self drawing elements of the single-headed arc

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

    754
    755
    756
    757
    758
    759
    760
    761
    762
    763
    764
    765
    766
    767
    def self_drawing_elements(self):
        drawing_elements = momapy.builder.super_or_builder(
            CellDesignerSingleHeadedArc, self
        ).self_drawing_elements()
        done_bases = []
        for base in type(self).__mro__:
            if (
                momapy.builder.issubclass_or_builder(base, momapy.sbgn.core._SBGNMixin)
                and base is not type(self)
                and not any([issubclass(done_base, base) for done_base in done_bases])
            ):
                drawing_elements += getattr(base, "_mixin_drawing_elements")(self)
                done_bases.append(base)
        return drawing_elements

#### `` 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)

### `` UnknownModulator `dataclass`

    UnknownModulator(
        *,
        id_: str = make_uuid4_as_str(),
        name: str | None = None,
        sbo_term: SBOTerm | None = None,
        metaid: str | None = None,
        referred_species: Species | BooleanLogicGate,
    )

Bases: `KnownOrUnknownModulator`

Class for unknown modulators

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 | `'e87ece35-3928-4502-8f27-c3fa8e994f63'`
`name` | `str | None` |  | `None`
`sbo_term` | `SBOTerm | None` |  | `None`
`metaid` | `str | None` |  | `None`
`referred_species` | `Species | BooleanLogicGate` | The species the modifier refers to | required

### `` UnknownNegativeInfluence `dataclass`

    UnknownNegativeInfluence(
        *,
        id_: str = make_uuid4_as_str(),
        source: Species | BooleanLogicGate,
        target: Species | None,
    )

Bases: `UnknownModulation`

Class for unknown negative influences

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 | `'2a5594cf-bfaf-4e7d-bcc5-478ee09e82f4'`
`source` | `Species | BooleanLogicGate` | The source of the influence | required
`target` | `Species | None` | The target of the influence | required

### `` UnknownPhysicalStimulation `dataclass`

    UnknownPhysicalStimulation(
        *,
        id_: str = make_uuid4_as_str(),
        source: Species | BooleanLogicGate,
        target: Species | None,
    )

Bases: `UnknownModulation`

Class for unknown physical 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 | `'1e733e05-18fc-4de0-b848-cc42efdbdb10'`
`source` | `Species | BooleanLogicGate` | The source of the influence | required
`target` | `Species | None` | The target of the influence | required

### `` UnknownPhysicalStimulationLayout `dataclass`

    UnknownPhysicalStimulationLayout(
        *,
        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_fill: NoneValueType | Color | None = NoneValue,
        path_filter: NoneValueType | Filter | None = None,
        path_stroke: NoneValueType | Color | None = black,
        path_stroke_dasharray: NoneValueType
        | tuple[float]
        | None = (12, 4),
        path_stroke_dashoffset: float | None = None,
        path_stroke_width: float | None = 1.0,
        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: NoneValueType | Color | None = black,
        arrowhead_stroke_dasharray: tuple[float, ...]
        | None = None,
        arrowhead_stroke_dashoffset: float | None = None,
        arrowhead_stroke_width: float | None = 1.0,
        arrowhead_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        arrowhead_height: float = 10.0,
        arrowhead_width: float = 10.0,
    )

Bases: `CellDesignerSingleHeadedArc`

Class for unknown physical 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 | `'7ac34d3d-f405-4223-83df-2ec62c823c09'`
`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` | `NoneValueType | tuple[float] | None` |  | `(12, 4)`
`path_stroke_dashoffset` | `float | None` | The path stroke dashoffset of the arc | `None`
`path_stroke_width` | `float | None` |  | `1.0`
`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.0`
`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()

Return the self drawing elements of the single-headed arc

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

    754
    755
    756
    757
    758
    759
    760
    761
    762
    763
    764
    765
    766
    767
    def self_drawing_elements(self):
        drawing_elements = momapy.builder.super_or_builder(
            CellDesignerSingleHeadedArc, self
        ).self_drawing_elements()
        done_bases = []
        for base in type(self).__mro__:
            if (
                momapy.builder.issubclass_or_builder(base, momapy.sbgn.core._SBGNMixin)
                and base is not type(self)
                and not any([issubclass(done_base, base) for done_base in done_bases])
            ):
                drawing_elements += getattr(base, "_mixin_drawing_elements")(self)
                done_bases.append(base)
        return drawing_elements

#### `` 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)

### `` UnknownPositiveInfluence `dataclass`

    UnknownPositiveInfluence(
        *,
        id_: str = make_uuid4_as_str(),
        source: Species | BooleanLogicGate,
        target: Species | None,
    )

Bases: `UnknownModulation`

Class for unknown positive influences

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 | `'31c40a93-2e32-4d53-9eab-d1edff3897a5'`
`source` | `Species | BooleanLogicGate` | The source of the influence | required
`target` | `Species | None` | The target of the influence | required

### `` UnknownPositiveInfluenceLayout `dataclass`

    UnknownPositiveInfluenceLayout(
        *,
        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_fill: NoneValueType | Color | None = NoneValue,
        path_filter: NoneValueType | Filter | None = None,
        path_stroke: NoneValueType | Color | None = black,
        path_stroke_dasharray: NoneValueType
        | tuple[float]
        | None = (12, 4),
        path_stroke_dashoffset: float | None = None,
        path_stroke_width: float | None = 1.0,
        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 = NoneValue,
        arrowhead_filter: NoneValueType | Filter | None = None,
        arrowhead_stroke: NoneValueType | Color | None = black,
        arrowhead_stroke_dasharray: tuple[float, ...]
        | None = None,
        arrowhead_stroke_dashoffset: float | None = None,
        arrowhead_stroke_width: float | None = 2.0,
        arrowhead_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        arrowhead_height: float = 10.0,
        arrowhead_width: float = 10.0,
    )

Bases: `CellDesignerSingleHeadedArc`

Class for unknown positive influence 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 | `'c49b98c1-c761-4a11-8f42-f253cee9c83e'`
`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` | `NoneValueType | tuple[float] | None` |  | `(12, 4)`
`path_stroke_dashoffset` | `float | None` | The path stroke dashoffset of the arc | `None`
`path_stroke_width` | `float | None` |  | `1.0`
`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` |  | `<momapy.drawing.NoneValueType object at 0x7fb32ae9f1d0>`
`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` |  | `2.0`
`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()

Return the self drawing elements of the single-headed arc

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

    754
    755
    756
    757
    758
    759
    760
    761
    762
    763
    764
    765
    766
    767
    def self_drawing_elements(self):
        drawing_elements = momapy.builder.super_or_builder(
            CellDesignerSingleHeadedArc, self
        ).self_drawing_elements()
        done_bases = []
        for base in type(self).__mro__:
            if (
                momapy.builder.issubclass_or_builder(base, momapy.sbgn.core._SBGNMixin)
                and base is not type(self)
                and not any([issubclass(done_base, base) for done_base in done_bases])
            ):
                drawing_elements += getattr(base, "_mixin_drawing_elements")(self)
                done_bases.append(base)
        return drawing_elements

#### `` 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)

### `` UnknownTransition `dataclass`

    UnknownTransition(
        *,
        id_: str = make_uuid4_as_str(),
        name: str | None = None,
        sbo_term: SBOTerm | None = None,
        metaid: str | None = None,
        reversible: bool,
        compartment: Compartment | None = None,
        reactants: frozenset[Reactant] = frozenset(),
        products: frozenset[Product] = frozenset(),
        modifiers: frozenset[
            KnownOrUnknownModulator
        ] = frozenset(),
    )

Bases: `Reaction`

Class for unknown transitions

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 | `'be1576e7-8a17-4dce-9897-1e36e51801da'`
`name` | `str | None` |  | `None`
`sbo_term` | `SBOTerm | None` |  | `None`
`metaid` | `str | None` |  | `None`
`reversible` | `bool` |  | required
`compartment` | `Compartment | None` |  | `None`
`reactants` | `frozenset[Reactant]` | The reactants of the reaction | `<class 'frozenset'>`
`products` | `frozenset[Product]` | The products of the reaction | `<class 'frozenset'>`
`modifiers` | `frozenset[KnownOrUnknownModulator]` | The modifiers of the reaction | `<class 'frozenset'>`

### `` UnknownTransitionLayout `dataclass`

    UnknownTransitionLayout(
        *,
        _left_connector_fraction: float = 0.4,
        _right_connector_fraction: float = 0.6,
        reaction_node_height: float = 10.0,
        reaction_node_width: float = 10.0,
        reaction_node_segment: int = 1,
        reaction_node_stroke: NoneValueType
        | Color
        | None = black,
        reaction_node_stroke_width: float | None = 1.0,
        reaction_node_stroke_dasharray: NoneValueType
        | tuple[float]
        | None = None,
        reaction_node_stroke_dashoffset: float | None = None,
        reaction_node_fill: NoneValueType
        | Color
        | None = white,
        reaction_node_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        reaction_node_filter: 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,
        end_shorten: float = 2.0,
        fill: NoneValueType | Color | None = None,
        filter: NoneValueType | Filter | None = None,
        path_fill: NoneValueType | Color | None = NoneValue,
        path_filter: NoneValueType | Filter | None = None,
        path_stroke: NoneValueType | Color | None = black,
        path_stroke_dasharray: tuple[float, ...] | None = None,
        path_stroke_dashoffset: float | None = None,
        path_stroke_width: float | None = 1.0,
        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 = 2.0,
        target: LayoutElement | None = None,
        transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        end_arrowhead_fill: NoneValueType
        | Color
        | None = black,
        end_arrowhead_filter: NoneValueType
        | Filter
        | None = None,
        end_arrowhead_stroke: NoneValueType
        | Color
        | None = black,
        end_arrowhead_stroke_dasharray: NoneValueType
        | tuple[float]
        | None = None,
        end_arrowhead_stroke_dashoffset: float | None = None,
        end_arrowhead_stroke_width: float | None = 1.0,
        end_arrowhead_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        start_arrowhead_fill: NoneValueType
        | Color
        | None = black,
        start_arrowhead_filter: NoneValueType
        | Filter
        | None = None,
        start_arrowhead_stroke: NoneValueType
        | Color
        | None = black,
        start_arrowhead_stroke_dasharray: NoneValueType
        | tuple[float]
        | None = None,
        start_arrowhead_stroke_dashoffset: float | None = None,
        start_arrowhead_stroke_width: float | None = 1.0,
        start_arrowhead_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        reversible: bool = False,
        end_arrowhead_height: float = 8.0,
        end_arrowhead_width: float = 15.0,
        start_arrowhead_height: float = 8.0,
        start_arrowhead_width: float = 15.0,
    )

Bases: `_ReactionLayout`, `_ReactionNodeMixin`

Class for unknown transition layouts

Parameters:

Name | Type | Description | Default
--- | --- | --- | ---
`reaction_node_height` | `float` |  | `10.0`
`reaction_node_width` | `float` |  | `10.0`
`reaction_node_segment` | `int` |  | `1`
`reaction_node_stroke` | `NoneValueType | Color | None` |  | `Color(red=0, green=0, blue=0, alpha=1.0)`
`reaction_node_stroke_width` | `float | None` |  | `1.0`
`reaction_node_stroke_dasharray` | `NoneValueType | tuple[float] | None` |  | `None`
`reaction_node_stroke_dashoffset` | `float | None` |  | `None`
`reaction_node_fill` | `NoneValueType | Color | None` |  | `Color(red=255, green=255, blue=255, alpha=1.0)`
`reaction_node_transform` | `NoneValueType | tuple[Transformation] | None` |  | `None`
`reaction_node_filter` | `NoneValueType | Filter | None` |  | `None`
`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 | `'d5732493-855a-4457-b24e-334e804a0493'`
`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` |  | `2.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.0`
`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` |  | `2.0`
`target` | `LayoutElement | None` | The target of the arc | `None`
`transform` | `NoneValueType | tuple[Transformation] | None` | The transform of the arc | `None`
`end_arrowhead_fill` | `NoneValueType | Color | None` |  | `Color(red=0, green=0, blue=0, alpha=1.0)`
`end_arrowhead_filter` | `NoneValueType | Filter | None` |  | `None`
`end_arrowhead_stroke` | `NoneValueType | Color | None` |  | `Color(red=0, green=0, blue=0, alpha=1.0)`
`end_arrowhead_stroke_dasharray` | `NoneValueType | tuple[float] | None` |  | `None`
`end_arrowhead_stroke_dashoffset` | `float | None` |  | `None`
`end_arrowhead_stroke_width` | `float | None` |  | `1.0`
`end_arrowhead_transform` | `NoneValueType | tuple[Transformation] | None` |  | `None`
`start_arrowhead_fill` | `NoneValueType | Color | None` |  | `Color(red=0, green=0, blue=0, alpha=1.0)`
`start_arrowhead_filter` | `NoneValueType | Filter | None` |  | `None`
`start_arrowhead_stroke` | `NoneValueType | Color | None` |  | `Color(red=0, green=0, blue=0, alpha=1.0)`
`start_arrowhead_stroke_dasharray` | `NoneValueType | tuple[float] | None` |  | `None`
`start_arrowhead_stroke_dashoffset` | `float | None` |  | `None`
`start_arrowhead_stroke_width` | `float | None` |  | `1.0`
`start_arrowhead_transform` | `NoneValueType | tuple[Transformation] | None` |  | `None`
`reversible` | `bool` |  | `False`
`end_arrowhead_height` | `float` |  | `8.0`
`end_arrowhead_width` | `float` |  | `15.0`
`start_arrowhead_height` | `float` |  | `8.0`
`start_arrowhead_width` | `float` |  | `15.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
`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_arrowhead_base` | Return the base anchor point of the double-headed arc end arrowhead
`end_arrowhead_bbox` | Return the bounding box of the double-headed arc start arrowhead
`end_arrowhead_border` | Return the point at the intersection of the drawing elements of the double-headed arc end arrowhead and the line going through the center of these drawing elements and the given point.
`end_arrowhead_length` | Return the length of the double-headed arc end arrowhead
`end_arrowhead_tip` | Return the tip anchor point of the double-headed arc end arrowhead
`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 double-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 double-headed arc. These include the drawing elements of the arc path, the start arrowhead, and the end arrowhead
`self_to_shapely` | Compute and return a shapely collection of geometries reproducing the self drawing elements of the group layout
`start_arrowhead_base` | Return the base anchor point of the double-headed arc start arrowhead
`start_arrowhead_bbox` | Return the bounding box of the double-headed arc start arrowhead
`start_arrowhead_border` | Return the point at the intersection of the drawing elements of the double-headed arc start arrowhead and the line going through the center of these drawing elements and the given point.
`start_arrowhead_drawing_elements` | Return the drawing elements of the double-headed arc start arrowhead
`start_arrowhead_length` | Return the length of the double-headed arc start arrowhead
`start_arrowhead_tip` | Return the tip anchor point of the double-headed arc start arrowhead
`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)()

#### `` 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_arrowhead_base

    end_arrowhead_base() -> Point

Return the base anchor point of the double-headed arc end arrowhead

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

    1333
    1334
    1335
    1336
    1337
    1338
    1339
    1340
    1341
    1342
    1343
    def end_arrowhead_base(self) -> momapy.geometry.Point:
        """Return the base anchor point of the double-headed arc end arrowhead"""
        arrowhead_length = self.end_arrowhead_length()
        if arrowhead_length == 0:
            return self.end_point()
        segment = self.segments[-1]
        segment_length = segment.length()
        if segment_length == 0:
            return self.end_arrowhead_tip() - (arrowhead_length, 0)
        fraction = 1 - (arrowhead_length + self.end_shorten) / segment_length
        return segment.get_position_at_fraction(fraction)

#### `` end_arrowhead_bbox

    end_arrowhead_bbox()

Return the bounding box of the double-headed arc start arrowhead

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

    1345
    1346
    1347
    1348
    1349
    def end_arrowhead_bbox(self):
        """Return the bounding box of the double-headed arc start arrowhead"""
        return momapy.drawing.get_drawing_elements_bbox(
            self.end_arrowhead_drawing_elements()
        )

#### `` end_arrowhead_border

    end_arrowhead_border(point)

Return the point at the intersection of the drawing elements of the double-headed arc end 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`

    1351
    1352
    1353
    1354
    1355
    1356
    1357
    1358
    1359
    1360
    1361
    def end_arrowhead_border(self, point):
        """Return the point at the intersection of the drawing elements of the double-headed arc end 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.end_arrowhead_drawing_elements(), point
        )
        if point.isnan():
            return self.end_arrowhead_tip()
        return point

#### `` end_arrowhead_length

    end_arrowhead_length() -> float

Return the length of the double-headed arc end arrowhead

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

    1315
    1316
    1317
    1318
    1319
    1320
    1321
    1322
    def end_arrowhead_length(self) -> float:
        """Return the length of the double-headed arc end arrowhead"""
        bbox = momapy.drawing.get_drawing_elements_bbox(
            self._end_arrowhead_border_drawing_elements()
        )
        if math.isnan(bbox.width):
            return 0.0
        return bbox.east().x

#### `` end_arrowhead_tip

    end_arrowhead_tip() -> Point

Return the tip anchor point of the double-headed arc end arrowhead

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

    1324
    1325
    1326
    1327
    1328
    1329
    1330
    1331
    def end_arrowhead_tip(self) -> momapy.geometry.Point:
        """Return the tip anchor point of the double-headed arc end arrowhead"""
        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)

#### `` 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 double-headed arc path

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

    1451
    1452
    1453
    1454
    1455
    1456
    1457
    1458
    1459
    1460
    1461
    1462
    1463
    1464
    1465
    1466
    1467
    1468
    1469
    1470
    1471
    1472
    1473
    1474
    1475
    1476
    1477
    1478
    1479
    1480
    1481
    1482
    1483
    1484
    1485
    1486
    1487
    1488
    1489
    1490
    1491
    1492
    def path_drawing_elements(self) -> list[momapy.drawing.Path]:
        """Return the drawing elements of the double-headed arc path"""
        start_arrowhead_length = self.start_arrowhead_length()
        end_arrowhead_length = self.end_arrowhead_length()
        if len(self.segments) == 1:
            segment = (
                self.segments[0]
                .shortened(self.start_shorten + start_arrowhead_length, "start")
                .shortened(self.end_shorten + end_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_arrowhead_length, "start"
            )
            last_segment = self.segments[-1].shortened(
                self.end_shorten + end_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()

Return the self drawing elements of the double-headed arc. These include the drawing elements of the arc path, the start arrowhead, and the end arrowhead

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

    782
    783
    784
    785
    786
    787
    788
    789
    790
    791
    792
    793
    794
    795
    def self_drawing_elements(self):
        drawing_elements = momapy.builder.super_or_builder(
            CellDesignerDoubleHeadedArc, self
        ).self_drawing_elements()
        done_bases = []
        for base in type(self).__mro__:
            if (
                momapy.builder.issubclass_or_builder(base, momapy.sbgn.core._SBGNMixin)
                and base is not type(self)
                and not any([issubclass(done_base, base) for done_base in done_bases])
            ):
                drawing_elements += getattr(base, "_mixin_drawing_elements")(self)
                done_bases.append(base)
        return drawing_elements

#### `` 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_arrowhead_base

    start_arrowhead_base() -> Point

Return the base anchor point of the double-headed arc start arrowhead

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

    1285
    1286
    1287
    1288
    1289
    1290
    1291
    1292
    1293
    1294
    1295
    1296
    def start_arrowhead_base(self) -> momapy.geometry.Point:
        """Return the base anchor point of the double-headed arc start arrowhead"""
        arrowhead_length = self.start_arrowhead_length()
        if arrowhead_length == 0:
            return self.start_point()
        segment = self.segments[0]
        segment = momapy.geometry.Segment(segment.p2, segment.p1)
        segment_length = segment.length()
        if segment_length == 0:
            return self.start_arrowhead_tip() + (arrowhead_length, 0)
        fraction = 1 - (arrowhead_length + self.start_shorten) / segment_length
        return segment.get_position_at_fraction(fraction)

#### `` start_arrowhead_bbox

    start_arrowhead_bbox() -> Bbox

Return the bounding box of the double-headed arc start arrowhead

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

    1298
    1299
    1300
    1301
    1302
    def start_arrowhead_bbox(self) -> momapy.geometry.Bbox:
        """Return the bounding box of the double-headed arc start arrowhead"""
        return momapy.drawing.get_drawing_elements_bbox(
            self.start_arrowhead_drawing_elements()
        )

#### `` start_arrowhead_border

    start_arrowhead_border(point) -> Point

Return the point at the intersection of the drawing elements of the double-headed arc start 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`

    1304
    1305
    1306
    1307
    1308
    1309
    1310
    1311
    1312
    1313
    def start_arrowhead_border(self, point) -> momapy.geometry.Point:
        """Return the point at the intersection of the drawing elements of the double-headed arc start 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.start_arrowhead_drawing_elements(), point
        )
        if point.isnan():
            return self.start_arrowhead_tip()
        return point

#### `` start_arrowhead_drawing_elements

    start_arrowhead_drawing_elements() -> list[DrawingElement]

Return the drawing elements of the double-headed arc start arrowhead

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

    1394
    1395
    1396
    1397
    1398
    1399
    1400
    1401
    1402
    1403
    1404
    1405
    1406
    1407
    1408
    1409
    1410
    1411
    1412
    1413
    def start_arrowhead_drawing_elements(
        self,
    ) -> list[momapy.drawing.DrawingElement]:
        """Return the drawing elements of the double-headed arc start arrowhead"""
        drawing_elements = self._start_arrowhead_border_drawing_elements()
        group = momapy.drawing.Group(
            class_=f"{type(self).__name__}_start_arrowhead",
            elements=tuple(drawing_elements),
            id_=f"{self.id_}_start_arrowhead",
            fill=self.start_arrowhead_fill,
            filter=self.start_arrowhead_filter,
            stroke=self.start_arrowhead_stroke,
            stroke_dasharray=self.start_arrowhead_stroke_dasharray,
            stroke_dashoffset=self.start_arrowhead_stroke_dashoffset,
            stroke_width=self.start_arrowhead_stroke_width,
            transform=self.start_arrowhead_transform,
        )
        transformation = self._get_start_arrowhead_transformation()
        group = group.transformed(transformation)
        return [group]

#### `` start_arrowhead_length

    start_arrowhead_length() -> float

Return the length of the double-headed arc start arrowhead

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

    1266
    1267
    1268
    1269
    1270
    1271
    1272
    1273
    def start_arrowhead_length(self) -> float:
        """Return the length of the double-headed arc start arrowhead"""
        bbox = momapy.drawing.get_drawing_elements_bbox(
            self._start_arrowhead_border_drawing_elements()
        )
        if math.isnan(bbox.width):
            return 0.0
        return abs(bbox.west().x)

#### `` start_arrowhead_tip

    start_arrowhead_tip() -> Point

Return the tip anchor point of the double-headed arc start arrowhead

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

    1275
    1276
    1277
    1278
    1279
    1280
    1281
    1282
    1283
    def start_arrowhead_tip(self) -> momapy.geometry.Point:
        """Return the tip anchor point of the double-headed arc start arrowhead"""
        segment = self.segments[0]
        segment = momapy.geometry.Segment(segment.p2, segment.p1)
        segment_length = segment.length()
        if segment_length == 0:
            return segment.p2
        fraction = 1 - self.start_shorten / segment_length
        return segment.get_position_at_fraction(fraction)

#### `` 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)

### `` UnknownTriggering `dataclass`

    UnknownTriggering(
        *,
        id_: str = make_uuid4_as_str(),
        source: Species | BooleanLogicGate,
        target: Species | None,
    )

Bases: `UnknownModulation`

Class for unknown triggerings

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 | `'28df3d76-c0f1-4fcc-9ffb-fbb144b6f134'`
`source` | `Species | BooleanLogicGate` | The source of the influence | required
`target` | `Species | None` | The target of the influence | required

### `` UnknownTriggeringLayout `dataclass`

    UnknownTriggeringLayout(
        *,
        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_fill: NoneValueType | Color | None = NoneValue,
        path_filter: NoneValueType | Filter | None = None,
        path_stroke: NoneValueType | Color | None = black,
        path_stroke_dasharray: NoneValueType
        | tuple[float]
        | None = (12, 4),
        path_stroke_dashoffset: float | None = None,
        path_stroke_width: float | None = 1.0,
        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: NoneValueType | Color | None = black,
        arrowhead_stroke_dasharray: tuple[float, ...]
        | None = None,
        arrowhead_stroke_dashoffset: float | None = None,
        arrowhead_stroke_width: float | None = 1.0,
        arrowhead_transform: NoneValueType
        | tuple[Transformation]
        | None = None,
        arrowhead_bar_height: float = 8.0,
        arrowhead_sep: float = 5.0,
        arrowhead_triangle_height: float = 10.0,
        arrowhead_triangle_width: float = 15.0,
    )

Bases: `CellDesignerSingleHeadedArc`

Class for unknown triggering 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 | `'c49a2d06-9fa1-4d5a-835f-58c5ea4df215'`
`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` | `NoneValueType | tuple[float] | None` |  | `(12, 4)`
`path_stroke_dashoffset` | `float | None` | The path stroke dashoffset of the arc | `None`
`path_stroke_width` | `float | None` |  | `1.0`
`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.0`
`arrowhead_transform` | `NoneValueType | tuple[Transformation] | None` | The arrowhead transform of the arc | `None`
`arrowhead_bar_height` | `float` |  | `8.0`
`arrowhead_sep` | `float` |  | `5.0`
`arrowhead_triangle_height` | `float` |  | `10.0`
`arrowhead_triangle_width` | `float` |  | `15.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()

Return the self drawing elements of the single-headed arc

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

    754
    755
    756
    757
    758
    759
    760
    761
    762
    763
    764
    765
    766
    767
    def self_drawing_elements(self):
        drawing_elements = momapy.builder.super_or_builder(
            CellDesignerSingleHeadedArc, self
        ).self_drawing_elements()
        done_bases = []
        for base in type(self).__mro__:
            if (
                momapy.builder.issubclass_or_builder(base, momapy.sbgn.core._SBGNMixin)
                and base is not type(self)
                and not any([issubclass(done_base, base) for done_base in done_bases])
            ):
                drawing_elements += getattr(base, "_mixin_drawing_elements")(self)
                done_bases.append(base)
        return drawing_elements

#### `` 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)