galactic.algebras.lattice.examples.color.renderer

galactic.algebras.lattice.examples.color.renderer#

Defines a color renderer for visualizing colors in a lattice structure.

Classes


class ColorRenderer#

Bases: NodeRenderer[Color, Color]

Renders Graphviz node and edge attributes for colors.

attributes(elem, domain, co_domain, *, index=None, current=False, successors=None, predecessors=None)#

Produce a dictionary of Graphviz attributes for a node.

Parameters:
  • elem (Color) – The color to render

  • index (int | None, default: None) – The index of the element

  • current (bool, default: False) – Whether elem is the current element

  • domain (Collection[Color]) – The domain to render

  • co_domain (Collection[Color]) – The co-domain to render

  • successors (Collection[Color] | None, default: None) – The successors of the element

  • predecessors (Collection[Color] | None, default: None) – The predecessors of the element

Returns:

A dictionary of Graphviz attributes

Return type:

dict[str, str]

model_config: ClassVar[ConfigDict] = {'validate_assignment': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].