GraphMapping
metExploreViz.GraphMapping provides some functions to load mapping data and map this data on nodes and/or links.
Load mapping data
Some functions are dedicated to load mapping data.
#metExploreViz.GraphMapping.loadDataFromJSON(jsonString)
This function allows you to load mapping data from a json string.
metExploreViz.GraphMapping.loadDataFromJSON(jsonString);
#metExploreViz.GraphMapping.loadDataTSV(url, callback)
This function allows you to load mapping data from a TSV file. Callback function is optional.
metExploreViz.GraphMapping.loadDataTSV(pathFile, func);
Map data
Some functions are dedicated to map data on your network.
#metExploreViz.GraphMapping.mapNodes(mappingName, callback)
This function allows you to highlight the nodes that are mapped in a given mapping. Callback function is optional.
metExploreViz.GraphMapping.loadDataTSV("mappingName");
metExploreViz.GraphMapping.mapNodes("mappingName");
#metExploreViz.GraphMapping.graphMappingContinuousData(name, cmpt, callback)
This function allows you to display mapping data through a specific style with continuous data.
// choose element (link, reaction or metabolite)
var styleForm = metExploreViz.getCmpt("linkStyleForm");
// choose specific style
var linkColorForm = styleForm.query("aStyleForm").find(function(aStyleForm){ return aStyleForm.title === "Link color" });
// launch mapping
metExploreViz.graphMappingContinuousData("mappingName / conditionName", linkColorForm);
#metExploreViz.GraphMapping.graphMappingDiscreteData(name, cmpt, callback)
This function allows you to display mapping data through a specific style with discrete data.
// choose element (link, reaction or metabolite)
var styleForm = metExploreViz.getCmpt("linkStyleForm");
// choose specific style
var linkColorForm = styleForm.query("aStyleForm").find(function(aStyleForm){ return aStyleForm.title === "Link color" });
// launch mapping
metExploreViz.graphMappingDiscreteData("mappingName / conditionName", linkColorForm);
#metExploreViz.GraphMapping.graphMappingAsSelectionData(name, cmpt, callback)
This function allows you to change specific style if element is mapped in a given mapping.
// choose element (link, reaction or metabolite)
var styleForm = metExploreViz.getCmpt("linkStyleForm");
// choose specific style
var linkColorForm = styleForm.query("aStyleForm").find(function(aStyleForm){ return aStyleForm.title === "Link color" });
// launch mapping
metExploreViz.graphMappingAsSelectionData("mappingName / conditionName", linkColorForm);
#metExploreViz.GraphMapping.mapImageToNode(fileList, label)
This function allows you to map image to specific node. The name of the file must match the name of the node on which you want to map the image, according to the choosen label.
You can import one or several files.
metExploreViz.GraphMapping.mapImageToNode([pathFile1, pathFile2, ...], "name");
#metExploreViz.GraphMapping.setDiscreteMappingColor(color, mappingValue, conditionName, selectedMapping)
This function allows you to bind specific color to your mapping value.
metExploreViz.GraphMapping.setDiscreteMappingColor("#000000", "14", conditionName, mappingName);