code: function( cytoscape, $ ){
      if( !cytoscape || !$ ){ return; } // can't register if cytoscape or jquery unspecified
  
      $.fn.cyPanzoom = $.fn.cytoscapePanzoom = function( options ){
        panzoom.apply( this, [ options, cytoscape, $ ] );
  
        return this; // chainability
      };
  
      // if you want a core extension
      cytoscape('core', 'panzoom', function( options ){ // could use options object, but args are up to you
        panzoom.apply( this, [ options, cytoscape, $ ] );
  
        return this; // chainability
      });
  
    }
docs: registers the extension on a cytoscape lib ref