Metadata-Version: 2.1
Name: openchord
Version: 0.1.2
Summary: A library for ploting chord diagrams
Author-email: Kenny Pang <pangkhangee@gmail.com>
Project-URL: Homepage, https://github.com/pke1029/open-chord
Keywords: plot,data science,Jupyter,network,graph
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
Classifier: Operating System :: OS Independent
Requires-Python: >=3.6
Description-Content-Type: text/markdown
License-File: LICENSE

# OpenChord

OpenChord is a Python library I am developing to plot beautiful chord diagrams for visualising networks and graphs. OpenChord uses the `drawsvg` library and can display figures in a Jupyter notebook or Jupyter lab. Other libraries for drawing chord diagram includes [PlotAPI](https://plotapi.com/) (paid), [Bokeh](https://holoviews.org/reference/elements/bokeh/Chord.html) (visible moire artifact), and [Plotly](https://plotly.com/python/v3/filled-chord-diagram/) (tedious). 

## Installation

OpenChord is now on PyPI.org! Install using the command
```
python3 -m pip install openchord
```

## Usage

Currently, the function only support symmetric adjacency matricies (i.e. weighted graph, non-directed)
```python
import openchord as ocd

adjacency_matrix = [[ 3, 18,  9,  0, 23],
                    [18,  0, 12,  5, 29],
                    [ 9, 12,  0, 27, 10],
                    [ 0,  5, 27,  0,  0],
                    [23, 29, 10,  0,  0]]
labels = ['Emma', 'Isabella', 'Ava', 'Olivia', 'Sophia']

fig = ocd.Chord(adjacency_matrix, labels)
fig.show()
```
Color can be changed like so
```python
fig.color_map = ['#636EFA', '#EF553B', '#00CC96', '#AB63FA', '#FFA15A', '#19D3F3', '#FF6692', '#B6E880', '#FF97FF', '#FECB52']
fig.show()
```
You can export the figure as an .svg file and open it in a vector graphics software such as [Inkscape](https://inkscape.org/)
```python
fig.save_svg("figure.svg")
```
![Chord diagram using OpenChord](https://github.com/pke1029/open-chord/blob/main/media/figure.png)
