# Algviz
[<img src="https://cdn.jsdelivr.net/gh/zjl9959/algviz@main/docs/images/logo_v1.svg"/>](https://algviz.com)
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/algviz)
![PyPI](https://img.shields.io/pypi/v/algviz)
![Conda-forge](https://img.shields.io/conda/vn/conda-forge/algviz)
![License](https://img.shields.io/github/license/zjl9959/algviz)
[中文介绍文档](README_CN.md)
## What is algviz?
[Algviz](https://algviz.com) is an algorithm animation engine for your Python code in [Jupyter](https://jupyter.org/), which supports multiple data structures such as `vector`, `table`, `linked_list`, `tree` and `graph`.
| Vector | Table | Tree | Graph |
|:---:|:---:|:---:|:---:|
| ![vector.svg] | ![table.svg] | ![tree.svg] | ![graph.svg] |
You can get live algorithm animation after bringing some algviz interfaces to your algorithm.
For example, this code below shows the bubble sort algorithm:
<details>
<summary>Click to show the code example</summary>
```python
import algviz
def bubble_sort(data):
viz = algviz.Visualizer(0.5)
vector = viz.createVector(data, cell_size=(40, 160), histogram=True)
for i in range(len(vector)):
for j in range(len(vector)-i-1):
if vector[j] > vector[j+1]:
vector.mark(algviz.cRed, j)
vector.mark(algviz.cGreen, j+1)
viz.display()
vector.swap(j, j+1)
else:
vector.mark(algviz.cRed, j+1)
vector.mark(algviz.cGreen, j)
viz.display()
vector.mark(algviz.cGray, len(vector)-i-1, hold=True)
vector.removeMark(algviz.cGray)
viz.display()
bubble_sort([5, 4, -2, 1, -1, 3])
```
</details>
<br>
The rendered animation looks like this:
![bubble_sort_animation](https://cdn.jsdelivr.net/gh/zjl9959/algviz-launch@master/svgs/BubbleSort.svg)
*If you are interested in this project, please give me a star⭐, thanks!*
## Examples
Ready to see the magic? Click this button to try more algorithms on Gitpod!
[![Open algviz examples in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/zjl9959/algviz-launch) *Need to login with your github account.*
## Installation
Please follow this [installation guide](https://algviz.com/en/installation.html) to setup algviz.
## Tutorial
This [tutorial](https://algviz.com/en/examples.html) gives you a quick start on using algviz.
All the API references can be found at [algviz API reference](https://algviz.readthedocs.io/en/latest/api.html#).
## License
Algviz uses GNU general public [LICENSE](https://github.com/zjl9959/algviz/blob/main/LICENSE). You can use it freely for learning and communication. For the commercial usage, please contact the author.
## Contribution
Any form of contribution is welcomed! Please feel free to report a [bug](https://github.com/zjl9959/algviz/issues) or create a [pull request](https://github.com/zjl9959/algviz/pulls).
If you want to share your algorithms using algviz, you can create a [PR](https://github.com/zjl9959/algviz-launch/pulls) from this repo: 👉 [algviz-launch](https://github.com/zjl9959/algviz-launch).
[bubble sort algorithm]: https://en.wikipedia.org/wiki/Bubble_sort
[vector.svg]: https://cdn.jsdelivr.net/gh/zjl9959/algviz.com@master/assets/img/data_vector.svg
[table.svg]: https://cdn.jsdelivr.net/gh/zjl9959/algviz.com@master/assets/img/data_table.svg
[tree.svg]: https://cdn.jsdelivr.net/gh/zjl9959/algviz.com@master/assets/img/data_tree.svg
[graph.svg]: https://cdn.jsdelivr.net/gh/zjl9959/algviz.com@master/assets/img/data_graph.svg
## Discussion
**QQ group**: [334605370](http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=NYzoqZd6B8sryXf0S8o1uv72b_p2M5ai&authKey=qTbFUbVoI%2F8RWZVmlabPkuBHnuY2RzywEnKeNZlV8dOhcdcKY%2BoiYnPklmdfpwlE&noverify=0&group_code=334605370)
**Telegram**: https://t.me/+mvF8Sivxr3thZWY1
Raw data
{
"_id": null,
"home_page": "https://algviz.com/",
"name": "algviz",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": "",
"keywords": "Algorithm Visualizer Animation Jupyter-notebook Graph",
"author": "zjl9959",
"author_email": "zjl9959@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/83/90/3d30c677f74a85a21e6761df9e3852da3ee293804714fbf18186938f2f61/algviz-0.3.1.tar.gz",
"platform": null,
"description": "# Algviz\r\n\r\n[<img src=\"https://cdn.jsdelivr.net/gh/zjl9959/algviz@main/docs/images/logo_v1.svg\"/>](https://algviz.com)\r\n\r\n![PyPI - Python Version](https://img.shields.io/pypi/pyversions/algviz)\r\n![PyPI](https://img.shields.io/pypi/v/algviz)\r\n![Conda-forge](https://img.shields.io/conda/vn/conda-forge/algviz)\r\n![License](https://img.shields.io/github/license/zjl9959/algviz)\r\n\r\n[\u4e2d\u6587\u4ecb\u7ecd\u6587\u6863](README_CN.md)\r\n\r\n## What is algviz?\r\n\r\n[Algviz](https://algviz.com) is an algorithm animation engine for your Python code in [Jupyter](https://jupyter.org/), which supports multiple data structures such as `vector`, `table`, `linked_list`, `tree` and `graph`.\r\n\r\n| Vector | Table | Tree | Graph |\r\n|:---:|:---:|:---:|:---:|\r\n| ![vector.svg] | ![table.svg] | ![tree.svg] | ![graph.svg] |\r\n\r\nYou can get live algorithm animation after bringing some algviz interfaces to your algorithm.\r\nFor example, this code below shows the bubble sort algorithm:\r\n\r\n<details>\r\n\r\n<summary>Click to show the code example</summary>\r\n\r\n```python\r\nimport algviz\r\n\r\ndef bubble_sort(data):\r\n viz = algviz.Visualizer(0.5)\r\n vector = viz.createVector(data, cell_size=(40, 160), histogram=True)\r\n for i in range(len(vector)):\r\n for j in range(len(vector)-i-1):\r\n if vector[j] > vector[j+1]:\r\n vector.mark(algviz.cRed, j)\r\n vector.mark(algviz.cGreen, j+1)\r\n viz.display()\r\n vector.swap(j, j+1)\r\n else:\r\n vector.mark(algviz.cRed, j+1)\r\n vector.mark(algviz.cGreen, j)\r\n viz.display()\r\n vector.mark(algviz.cGray, len(vector)-i-1, hold=True)\r\n vector.removeMark(algviz.cGray)\r\n viz.display()\r\n\r\nbubble_sort([5, 4, -2, 1, -1, 3])\r\n```\r\n\r\n</details>\r\n\r\n<br>\r\n\r\nThe rendered animation looks like this:\r\n\r\n![bubble_sort_animation](https://cdn.jsdelivr.net/gh/zjl9959/algviz-launch@master/svgs/BubbleSort.svg)\r\n\r\n*If you are interested in this project, please give me a star\u2b50, thanks!*\r\n\r\n## Examples\r\n\r\nReady to see the magic? Click this button to try more algorithms on Gitpod!\r\n\r\n[![Open algviz examples in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/zjl9959/algviz-launch) *Need to login with your github account.*\r\n\r\n## Installation\r\n\r\nPlease follow this [installation guide](https://algviz.com/en/installation.html) to setup algviz.\r\n\r\n## Tutorial\r\n\r\nThis [tutorial](https://algviz.com/en/examples.html) gives you a quick start on using algviz.\r\n\r\nAll the API references can be found at [algviz API reference](https://algviz.readthedocs.io/en/latest/api.html#).\r\n\r\n## License\r\n\r\nAlgviz uses GNU general public [LICENSE](https://github.com/zjl9959/algviz/blob/main/LICENSE). You can use it freely for learning and communication. For the commercial usage, please contact the author.\r\n\r\n## Contribution\r\n\r\nAny form of contribution is welcomed! Please feel free to report a [bug](https://github.com/zjl9959/algviz/issues) or create a [pull request](https://github.com/zjl9959/algviz/pulls).\r\n\r\nIf you want to share your algorithms using algviz, you can create a [PR](https://github.com/zjl9959/algviz-launch/pulls) from this repo: \ud83d\udc49 [algviz-launch](https://github.com/zjl9959/algviz-launch).\r\n\r\n[bubble sort algorithm]: https://en.wikipedia.org/wiki/Bubble_sort\r\n[vector.svg]: https://cdn.jsdelivr.net/gh/zjl9959/algviz.com@master/assets/img/data_vector.svg\r\n[table.svg]: https://cdn.jsdelivr.net/gh/zjl9959/algviz.com@master/assets/img/data_table.svg\r\n[tree.svg]: https://cdn.jsdelivr.net/gh/zjl9959/algviz.com@master/assets/img/data_tree.svg\r\n[graph.svg]: https://cdn.jsdelivr.net/gh/zjl9959/algviz.com@master/assets/img/data_graph.svg\r\n\r\n\r\n## Discussion\r\n\r\n**QQ group**: [334605370](http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=NYzoqZd6B8sryXf0S8o1uv72b_p2M5ai&authKey=qTbFUbVoI%2F8RWZVmlabPkuBHnuY2RzywEnKeNZlV8dOhcdcKY%2BoiYnPklmdfpwlE&noverify=0&group_code=334605370)\r\n\r\n**Telegram**: https://t.me/+mvF8Sivxr3thZWY1\r\n",
"bugtrack_url": null,
"license": "GPLv3",
"summary": "An algorithm visualization tool for jupyter notebook to show animation for vector, table, linked list, tree and graph data structures.",
"version": "0.3.1",
"project_urls": {
"Documentation": "https://algviz.readthedocs.io/en/latest/index.html",
"Homepage": "https://algviz.com/",
"Issue Tracker": "https://github.com/zjl9959/algviz/issues"
},
"split_keywords": [
"algorithm",
"visualizer",
"animation",
"jupyter-notebook",
"graph"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "26d32f3f6294531e0106f20650f1a1e777a72a7d3b0a57c7ca31d73fadbc70ef",
"md5": "ddd59d31ccc84642381c62c65fb174d1",
"sha256": "025f1e0ad4351e007ed9c359fa48c79b61ce489cfd7fd246b84a3a0c38170ee7"
},
"downloads": -1,
"filename": "algviz-0.3.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "ddd59d31ccc84642381c62c65fb174d1",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 124026,
"upload_time": "2023-09-09T12:36:17",
"upload_time_iso_8601": "2023-09-09T12:36:17.783537Z",
"url": "https://files.pythonhosted.org/packages/26/d3/2f3f6294531e0106f20650f1a1e777a72a7d3b0a57c7ca31d73fadbc70ef/algviz-0.3.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "83903d30c677f74a85a21e6761df9e3852da3ee293804714fbf18186938f2f61",
"md5": "5348c06cc3f7b38945a33555fa5d24e9",
"sha256": "f9ca77b1ad4ffec6c3eada5c80df52bf85a9aee1d8bc1b572088023ba10c48e7"
},
"downloads": -1,
"filename": "algviz-0.3.1.tar.gz",
"has_sig": false,
"md5_digest": "5348c06cc3f7b38945a33555fa5d24e9",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 129861,
"upload_time": "2023-09-09T12:36:20",
"upload_time_iso_8601": "2023-09-09T12:36:20.118748Z",
"url": "https://files.pythonhosted.org/packages/83/90/3d30c677f74a85a21e6761df9e3852da3ee293804714fbf18186938f2f61/algviz-0.3.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-09-09 12:36:20",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "zjl9959",
"github_project": "algviz",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "algviz"
}