-
Notifications
You must be signed in to change notification settings - Fork 1
sankey nodes position #189
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
Conversation
python/sankey-diagram.md
Outdated
@@ -129,6 +132,28 @@ fig.update_layout( | |||
fig.show() | |||
``` | |||
|
|||
### Define Node Position | |||
|
|||
The following axample sets [node.x](https://plot.ly/python/reference/#sankey-node-x) and [node.y](https://plot.ly/python/reference/#sankey-node-y) to place nodes in the specified locations, except in the [snap arrangement](https://plot.ly/python/reference/#sankey-arrangement) to avoid overlapping of the nodes, therefore, an automatic snapping of elements will be set to define the padding between nodes via [nodepad](https://plot.ly/python/reference/#sankey-node-pad). The other possible arrangements are:<font color='blue'> 1)</font> perpendicular <font color='blue'>2)</font> freeform <font color='blue'>3)</font> fixed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo: example
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is the default value of arrangement
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The default value for the arrangement is snap
https://github.com/plotly/plotly.js/blob/f78f3cd3beee04db95aafcf9498031d112c87514/src/traces/sankey/attributes.js#L69-L81
unless node.x
and node.y
are defined, then it's freeform
https://github.com/plotly/plotly.js/blob/f78f3cd3beee04db95aafcf9498031d112c87514/src/traces/sankey/defaults.js#L88-L92
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks @antoinerg !
python/sankey-diagram.md
Outdated
"label": ["A", "B", "C", "D", "E", "F"], | ||
"x": [0.2, 0.1, 0.5, 0.7, 0.3, 0.5], | ||
"y": [0.7, 0.5, 0.2, 0.4, 0.2, 0.3], | ||
'pad':10}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add comment before this line "pad is given in number of pixels"
💃 thanks! |
resolves plotly/documentation#1589