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

How to place a node without children NOT in the rightmost position => How to completely hide a node? #36

Open
Nemecsek opened this issue Apr 16, 2018 · 1 comment

Comments

@Nemecsek
Copy link

Nemecsek commented Apr 16, 2018

This looks related to #11.

Using these data

A1 [100] B1
A2 [100] B1

A1 [100] B2

B1 [60] C1
B1 [60] C2
B1 [80] C3

I would like to align B2 to B1, even if it has no children.

Normally I get this:
sankeymatic_300x300

but I would like to get this:
sankeymatic_300x300 1

This could be easily solved if issue #35 has an answer:
I would create a dummy node (say B2DUMMY) after B2, same value, transparent and flow set as "target" (so transparent). As the dummy node would have no text to show, it would be completely invisible.

In this example it is what I can get, but I need the the text B2DUMMY:100 to disappear:

A1 [100] B1
A2 [100] B1

A1 [100] B2

B1 [60] C1
B1 [60] C2
B1 [80] C3

B2 [100] B2DUMMY

:B2DUMMY #ffffff.0 >>

sankeymatic_300x300 2

@Nemecsek Nemecsek changed the title How to place a node without children NOT in the most right position? How to place a node without children NOT in the rightmost position => How to completely hide a node? Apr 18, 2018
@Nemecsek
Copy link
Author

Nemecsek commented Apr 18, 2018

As partial solution, I modified the library to add to each node tag (A1, A2, etc) a node label ("Hall 1", "Hall 2", etc.).
Now:

  1. The label can be multiline, with first line as title, as proposed in Tag and text #35.
  2. Associating to a node tag an empty node label, no text is shown: in my case, "B2DUMMY: 100" just disappears.
  3. The values to print can be chosen programmatically, something very useful in my case because I need to print some extra data for each node.

Alas, I am a real newbie with JS and my solution has been greatly patched together without skill. Upon request I can provide the modified library: perhaps somebody could properly rewrite my poor code.

An example of sankey I am producing programmatically:
sankey 13

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

No branches or pull requests

1 participant