Hi everyone! I am trying to make the Graph canvas responsive to the screen size. Therefore I have added the following simple event listener to the code:
This event listener works well and the canvas become responsive, hence when I change the size of the browser the drawn graph readjust properly.
However, it broke the onNodeClick() function. Event hough I click on the node, onNodeClick() function cannot be called when I resize the screen. I have tried in both Safari and Chrome, same problem exist in both browsers.
Is there any way I can fix this, or any other way to make graph responsive to the screen size without messing up the onNodeClick()? I've tried to call Graph.refresh() but unfortunately it does not change anything.
Hi everyone! I am trying to make the Graph canvas responsive to the screen size. Therefore I have added the following simple event listener to the code:
This event listener works well and the canvas become responsive, hence when I change the size of the browser the drawn graph readjust properly.
However, it broke the onNodeClick() function. Event hough I click on the node, onNodeClick() function cannot be called when I resize the screen. I have tried in both Safari and Chrome, same problem exist in both browsers.
Find the snippet here where the resizing breaks the onNodeClick focus function: https://codepen.io/turhanberk/pen/xxjOWwr
Is there any way I can fix this, or any other way to make graph responsive to the screen size without messing up the onNodeClick()? I've tried to call Graph.refresh() but unfortunately it does not change anything.
Thanks a lot!