I forked an existing Cytoscape example to test playing and stopping an animation. Playing the animation works on "Add node" button, but stopping it fails to stop the animation without any error in the "Add relationship" button.
You will see an alert followed by
mySubCyRef.stop();
cy.current.stop();
https://codesandbox.io/p/sandbox/react-cytoscape-forked-jc6yky
What would work to stop all animations
(1) without resetting the layout
(2) maintaining the same styles as before the animation started?