Metadata-Version: 2.1
Name: pylluvial
Version: 1.1.0
Summary: Python package for plotting alluvial diagrams with an arbitrary number of layers
Author-email: Daniel Malzl <daniel@menchelab.com>
License: MIT License
        
        Copyright (c) 2022 Daniel Malzl
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Homepage, https://github.com/dmalzl/pyalluvial
Keywords: plotting,networks,analysis,alluvial-plot
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE

# pylluvial
![pypi](https://img.shields.io/badge/pypi-v1.1.0-blue)
![python-version](https://img.shields.io/badge/Python->=3.9-blue)
![stable-version](https://img.shields.io/badge/version-1.1.0-blue)

A python library for creating alluvial diagrams with an arbitrary number of layers

## Installation
Simply run the following
```commandline
pip install pylluvial
```
or clone the repository 
```commandline
git clone git@github.com:dmalzl/pyalluvial.git
```
and run
```commandline
cd pyluvial
pip install .
```
you should then be able to import the package as usual

## Usage
A minimal usage example would be as follows

```python
import pylluvial as pa

data = pa.generate_test_data(
    [3, 4, 3, 2]
)

# by default labels are not shown
fig, ax = pa.alluvial(
    x='timepoint',
    stratum='module',
    alluvium='nodename',
    data=data,
    palette='husl',
    stratum_gap=2,
    stratum_width=2
)

fig.set_figwidth(10)
fig.set_figheight(5)
fig.tight_layout()
```
![](/example/without_labels.png)
```python
# pass show_labels = True to get labelled plots
fig, ax = pa.alluvial(
    x = 'timepoint',
    stratum = 'module',
    alluvium = 'nodename',
    palette = 'husl',
    data = data,
    stratum_gap = 2,
    stratum_width = 2,
    show_labels = True
)

fig.set_figwidth(10)
fig.set_figheight(5)
fig.tight_layout()
```
![](/example/with_labels.png)
```python
# use hue to split strata by a given grouping variable
fig, ax = pa.alluvial(
    x = 'timepoint',
    stratum = 'module',
    alluvium = 'nodename',
    hue = 'signif',
    palette = 'tab20',
    data = data,
    stratum_gap = 2,
    stratum_width = 2,
    show_labels = True
)

fig.set_figwidth(10)
fig.set_figheight(5)
fig.tight_layout()
```
![](/example/with_hue.png)

