Metadata-Version: 2.1
Name: hasse-diagram
Version: 1.0
Summary: Plot Hasse Diagram in Python
Home-page: https://github.com/anras5/hasse-diagram
Author: Filip Marciniak
Author-email: filip.marciniak15@gmail.com
Project-URL: Bug Tracker, https://github.com/anras5/hasse-diagram/issues
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: numpy==2.0.0
Requires-Dist: matplotlib==3.9.0
Requires-Dist: networkx==3.3

# Hasse Diagram

This small package helps with plotting Hasse Diagrams and is very useful when presenting results for the MCDA methods.

## Installation

```
pip install hasse-diagram
```

## Example usage
```python
import numpy as np
from hassediagram import plot_hasse

data = np.array([
    [0, 1, 1, 1, 1],
    [0, 0, 1, 0, 1],
    [0, 1, 0, 0, 1],
    [0, 0, 0, 0, 0],
    [0, 0, 0, 0, 0]
])
labels = ["node a", "node b", "node c", "node d", "node e"]
plot_hasse(data, labels)
```

Result:

![img.png](./images/example_plot1.png)

You can optionally turn off the transitive reduction and change the color of nodes and edges.

## Testing
```
pytest --cov=src --cov-report=term-missing
```

This package is inspired by a similar one for R: [hasseDiagram](https://github.com/kciomek/hasseDiagram)
