`useSelection` should expose a function which focuses & selects a node, same as `onNodeClick`
See original GitHub issueI’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:
- Created a year ago
- Reactions:1
- Comments:6 (6 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Now that Im thinking about this, I’m realizing there might be 3 different use cases:
There is a
centerGraph
method on theGraphCanvas
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.
See https://github.com/reaviz/reagraph/pull/28#issuecomment-1186578682