Giter Site home page Giter Site logo

ausankey's Introduction

ausankey

Uses matplotlib to create simple Sankey diagrams flowing only from left to right.

PyPI version Coverage Status

Python package Jekyll Pages Publish release

This package is available on PyPi and can be installed via:

pip install ausankey

User documentation for the repository is published via GitHub Pages: https://aumag.github.io/ausankey/

Code documentation by Mkdocs is available here: https://aumag.github.io/ausankey/reference/

Minimal example

example

import ausankey as sky
import matplotlib.pyplot as plt
import pandas as pd

data = pd.DataFrame([
  ("a",1.0,"ab",2.0,"a",1.0),
  ("a",1.0,"ba",0.8,"ba",0.4),
  ("c",1.5,"cd",0.5,"d",2.0),
  ("b",0.5,"ba",0.8,"ba",0.4),
  ("b",0.5,"ab",0.8,"a",1.0),
  ("d",2.0,"cd",0.4,"d",1.0),
  ("e",1.0,"e",1.0,"e",3.0),
])

plt.figure()
sky.sankey(
  data,
  sort      =top”,
  titles    = ["Stage 1","Stage 2","Stage 3"],
  valign    = "center",
)
plt.show()

Requirements

  • Python 3.x
  • matplotlib
  • numpy
  • pandas

ausankey's People

Contributors

wspr avatar pierre-sassoulas avatar anazalea avatar marcomanz avatar

Stargazers

Longyong Wu avatar  avatar  avatar  avatar  avatar

Forkers

sulaimanhayek

ausankey's Issues

Groups of labels

It might be desirable to sort and colour labels in groups rather than treating them all as independent. Not sure if data frames might allow this in a sensible way for data entry

Add pypi packager

Last step to setting up the repo properly (at least for this round of updates) is to get listed in pypi

not sure how to do this yet! Will need to look around

Boundaries around flows

Switching to the gradient model has meant that we lost an outline around each flow. It would be good to (optionally) bring this back by plotting another line over the boundary

Rows need to be able to start/stop

I.E., a label should be able to split into two.
This would need syntax like

(“A”,1,”B”,1,None,None),
(None,None,”B”,0.5,”C”,0.5),
(None,None,”B”,0.5,”D”,0.5),

Or similar…

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.