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

Fix overlaying labels with sankey #5864

Merged
merged 2 commits into from
Aug 28, 2023
Merged

Fix overlaying labels with sankey #5864

merged 2 commits into from
Aug 28, 2023

Conversation

ahuang11
Copy link
Collaborator

Not sure if this fixes the root of the problem or is simply a bandaid, but fixes #5863

import holoviews as hv
from holoviews import opts, dim
hv.extension('bokeh')
import numpy as np


nodes = ["PhD", "Career Outside Science",  "Early Career Researcher", "Research Staff",
         "Permanent Research Staff",  "Professor",  "Non-Academic Research"]
nodes = hv.Dataset(enumerate(nodes), 'index', 'label')
edges = [
    (0, 1, 53), (0, 2, 47), (2, 6, 17), (2, 3, 30), (3, 1, 22.5), (3, 4, 3.5), (3, 6, 4.), (4, 5, 0.45)   
]

value_dim = hv.Dimension('Percentage', unit='%')
careers = hv.Sankey((edges, nodes), ['From', 'To'], vdims=value_dim)
labels = hv.Labels(([0, 1, 2, 3], [6, 6, 6, 6], ["A", "B", "C", "D"]), kdims=["From", "To"])

labels * careers

@codecov-commenter
Copy link

codecov-commenter commented Aug 24, 2023

Codecov Report

Merging #5864 (7c508f2) into main (e2f06d0) will not change coverage.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main    #5864   +/-   ##
=======================================
  Coverage   88.36%   88.36%           
=======================================
  Files         310      310           
  Lines       63950    63950           
=======================================
  Hits        56512    56512           
  Misses       7438     7438           
Flag Coverage Δ
ui-tests 23.40% <0.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Changed Coverage Δ
holoviews/plotting/bokeh/element.py 88.06% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Co-authored-by: Philipp Rudiger <prudiger@anaconda.com>
@hoxbro hoxbro merged commit 42db40f into main Aug 28, 2023
14 checks passed
@hoxbro hoxbro deleted the fix_overlay_labels branch August 28, 2023 07:19
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Sankey diagram sometimes breaks >=1.17.0
4 participants