waitUntilGraphSimulationEnd: () => { return new Promise((resolve) => { // We are checking if when the hasSimulationEnded flag is set to true const delay = window.setInterval(() => { if (this.componentRef.state.hasSimulationEnded) { resolve(); window.clearInterval(delay); } }, 500); }); }