{"id":13557315,"url":"https://github.com/gaphor/gaphas","last_synced_at":"2025-04-05T06:04:15.873Z","repository":{"id":595690,"uuid":"230791","full_name":"gaphor/gaphas","owner":"gaphor","description":"Gaphas is the diagramming widget library for Python.","archived":false,"fork":false,"pushed_at":"2024-05-13T12:51:32.000Z","size":4508,"stargazers_count":161,"open_issues_count":1,"forks_count":22,"subscribers_count":13,"default_branch":"main","last_synced_at":"2024-05-19T00:05:59.777Z","etag":null,"topics":["cairo","diagram-editor","gtk","python","widget"],"latest_commit_sha":null,"homepage":"https://gaphas.readthedocs.io","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gaphor.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSES/Apache-2.0.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2009-06-18T20:16:19.000Z","updated_at":"2024-08-20T17:40:57.444Z","dependencies_parsed_at":"2023-11-27T21:28:07.410Z","dependency_job_id":"b8fd0b1c-9fcb-4a1e-9014-aeb810eca7fe","html_url":"https://github.com/gaphor/gaphas","commit_stats":{"total_commits":2097,"total_committers":19,"mean_commits":"110.36842105263158","dds":0.424892703862661,"last_synced_commit":"f60e7ac7148c87d245d7c9b978fa29a37019242a"},"previous_names":[],"tags_count":79,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gaphor%2Fgaphas","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gaphor%2Fgaphas/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gaphor%2Fgaphas/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gaphor%2Fgaphas/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gaphor","download_url":"https://codeload.github.com/gaphor/gaphas/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247294516,"owners_count":20915340,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cairo","diagram-editor","gtk","python","widget"],"created_at":"2024-08-01T12:04:16.479Z","updated_at":"2025-04-05T06:04:15.847Z","avatar_url":"https://github.com/gaphor.png","language":"Python","funding_links":[],"categories":["Python","python"],"sub_categories":[],"readme":"# Gaphas\n[![Build state](https://github.com/gaphor/gaphas/workflows/build/badge.svg)](https://github.com/gaphor/gaphas/actions)\n[![Maintainability](https://api.codeclimate.com/v1/badges/e9837cc647b72119fd11/maintainability)](https://codeclimate.com/github/gaphor/gaphas/maintainability)\n[![Test Coverage](https://api.codeclimate.com/v1/badges/e9837cc647b72119fd11/test_coverage)](https://codeclimate.com/github/gaphor/gaphas/test_coverage)\n![Docs build state](https://readthedocs.org/projects/gaphas/badge/?version=latest)\n[![standard-readme compliant](https://img.shields.io/badge/readme%20style-standard-brightgreen.svg?style=flat)](https://github.com/RichardLitt/standard-readme)\n[![Matrix](https://img.shields.io/badge/chat-on%20Matrix-success)](https://matrix.to/#/#gaphor_Lobby:gitter.im)\n[![All Contributors](https://img.shields.io/badge/all_contributors-9-orange.svg?style=flat-square)](#contributors)\n\n\u003e Gaphas is the diagramming widget library for Python.\n\n![Gaphas Demo](https://raw.githubusercontent.com/gaphor/gaphas/main/docs/images/gaphas-demo.gif)\n\nGaphas is a library that provides the user interface component (widget) for drawing diagrams. Diagrams can be drawn to screen and then easily exported to a variety of formats, including SVG and PDF. Want to build an app with chart-like diagrams? Then Gaphas is for you! Use this library to build a tree, network, flowchart, or other diagrams.\n\nThis library is currently being used by [Gaphor](https://github.com/gaphor/gaphor) for UML drawing,\n[RAFCON](https://github.com/DLR-RM/RAFCON) for state-machine based robot control, and [ASCEND](http://ascend4.org/) for solving mathematical models.\n\n## 📑 Table of Contents\n\n- [Background](#background)\n- [Install](#install)\n- [Usage](#usage)\n- [Contributing](#contributing)\n- [License](#license)\n\n## 📜 Background\n\nGaphas was built to provide the foundational diagramming portions of [Gaphor](https://github.com/gaphor/gaphor). Since Gaphor is built on GTK and Cairo, [PyGObject](https://pygobject.readthedocs.io/) provides access to the GUI toolkit and [PyCairo](https://pycairo.readthedocs.io/) to the 2D graphics library. However, there wasn't a project that abstracted these technologies to easily create a diagramming tool. Hence, Gaphas was created as a library to allow others to create a diagramming tool using GTK and Cairo.\n\nHere is how it works:\n\n- Items (Canvas items) can be added to a Canvas.\n- The Canvas maintains the tree structure (parent-child relationships between items).\n- A constraint solver is used to maintain item constraints and inter-item constraints.\n- The item (and user) should not be bothered with things like bounding-box calculations.\n- Very modular--e.g., handle support could be swapped in and swapped out.\n- Rendering using Cairo.\n\nThe main portions of the library include:\n\n- canvas - The main canvas class (container for Items).\n- items - Objects placed on a Canvas.\n- solver - A constraint solver to define the layout and connection of items.\n- gtkview - A view to be used in GTK applications that interacts with users with tools.\n- painters - The workers used to paint items.\n- tools - Tools are used to handle user events (such as mouse movement and button presses).\n- aspects - Provides an intermediate step between tools and items.\n\nGaphas contains default implementations for `Canvas` and `Item`s. There are protocols in place\nto allow you to make your own canvas.\n\n## 💾 Install\n\nTo install Gaphas, simply use pip:\n\n```bash\n$ pip install gaphas\n```\n\nUse of a\n[virtual environment](https://virtualenv.pypa.io/en/latest/) is highly recommended.\n\n### Development\n\nTo setup a development environment with Linux:\n\n```bash\n$ sudo apt-get install -y python3-dev python3-gi python3-gi-cairo\n    gir1.2-gtk-3.0 libgirepository1.0-dev libcairo2-dev\n$ pip install poetry\n$ poetry install\n```\n\n## 🔦 Usage\n\nAPI docs and tutorials can be found on [Read the Docs](https://gaphas.readthedocs.io).\n\n## ♥ Contributing\n\nThanks goes to these wonderful people ([emoji key](https://github.com/kentcdodds/all-contributors#emoji-key)):\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --\u003e\n\u003c!-- prettier-ignore --\u003e\n\u003ctable\u003e\u003ctr\u003e\u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/amolenaar\"\u003e\u003cimg src=\"https://avatars0.githubusercontent.com/u/96249?v=4\" width=\"100px;\" alt=\"Arjan Molenaar\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eArjan Molenaar\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/gaphor/gaphas/commits?author=amolenaar\" title=\"Code\"\u003e💻\u003c/a\u003e \u003ca href=\"https://github.com/gaphor/gaphas/issues?q=author%3Aamolenaar\" title=\"Bug reports\"\u003e🐛\u003c/a\u003e \u003ca href=\"https://github.com/gaphor/gaphas/commits?author=amolenaar\" title=\"Documentation\"\u003e📖\u003c/a\u003e \u003ca href=\"#review-amolenaar\" title=\"Reviewed Pull Requests\"\u003e👀\u003c/a\u003e \u003ca href=\"#question-amolenaar\" title=\"Answering Questions\"\u003e💬\u003c/a\u003e \u003ca href=\"#plugin-amolenaar\" title=\"Plugin/utility libraries\"\u003e🔌\u003c/a\u003e\u003c/td\u003e\u003ctd align=\"center\"\u003e\u003ca href=\"https://ghuser.io/danyeaw\"\u003e\u003cimg src=\"https://avatars1.githubusercontent.com/u/10014976?v=4\" width=\"100px;\" alt=\"Dan Yeaw\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eDan Yeaw\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/gaphor/gaphas/commits?author=danyeaw\" title=\"Code\"\u003e💻\u003c/a\u003e \u003ca href=\"https://github.com/gaphor/gaphas/commits?author=danyeaw\" title=\"Tests\"\u003e⚠️\u003c/a\u003e \u003ca href=\"#review-danyeaw\" title=\"Reviewed Pull Requests\"\u003e👀\u003c/a\u003e \u003ca href=\"https://github.com/gaphor/gaphas/issues?q=author%3Adanyeaw\" title=\"Bug reports\"\u003e🐛\u003c/a\u003e \u003ca href=\"#question-danyeaw\" title=\"Answering Questions\"\u003e💬\u003c/a\u003e \u003ca href=\"#infra-danyeaw\" title=\"Infrastructure (Hosting, Build-Tools, etc)\"\u003e🚇\u003c/a\u003e \u003ca href=\"https://github.com/gaphor/gaphas/commits?author=danyeaw\" title=\"Documentation\"\u003e📖\u003c/a\u003e\u003c/td\u003e\u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/wrobell\"\u003e\u003cimg src=\"https://avatars2.githubusercontent.com/u/105664?v=4\" width=\"100px;\" alt=\"wrobell\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003ewrobell\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/gaphor/gaphas/commits?author=wrobell\" title=\"Code\"\u003e💻\u003c/a\u003e \u003ca href=\"https://github.com/gaphor/gaphas/commits?author=wrobell\" title=\"Tests\"\u003e⚠️\u003c/a\u003e \u003ca href=\"#review-wrobell\" title=\"Reviewed Pull Requests\"\u003e👀\u003c/a\u003e\u003c/td\u003e\u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/jlstevens\"\u003e\u003cimg src=\"https://avatars3.githubusercontent.com/u/890576?v=4\" width=\"100px;\" alt=\"Jean-Luc Stevens\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eJean-Luc Stevens\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/gaphor/gaphas/commits?author=jlstevens\" title=\"Code\"\u003e💻\u003c/a\u003e \u003ca href=\"https://github.com/gaphor/gaphas/issues?q=author%3Ajlstevens\" title=\"Bug reports\"\u003e🐛\u003c/a\u003e \u003ca href=\"https://github.com/gaphor/gaphas/commits?author=jlstevens\" title=\"Documentation\"\u003e📖\u003c/a\u003e\u003c/td\u003e\u003ctd align=\"center\"\u003e\u003ca href=\"http://www.franework.de\"\u003e\u003cimg src=\"https://avatars1.githubusercontent.com/u/1144966?v=4\" width=\"100px;\" alt=\"Franz Steinmetz\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eFranz Steinmetz\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/gaphor/gaphas/commits?author=franzlst\" title=\"Code\"\u003e💻\u003c/a\u003e \u003ca href=\"https://github.com/gaphor/gaphas/issues?q=author%3Afranzlst\" title=\"Bug reports\"\u003e🐛\u003c/a\u003e\u003c/td\u003e\u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/adrianboguszewski\"\u003e\u003cimg src=\"https://avatars3.githubusercontent.com/u/4547501?v=4\" width=\"100px;\" alt=\"Adrian Boguszewski\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eAdrian Boguszewski\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/gaphor/gaphas/commits?author=adrianboguszewski\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/Rbelder\"\u003e\u003cimg src=\"https://avatars3.githubusercontent.com/u/15119522?v=4\" width=\"100px;\" alt=\"Rico Belder\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eRico Belder\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/gaphor/gaphas/issues?q=author%3ARbelder\" title=\"Bug reports\"\u003e🐛\u003c/a\u003e \u003ca href=\"#review-Rbelder\" title=\"Reviewed Pull Requests\"\u003e👀\u003c/a\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd align=\"center\"\u003e\u003ca href=\"http://www.boduch.ca\"\u003e\u003cimg src=\"https://avatars2.githubusercontent.com/u/114619?v=4\" width=\"100px;\" alt=\"Adam Boduch\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eAdam Boduch\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/gaphor/gaphas/issues?q=author%3Aadamboduch\" title=\"Bug reports\"\u003e🐛\u003c/a\u003e\u003c/td\u003e\u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/janettech\"\u003e\u003cimg src=\"https://avatars3.githubusercontent.com/u/13398384?v=4\" width=\"100px;\" alt=\"Janet Jose\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eJanet Jose\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/gaphor/gaphas/commits?author=janettech\" title=\"Documentation\"\u003e📖\u003c/a\u003e\u003c/td\u003e\u003c/tr\u003e\u003c/table\u003e\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:END --\u003e\n\nThis project follows the [all-contributors](https://github.com/kentcdodds/all-contributors) specification. Contributions of any kind are welcome!\n\n1. Check for open issues or open a fresh issue to start a discussion around a feature idea or a bug.\n    There is a [first-timers-only](https://github.com/gaphor/gaphas/issues?utf8=%E2%9C%93\u0026q=is%3Aissue+is%3Aopen+label%3Afirst-timers-only) tag for issues that should be ideal for people who are not very familiar with the codebase yet.\n2. Fork [the repository](https://github.com/gaphor/gaphas) on GitHub to    start making your changes to the **main**       branch (or branch off of it).\n3. Write a test which shows that the bug was fixed or that the feature\n   works as expected.\n4. Send a pull request and bug the maintainers until it gets merged and\n   published. :smile:\n\nSee [the contributing file](CONTRIBUTING.md)!\n\n## © License\n\nCopyright © Arjan Molenaar and Dan Yeaw\n\nLicensed under the [Apache License 2.0](LICENSES/Apache-2.0.txt).\n\nSummary: You can do what you like with Gaphas, as long as you include the required notices. This permissive license contains a patent license from the contributors of the code.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgaphor%2Fgaphas","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgaphor%2Fgaphas","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgaphor%2Fgaphas/lists"}