I want to do something similar to this tutorial: https://www.amcharts.com/docs/v4/tutorials/toggling-forcedirectednode-via-api/, but I want to make it with react hooks.
I've created a chart but I'm unsure where to put the function to toggle the nodes through a button. According to their overview (https://www.amcharts.com/docs/v4/getting-started/integrations/using-react/) they recommend to use useRef() for the chart but I do not understand how to hide the nodes because I cannot use .getDataItemById() with the useRef(). Anyone knows how where to place this function and how to call it properly with hooks?