Use case
When the library is installed we are able to launch drawing with files but we want to launch drawing programmatically. To be sure that MetExploreViz is defined we have to use all functions in this one:
MetExploreViz.onloadMetExploreViz(function(){
  // All functions to interact with MetExploreViz
});
In this function you can call the function to launch the drawing. You have to use a MetExplore JSON format. You can get network JSON directly from MetExplore website or by our WebService API:
var myJsonString = '{"nodes":[{"name":"aspartate transaminase","dbIdentifier":"R_ASPTA","ec":"2.6.1.1","id":"2405504",
     "reactionReversibility":true,"biologicalType":"reaction"},{.....],"links":[{"id":"2405504 -- 1109303","source":1,"target":0,
     "interaction":"in","reversible":true},{....],"mappingdata":[{"name":"Global Mapping","targetLabel":"metaboliteId",
     "mappings":[{"name":"Control Condition","data":[{"node":"1107024"},{"node":"1107031"},{"node":"1107950"}]}]}]}';

metExploreViz.GraphPanel.refreshPanel(myJsonString);
To use programmatically other functions after launching drawing you can use this function with a callback function like this:
var myJsonString = '{"nodes":[{"name":"aspartate transaminase","dbIdentifier":"R_ASPTA","ec":"2.6.1.1","id":"2405504",
     "reactionReversibility":true,"biologicalType":"reaction"},{.....],"links":[{"id":"2405504 -- 1109303","source":1,"target":0,
     "interaction":"in","reversible":true},{....],"mappingdata":[{"name":"Global Mapping","targetLabel":"metaboliteId",
     "mappings":[{"name":"Control Condition","data":[{"node":"1107024"},{"node":"1107031"},{"node":"1107950"}]}]}]}';

  //Run graph
metExploreViz.GraphPanel.refreshPanel(myJsonString, function(){
  metExploreViz.onloadSession(function(){
    // Interations with the network
  });
});
The function metExploreViz.onloadSession allows to launch other functions only when the network is drew. You can also use callback functions in others functions to launch their sequentially and programmatically.
MetExploreViz.onloadMetExploreViz(function(){ //Callback when library is loaded
  metExploreViz.GraphPanel.refreshPanel(myJsonString, function() { //Callback when network is drew
    metExploreViz.onloadSession(function(){
    var mapJSON = metExploreViz.GraphUtils.parseWebServiceMapping(myJsonString);
      //Load mapping
    metExploreViz.GraphMapping.loadDataFromJSON(mapJSON);
      //Highlight
    metExploreViz.GraphMapping.mapNodes("Global Mapping", function() { //Callback when node are mapped
      var sideCompounds = ["M_adp_m", "M_adp_c", "M_amp_c", "M_amp_m", "M_amp_r"];
      metExploreViz.GraphNode.loadSideCompounds(sideCompounds);
      metExploreViz.GraphNetwork.duplicateSideCompounds();
      });
    });
  });
});

Go to MetExploreViz API Reference to see more functions !