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

Sankey diagram problem #84

Closed
crazycodingcat opened this issue Jul 14, 2017 · 2 comments
Closed

Sankey diagram problem #84

crazycodingcat opened this issue Jul 14, 2017 · 2 comments

Comments

@crazycodingcat
Copy link

Hi,

I am trying to reproduce this sample Sankey diagram from plotly in Dash: https://plot.ly/python/sankey-diagram/

I just copy-pasted the sample code and in my dash application use
dcc.Graph(figure={'data': [data_trace], 'layout': layout})

The graph gets rendered but the rectangles are not displaying:
sankey

I checked the properties of the rect svg elements and found the height is negative. Any idea why this happens?

Thanks,
Xuan

@alishobeiri
Copy link

alishobeiri commented Jul 14, 2017

Hey @crazycodingcat,

Thanks for the question.

Try changing the value of pad inside the node dictionary to be equal to 5.

For example:

    node = dict(
      pad = 5,
      thickness = 15,
      line = dict(
        color = "black",
        width = 0.5
      ),
      label =  data['data'][0]['node']['label'],
      color =  data['data'][0]['node']['color']
    ),

The same effect can be achieved by increasing the height of the graph in the layout. This issue happens when the padding between nodes is too high for the each node to be displayed in the graph.

@crazycodingcat
Copy link
Author

@alishobeiri Thanks! Yes that works like a charm :)

HammadTheOne pushed a commit to HammadTheOne/dash that referenced this issue May 28, 2021
HammadTheOne pushed a commit that referenced this issue Jul 23, 2021
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

2 participants