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

Component | Graph: Layout recalculation and persistency fix #396

Merged
merged 6 commits into from
Jun 26, 2024

Conversation

rokotyan
Copy link
Contributor

This PR fixes layout problems reported in #393:

  • fixNodePositionAfterSimulation not working correctly in Force Layout
  • Layout update when dynamically switching between different layouts

Copy link
Collaborator

@reb-dev reb-dev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rokotyan I made a demo example to test this, I'm getting strange behavior if any panning/zooming occurs. Should we reset the transform on layout change as well?

Screen.Recording.2024-05-31.at.10.58.39.AM.mov

@lee00678
Copy link
Collaborator

@rokotyan I tried to modify one of the gallery example to test this. It seems once the layout changed, the chart no longer fit in the view window.

Screen.Recording.2024-05-31.at.11.21.45.AM.mov

@rokotyan
Copy link
Contributor Author

@reb-dev @lee00678 Thanks for testing this! I didn't see such behavior in my environment, let me take another look.

@rokotyan
Copy link
Contributor Author

@reb-dev Can you please push your example to the branch?

@rokotyan
Copy link
Contributor Author

rokotyan commented Jun 5, 2024

Thanks @reb-dev

My latest commits should take care of that and also fix #393

@reb-dev
Copy link
Collaborator

reb-dev commented Jun 6, 2024

@rokotyan Testing it again I'm discovering inconsistent behavior with fixNodePositionAfterSimulation.

Currently if you dynamically add data to the graph when it is set to true, the layout doesn't rearrange. When false, it does. However if you switch to force layout type from a different layout with fixNodePositionAfterSimulation set to true, the layout still rearranges on data updates.

Also could you clarify what the expected behavior is for this property?

@rokotyan
Copy link
Contributor Author

@reb-dev You're right, something wrong is happening when changing the layout. Thanks for catching this, I'll investigate

@rokotyan
Copy link
Contributor Author

@reb-dev Found the problem and fixed, see the last two commits. Thanks again for testing this thoroughly.

Copy link
Collaborator

@reb-dev reb-dev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the updates @rokotyan, looks good to me!

@reb-dev reb-dev merged commit 6ec5ba1 into f5:main Jun 26, 2024
4 checks passed
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

Successfully merging this pull request may close these issues.

3 participants