code: function (renderedPosition) {
      var pan = cy.pan();
      var zoom = cy.zoom();
  
      var x = (renderedPosition.x - pan.x) / zoom;
      var y = (renderedPosition.y - pan.y) / zoom;
  
      return {
        x: x,
        y: y
      };
    }
docs: Converst the rendered position to model position according to global pan and zoom values