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

Searched node doesn't come at center on the very first time. What is the significance of _centered? #403

Open
saaagarsingh opened this issue May 20, 2024 · 1 comment

Comments

@saaagarsingh
Copy link

saaagarsingh commented May 20, 2024

When I'm trying to search for a node I want it to be highlighted and positioned at center of my page but when all the nodes are collapsed and I'm trying to search for a node my node gets highlighted but it is not coming at the center of the page.
Tried using the setCentered method as well and _centered property as well but nothing seems to work.
Is there a possible way to align it center on every search like if my chart is collapsed and I try to search for a node it will be centered.

Also just for information after setHighlighted I've appended initialZoom(1).

Expected behavior
Expected behaviour is that it should show the searched node at the center,

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

OS: MAC
Browser- chrome
Smartphone (please complete the following information):
Device: [e.g. iPhone6]
OS: [e.g. iOS8.1]
Browser [e.g. stock browser, safari]
Version [e.g. 22]

@saaagarsingh saaagarsingh changed the title Searched node doesn't come at center on the very first time. What is the significance of _centered? Raised mistakenly. May 20, 2024
@saaagarsingh saaagarsingh changed the title Raised mistakenly. Searched node doesn't come at center on the very first time. What is the significance of _centered? May 20, 2024
@bumbeishvili
Copy link
Owner

Not sure how to approach that

This is how I implemented node search

https://stackblitz.com/edit/js-wdexqc?file=index.html

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