Skip to content

Added option for gradient coloring and alpha in edges#1

Open
fransua wants to merge 4 commits intoweirdyang:masterfrom
fransua:master
Open

Added option for gradient coloring and alpha in edges#1
fransua wants to merge 4 commits intoweirdyang:masterfrom
fransua:master

Conversation

@fransua
Copy link
Copy Markdown

@fransua fransua commented Jul 7, 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

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant