Convert graphviz (dot) files into draw.io (mxGraph) format.
- Migrate from Travis to GHA for CI
- Migrate from Make to GHA for release
- Fix "cb" bug
- Add support for clusters
- Add support for edge labels
- Upgrade to latest pygraphviz
- Upgrade to latest svg.path
- Reformat for most recent black style
- Publish api docs to GH pages
- Remove this section before release! (move to release notes)
The graphviz library is required before installing this package.
Python 3 and graphviz can be installed with Homebrew:
brew update
brew install python3 graphviz
# In order to build pygraphviz:
export CFLAGS="-I$(brew --prefix graphviz)/include/"
export LDFLAGS="-L$(brew --prefix graphviz)/lib/"
sudo apt install python3-pip graphviz graphviz-dev
It is recommended to use pipx to install and run the CLI tool. If you wish to use the library, you can install with pip
instead.
brew install pipx
pipx install -U graphviz2drawio
Run the conversion app on your graphviz file
graphviz2drawio example.dot
You can them import the output XML file into draw.io
from graphviz2drawio import graphviz2drawio
xml = graphviz2drawio.convert(graph_to_convert)
print(xml)
where graph_to_convert
can be any of a file path, file handle, string of dot language, or PyGraphviz.AGraph object
Please open an issue with your dot file to report crashes or incorrect conversions.
- PyGraphviz - Python interface to Graphviz
- svg.path - SVG path objects and parser
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
git clone [email protected]:hbmartin/graphviz2drawio.git
cd graphviz2drawio
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
# Replace with the actual path to your dot files
python -m graphviz2drawio test/directed/hello.gv.txt
Roadmap to 0.4
- Bezier curve support
- Subgraph conversion #33
- Invisible node handling for edges #67
- Implementation for outstanding TODOs in code
- Image / tooltip support #49
- Text on edge alignment #59
- Support for node with
path
shape #47
- Complete test suite for official graphviz examples
- Migrate to uv/hatch for packaging and dep mgmt
- Port layout/orientation
- Fix text alignment inside of shape
- Possible to screenshot test with maxGraph ?