Skip to content

Sankey Plot Node Positions are incorrect #4714

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
akhildevelops opened this issue Jan 3, 2020 · 0 comments
Open

Sankey Plot Node Positions are incorrect #4714

akhildevelops opened this issue Jan 3, 2020 · 0 comments
Labels
bug something broken P3 backlog

Comments

@akhildevelops
Copy link

Describe your context

  • replace the result of pip list | grep dash below
dash                 1.5.1              
dash-core-components 1.4.0              
dash-html-components 1.0.1              
dash-renderer        1.2.0              
dash-table           4.5.0  

Describe the bug

Want to position Nodes along X-Axis in a Sankey Plot and Y to be automatically Adjusted. When I define X Positions only Sankey doesn't align the Nodes. But If I define Y Positions then only Sankey aligns the Nodes.

    def create_sankey_plot(self, source_r, target_r, value_r, colors_r,
                           labels_r, labels_a, colors_a):
        return go.Sankey(
            node=dict(
                pad=15,
                thickness=20,
                line=dict(color="black", width=0.5),
                label=labels_a,
                color=colors_a,
                x=[0.2, 0.1, 0.5, 0.7, 0.3, 0.5]
            ),
            link=dict(
                source=source_r,
                target=target_r,
                value=value_r,
                color=colors_r,
                line={'width': 1},
                label=labels_r
            )
        )

Above code will not align Nodes. Below code works:

def create_sankey_plot(self, source_r, target_r, value_r, colors_r,
                           labels_r, labels_a, colors_a):
        return go.Sankey(
            node=dict(
                pad=15,
                thickness=20,
                line=dict(color="black", width=0.5),
                label=labels_a,
                color=colors_a,
                x=[0.2, 0.1, 0.5, 0.7, 0.3, 0.5],
                y=[0.3, 0.3, 0.3, 0.3, 0.3, 0.3],
            ),
            link=dict(
                source=source_r,
                target=target_r,
                value=value_r,
                color=colors_r,
                line={'width': 1},
                label=labels_r
            )
        )

Expected behavior

Align Nodes if provided only X values / Y values making other default.

@gvwilson gvwilson self-assigned this Jul 17, 2024
@gvwilson gvwilson removed their assignment Aug 2, 2024
@gvwilson gvwilson added bug something broken P3 backlog labels Aug 13, 2024
@gvwilson gvwilson changed the title [BUG] Sankey Plot Node Positions Sankey Plot Node Positions are incorrect Aug 13, 2024
@gvwilson gvwilson transferred this issue from plotly/dash Aug 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something broken P3 backlog
Projects
None yet
Development

No branches or pull requests

2 participants