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

Incorrect end points with cross hierarchical edges and node padding #10

Open
robclouth opened this issue Apr 26, 2016 · 7 comments
Open

Comments

@robclouth
Copy link

Hi,
I need a sub graph to have padding to ensure there will be space above it to put some other controls.
But when I set the padding to a non-zero value, the edges going into and out of that sub graph ignore it, causing a misalignment.

To see this, look at the hierarchy2 demo and add a top padding to the sub graph. You'll see that the edge placement is wrong.
Is this a bug or is there some setting I'm missing?

Thanks

@uruuru
Copy link
Member

uruuru commented Apr 26, 2016

I suspect it's a bug. I'll check it and let you know once I know more.
Could be related to KIPRA-1767.

@robclouth
Copy link
Author

Thanks!

@uruuru
Copy link
Member

uruuru commented Apr 27, 2016

Actually, the padding values are not automatically added to the bend points (neither to the child nodes). Have a look at the coordinate system of the KGraph. There the padding is called insets but has the same effect. So as long as you use the relative coordinates, you have to add the insets/padding yourself.

Your modification of the hierarchy2 example resulted in wrong positions because there was a bug in the d3 extension. It didn't consider the padding when computing absolute coordinates. I added a padding example.

Let me know if this resolves your issues.

@robclouth
Copy link
Author

Ah right, ok. I'm not actually using D3, but I can use the toAbsolute code in the d3 extension for my use. Thanks for this library btw, it's brilliant. I'm using it for an open source node based shader editor in React Native.
Oh and speaking of which, if klay.js is used in React Native it continuously fires off errors because it attaches to a messaging system that it shouldn't. Other than that it worked perfectly!
To get it to work I had to comment out the eventListener line shown below (line 1987)

function GP(){var b={
    'layout':function(a){Rxb(IP(a))}};
    if(typeof klayregister===Zxb){
        klayregister(b)}
        else{typeof document!==Czb&&($wnd.$klay=b);
            typeof module===Sxb&&module.exports&&(module.exports=b);
            //typeof document===Czb&&typeof self!==Czb&&self.addEventListener('message',function(a){b.layout(a.data)},false)
        }
    }

@uruuru
Copy link
Member

uruuru commented Apr 27, 2016

Thanks, we do our best :).
Regarding the eventListener issue: If I'm correct, that line is supposed to register the script if and only if a web worker is used. See line 66 in [1]. In case you know what the correct way is in your case, I can fix it.

[1] Script Registration

@robclouth
Copy link
Author

The thing is React Native passes both the nodejs test and the webworker test. Could the tests be 'else if' instead, so that two can't pass?

@uruuru
Copy link
Member

uruuru commented Apr 27, 2016

Probably, though I feel as if we had an 'else if' somewhere and had to remove it for something else to work (see #3).

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