Code looks like this:
useEffect(function init() {
const layoutNodes = // apply layout
// this code seems to work but when I apply a bound using the result, it's off!
const result = calculateBounds(layoutNodes);
setNodes(layoutNodes);
// bounds are off! even though leftMax,topMax,width,height are correct
fitBounds({
x: result.bounds.leftMax,
y: result.bounds.topMax,
width: result.width,
height: result.height,
});
}, []);
You can see in the screenshot that the graph is cut off