G6
G6 copied to clipboard
feat: fitItems function
Checklist
- [x]
npm test
passes - [x] tests and/or benchmarks are included
- [x] commit message follows commit guidelines
Description of change
This PR implements the fitItems
function. This allows to fit a subset of the graph, eg: fit only the selected items.
This is useful with big graphs, where you want to have a closer look at a bunch of nodes.
In this example I'm using the fitItems
function on the selected nodes via a keyboard shortcut:
animate
false
https://user-images.githubusercontent.com/2861371/182404337-01167ecc-acfc-4ec2-98ce-c9af4da3b1e7.mp4
animate
true
https://user-images.githubusercontent.com/2861371/182404386-77fbaccb-3fdb-4167-9bc6-ff2735257def.mp4
Hi @Blakko , thanks for your PR! I have commented with some suggestions, please check them out to see if they are reasonable.
My bad, I totally missed the focusItem
function :)
I'll apply the changes you suggested and update this PR asap!