cottax.consumers.visualization.interface_types module

What a drawing is answered with: a condition node’s Drawn, its Kind and Slot`s; and the `Notation`s a `Formatter writes a minted name in.

class Kind(name: str, legend: str, title: str, slotted: bool, colour: tuple[str, str])[source]

Bases: Frozen

A category of problem: a language’s own, which the drawing names nowhere. name is its short name, what a struct calls it; two categories with one name are refused in one picture. legend is what a key says, title what hovering says. slotted: its reads are of mixed kind, so its slots are drawn by default. colour is its (fill, stroke) on a light ground, which a style draws as it is or derives its own from (Style.ground), written on each shape drawn in it.

name: str
legend: str
title: str
slotted: bool
colour: tuple[str, str]
class Text(plain: str, latex: str)[source]

Bases: Frozen

A text naming no place, written in each source a Formatter sets from: plain, and latex – Text(’≤ 0’, r’leq 0’).

plain: str
latex: str
class Slot(label: tuple[Text | Place, ...], reads: tuple[Place, ...])[source]

Bases: Frozen

Some of a problem’s reads under one label. label is texts and places in order – (Text(‘min’, r’min’),), (Text(’= ‘, ‘= ‘), u), (lhs, Text(’ = ‘, ‘ = ‘), rhs) – set by the drawing: a text as Formatter.text, a place as its shown name.

label: tuple[Text | Place, ...]
reads: tuple[Place, ...]
class Drawn(kind: Kind | None, slots: tuple[Slot, ...])[source]

Bases: Frozen

How one condition node is drawn: its category (None: none, a grey problem) and its slots, in the order its driver is handed them.

kind: Kind | None
slots: tuple[Slot, ...]
class Notation[source]

Bases: Frozen

How a name minted in a namespace is written over the place it stands for.

class Around(template: str)[source]

Bases: Notation

Text around the inner name: template in the formatter’s own source (plain text for PlainFormat, LaTeX for a LatexFormatter), its first {} the inner – Around(‘solve({})’), Around(‘{}′’), Around(r’S_{{}}’).

template: str
class Accent(mark: str, spelled: str)[source]

Bases: Notation

A mark over the inner name, whatever it is: ‘hat’, ‘bar’, ‘tilde’, ‘dot’. spelled (an Around template) is how it is written where no mark can be drawn – inside another notation, or in plain text.

mark: str
spelled: str