Metadata-Version: 2.2
Name: sp-svg-diagram
Version: 0.1.1
Summary: A library for rendering diagrams to SVG.
License: MIT
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: C++
Classifier: Operating System :: OS Independent
Requires-Python: >=3.8
Provides-Extra: test
Requires-Dist: pytest; extra == "test"
Requires-Dist: black; extra == "test"
Requires-Dist: isort; extra == "test"
Requires-Dist: flake8; extra == "test"
Description-Content-Type: text/markdown

SVG Diagram
===========

[![C++ Unit Tests](https://github.com/CyberZHG/SVGDiagram/actions/workflows/cpp-unit-test.yml/badge.svg)](https://github.com/CyberZHG/SVGDiagram/actions/workflows/cpp-unit-test.yml)
[![Python Build & Test](https://github.com/CyberZHG/SVGDiagram/actions/workflows/python-build-test.yml/badge.svg)](https://github.com/CyberZHG/SVGDiagram/actions/workflows/python-build-test.yml)
[![ES Build & Test](https://github.com/CyberZHG/SVGDiagram/actions/workflows/es-build-test.yml/badge.svg)](https://github.com/CyberZHG/SVGDiagram/actions/workflows/es-build-test.yml)
[![Deploy Docs to GitHub Pages](https://github.com/CyberZHG/SVGDiagram/actions/workflows/deploy-docs.yml/badge.svg)](https://github.com/CyberZHG/SVGDiagram/actions/workflows/deploy-docs.yml)
[![Coverage Status](https://coveralls.io/repos/github/CyberZHG/SVGDiagram/badge.svg?branch=main)](https://coveralls.io/github/CyberZHG/SVGDiagram?branch=main)
[![PyPI version](https://img.shields.io/pypi/v/sp-svg-diagram.svg)](https://pypi.org/project/sp-svg-diagram/)
[![npm version](https://img.shields.io/npm/v/sp-svg-diagram.svg)](https://www.npmjs.com/package/sp-svg-diagram)
<!-- ![PyPI downloads](https://img.shields.io/pypi/dm/sp-svg-diagram.svg) -->
<!-- ![npm downloads](https://img.shields.io/npm/dm/sp-svg-diagram.svg) -->

A library for rendering diagrams to SVG. This library does not provide any automatic layout for nodes and edges.

[Document](https://cyberzhg.github.io/SVGDiagram/)

## Examples

Click the image to see the code that generated it:

|   [![](docs/images/example_pentagon.svg)](./tests/example/test_example_pentagon.cpp)   | [![](docs/images/example_pentagram.svg)](./tests/example/test_example_pentagram.cpp) |
|:--------------------------------------------------------------------------------------:|:------------------------------------------------------------------------------------:|
| [![](docs/images/example_sequential.svg)](./tests/example/test_example_sequential.cpp) |  [![](docs/images/example_subgraph.svg)](./tests/example/test_example_subgraph.cpp)  |

## Development

To enable tests, add the following to your CMake options:

```bash
-DGRAPH_LAYOUT_BUILD_TESTS=ON
```

## Optional Requirements

By default, this library estimates text dimensions using approximations. For more accurate measurements, PangoCairo can be enabled.

To install PangoCairo:

MacOS:

```bash
brew install cairo pango pkg-config
```

Linux:

```bash
sudo apt install libcairo2-dev libpango1.0-dev pkg-config
```

To enable PangoCairo, add the following to your CMake options:

```bash
-DSVG_DIAGRAM_ENABLE_PANGO_CAIRO=ON
```
