Backend#

class discopy.drawing.legacy.Backend(linewidth=1)[source]#

Bases: ABC

Abstract drawing backend.

draw_text(text, i, j, **params)[source]#

Draws a piece of text at a given position.

draw_node(i, j, **params)[source]#

Draws a node for a given position, color and shape.

draw_polygon(*points, color='white')[source]#

Draws a polygon given a list of points.

draw_wire(source, target, bend_out=False, bend_in=False, style=None)[source]#

Draws a wire from source to target, possibly with a Bezier.

draw_spiders(graph, positions, draw_box_labels=True, **params)[source]#

Draws a list of boxes depicted as spiders.

abstract output(path=None, show=True, **params)[source]#

Output the drawing.