feynml.feynmandiagram.FeynmanDiagram

class feynml.feynmandiagram.FeynmanDiagram(id: Optional[str] = None, style: cssutils.css.cssstyledeclaration.CSSStyleDeclaration = <factory>, clazz: Optional[str] = None, default_style: Optional[bool] = True, propagators: List[feynml.propagator.Propagator] = <factory>, vertices: List[feynml.vertex.Vertex] = <factory>, legs: List[feynml.leg.Leg] = <factory>, sheet: cssutils.css.cssstylesheet.CSSStyleSheet = <factory>)[source]

Bases: Styled, Identifiable

__init__(id: str | None = None, style: ~cssutils.css.cssstyledeclaration.CSSStyleDeclaration = <factory>, clazz: str | None = None, default_style: bool | None = True, propagators: ~typing.List[~feynml.propagator.Propagator] = <factory>, vertices: ~typing.List[~feynml.vertex.Vertex] = <factory>, legs: ~typing.List[~feynml.leg.Leg] = <factory>, sheet: ~cssutils.css.cssstylesheet.CSSStyleSheet = <factory>) None

Methods

__init__([id, style, clazz, default_style, ...])

add(*fd_all)

add_rule(rule)

add_rules(rules)

from_xml(xml)

Load self from XML.

get_bounding_box()

get_connections(vertex)

get_style(obj)

Get the style of an object.

get_style_property(key)

get_vertex(idd)

put_style(key, value)

Deprecated since version 0.0.0.

put_styles(**kwargs)

Deprecated since version 0.0.0.

raw_style()

remove_propagator(propagator)

to_xml()

Return self as XML.

with_class(clazz)

with_default_style(value[, k])

Set default_style to value and return self.

with_id(value[, k])

Set id to value and return self.

with_legs(value[, k])

Set legs to value and return self.

with_propagators(value[, k])

Set propagators to value and return self.

with_rule(rule)

with_rules(rules)

with_sheet(value[, k])

Set sheet to value and return self.

with_style(style)

with_style_properties(**kwargs)

with_style_property(key, value)

with_vertices(value[, k])

Set vertices to value and return self.

Attributes

clazz

CSS class string.

default_style

id

propagators

vertices

legs

sheet

clazz: str | None = None

CSS class string.

classmethod from_xml(xml: str)[source]

Load self from XML.

get_style(obj) CSSStyleDeclaration[source]

Get the style of an object.

This is prefered over accessing the style attribute directly, sicne it includes class and pdgid definitions.

put_style(key, value)

Deprecated since version 0.0.0: This will be removed in 0.2.0.

put_styles(**kwargs)

Deprecated since version 0.0.0: This will be removed in 0.2.0.

style: CSSString

CSS style string.

to_xml() str[source]

Return self as XML.

with_default_style(value, k='default_style')

Set default_style to value and return self.

with_id(value, k='id')

Set id to value and return self.

with_legs(value, k='legs')

Set legs to value and return self.

with_propagators(value, k='propagators')

Set propagators to value and return self.

with_sheet(value, k='sheet')

Set sheet to value and return self.

with_vertices(value, k='vertices')

Set vertices to value and return self.