[docs]@withify()
@dataclass
class Connector(Labeled, Styled, PDG):
momentum: Optional[Momentum] = field(
default=None, metadata={"name": "momentum", "type": "Element"}
)
"""Momentum of the connector"""
def goes_into(self, vertex):
raise NotImplementedError
def goes_out_of(self, vertex):
raise NotImplementedError
[docs] def with_tension(self, tension: float):
"""Add tension to the connector"""
return self.with_style_properties(tension=tension)
[docs] def get_tension(self):
"""Get tension of the connector"""
return self.get_style_property("tension")
[docs] def with_length(self, length: float):
"""Add length to the connector"""
return self.with_style_properties(length=length)
[docs] def get_length(self):
"""Get length of the connector"""
return self.get_style_property("length")