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

Prevent tree jumpiness at the initial drag/zoom #147

Open
HagerDakroury opened this issue Apr 28, 2021 · 5 comments
Open

Prevent tree jumpiness at the initial drag/zoom #147

HagerDakroury opened this issue Apr 28, 2021 · 5 comments

Comments

@HagerDakroury
Copy link
Collaborator

HagerDakroury commented Apr 28, 2021

Not a new issue, but documenting it for future reference.

Following #115 (comment) , there is a current problem with the tree jumping from the reset/initial position.

Current Behaviour:

jumpIssue

Expected Behaviour:

Either the initial position be set to the middle (position after jumping) or the drag can be allowed from the initial position (the tree will move freely with looser bounds)

@raashika03
Copy link
Contributor

Initial position in the left side leaves little more space in the right side for expanding the tree at first. So setting it to the middle might not be a good option specially for smaller screens.
IMG_20210428_162940

@HagerDakroury
Copy link
Collaborator Author

Initial position in the left side leaves little more space in the right side for expanding the tree at first. So setting it to the middle might not be a good option specially for smaller screens.

That's a valid point. Although, I'm not sure if the jumpiness is an issue on smaller screens. (looks like it jumps to a more appropriate position on my phone)

Also, the position is not static, it depends on the size of the tree and the view size(eg. when more branches are extended at reset, it jumps less, sometimes not at all). So, proposing to start in the middle just means start on the jumping positing (wherever it is).

@raashika03
Copy link
Contributor

Position is static it seems, when we press the reset button twice for some cases.
Twice pressing the reset button, when we zoom the tree.
Single pressing, when we drag.
Results in initial position to be at the leftmost side.

@HagerDakroury
Copy link
Collaborator Author

Position is static it seems, when we press the reset button twice for some cases.
Twice pressing the reset button, when we zoom the tree.
Single pressing, when we drag.
Results in initial position to be at the leftmost side.

I meant the position it jumps to is not static, it depends on the translateExtent boundaries which are set according to the SVG's size.
So, it differs according to the tree's state.

@HagerDakroury
Copy link
Collaborator Author

To illustrate:

No jumping when the tree is a bit expanded (bigger SVG)

noJump

Jumping at initial tree state (smaller SVG)

Jump

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants