simulationStep() {
    // check if the physics have settled
    const startTime = Date.now();
    this.physicsTick();
    const physicsTime = Date.now() - startTime;

    // run double speed if it is a little graph
    if (
      (physicsTime < 0.4 * this.simulationInterval ||
        this.runDoubleSpeed === true) &&
      this.stabilized === false
    ) {
      this.physicsTick();

      // this makes sure there is no jitter. The decision is taken once to run it at double speed.
      this.runDoubleSpeed = true;
    }

    if (this.stabilized === true) {
      this.stopSimulation();
    }
  }
The viewFunction inserts this step into each render loop. It calls the physics tick and handles the cleanup at stabilized.