cottax.consumers.visualization.interface module

What drawing asks. Of a node class: how a condition node is drawn (NodeDrawing) [answer]. Of a place class: how a place is written (PlaceDrawing) [answer]. Of a purpose: how a name derived for it is written (MintDrawing) [answer]. Of a study: how a name is written (Formatter) [choice].

class NodeDrawing[source]

Bases: Answer

How a condition node is drawn.

about

alias of ConditionalNode

abstractmethod drawn(node: Any)[source]

Its category and slots.

Return type:

Drawn

class PlaceDrawing[source]

Bases: Answer

How a place is written in a drawing, and a node name of its kind.

about: AbstractClassVar[Any] = (<class 'cottax.core.maths.places.Place'>, Label)

a class, a type alias of one, a protocol, or a tuple of those. @answers refuses a class that is none; a protocol is met by shape, which a class cannot be asked.

Type:

What the interface is answered per, bound by the interface

abstractmethod spell_plain(place: Label)[source]

A name written plainly: a key within one picture, its identity there whatever it shows. A picture refuses two places, or two node names, sharing one (refusals.SpelledAlike).

Return type:

str

abstractmethod spelling(place: Label)[source]

A name as its own kind writes it in full, in a one-line summary or a refusal.

Return type:

str

abstractmethod minted_from(place: Label)[source]

(purpose, what it stands for) for a minted name, else None.

Return type:

tuple[Mint, Place] | None

abstractmethod namespace_of(place: Label, depth: int | None = None)[source]

The group a name declares: the names it sits under, at most depth of them.

Return type:

tuple[str, ...]

class MintDrawing[source]

Bases: Answer

How a name derived for a purpose is written over what it stands for: plain in plain text, latex in LaTeX. A purpose nobody answers for is written by its spelling, copy(·).

about

alias of Mint

plain: AbstractVar[Notation]

abstract to ABC until a subclass binds the name, and absent on a class that declares it as a field.

Type:

What the level binds in place of the annotation

latex: AbstractVar[Notation]

abstract to ABC until a subclass binds the name, and absent on a class that declares it as a field.

Type:

What the level binds in place of the annotation

class Formatter[source]

Bases: Choice

How a drawing writes a name. spell(path) is the name of a place in the formatter’s own source, set(source) that source as what a drawing sets (MARKUP runs), label(text) a text naming no place written in its own source (a boundary box), and text(text) one written in each (a slot’s, Text), set from its own. A minted name is written by shown: outright(path) says the formatter names it itself, and otherwise notation(m) is how its purpose is written over what it stands for: its MintDrawing, unless the formatter overrides it. Named by a drawing’s formatter=.

Handed in as:

render_xdsm_svg(graph, formatter=PlainFormat(notation={Copy: Around(‘{}′’)})) where the argument is a Formatter: names as words, a cut’s copy primed.

abstractmethod spell(path: Place)[source]
Return type:

str

abstractmethod set(source: str)[source]
Return type:

str

abstractmethod label(text: str)[source]
Return type:

str

abstractmethod text(text: Text)[source]
Return type:

str

abstractmethod outright(path: Place)[source]
Return type:

bool

abstractmethod notation(m: Mint)[source]
Return type:

Notation