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

Is it possible to have fixed nodes at same height #83

Open
yshaik77 opened this issue Oct 9, 2020 · 0 comments
Open

Is it possible to have fixed nodes at same height #83

yshaik77 opened this issue Oct 9, 2020 · 0 comments

Comments

@yshaik77
Copy link

yshaik77 commented Oct 9, 2020

In my example there is only one link between two nodes but yet the link has curvature instead of straight line .
How to change this function to make link come as a straight line .
value is 1 and two nodes
sankey.link = function () {
var curvature = 0.5;

    function link(d) {
        var x0 = d.source.x + d.source.dx,
            x1 = d.target.x,
            xi = d3.interpolateNumber(x0, x1),
            x2 = xi(curvature),
            x3 = xi(1 - curvature),
            y0 = d.source.y + d.sy + d.dy / 2,
            y1 = d.target.y + d.ty + d.dy / 2;
        return "M" + x0 + "," + y0
             + "C" + x2 + "," + y0
             + " " + x3 + "," + y1
             + " " + x1 + "," + y1;
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant