We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Consider example below
# example from <https://plotly.com/python/sankey-diagram/> import plotly.graph_objects as go fig = go.Figure(data=[go.Sankey( arrangement = "perpendicular", node = dict( pad = 15, thickness = 20, line = dict(color = "black", width = 0.5), label = ["A1", "A2", "B1", "B2", "C1", "C2"], color = "blue", ), link = dict( source = [0, 1, 0, 2, 3, 3], # indices correspond to labels, eg A1, A2, A1, B1, ... target = [2, 3, 3, 4, 4, 5], value = [8, 4, 2, 8, 4, 2] ))]) fig.update_layout(title_text="Basic Sankey Diagram", font_size=10) fig.show()
Now we want to put A2, B2, C2 before A1,B1,C1 on Y axis:
fig.data[0].node.x = [0., 0., 0.5, 0.5, 1, 1] fig.data[0].node.y = [1, 0.5, 1, 0.5, 1, 0.5] fig.show()
We are able to see that A1 and A2 did not change their places. That because they have 0 in x coordinates. It is easy to fix:
fig.data[0].node.x = [1e-09, 1e-09, 0.5, 0.5, 1, 1]
We are not reloading Ys, just fixing Xs is enough. Probably plotly.js problem on visualization, but plotly.python problem for letting this.
If we will do something like fig.data[0].node.x = [np.nan, 1e-09, 0.5, 0.5, 1, 1], A1 will behave in the same way as if it would be a 0.
fig.data[0].node.x = [np.nan, 1e-09, 0.5, 0.5, 1, 1]
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Consider example below
Now we want to put A2, B2, C2 before A1,B1,C1 on Y axis:
We are able to see that A1 and A2 did not change their places. That because they have 0 in x coordinates.
It is easy to fix:
We are not reloading Ys, just fixing Xs is enough.
Probably plotly.js problem on visualization, but plotly.python problem for letting this.
If we will do something like
fig.data[0].node.x = [np.nan, 1e-09, 0.5, 0.5, 1, 1]
, A1 will behave in the same way as if it would be a 0.The text was updated successfully, but these errors were encountered: