Twin-width animation tools.
Project description
twwanim
Twin-width animation tools. Given an (undirected, simple) graph and a corresponding contraction sequence (see Wikipedia for the definition of twin-width), twwanim creates a video visualizing contractions and red edges.
Dependencies
- Python 3
- LaTeX
- Manim Community (v0.18.0 or later)
- NetworkX (v3.1 or later)
Installation
- Install LaTeX distribution (the following are recommended):
- Install Manim Community: follow the installation docs.
- Install
twwanim: runpip install twwanim.
| Operation | Command |
|---|---|
| Install | pip install twwanim |
| Upgrade | pip install --upgrade twwanim |
| Uninstall | pip uninstall twwanim |
| Check installed version | twwanim --version |
| Help | twwanim -h |
Getting Started
- Make sure the command
twwanimhas been installed.
$ twwanim --version
twwanim 0.0.1
$ twwanim --help
(the usage will be shown)
- The command
twwanimtakes two inputs: a graph and a contraction sequence.
- Graph file (
.jsonor.gr):- An edge list in the JSON format (output of
json.dumps(networkx.node_link_data(G))) or the PACE 2023 input format. - For the JSON format, you may include the position of each node as a node property
pos. - See the Jupyter Notebook for an example of graph conversions.
- An edge list in the JSON format (output of
- Contraction sequence (
.jsonor.txt):- A list of vertex pairs in JSON or in the PACE 2023 output format.
Example:
twwanim -p -ql tests/resources/pace2023/public/exact_001.json tests/resources/pace2023/public/exact_001_cs.txt
-p: Preview the video after rendering it.-ql: Set the quality to low (854x480 15FPS).tests/resources/pace2023/tiny/tiny001.json: Path to a graph file.tests/resources/pace2023/tiny/tiny001_cs.txt: Path to a contraction sequence file.
- A video will be made in the
media/videosdirectory.
The example above will create media/videos/480p15/TwinwidthAnimation.mp4.
Gallery
The following videos are available on YouTube.
- PACE 2023 public instances
Developer's Guide
| Operation | Command |
|---|---|
| Run unit tests | make test |
| Install in the developer mode | make dev-install |
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file twwanim-0.0.2.tar.gz.
File metadata
- Download URL: twwanim-0.0.2.tar.gz
- Upload date:
- Size: 14.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
aa5046231334a826e4f54d7400ba2165c16b42106a8d74896fbb847b28a4ca06
|
|
| MD5 |
61fe358000012d1b9379e95cb89731fc
|
|
| BLAKE2b-256 |
06e8a5e184e71ebcbbfe1b4addb8e4c3d55c6b7cfba6a084980f10cfc702d451
|
File details
Details for the file twwanim-0.0.2-py3-none-any.whl.
File metadata
- Download URL: twwanim-0.0.2-py3-none-any.whl
- Upload date:
- Size: 15.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
033051b4027a67cc167ef50905b831886a6bfdf277b7076c3596348e29a6e916
|
|
| MD5 |
e2a0c2e1b236c532c140badb7bcdad11
|
|
| BLAKE2b-256 |
cde54507c16063ce6c8f9510c38243fc5fad7676b3fcf5c50ba8a92c39c66051
|