https://github.com/davep/textual-canvas
A simple character-based canvas widget for use with Textual.
https://github.com/davep/textual-canvas
canvas drawing plotting python python-library python3 terminal textual textual-widget widget
Last synced: 5 months ago
JSON representation
A simple character-based canvas widget for use with Textual.
- Host: GitHub
- URL: https://github.com/davep/textual-canvas
- Owner: davep
- License: mit
- Created: 2023-03-25T17:48:43.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2025-10-02T15:09:35.000Z (5 months ago)
- Last Synced: 2025-10-02T16:18:44.755Z (5 months ago)
- Topics: canvas, drawing, plotting, python, python-library, python3, terminal, textual, textual-widget, widget
- Language: Python
- Homepage: http://textual-canvas.davep.dev/
- Size: 1.64 MB
- Stars: 46
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: ChangeLog.md
- License: LICENSE
Awesome Lists containing this project
- awesome-textualize-projects - Canvas - A simple character-based canvas widget for use with Textual. (Community / Third Party Applications)
README
# textual-canvas

*An example of `textual-canvas` being used in a Textual application*
[](https://github.com/davep/textual-canvas/actions)
[](https://github.com/davep/textual-canvas/commits/main/)
[](https://github.com/davep/textual-canvas/issues)
[](https://github.com/davep/textual-canvas/releases)
[](https://github.com/davep/textual-canvas/blob/main/LICENSE)
[](https://github.com/davep/textual-canvas/blob/main/pyproject.toml)
[](https://pypi.org/project/textual-canvas/)
## Introduction
`textual-canvas` provides a simple terminal-based drawing canvas widget for
use with [Textual](https://textual.textualize.io/). Initially developed as a
widget for building
[`textual-mandelbrot`](https://github.com/davep/textual-mandelbrot), it made
sense to spin it out into its own general-purpose library.
## Installing
The package can be installed with `pip` or related tools, for example:
```sh
$ pip install textual-canvas
```
## The library
The library provides one very simple widget for use in Textual: `Canvas`.
This is a scrollable and focusable widget that can be used to colour
"pixels", acting as a basic building block for drawing other things. The
"pixels" themselves are half a character cell in height, hopefully coming
out roughly square in most environments.
See [the documentation](https://textual-canvas.davep.dev/) for an
introduction, a usage guide and detailed API documentation.
[//]: # (README.md ends here)