Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added option for gradient coloring and alpha in edges #11

Closed
wants to merge 13 commits into from

Conversation

fransua
Copy link

@fransua fransua commented Jul 8, 2020

Also a notebook to summarize options

The idea:

    'Ben': 'tab:red',
    'Betty': 'tab:blue',
    'Mike': 'tab:orange',
    'John': 'tab:green',
    'drinks': 'tab:purple',
    'fruit': 'olive',
    'meat': 'tab:brown',
    'bread': 'gold',
    ('John', 'fruit'): 'red'
}

alpha_dict = {
    'Ben': 0.65,
    'Betty': 0.65,
    'Mike': 0.65,
    'John': 0.2,
    'drinks': 0.65,
    'fruit': 0.65,
    'meat': 0.65,
    'bread': 0.65,
    ('John', 'fruit'): 1
}

ax, left_coords, right_coords = sankey(
    left=df['customer'].values[1:], right=df['good'].values[1:],
    rightWeight=weight, leftWeight=weight, aspect=20, fontsize=20, color_gradient=True,
    rightLabels=['bread', 'meat', 'fruit', 'drinks'], colorDict=color_dict, alphaDict=alpha_dict
)

image

@coveralls
Copy link

Pull Request Test Coverage Report for Build 75

  • 33 of 56 (58.93%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-11.6%) to 87.692%

Changes Missing Coverage Covered Lines Changed/Added Lines %
pysankey/sankey.py 33 56 58.93%
Totals Coverage Status
Change from base Build 74: -11.6%
Covered Lines: 171
Relevant Lines: 195

💛 - Coveralls

@Pierre-Sassoulas
Copy link
Owner

Hello, thank you very much for the pull request. There is a lot to check, I'll find the time at some point. Can you rebase on the current master and add tests first so the coverage stays roughly the same?

@Pierre-Sassoulas
Copy link
Owner

I made the necessary change so the continuous integration work again but I'm going to close as it's impossible to rebase this feature on the main branch at this point. Please feel free to reopen a new merge request if you like, the alpha was interesting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants