question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`useSelection` should expose a function which focuses & selects a node, same as `onNodeClick`

See original GitHub issue

I’m submitting a…


[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report  
[ ] Performance issue
[X] Feature request
[ ] Documentation issue or request
[ ] Other... Please describe:

Current behavior

I’ve got a storybook plugin which displays Recoil trees both in the graph & in a list, currently if the user clicks a node on the graph they get a nice zoom in focus animation to show the node - but if they click it in the list the node is selected (via setSelections) but the graph doesn’t zoom to focus on it.

Expected behavior

Ideally I’d like the same focusing action to occur regardless of if the user clicks the node in the graph or in the list.

Also it’d be really nice to have a way to trigger the hover effect.

Could be there’s something returned by useSelection that’d do this already but I’ve not spotted it

What is the motivation / use case for changing the behavior?

To allow the nice graph features to be used programmatically as well.

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:1
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
amcdnlcommented, Jun 21, 2022

Now that Im thinking about this, I’m realizing there might be 3 different use cases:

  • Focus ( Focus a particular node but not select )
  • Selection by External ( click on something outside of the graph and it select )
  • Selection by System ( click on something inside the graph and it select )

There is a centerGraph method on the GraphCanvas which is the better way to handle this since the selection helper is optional and not required. If we did want to enhance this, we should put the methods there.

Let me think about this today. Feel free to post any thoughts in the meantime.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Reagraph - a high-performance network graph visualization ...
`useSelection` should expose a function which focuses & selects a node ... the user clicks a node on the graph they get a...
Read more >
Learning Ext JS 4. Sencha Ext JS for a beginner. Crysfel Villa ...
Ext JS provides a function called Ext.onReady, which executes a callback automatically when all nodes in the tree can be accessed. Let's write...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found