Toggle Menu
Prev Up Next

# `langchain_core.runnables.graph_ascii`.AsciiCanvas

class langchain_core.runnables.graph_ascii.AsciiCanvas(cols: int, lines: int)

  Class for drawing in ASCII.

  Parameters

    - cols (int) – number of columns in the canvas. Should be > 1.

    - lines (int) – number of lines in the canvas. Should be > 1.

  Attributes

  `TIMEOUT` |

  Methods

  `__init__`(cols, lines) |
  `box`(x0, y0, width, height) | Create a box on ASCII canvas.
  `draw`() | Draws ASCII canvas on the screen.
  `line`(x0, y0, x1, y1, char) | Create a line on ASCII canvas.
  `point`(x, y, char) | Create a point on ASCII canvas.
  `text`(x, y, text) | Print a text on ASCII canvas.

  __init__(cols: int, lines: int) → None
    Parameters

      - cols (int) –

      - lines (int) –

    Return type

      None

  box(x0: int, y0: int, width: int, height: int) → None

    Create a box on ASCII canvas.

    Parameters

      - x0 (int) – x coordinate of the box corner.

      - y0 (int) – y coordinate of the box corner.

      - width (int) – box width.

      - height (int) – box height.

    Return type

      None

  draw() → str

    Draws ASCII canvas on the screen.

    Return type

      str

  line(x0: int, y0: int, x1: int, y1: int, char: str) → None

    Create a line on ASCII canvas.

    Parameters

      - x0 (int) – x coordinate where the line should start.

      - y0 (int) – y coordinate where the line should start.

      - x1 (int) – x coordinate where the line should end.

      - y1 (int) – y coordinate where the line should end.

      - char (str) – character to draw the line with.

    Return type

      None

  point(x: int, y: int, char: str) → None

    Create a point on ASCII canvas.

    Parameters

      - x (int) – x coordinate. Should be >= 0 and < number of columns in the canvas.

      - y (int) – y coordinate. Should be >= 0 an < number of lines in the canvas.

      - char (str) – character to place in the specified point on the canvas.

    Return type

      None

  text(x: int, y: int, text: str) → None

    Print a text on ASCII canvas.

    Parameters

      - x (int) – x coordinate where the text should start.

      - y (int) – y coordinate where the text should start.

      - text (str) – string that should be printed.

    Return type

      None