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

Grid view bugs when force layout is on #102

Closed
dariomesic opened this issue Mar 7, 2023 · 3 comments
Closed

Grid view bugs when force layout is on #102

dariomesic opened this issue Mar 7, 2023 · 3 comments

Comments

@dariomesic
Copy link

Hey @dash14,

I really like what you have done with this component and I would like to use it in my project.
Recently I encountered a small issue that I would like to know what I could do to fix it.
When using force layout with grid background, page with grid bugs and shrinks on the bottom right until I zoom in/out or click on the grid.
You can see the issue in image. Is this intentionall because grid can't be used normally with d3 or what seems to be a problem.
Thank you in advance and kind regards.

slika

@dariomesic
Copy link
Author

I managed to find what was the cause of this issue. Issue is quite odd and I'm still not sure if this is intended or not but when I was using node names with simple alphabetical names grid would bug, but when I changed it to "node1", "node2" it worked.
First image worked and second one didn't.

slika

slika

@dash14
Copy link
Owner

dash14 commented Mar 9, 2023

Hi @dariomesic,
Thank you for reporting the issue!

I was able to reproduce the issue here as well, so I investigated and found it to be a bug.

When displaying a network graph, there was a problem with the view:pan event not informing the initial position of the pan if the pan was not moved at all as a result of the automatic pan adjustment. This caused rendering problems in the initial display, which in turn affected the grid display that was internally dependent on this view:pan event.

The initial state of the internal coordinates is that the center of the display area is (0,0). The force-layout is prone to this.
The reason the symptoms no longer occur when the label text is long is because the shape size has changed, and the automatic pan adjustment happens to work correctly in that case.

I have released v0.8.2 which fixes this issue, so please give it a try!

@dariomesic
Copy link
Author

dariomesic commented Mar 9, 2023

@dash14 Works amazing now, thank you so much!
I'm grateful I could help :)

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