-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Add bottom-up and right-left orientations for Sankey diagrams #7870
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
Open
wf-r
wants to merge
11
commits into
plotly:v4.0
Choose a base branch
from
wf-r:Add_bottom-up_and_right-left_orientation_for_Sankey
base: v4.0
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
5887787
Add bottom-up and right-left orientations to Sankey
0758cdb
Add bottom-up and right-left orientations to Sankey
bdadff8
Add bottom-up and right-left orientations to Sankey
5ea67d9
Add draft log
542c55e
Introduce `direction` attribute instead of more parameters for `orien…
61a556d
Add tests and mocks for direction argument.
3b8c586
Adjust test.
f89f62f
Add updated plot-schema and horizontal baselines
789ae0c
Reset original node label layout in vertical case; adjust select.js; …
4b4886b
Merge branch 'v4.0' into Add_bottom-up_and_right-left_orientation_for…
4d60088
Add 2nd generated schema, add basline images
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| - Add `direction` attribute (`forward` / `reverse`) to the Sankey trace, controlling the flow direction along the `orientation` axis: `forward` keeps sources on the left (horizontal) or top (vertical), `reverse` moves them to the right or bottom [[#7870](https://github.com/plotly/plotly.js/pull/7870)] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+40.1 KB
test/image/baselines/diff-sankey_circular_with_arrows_vertical_reverse.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+47.1 KB
test/image/baselines/diff-sankey_input_link_sort-vertical-reverse.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+47.7 KB
test/image/baselines/diff-sankey_input_node_sort-vertical-reverse.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+39.1 KB
test/image/baselines/sankey_circular_with_arrows_vertical_reverse.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| { | ||
| "data": [ | ||
| { | ||
| "type": "sankey", | ||
| "direction": "reverse", | ||
| "node": { | ||
| "pad": 5, | ||
| "label": ["0", "1", "2", "3", "4", "5", "6"] | ||
| }, | ||
| "link": { | ||
| "source": [0, 0, 1, 2, 5, 4, 3], | ||
| "target": [5, 3, 4, 3, 0, 2, 2], | ||
| "value": [1, 2, 1, 1, 1, 1, 1] | ||
| } | ||
| } | ||
| ], | ||
| "layout": { | ||
| "title": { "text": "Sankey with circular data" }, | ||
| "width": 800, | ||
| "height": 800 | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| { | ||
| "data": [ | ||
| { | ||
| "type": "sankey", | ||
| "orientation": "v", | ||
| "node": { | ||
| "pad": 5, | ||
| "label": ["0", "1", "2", "3", "4", "5", "6"] | ||
| }, | ||
| "link": { | ||
| "source": [0, 0, 1, 2, 5, 4, 3], | ||
| "target": [5, 3, 4, 3, 0, 2, 2], | ||
| "value": [1, 2, 1, 1, 1, 1, 1] | ||
| } | ||
| } | ||
| ], | ||
| "layout": { | ||
| "title": { "text": "Sankey with circular data" }, | ||
| "width": 800, | ||
| "height": 800 | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| { | ||
| "data": [ | ||
| { | ||
| "type": "sankey", | ||
| "orientation": "v", | ||
| "direction": "reverse", | ||
| "node": { | ||
| "pad": 5, | ||
| "label": ["0", "1", "2", "3", "4", "5", "6"] | ||
| }, | ||
| "link": { | ||
| "source": [0, 0, 1, 2, 5, 4, 3], | ||
| "target": [5, 3, 4, 3, 0, 2, 2], | ||
| "value": [1, 2, 1, 1, 1, 1, 1] | ||
| } | ||
| } | ||
| ], | ||
| "layout": { | ||
| "title": { "text": "Sankey with circular data" }, | ||
| "width": 800, | ||
| "height": 800 | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| { | ||
| "data": [ | ||
| { | ||
| "type": "sankey", | ||
| "direction": "reverse", | ||
| "node": { | ||
| "pad": 5, | ||
| "label": ["0", "1", "2", "3", "4", "5", "6"] | ||
| }, | ||
| "link": { | ||
| "arrowlen": 20, | ||
| "source": [0, 0, 1, 2, 5, 4, 3], | ||
| "target": [5, 3, 4, 3, 0, 2, 2], | ||
| "value": [1, 2, 1, 1, 1, 1, 1] | ||
| } | ||
| } | ||
| ], | ||
| "layout": { | ||
| "title": { "text": "Sankey with circular data and arrows" }, | ||
| "width": 800, | ||
| "height": 800 | ||
| } | ||
| } |
24 changes: 24 additions & 0 deletions
24
test/image/mocks/sankey_circular_with_arrows_vertical_reverse.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| { | ||
| "data": [ | ||
| { | ||
| "type": "sankey", | ||
| "orientation": "v", | ||
| "direction": "reverse", | ||
| "node": { | ||
| "pad": 5, | ||
| "label": ["0", "1", "2", "3", "4", "5", "6"] | ||
| }, | ||
| "link": { | ||
| "arrowlen": 20, | ||
| "source": [0, 0, 1, 2, 5, 4, 3], | ||
| "target": [5, 3, 4, 3, 0, 2, 2], | ||
| "value": [1, 2, 1, 1, 1, 1, 1] | ||
| } | ||
| } | ||
| ], | ||
| "layout": { | ||
| "title": { "text": "Sankey with circular data and arrows" }, | ||
| "width": 800, | ||
| "height": 800 | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| { | ||
| "data": [ | ||
| { | ||
| "type": "sankey", | ||
| "direction": "reverse", | ||
| "node": { | ||
| "label": ["0", "1", "2", "3", "4", "5"], | ||
| "align": "center", | ||
| "color": "gray" | ||
| }, | ||
| "link": { | ||
| "source": [0, 0, 0, 0, 1, 4], | ||
| "target": [1, 3, 2, 4, 5, 5], | ||
| "value": [1, 1, 2, 1, 1, 1], | ||
| "color": [ | ||
| "rgba(230, 25, 75, 0.6)", | ||
| "rgba(255, 165, 0, 0.6)", | ||
| "rgba(60, 180, 75, 0.6)", | ||
| "rgba(0, 130, 200, 0.6)", | ||
| "rgba(145, 30, 180, 0.6)", | ||
| "rgba(128, 128, 128, 0.6)" | ||
| ], | ||
| "sort": "input" | ||
| } | ||
| } | ||
| ], | ||
| "layout": { | ||
| "title": { "text": "Sankey with link ordering matching the input array" }, | ||
| "width": 800, | ||
| "height": 800 | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.