class cirq.TextDiagramDrawer[source]

A utility class for creating simple text diagrams.


Initialize self. See help(type(self)) for accurate signature.


content_present(x, y) Determines if a line or printed text is at the given location.
force_horizontal_padding_after(index, padding) Change the padding after the given column.
force_vertical_padding_after(index, padding) Change the padding after the given row.
grid_line(x1, y1, x2, y2, emphasize) Adds a vertical or horizontal line from (x1, y1) to (x2, y2).
height() Determines how many entry rows are in the diagram.
horizontal_line(y, x1, x2, emphasize) Adds a line from (x1, y) to (x2, y).
insert_empty_columns(x, amount) Insert a number of columns after the given column.
insert_empty_rows(y, amount) Insert a number of rows after the given row.
render(horizontal_spacing, vertical_spacing, …) Outputs text containing the diagram.
transpose() Returns the same diagram, but mirrored across its diagonal.
vertical_line(x, y1, y2, emphasize) Adds a line from (x, y1) to (x, y2).
width() Determines how many entry columns are in the diagram.
write(x, y, text, transposed_text) Adds text to the given location.