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

add feature to go to a node #84

Open
AliRezaHosseiniOfficial opened this issue Dec 23, 2021 · 4 comments
Open

add feature to go to a node #84

AliRezaHosseiniOfficial opened this issue Dec 23, 2021 · 4 comments

Comments

@AliRezaHosseiniOfficial

Hello
Is there a feature to switch the chart to the corresponding node location ?

@adevicq
Copy link

adevicq commented Mar 9, 2022

Hi
I don't know if this is the same need, but mine is: provide a method to center the chart on a specific node.
I did something on my side but it would be useful to have it as a standard function. For example, I give the possibility to a user to search for a person and I center the chart on the found node.

@tylerdelange
Copy link

@adevicq Can I ask how you accomplished centering the node to the screenspace?

@adevicq
Copy link

adevicq commented Jun 8, 2022

Hi,
If you inspect the DOM, you will find two elements under a DIV which class is "tree-container"
image
These two elements (SVG and DIV) have a style which defines the position of the diagram:
style="transform: scale(1) translate(1024px, -15px); transform-origin: center center;"
You have to play with the "translate" parameter to move the view up/down and right/left.
Store the initial values of the two values in the translate property and move the view according to the desired coordinates.

Hope this helps.

@awaisamir123
Copy link

@adevicq How can we calculate this transformation? Suppose a node has properties such as width, height, top, and left. How can we manipulate these properties to determine the transformation translation values for X and Y?

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

4 participants