react-graph-vis icon indicating copy to clipboard operation
react-graph-vis copied to clipboard

network.focus locks manipulation and interaction

Open sk8Guerra opened this issue 6 months ago • 0 comments

Hey. I have a getNetwork={(network) => setLocalNetwork(network)} prop in the Graph where I get the network object and save it to a local state. I also have an afterDrawing event that will trigger a network.focus(randomNode, focusSettings); after the graph has been finished painting to focus a random node.

The result is that I cannot longer interact with the graph after the focus event is fired (e.g. zoom in, zoom out) even if I set the locked prop to false. This is the focusSettings object:

const focusSettings = {
  scale: 3,
  locked: false,
  offset: {
    x: 0,
    y: 0,
  },
  animation: {
    duration: 1000,
    easingFunction: 'easeInOutQuad',
  },
};

Any idea on why I cannot interact with the graph afterwards the focus is executed? Thanks!

sk8Guerra avatar Aug 08 '24 16:08 sk8Guerra