API Reference
Everything in MetExploreViz is scoped under the
metExploreViz namespace. See one of:
- Core
- GraphPanel - To manage the panel where is the graph
- GraphNetwork - To manage your network
- GraphNode - To draw and manage nodes
- GraphMapping - To map data on nodes or links
- GraphUtils - Some useful functions
Core
metExploreViz provides some features to manage the style of the visualisation and general functions In MetExploreViz, you can manage and change 4 differents style:
- GeneralStyle - Object to manage global style of your visualization:
- siteName: the site name
- minContinuous: the color for min value in continuous mapping
- maxContinuous: the color for max value in continuous mapping
- max: a threshold to optimize drawing
- dispLabel: if the node labels are displayed
- dispLink: if the links are displayed
- dispConvexhull: if the compartments is highlighted with convex hulls
- dispPathwaysOnLinks: if the pathways are highlighted on links
- clust: if the components highlighted are clustered
- dispCaption: what caption is displayed
- eventForNodeInfo: enable or not event for nodes informations
- loadButtonHidden: hide or not loading button at initialisation of div
- windowsAlertDisable: enable or not windows alert
var GeneralStyle = function(siteName, minContinuous, maxContinuous, max, dispLabel, dispLink,
dispConvexhull, dispPathwaysOnLinks, clust, dispCaption, eventForNodeInfo, loadButtonHidden,
windowsAlertDisable){
// ...
};
- MetaboliteStyle - Object to manage global metabolites styles:
- backgroundColor: metabolite node color
- height: metabolite node height
- width: metabolite node width
- rx: metabolite node shape for x axis
- ry: metabolite node shape for y axis
- opacity: metabolite node opacity
- strokeColor: metabolite node border color
- strokeWidth: metabolite node border width
- fontColor: metabolite label color
- fontSize: metabolite label size
- fontWeight: metabolite label thickness
- labelOpacity: metabolite label opacity
- displayNodeName: choose metabolite label to display
- useAlias: change metabolite label
var MetaboliteStyle = function(backgroundColor, height, width, rx, ry, opacity, strokeColor,
strokeWidth, fontColor, fontSize, fontWeight, labelOpacity, displayNodeName, useAlias){
// ...
};
- ReactionStyle - Object to manage global reactions styles:
- backgroundColor: reaction node color
- height: reaction node height
- width: reaction node width
- rx: reaction node shape for x axis
- ry: reaction node shape for y axis
- opacity: reaction node opacity
- strokeColor: reaction node border color
- strokeWidth: reaction node border width
- fontColor: reaction label color
- fontSize: reaction label size
- fontWeight: reaction label thickness
- labelOpacity: reaction label opacity
- displayNodeName: choose reaction label to display
- useAlias: change reaction label
var ReactionStyle = function(backgroundColor, height, width, rx, ry, opacity, strokeColor,
strokeWidth, fontColor, fontSize, fontWeight, labelOpacity, displayNodeName, useAlias){
// ...
};
- LinkStyle - Object to manage global links styles:
- size: link max length
- lineWidth: link width
- markerWidth: arrow head width
- markerHeight: arrow head height
- markerInColor: arrow head color for IN interaction
- markerOutColor: arrow head color for OUT interaction
- markerStrokeColor: arrow head border color
- markerStrokeWidth: arrow head border width
- strokeColor: link color
- opacity: link opacity
var LinkStyle = function(size, lineWidth, markerWidth, markerHeight, markerInColor, markerOutColor, markerStrokeColor, markerStrokeWidth, strokeColor, opacity){ // ... };
#
metExploreViz.setGeneralStyle(style) To change general style you could create new general style and set the style by default.
var style = metExploreViz.createGeneralStyle("Website", "yellow", "blue", 500, false, false, false,
false, false, false, false, false, false);
metExploreViz.setGeneralStyle(style);
#
metExploreViz.setMetaboliteStyle(style) To change metabolite style you could create new metabolite style and set the style by default.
var style = metExploreViz.createMetaboliteStyle("white", 14, 14, 7, 7, 1, "red", 2, "black", 5, 500, 1,
"name", false);
metExploreViz.setMetaboliteStyle(style);
#
metExploreViz.setReactionStyle(style) To change reaction style you could create new reaction style and set the style by default.
var style = metExploreViz.createReactionStyle("white", 14, 14, 7, 7, 1, "red", 2, "black", 5, 500, 1,
"dbIdentifier", false);
metExploreViz.setReactionStyle(style);
#
metExploreViz.setLinkStyle(style) To change link style you could create new link style and set the style by default.
var style = metExploreViz.createLinkStyle(25, 2, 5, 5, 'red', 'green', 'black', '0.7', '#000000', 1);
metExploreViz.setLinkStyle(style);
Some features and functions in MetExploreViz need to use component object as argument. To find and use component as object, you can used the function below.
#
metExploreViz.findCmpt("componentName")var component = metExploreViz.findCmpt("componentName");
For style change and mapping application, the following components must be used: - For reactions nodes: reactionStyleForm
- For metabolites nodes: metaboliteStyleForm
- For links: linkStyleForm
Somes functions are dedicated to get metExploreViz objects like nodes or styles.
#
metExploreViz.getStyles() This function return an array that contains all styles properties.
var style = metExploreViz.getStyles();#
metExploreViz.getNodeById(nodeID, vizPanel) This function allows you to get a specific node object by their ID.
var nodeById = metExploreViz.getNodeById("M199208", "viz");#
metExploreViz.getNodeByName(nodeName, vizPanel) This function allows you to get a specific node object by their name.
var nodeByName = metExploreViz.getNodeByName("acetyl-CoA", "viz");#
metExploreViz.getAllNodes(vizPanel) This function allows you to get an array that contains all nodes objects from your network.
var allNodes = metExploreViz.getAllNodes("viz");#
metExploreViz.getSessionById(vizPanel) This function allows you to get metExploreViz session object.
metExploreViz.getSessionById("viz"); vizPanel argument corresponds to the ID you gave to the div tag of your visualization. metExploreViz.onloadSession function allow users to use programmatically others functions.
#
metExploreViz.onloadSession(function) This function must be used with a callback function that contains your pipeline to launch functions after launching drawing.
metExploreViz.onloadSession(function(){
// functions
});
To fully implement this function, you must used metExploreViz.graphPanel function call refreshPanel.