Skip to main content

DrawSVG UI

Tag Build PyPI

This repository provides a graphical user interface designed to make it easier to create files with the drawsvg library.
Instead of writing raw Python code by hand, you can visually place, move, and edit shapes on a canvas, then export your work as a ready-to-use drawsvg file. The UI runs on PySide6 and comes with a property inspector, snapping/grid helpers and a set of ready-made shapes.

The goal of this project is to help users quickly prototype and generate drawsvg code through an intuitive drag-and-drop UI.

DrawSVG UI screenshot

Requirements

The application requires Python 3.10 or newer. Dependencies include:

  • drawsvg
  • PySide6

Install via PyPI

You can install the packaged app and launch it via the generated executable script:

python -m pip install --upgrade drawsvg-ui
drawsvg-ui  # on Windows this is available as drawsvg-ui.exe

Install all via dependencies with:

python -m pip install -e .

Running the Application

After installing the dependencies, start the application with:

python src/main.py

UI Features

Canvas and navigation

  • A4 canvas with grid/subgrid preview; toggle visibility via View → Show grid.
  • Snap-to-grid movement and resizing; hold Alt to place/drag/resize freely.
  • Automatic extra A4 pages when objects cross page borders; empty pages are cleaned up again.
  • Zoom with Ctrl/Alt + mouse wheel; pan with middle button or right-button drag (right click on empty space resets zoom).
  • Rotation handle above the selection; snaps to 5° steps, hold Alt for smooth rotation with a live angle readout.

Shape palette

  • Drag shapes from the palette or click to drop them at the view center.
  • Shapes: rectangle, rounded rectangle, split rounded rectangle (adjustable header), ellipse/circle, triangle, diamond, line, arrow, block arrow, curvy right bracket, text box, and a folder-tree placeholder.

Editing and layout

  • Rubber-band selection; add to selection with Ctrl/Shift click; duplicate selection with Ctrl + drag.
  • Resize via handles; items snap while moving/resizing unless Alt is held.
  • Align multiple items (left/center/right, top/middle/bottom, snap to grid) from the context menu.
  • Group selections (Ctrl+G); ungroup an entire selection including nested groups (Ctrl+Shift+G); change z-order (bring forward/back).
  • Delete with the Delete key or clear everything via Edit → Clear canvas. Full undo/redo stack (Ctrl+Z, Ctrl+Y / Ctrl+Shift+Z).

Styling, text, and labels

  • Context menu or properties panel to edit fill/stroke color, opacity, stroke width, and line style (solid/dashed/dotted).
  • Corner radius for rectangles; adjustable divider and separate top/bottom fills for split rounded rectangles.
  • Arrowheads on lines/arrows with configurable width/height; block arrow head/shaft ratios; curvy bracket hook depth.
  • Built-in labels for supported shapes: edit text inline or in the properties panel, set font family/size/color, and horizontal/vertical alignment.
  • Text items support multi-line content, font and padding, alignment, and left-to-right or right-to-left direction.

Properties panel

  • Live inspector synced to the current selection: position, rotation, scale, z-value, size, stroke/fill, and shape-specific options.
  • Dedicated text tab for labels/text content including font, color, padding, alignment, and direction controls.

Import/Export

  • Load or save scenes as ready-to-run drawsvg Python files via the File menu.

Version 0.7.2

Text boxes now fit their content automatically until manually resized, with a Fit to text action and preserved sizing mode in native and Python files. Group selection bounds exclude temporary child handles. Light and dark themes use consistent Fusion styling, readable controls and stable widget geometry.

Version 0.8.0

  • Set solid, dashed, or dotted strokes on shapes and arrows. Line styles are preserved when loading drawings.
  • Use the Windows 11 style when available and toggle the grid in the View menu.
  • Export Python scripts that save SVGs with the same base name as the script.
  • Preserve layer tree selection and scroll position, apply visibility and locking consistently, and keep undo working after group moves.
  • Speed up scene updates, line hit testing, and snapping during drags.

The separate drawsvg Preview extension can show an exported drawing beside its Python source in VS Code.

Version 0.7.1

This release fixes grouped selection handles, arrow selection outlines, editing rotated arrows, recursive ungrouping and restoring group pivots during undo. PDF export preserves page-edge content and arrowhead contours; curved paths use tight export bounds. The public hover preview and aligned Python text export remain available.

Editor integration introduced in 0.7.0

This candidate integrates the editor development from UI_drawsvg into this repository. It adds native .drawsvg project files, connectors, free paths, diagram shapes, layers, clipboard operations, style presets, templates, guides and document lifecycle support. SVG, PDF and configurable PNG export use the shared Qt renderer. The existing canvas hover preview and aligned Python text export are retained.

See the integration report for validation of the original integration and the existing Python-export visual-parity limitation.

Development checks

python -m pip install -e ".[dev]"
python -m pytest -q
python -m ruff check .
python -m build

License

This project is licensed under the GNU General Public License version 2 or later (GPL-2.0-or-later); see LICENSE.

You may use, modify and distribute this software under the terms of the GPL. Any derivative work must also be distributed under the same license.

Metadata

Release files for drawsvg-ui 0.8.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for drawsvg-ui 0.8.0
File Size Uploaded Provenance Actions
drawsvg_ui-0.8.0.tar.gz 335.2 kB Without provenance Details for drawsvg_ui-0.8.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for drawsvg-ui 0.8.0
File Interpreter ABI Platform Actions
drawsvg_ui-0.8.0-py3-none-any.whl Python 3 none any Details for drawsvg_ui-0.8.0-py3-none-any.whl

Total release size: 553.0 kB

Release files / drawsvg_ui-0.8.0.tar.gz

Download URL drawsvg_ui-0.8.0.tar.gz
Size 335.2 kB
Tags Source
SHA-256 checksum
How to use checksums
14be8efa143ba082d990fe1d61754e66ea0fd0f7ab0598efb56340531d986f13
BLAKE2b-256 checksum
How to use checksums
843c54ebfa16a090d6f81c5a09648a016e899fc0c7939b4f29006e9c786a1a3b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / drawsvg_ui-0.8.0-py3-none-any.whl

Download URL drawsvg_ui-0.8.0-py3-none-any.whl
Size 217.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
68bcdd21695079f00b2d2a528de1b5416a317c3b8db8faf557676bf8172410fa
BLAKE2b-256 checksum
How to use checksums
7d9b15de22cf786e59ee4ff5a6f1c192b711ce74f23de7f0c0c2639b6fcb4fc1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Security for drawsvg-ui 0.8.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page